:root {
  --background: #0b0b0b;
  --background-tint: rgba(255, 255, 255, 0.03);
  --layer-primary: rgba(255, 255, 255, 0.1);
  --layer-secondary: rgba(255, 255, 255, 0.15);
  --text-primary: rgba(255, 255, 255, 0.8);
  --text-secondary: rgba(255, 255, 255, 0.5);
  --green: #64d777;
  --green-bar: rgba(0, 139, 7, 0.8);
  --green-dark: rgba(0, 59, 16, 0.8);
  --blue: #2caeff;
  --yellow: #dfe600;
  --orange: rgba(255, 102, 41, 0.8);
  --red: #ff6641;
  --card-border: rgba(255, 255, 255, 0.1);
  --shadow-green: rgba(100, 215, 119, 0.5);
  --shadow-blue: rgba(44, 174, 255, 0.5);
  --shadow-yellow: rgba(223, 230, 0, 0.5);
  --shadow-orange: rgba(255, 102, 41, 0.5);
  --motion-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --motion-snap: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--background);
  color: var(--text-primary);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  line-height: 1;
}

.page-reveal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(var(--reveal-columns, 12), minmax(0, 1fr));
  grid-template-rows: repeat(var(--reveal-rows, 12), minmax(0, 1fr));
  overflow: hidden;
  background: var(--background);
  pointer-events: none;
}

.page-reveal.is-ready {
  background: transparent;
}

.page-reveal-cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: #0b0b0b;
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.035),
    inset -1px -1px 0 rgba(0, 0, 0, 0.55);
  opacity: 1;
  transform: scale(1.04);
  transform-origin: center;
  will-change: opacity, transform, filter;
}

.page-reveal-cell::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(100, 215, 119, calc(var(--ripple-strength) * 0.08));
  opacity: 0;
}

.page-reveal.is-revealing .page-reveal-cell {
  animation: grid-cell-reveal 450ms var(--motion-ease) var(--ripple-delay) forwards;
}

.page-reveal.is-revealing .page-reveal-cell::after {
  animation: grid-cell-pulse 310ms var(--motion-ease) var(--ripple-delay) both;
}

button {
  font: inherit;
}

button,
.segment,
.clear-button,
.info-button,
.goal-card,
.rating-button,
.text-link {
  transition:
    background-color 180ms var(--motion-ease),
    border-color 180ms var(--motion-ease),
    color 180ms var(--motion-ease),
    opacity 180ms var(--motion-ease),
    box-shadow 180ms var(--motion-ease),
    transform 180ms var(--motion-ease),
    filter 180ms var(--motion-ease);
}

.app {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: var(--background);
}

.app.is-what-if-mode {
  filter: invert(1);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(100%, 988px);
  min-height: 870px;
  margin: 0 auto;
  padding: 50px;
}

.header {
  position: relative;
  z-index: 1;
  min-height: 69px;
  margin-bottom: 15px;
}

.brand {
  position: absolute;
  top: 1px;
  left: 4px;
  display: grid;
  grid-template-columns: 37px auto;
  column-gap: 15px;
  align-items: center;
}

.brand-logo {
  width: 37px;
  height: 43px;
  color: #ff0038;
  filter: drop-shadow(0 0 12px rgba(255, 0, 56, 0.16));
}

