﻿/* The worksheet uses the same paper, ink and indigo as the signed-in study home. */
#workspace:has(#worksheet-view:not([hidden])) #main { background: #f8f9fc; }
#worksheet-view {
  --ws-ink: #1b1937; --ws-muted: #5b6075; --ws-line: #dcdfe9; --ws-paper: #fff;
  --ws-tint: #f6f6f2; --ws-purple: #5843c8; --ws-purple-hover: #4834ad; --ws-purple-line: #9385d5;
  --ws-green: #d8f2df; --ws-green-ink: #285e40; --ws-cream: #fcf4df;
  color-scheme: light; color: var(--ws-ink); width: 100%; min-width: 0; margin: 0 auto;
  font: 480 16px/1.5 var(--sans), sans-serif; overflow-wrap: anywhere;
}
#worksheet-view *, #worksheet-view *::before, #worksheet-view *::after { box-sizing: border-box; }
#worksheet-view :is(h1,h2,p,ol,figure) { margin: 0; }
#worksheet-view button, #worksheet-view input, #worksheet-view textarea { font-family: inherit; }
#worksheet-view button { cursor: pointer; }
#worksheet-view button:disabled { opacity: .63; cursor: default; }
#worksheet-view :focus-visible { outline: 3px solid var(--ws-purple); outline-offset: 3px; }
#worksheet-view :is(h1,h2):focus { outline: none; }
.ws-shell { max-width: 1440px; padding: 0 clamp(20px,3.15vw,53px) 48px; margin: auto; }
.ws-top { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--ws-line); }
.ws-crumbs, .ws-inline, .ws-question-bar, .ws-switcher, .ws-task-actions, .ws-topic-form { display: flex; align-items: center; flex-wrap: wrap; }
.ws-crumbs { gap: 7px; color: var(--ws-muted); font-size: 13px; }
.ws-crumbs button, .ws-link { color: var(--ws-muted); border: 0; border-radius: 3px; background: none; font: inherit; padding: 3px 0; }
.ws-crumbs [aria-current] { color: var(--ws-ink); font-weight: 560; }
.ws-crumbs button:hover, .ws-link:hover { color: var(--ws-purple); text-decoration: underline; text-underline-offset: 3px; }
.ws-slash { color: #85899d; }
.ws-wordmark { font-weight: 750; font-size: 24px; letter-spacing: -.075em; line-height: 1; }
#worksheet-view .ws-status { margin: 12px 0 0; color: var(--ws-muted); font-size: 14px; }
#worksheet-view .ws-status:empty { display: none; }
#worksheet-view .ws-status.ws-error { color: #9c301f; }
.ws-queue { max-width: 1040px; margin: 0 auto; }
.ws-queue-head { display: flex; align-items: center; gap: clamp(18px,2.5vw,42px); padding: 27px 6px 23px; }
#worksheet-view .ws-title { flex: 1 1 auto; min-width: 0; color: var(--ws-ink); font: 700 clamp(30px,3.1vw,48px)/1.035 var(--sans); letter-spacing: -.058em; }
.ws-title span { display: block; }
.ws-paper { position: relative; flex: 0 0 95px; width: 95px; align-self: center; padding: 7px; border: 1px solid #d7d6d1; border-radius: 5px; background: #fffefa; box-shadow: 0 3px 8px #24253b13; transform: rotate(2deg); }
.ws-paper img, .ws-paper-lines { width: 100%; height: 83px; object-fit: cover; object-position: top; display: block; overflow: hidden; }
.ws-paper-lines { padding: 5px; color: #414451; font: 5px/1.6 var(--sans); text-align: left; }
.ws-paper-lines strong { display: block; font-size: 6px; line-height: 1.15; padding-bottom: 3px; border-bottom: 1px solid #c8c9cc; }
#worksheet-view .ws-paper-lines p { white-space: normal; margin-top: 4px; }
.ws-paper figcaption { margin-top: 4px; padding-top: 3px; border-top: 1px solid #e0dfd7; font-size: 9px; line-height: 1.35; font-weight: 600; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.ws-hero-action { flex: 0 0 auto; display: grid; justify-items: center; }
.ws-mascot { display: block; width: 104px; height: 93px; object-fit: contain; }
[data-mascot="off"] #worksheet-view .ws-mascot { display: none; }
.ws-btn, .ws-switch { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border-radius: 999px; border: 1px solid #a1a2a9; background: transparent; color: var(--ws-ink); padding: 8px 18px; min-height: 40px; line-height: 1.2; font-size: 14px; font-weight: 560; }
.ws-btn:hover:not(:disabled), .ws-switch:hover, .ws-topic-edit:hover { background: #f0eef9; border-color: var(--ws-purple-line); color: #47349e; }
.ws-btn.ws-primary { color: white; background: var(--ws-purple); border-color: var(--ws-purple); }
.ws-btn.ws-primary:hover:not(:disabled), .ws-start:hover:not(:disabled) { color: white; background: var(--ws-purple-hover); border-color: var(--ws-purple-hover); }
.ws-arrow { font-size: 1.2em; line-height: 1; }
#worksheet-view .ws-question-list { display: grid; gap: 12px; list-style: none; padding: 0; }
.ws-question-row { min-width: 0; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: clamp(15px,2vw,29px); padding: 19px clamp(16px,2.1vw,30px); min-height: 99px; border: 1px solid var(--ws-line); border-radius: 12px; background: #fff; box-shadow: 0 2px 4px #25284604; }
.ws-question-row:focus-within, .ws-question-row:hover { border-color: var(--ws-purple-line); }
.ws-number { font-size: 21px; font-weight: 680; letter-spacing: -.055em; }
.ws-row-content { min-width: 0; }
.ws-equation, .ws-original { white-space: pre-line; }
.ws-equation { font-size: clamp(16px,1.25vw,20px); line-height: 1.45; }
.ws-inline { gap: 7px 12px; margin-top: 8px; }
.ws-topic { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid transparent; border-radius: 999px; background: #e9ecf1; color: #3e4355; font: 540 12px/1.45 var(--sans); }
.ws-topic-edit { min-height: 27px; }
.ws-topic-edit::after { content: ''; width: 5px; height: 5px; border: solid currentColor; border-width: 0 1.3px 1.3px 0; transform: translateY(-1px) rotate(45deg); }
.ws-topic-form { gap: 7px; font-size: 13px; }
.ws-topic-input { width: min(24ch,100%); min-width: 0; color: var(--ws-ink); background: white; border: 1px solid var(--ws-purple-line); border-radius: 7px; padding: 5px 8px; font-size: 14px; }
.ws-small-save { color: white; border: 1px solid var(--ws-purple); background: var(--ws-purple); border-radius: 7px; padding: 4px 9px; }
.ws-merge { font-size: 12px; text-decoration: underline; text-decoration-color: #bdc0c8; text-underline-offset: 3px; }
.ws-start { min-width: 85px; }
.ws-studio { padding-top: 24px; }
.ws-question-bar { gap: 11px 14px; margin-bottom: 23px; }
.ws-switcher { gap: 6px; }
.ws-switch { min-width: 43px; min-height: 36px; padding: 6px 13px; background: white; border-color: #d2d4dd; }
.ws-switch.ws-done { background: var(--ws-green); color: var(--ws-green-ink); border-color: #a8d0b3; }
.ws-switch[aria-current="page"] { background: var(--ws-purple); color: white; border-color: var(--ws-purple); }
.ws-question-bar > .ws-topic { min-height: 35px; background: transparent; border-color: #cbd0db; padding-inline: 14px; }
#worksheet-view .ws-progress { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); padding: 1px; overflow: hidden; border-radius: 999px; background: #d4d6e0; list-style: none; margin-bottom: 22px; }
.ws-progress li { position: relative; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 1px; min-height: 56px; padding: 5px 10px; color: #505567; background: #f4f5f9; font-size: 13px; font-weight: 550; }
.ws-progress li:first-child { border-radius: 999px 0 0 999px; }
.ws-progress li:last-child { border-radius: 0 999px 999px 0; }
.ws-progress li::after { content: ''; z-index: 1; position: absolute; top: 0; left: calc(100% - .5px); width: 11px; height: 100%; background: #d4d6e0; clip-path: polygon(0 0,100% 50%,0 100%); }
.ws-progress li:not(:last-child)::before { content: ''; z-index: 2; position: absolute; top: 0; left: calc(100% - 1.7px); width: 11px; height: 100%; background: inherit; clip-path: polygon(0 0,100% 50%,0 100%); }
.ws-progress li:last-child::after { display: none; }
.ws-progress li.ws-past { background: var(--ws-green); color: var(--ws-green-ink); }
.ws-progress li[aria-current="step"] { background: var(--ws-purple); color: #fff; }
.ws-progress small { font: 560 11px/1.2 var(--sans); font-variant-numeric: tabular-nums; }
.ws-studio-grid { display: grid; grid-template-columns: minmax(0,7fr) minmax(210px,3fr); align-items: start; gap: clamp(12px,1.2vw,22px); }
.ws-work { display: grid; min-width: 0; gap: 14px; }
.ws-source-card, .ws-task, .ws-rail { min-width: 0; border: 1px solid var(--ws-line); border-radius: 12px; padding: clamp(16px,1.8vw,28px); }
.ws-source-card { background: var(--ws-tint); }
#worksheet-view .ws-original { font: 520 clamp(19px,1.62vw,26px)/1.38 var(--sans); color: var(--ws-ink); letter-spacing: -.033em; }
.ws-task { background: var(--ws-paper); box-shadow: 0 4px 14px #25284609; }
#worksheet-view .ws-stage-title { font: 680 clamp(21px,1.65vw,27px)/1.25 var(--sans); color: var(--ws-ink); letter-spacing: -.045em; }
#worksheet-view .ws-instruction { margin: 8px 0 0; white-space: pre-line; color: var(--ws-ink); }
.ws-working { width: 100%; display: block; min-height: 112px; margin-top: 14px; resize: vertical; padding: 12px 14px; color: var(--ws-ink); background: #fff; border: 1px solid #89849a; border-radius: 7px; font: 480 16px/1.5 var(--sans); }
.ws-working::placeholder { color: #797587; }
.ws-task-actions { justify-content: flex-end; gap: 12px; margin-top: 13px; }
.ws-rail { display: flex; flex-direction: column; gap: 14px; background: var(--ws-cream); border-color: #e4dac4; }
.ws-rail .ws-mascot { margin: 0 auto; height: 100px; }
#worksheet-view .ws-nudge { padding: 13px 14px; border-radius: 12px 12px 12px 3px; background: #f1e6cc; color: #413b30; font-size: 14px; line-height: 1.5; white-space: pre-line; }
.ws-rail-actions { display: grid; gap: 9px; }
.ws-rail-actions:empty { display: none; }
.ws-rail .ws-btn { border-color: #a49a81; font-size: 14px; }
.ws-rail .ws-btn:hover:not(:disabled) { background: #f3e7c9; border-color: #8b7f63; color: var(--ws-ink); }
#worksheet-view .ws-visual { list-style: none; padding: 0; display: grid; gap: 12px; }
.ws-visual li { position: relative; text-align: center; border: 1px solid #ccbea0; color: #473c29; background: #fffdf6; border-radius: 8px; padding: 9px 11px; font-size: .88em; }
.ws-visual li + li::before { position: absolute; top: -13px; left: 50%; content: '↓'; font-size: 11px; }
#worksheet-view .ws-feedback, .ws-conflict { margin-top: 12px; padding: 9px 12px; border-radius: 7px; background: #f2f0fa; font-size: 14px; white-space: pre-line; }
.ws-conflict .ws-btn { margin: 6px 6px 0 0; }
.ws-transcript { border-top: 1px solid var(--ws-line); margin-top: 17px; padding-top: 12px; font-size: 13px; }
.ws-transcript summary { cursor: pointer; color: var(--ws-muted); width: fit-content; }
#worksheet-view .ws-transcript ol:not(.ws-visual) { padding: 0; list-style: none; }
.ws-transcript li { margin-top: 9px; }
.ws-transcript p { white-space: pre-line; }
.ws-note { color: var(--ws-muted); }
@media (max-width: 1000px) {
  .ws-shell { padding-inline: 22px; }
  .ws-studio-grid { grid-template-columns: minmax(0,2fr) minmax(192px,1fr); }
}
@media (max-width: 720px) {
  .ws-shell { padding: 0 14px 32px; }
  .ws-top { min-height: 48px; }
  .ws-wordmark { display: none; }
  .ws-queue-head { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 15px 10px; padding: 24px 0 18px; }
  #worksheet-view .ws-title { font-size: clamp(27px,6.2vw,39px); }
  .ws-paper { width: 55px; padding: 4px; }
  .ws-paper img, .ws-paper-lines { height: 53px; }
  .ws-paper figcaption { font-size: 6px; }
  .ws-hero-action { grid-column: 1/-1; display: flex; justify-content: flex-start; gap: 7px; }
  .ws-hero-action .ws-mascot { width: 37px; height: 38px; }
  .ws-question-row { padding: 14px; gap: 6px 12px; }
  .ws-number { font-size: 18px; }
  .ws-equation { font-size: 16px; }
  .ws-inline { gap: 4px 8px; }
  .ws-start { padding-inline: 13px; min-width: 0; }
  .ws-studio { padding-top: 16px; }
  .ws-question-bar { margin-bottom: 16px; }
  .ws-studio-grid { grid-template-columns: minmax(0,1fr); }
  #worksheet-view .ws-progress { margin-bottom: 13px; }
  .ws-progress li { font-size: 11px; padding-inline: 4px; min-height: 45px; }
  .ws-progress small { font-size: 10px; }
  .ws-progress li::after, .ws-progress li:not(:last-child)::before { width: 6px; }
  .ws-btn { min-height: 42px; }
  .ws-rail { display: grid; grid-template-columns: 49px minmax(0,1fr); align-items: center; gap: 9px 12px; }
  .ws-rail .ws-mascot { width: 49px; height: 50px; }
  .ws-rail .ws-visual, .ws-rail-actions { grid-column: 1/-1; }
  [data-mascot="off"] .ws-rail .ws-nudge { grid-column: 1/-1; }
}
@media (max-width: 430px) {
  .ws-question-row { grid-template-columns: minmax(0,1fr) auto; align-items: start; }
  .ws-question-row .ws-number { grid-column: 1; grid-row: 1; }
  .ws-row-content { grid-column: 1/-1; grid-row: 2; }
  .ws-start { grid-column: 2; grid-row: 1; min-height: 31px; font-size: 12px; }
  .ws-switcher { gap: 5px; }
  .ws-switch { min-width: 40px; }
  .ws-progress li { font-size: clamp(9px,2.65vw,11px); }
}