.brand-title {
  margin: 0 0 6px;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.brand-date {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.header-actions {
  position: absolute;
  top: 8px;
  right: 0;
  display: flex;
  gap: 12px;
  align-items: center;
}

.clear-button {
  display: flex;
  width: 76px;
  height: 34px;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border: none;
  border-radius: 10px;
  background: var(--layer-primary);
  box-shadow:
    inset 0 0 2px rgba(255, 255, 255, 0.3),
    0 0 12px rgba(0, 0, 0, 0.14);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}

.what-if-button {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 0 1px;
  border: 0;
  border-radius: 10px;
  background: var(--layer-primary);
  box-shadow:
    inset 0 0 2px rgba(255, 255, 255, 0.3),
    0 0 12px rgba(0, 0, 0, 0.14);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
}

.what-if-button:hover {
  background: var(--layer-secondary);
  color: var(--text-primary);
}

.what-if-button.is-active {
  background: var(--green);
  color: var(--background);
  box-shadow: 0 0 14px var(--shadow-green);
}

.clear-button:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background: var(--layer-secondary);
  color: var(--text-primary);
}

.clear-button:active {
  transform: scale(0.98);
}

.segmented {
  position: relative;
  display: flex;
  width: 287px;
  height: 34px;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  padding: 3px 2px;
  border: 0;
  border-radius: 10px;
  background: var(--layer-primary);
  box-shadow: inset 0 0 2px rgba(255, 255, 255, 0.3);
}

.segmented::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 3px;
  left: 3px;
  width: calc((100% - 6px) / 2);
  height: 28px;
  border-radius: 7px;
  background: var(--layer-secondary);
  pointer-events: none;
  transition: transform 240ms var(--motion-ease);
}

.segmented.is-assignments::before {
  transform: translateX(100%);
}

.segment {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1 1 0;
  height: 28px;
  min-width: 1px;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  overflow: hidden;
}

.segment.is-active {
  color: var(--text-primary);
}

.segment:hover {
  color: var(--text-primary);
}

.grade-view,
.assignments-view {
  position: relative;
  z-index: 1;
}

.grade-view.view-enter,
.assignments-view.view-enter {
  animation: view-enter 500ms var(--motion-snap) both;
}

.grade-view.is-leaving,
.assignments-view.is-leaving {
  animation: view-leave 350ms var(--motion-ease) both;
  pointer-events: none;
}

.goal-detail.detail-enter {
  animation: detail-enter 500ms var(--motion-snap) both;
}

.goal-detail.is-leaving {
  animation: detail-leave 300ms var(--motion-ease) both;
  pointer-events: none;
}

.metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 15px;
}

.metric-card,
.goal-card,
.panel,
.subgoal-card {
  border: 1px solid var(--card-border);
  border-radius: 9px;
}

.metric-card {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 1px;
  align-items: center;
  justify-content: center;
  padding: 5px;
}

.metric-title,
.panel-title,
.goal-card-title {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: var(--layer-primary);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  text-align: center;
}

.metric-title {
  width: 200px;
  padding: 3px 10px;
}

.metric-value {
  margin: 8px 0 5px;
  color: var(--text-primary);
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.metric-subtitle {
  width: 120px;
  min-height: 27px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.15;
  text-align: center;
}

.text-link {
  cursor: pointer;
  text-decoration: underline;
  text-underline-position: from-font;
}

.text-link:hover {
  color: var(--text-primary);
}

.info-button {
  display: inline-flex;
  width: 14px;
  height: 14px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 3px;
  background: var(--layer-secondary);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}

.info-button:hover {
  background: var(--text-primary);
  border-radius: 3.5px;
  color: var(--background);
  transform: scale(1.1);
}

.metric-card .info-button {
  position: absolute;
  top: 7px;
  right: 7px;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
  padding: 5px 5px 15px;
}

.panel-title {
  width: 100%;
  padding: 5px 4px;
}

.chart-shell {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 5px;
}

.chart-grid {
  display: grid;
  grid-template-columns: 25px repeat(13, minmax(0, 1fr));
  gap: 2px 11px;
  width: 100%;
}

.y-label {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}

.bar-cell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  height: 21px;
  background: var(--background-tint);
}

.bar-half {
  background: transparent;
}

.bar-half.current.is-lit {
  background: var(--green-bar);
}

.bar-half.current.is-half {
  background: linear-gradient(to top, var(--green-bar) 0 50%, transparent 50% 100%);
}

.bar-half.max.is-lit {
  background: var(--green-dark);
}

.bar-half.max.is-half {
  background: linear-gradient(to top, var(--green-dark) 0 50%, transparent 50% 100%);
}

.axis-label {
  display: flex;
  height: 24px;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.axis-label.exam-label {
  color: var(--text-primary);
}

.projected-line {
  position: absolute;
  left: 36px;
  right: 0;
  border-top: 2px dashed var(--green);
  opacity: 0.95;
  pointer-events: none;
}

.legend-row,
.projected-legend {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}

.legend-row {
  margin-top: 22px;
}

.legend-item {
  display: flex;
  gap: 4px;
  align-items: center;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 2px;
}

.legend-swatch.current {
  background: var(--green-bar);
}

.legend-swatch.max {
  background: var(--green-dark);
}

.projected-divider {
  width: 100%;
  height: 1px;
  margin: 10px 0 15px;
  background: var(--layer-primary);
}

.projected-legend {
  gap: 4px;
}

.projected-dash {
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: var(--green);
}

.projected-output {
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  color: var(--orange);
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.projected-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
}

.assignment-strip-shell {
  position: relative;
  margin: 20px 0;
  overflow: hidden;
}

.assignment-strip {
  scroll-snap-type: x mandatory;
  display: flex;
  gap: 16px;
  align-items: center;
  margin: 0;
  overflow-x: scroll;
  overflow-y: hidden;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0,
    #000 52px,
    #000 calc(100% - 52px),
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0,
    #000 52px,
    #000 calc(100% - 52px),
    transparent 100%
  );
}

.assignment-strip-shell.is-at-start .assignment-strip {
  -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 52px), transparent 100%);
  mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 52px), transparent 100%);
}

.assignment-strip-shell.is-at-end .assignment-strip {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 52px, #000 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 52px, #000 100%);
}

.assignment-strip-shell.is-at-start.is-at-end .assignment-strip {
  -webkit-mask-image: none;
  mask-image: none;
}

.goal-card {
  scroll-snap-align: start;
  display: flex;
  flex: 0 0 180px;
  flex-direction: column;
  gap: 1px;
  align-items: center;
  justify-content: center;
  padding: 5px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.goal-card.is-active {
  background: var(--layer-primary);
}

.goal-card.tone-p.is-active {
  background: rgba(100, 215, 119, 0.09);
  border-color: rgba(100, 215, 119, 0.26);
}

.goal-card.tone-d.is-active {
  background: rgba(44, 174, 255, 0.09);
  border-color: rgba(44, 174, 255, 0.26);
}

.goal-card.tone-s.is-active {
  background: rgba(255, 102, 65, 0.1);
  border-color: rgba(255, 102, 65, 0.28);
}

.goal-card:hover {
  border-color: var(--layer-secondary);
}

.goal-card-title {
  width: 100%;
  padding: 3px 10px;
  white-space: nowrap;
}

.goal-card.is-active .goal-card-title {
  background: var(--layer-secondary);
  color: var(--text-primary);
}

.goal-card-value {
  margin: 8px 0 2px;
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.goal-card.tone-p .goal-card-value {
  color: var(--green);
}

.goal-card.tone-d .goal-card-value {
  color: var(--blue);
}

.goal-card.tone-s .goal-card-value {
  color: var(--red);
}

.goal-card.is-inferred .goal-card-title,
.goal-card.is-inferred .goal-card-value {
  opacity: 0.5;
}

.goal-detail {
  width: 100%;
  align-items: stretch;
  gap: 21px;
  padding-bottom: 60px;
}

.detail-heading {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  width: 100%;
  text-align: center;
}

.detail-title-band {
  position: relative;
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 3px;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border-radius: 5px;
  background: var(--layer-primary);
}

.goal-filter-button {
  position: absolute;
  top: 50%;
  right: 9px;
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  padding: 5px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transform: translateY(-50%);
}

.goal-filter-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.goal-filter-button:hover {
  background: var(--layer-primary);
  color: var(--text-primary);
}

.goal-filter-button.is-active {
  background: rgba(100, 215, 119, 0.12);
  color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(100, 215, 119, 0.2);
}

.detail-title-band.is-inferred,
.detail-rating.is-inferred,
.detail-points.is-inferred,
.subgoal-rating.is-inferred {
  opacity: 0.5;
}

.detail-title {
  margin: 0;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
}

.detail-subtitle,
.small-copy {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
}

.detail-rating {
  margin: 15px 0;
  color: var(--green);
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
}

.detail-points {
  margin: 0;
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
}

.subgoal-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 60px;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
}

.subgoal-column {
  display: flex;
  width: 358px;
  flex-direction: column;
  gap: 30px;
}

.subgoal-column.wide {
  width: min(777px, 100%);
}

.subgoal-card {
  width: 100%;
  padding: 0 10px 10px;
  margin-bottom: 15px;
}

.subgoal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.subgoal-name {
  margin: 0 0 4px;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  text-align: left;
}

.subgoal-label {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  text-align: left;
}

.subgoal-rating {
  margin: 8px 0 3px 12px;
  color: var(--green);
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
}

.rule-note {
  display: flex;
  gap: 6px;
  align-items: center;
  width: 100%;
  margin-top: 3px;
}

.rule-bars {
  display: grid;
  width: 25px;
  height: 25px;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  align-items: end;
  flex: 0 0 25px;
}

.rule-bars span {
  display: block;
  border-radius: 1px;
  background: var(--layer-secondary);
}

.rule-bars span:nth-child(1) {
  height: 25px;
}

.rule-bars span:nth-child(2) {
  height: 13px;
}

.rule-bars span:nth-child(3) {
  height: 6px;
}

.rule-bars span:nth-child(4) {
  height: 4px;
}

.rule-bars.second-highest span:nth-child(2),
.rule-note.standard {
  color: var(--blue);
}

.rule-bars.second-highest span:nth-child(2) {
  background: var(--blue);
}

.rule-bars.second-lowest span:nth-child(3),
.rule-note.special {
  color: var(--yellow);
}

.rule-bars.second-lowest span:nth-child(3) {
  background: var(--yellow);
}

.rule-bars.global span:nth-child(4),
.rule-note.global {
  color: var(--green);
}

.rule-bars.global span:nth-child(4) {
  background: var(--green);
}

.rule-copy {
  margin: 0;
  flex: 1 1 auto;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.18;
}

.assessment-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
}

.assessment {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: stretch;
  justify-content: center;
  transition: opacity 220ms var(--motion-ease);
}

.goal-detail.is-filtering-completed .assessment.has-rating-input {
  opacity: 0.1;
}

.assessment-name {
  margin: 0;
  padding: 0 10px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
}

.assessment-name .multigoal {
  color: var(--yellow);
}

.what-if-change-marker {
  margin-left: 4px;
  color: var(--green);
  font-weight: 700;
}

.rating-row {
  display: flex;
  gap: 5px;
  align-items: flex-start;
  width: 100%;
}

.rating-button {
  display: flex;
  min-width: 1px;
  height: 26px;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  padding: 0 5px 2px;
  border: 1px solid var(--layer-secondary);
  border-radius: 3px;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  touch-action: none;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
}

.is-rating-dragging .rating-button {
  cursor: crosshair;
}

.app-toast {
  position: fixed;
  z-index: 40;
  bottom: 24px;
  left: 50%;
  display: flex;
  max-width: calc(100vw - 32px);
  gap: 10px;
  align-items: center;
  padding: 11px 14px;
  border: 1px solid rgba(100, 215, 119, 0.24);
  border-radius: 9px;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  background: rgba(24, 28, 25, 0.92);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.32),
    0 0 20px rgba(100, 215, 119, 0.08);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  transform: translateX(-50%);
  animation: rating-toast-in 280ms var(--motion-snap) both;
}

.app-toast.is-leaving {
  animation: rating-toast-out 240ms var(--motion-ease) both;
}

.app-toast-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: rgba(100, 215, 119, 0.14);
  color: var(--green);
  font-size: 16px;
  line-height: 1;
}

.rating-button:hover {
  transform: translateY(-1px);
}

.rating-button.tone-p:hover {
  border-color: var(--green);
  color: var(--green);
}

.rating-button.tone-d:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.rating-button.tone-s:hover {
  border-color: var(--red);
  color: var(--red);
}

.rating-button.tone-p.is-selected {
  background: var(--green);
  color: var(--background);
  box-shadow: 0 0 15px var(--shadow-green);
}

.rating-button.tone-d.is-selected {
  background: var(--blue);
  color: var(--background);
}

.rating-button.tone-s.is-selected {
  background: var(--red);
  color: var(--background);
}

.rating-button.is-selected.is-inferred {
  opacity: 0.5;
}

.rating-button.is-selected.is-inferred:hover {
  opacity: 0.75;
}

.rating-button.is-selected:hover {
  color: var(--background);
  filter: brightness(1.08);
}

.rating-button.exam-button {
  height: 26px;
}

.exam-detail {
  min-height: 150px;
  padding-bottom: 5px;
}

.modal-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(25px);
  background: rgba(16, 16, 16, 0.5);
  animation: modal-backdrop-in 220ms var(--motion-ease) both;
}

.modal-card {
  width: min(608px, 100%);
  overflow: hidden;
  padding: 20px 23px;
  border: 1px solid var(--background-tint);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  animation: modal-card-in 320ms var(--motion-snap) both;
  transform-origin: center;
}

.modal-card p,
.modal-card h2 {
  margin: 0;
}

.modal-heading {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 13px;
}

.modal-title {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
}

.modal-copy {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
}

.translation-grid {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.translation-row {
  display: flex;
  width: 100%;
  gap: 9px;
  align-items: stretch;
}

.translation-band {
  position: relative;
  display: flex;
  min-height: 72px;
  flex: 0 0 181px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  color: rgba(0, 0, 0, 0.7);
  text-align: center;
}

.translation-band.compact {
  flex-basis: 102px;
}

.translation-band.wide {
  flex-basis: 181px;
}

.translation-band.grade-a {
  background: var(--green);
  box-shadow: 0 0 10px var(--shadow-green);
}

.translation-band.grade-b {
  background: var(--blue);
  box-shadow: 0 0 10px var(--shadow-blue);
}

.translation-band.grade-c {
  background: var(--yellow);
  box-shadow: 0 0 10px var(--shadow-yellow);
}

.translation-band.grade-df {
  background: var(--orange);
  box-shadow: 0 0 20px var(--shadow-orange);
}

.translation-letter {
  font-size: 48px;
  font-weight: 700;
  line-height: 0.65;
}

.translation-word {
  margin-top: 9px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
}

.translation-note {
  display: flex;
  min-height: 72px;
  flex: 1 1 0;
  gap: 5px;
  flex-direction: column;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 3px;
  background: var(--layer-primary);
}

.translation-note-title {
  margin-bottom: 7px;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
}

.translation-table {
  display: grid;
  min-height: 72px;
  overflow: hidden;
  border-radius: 3px;
  grid-template-columns: 1fr 1fr;
  background: var(--layer-primary);
}

.translation-table.compact {
  flex: 0 0 70px;
}

.translation-table.wide {
  flex: 1 1 0;
}

.translation-cell {
  display: flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  border-right: 1px solid rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(0, 0, 0, 0.25);
  font-size: 16px;
  font-weight: 600;
}

.translation-cell:nth-child(even) {
  border-right: 0;
}

.green-text {
  color: var(--green);
}

.blue-text {
  color: var(--blue);
}

.yellow-text {
  color: var(--yellow);
}

.orange-text {
  color: var(--orange);
}

.roll-text {
  position: relative;
  display: inline-block;
  line-height: 1.18;
  overflow: hidden;
  padding-bottom: 0.12em;
  margin-bottom: -0.12em;
  vertical-align: bottom;
}

.roll-sizer {
  display: inline-block;
  visibility: hidden;
  white-space: nowrap;
}

.roll-layer {
  position: absolute;
  top: 0;
  left: 50%;
  display: inline-flex;
  justify-content: center;
  line-height: 1.18;
  white-space: nowrap;
  transform: translateX(-50%);
}

.roll-layer-old {
  display: none;
}

.roll-char {
  display: inline-block;
  line-height: 1.18;
}

.roll-text.is-rolling .roll-layer-old {
  display: inline-flex;
}

.roll-text.is-rolling .roll-char {
  animation-duration: 430ms;
  animation-timing-function: var(--motion-ease);
  animation-fill-mode: both;
  animation-delay: calc(var(--i) * 22ms);
}

.roll-text.is-rolling .roll-layer-old .roll-char {
  animation-name: roll-old-up;
}

.roll-text.is-rolling .roll-layer-new .roll-char {
  animation-name: roll-new-up;
}

.hidden {
  display: none;
}

@keyframes view-enter {
  from {
    opacity: 0;
    filter: blur(16px);
    transform: scale(0.965);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
  }
}

@keyframes rating-toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

@keyframes rating-toast-out {
  from {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(-50%, 8px) scale(0.98);
  }
}

@keyframes grid-cell-reveal {
  0% {
    opacity: 1;
    filter: brightness(1);
    transform: scale(1.04);
  }
  28% {
    opacity: 1;
    filter: brightness(1.35);
    transform: scale(0.94);
  }
  100% {
    opacity: 0;
    filter: brightness(1);
    transform: scale(0.28);
  }
}

@keyframes grid-cell-pulse {
  0% {
    opacity: 0;
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes view-leave {
  from {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
  }
  to {
    opacity: 0;
    filter: blur(18px);
    transform: scale(0.955);
  }
}

@keyframes modal-backdrop-in {
  from {
    opacity: 0;
    backdrop-filter: blur(0);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(25px);
  }
}

@keyframes modal-card-in {
  from {
    opacity: 0;
    filter: blur(14px);
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
  }
}

@keyframes detail-enter {
  from {
    opacity: 0;
    filter: blur(20px);
    transform: scale(0.975);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
  }
}

@keyframes detail-leave {
  from {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
  }
  to {
    opacity: 0;
    filter: blur(20px);
    transform: scale(0.975);
  }
}

@keyframes roll-old-up {
  0% {
    transform: translateY(0);
  }
  45%,
  100% {
    transform: translateY(-115%);
  }
}

@keyframes roll-new-up {
  0%,
  20% {
    transform: translateY(115%);
  }
  100% {
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 920px) {
  .shell {
    padding: 24px;
  }

  .header {
    display: flex;
    min-height: auto;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 18px;
  }

  .brand,
  .header-actions,
  .segmented {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .segmented {
    width: min(287px, calc(100% - 88px));
  }

  .metrics {
    flex-wrap: wrap;
  }

  .metric-card {
    flex: 1 1 210px;
  }

  .metric-title {
    width: 100%;
  }
}

@media (max-width: 680px) {
  .shell {
    padding: 18px;
  }

  .brand {
    grid-template-columns: 32px auto;
    column-gap: 12px;
  }

  .brand-logo {
    width: 32px;
    height: 37px;
  }

  .brand-title {
    white-space: normal;
  }

  .chart-shell {
    overflow-x: auto;
  }

  .chart-grid {
    min-width: 880px;
  }

  .projected-line {
    left: 36px;
    min-width: 844px;
  }

  .subgoal-grid {
    gap: 32px;
  }

  .subgoal-column,
  .subgoal-column.wide {
    width: 100%;
  }

  .translation-grid {
    width: 100%;
  }

  .translation-row {
    flex-wrap: wrap;
  }

  .translation-band,
  .translation-band.compact,
  .translation-band.wide {
    flex: 1 1 100%;
  }

  .translation-table.compact,
  .translation-table.wide,
  .translation-note {
    flex: 1 1 100%;
  }

  .modal-backdrop {
    align-items: flex-start;
    overflow: auto;
  }
}
