:root {
  color-scheme: light;
  --paper: #f3f2ef;
  --sheet: rgba(255, 255, 255, .86);
  --ink: #1c1c1c;
  --muted: #6d6a64;
  --line: rgba(28, 28, 28, .08);
  --accent: #1c1c1c;
  --soft: #f7f6f4;
  --rail: 220px;
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #f3f2ef; color: var(--ink); }
button, textarea, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.shell { display: flex; min-height: 100vh; align-items: stretch; }
.shell[hidden], #gate[hidden] { display: none !important; }
#gate { position: fixed; inset: 0; z-index: 20; background: #f3f2ef; color: #1c1c1c; overflow: hidden; }
.gate-layout { position: absolute; inset: 0; }
.gate-form-side { position: absolute; z-index: 2; left: 96px; top: 0; bottom: 0; width: min(420px, 100%); display: flex; align-items: center; justify-content: center; padding: 24px 28px; background: transparent; pointer-events: none; }
.gate-grid { position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(28, 28, 28, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(28, 28, 28, 0.045) 1px, transparent 1px), linear-gradient(rgba(28, 28, 28, 0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(28, 28, 28, 0.02) 1px, transparent 1px); background-size: 80px 80px, 80px 80px, 16px 16px, 16px 16px; mask-image: linear-gradient(to right, #000 0%, transparent 92%), linear-gradient(to top, #000 0%, transparent 68%); mask-composite: intersect; -webkit-mask-image: linear-gradient(to right, #000 0%, transparent 92%), linear-gradient(to top, #000 0%, transparent 68%); -webkit-mask-composite: source-in; }
.gate-stage { position: absolute; inset: 0; overflow: hidden; perspective: 1200px; background: radial-gradient(ellipse 68% 56% at 62% 42%, #f7f6f4 0%, #f3f2ef 58%, #e8e6e1 100%); }
.gate-world { position: absolute; inset: 0; background: transparent; }
.gate-world canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.gate-world.hot canvas { cursor: grab; }
.gate-world.dragging canvas { cursor: grabbing; }
.gate-grain { position: absolute; inset: 0; pointer-events: none; opacity: 0.55; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23g)' opacity='0.35'/%3E%3C/svg%3E"); }
.gate-slot { position: relative; z-index: 2; width: min(380px, 100%); pointer-events: auto; }
.gate-door { position: absolute; inset: 0 auto 0 0; z-index: 4; width: 50.6%; background: radial-gradient(120% 80% at var(--hinge) 46%, #232c48 0%, #151b2e 55%, #0c1020 100%); transition: transform 1.35s cubic-bezier(0.65, 0, 0.35, 1); pointer-events: none; }
.gate-door-l { left: 0; --hinge: 100%; transform-origin: left center; }
.gate-door-r { right: 0; left: auto; --hinge: 0%; transform-origin: right center; }
.gate-stage.is-open .gate-door-l { transform: rotateY(-100deg); }
.gate-stage.is-open .gate-door-r { transform: rotateY(100deg); }
.gate-splash-light { position: absolute; z-index: 5; top: 0; bottom: 0; left: 50%; width: 4px; transform: translateX(-50%); opacity: 0; pointer-events: none; background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(255, 236, 200, 0.95), rgba(255, 214, 150, 0.28) 46%, transparent 72%); }
.gate-stage.is-open .gate-splash-light { animation: gate-light 1.25s ease forwards; }
@keyframes gate-light { 0% { opacity: 0; width: 4px; } 28% { opacity: 1; width: 18%; } 100% { opacity: 0; width: 80%; } }
.gate-dust { position: absolute; inset: 0; z-index: 6; width: 100%; height: 100%; pointer-events: none; }
.gate-motion { position: absolute; z-index: 6; left: 50%; top: 7vh; width: max-content; transform: translateX(-50%); text-align: center; pointer-events: none; }
.gate-motion-title { position: relative; margin: 0; color: transparent; font: 900 clamp(64px, 7vw, 112px)/1 "Songti SC", STSong, serif; letter-spacing: 0.08em; text-shadow: none; }
.gate-motion-line { margin: 14px 0 0; color: #6d6a64; font: 400 16px/1.5 "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif; letter-spacing: 0.02em; opacity: 0; }
.gate-stage.is-settled .gate-motion-line { opacity: 1; transition: opacity 0.9s ease; }
.gate-motion-title span { margin-right: 0.16em; font-family: Didot, "Bodoni 72", "Times New Roman", serif; font-style: italic; font-weight: 500; }
.gate-stage.is-settled .gate-motion-title { color: #1c1c1c; text-shadow: none; transition: color 0.9s ease, text-shadow 0.9s ease; }
.gate-card { animation: gate-rise 620ms cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes gate-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .gate-card, .gate-door, .gate-beacon, .gate-field input { animation: none; transition: none; }
}
.stage-ui { position: absolute; left: 50%; bottom: 28px; z-index: 3; width: max-content; max-width: min(720px, calc(100% - 48px)); display: flex; flex-direction: column; align-items: center; gap: 12px; pointer-events: none; transform: translateX(-50%); }
.stage-kicker { margin: 0; font-size: 12px; letter-spacing: 0.22em; color: #6d6a64; }
.stage-picks { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; pointer-events: auto; }
.stage-pick { border: 1px solid rgba(28, 28, 28, 0.12); background: rgba(255, 255, 255, 0.72); color: #1c1c1c; border-radius: 999px; padding: 8px 15px; font-size: 13px; letter-spacing: 0.04em; white-space: nowrap; backdrop-filter: blur(12px); }
.stage-pick:hover { background: #fff; }
.stage-pick.on { background: #1c1c1c; color: #f7f6f4; border-color: #1c1c1c; }
.piece-note { margin: 0; max-width: 640px; padding: 0 28px; text-align: center; color: #1c1c1c; font-size: 16px; line-height: 1.7; }
.gate-hello { margin: 0 0 22px; font-family: "Songti SC", "Noto Serif SC", serif; font-size: 20px; font-weight: 600; letter-spacing: 0.14em; color: #1c1c1c; }
.gate-card { position: relative; z-index: 2; width: 100%; margin: 0; padding: 26px 26px 18px; border-radius: 16px; color: #1c1c1c; background: rgba(255, 255, 255, 0.9); border: 1px solid rgba(28, 28, 28, 0.08); box-shadow: 0 18px 40px rgba(28, 28, 28, 0.06); backdrop-filter: blur(18px); }
.wordmark { display: block; width: 168px; height: 56px; color: #1c1c1c; }
.wordmark.compact { width: 124px; height: 41px; }
.gate-line { margin: 4px 52px 0 0; color: #1c1c1c; font-size: 14px; line-height: 1.5; }
.gate-card h1 { margin: 10px 0 0; font-size: 16px; font-weight: 560; }
.gate-field { display: grid; gap: 8px; margin-top: 18px; }
.gate-card > .gate-field:first-of-type { margin-top: 0; }
.gate-field span { font-size: 14px; color: var(--muted); }
.gate-field input { width: 100%; height: 44px; border-radius: 10px; border: 1px solid #e4e2dc; padding: 0 14px; background: #fff; color: #1c1c1c; transition: border-color 220ms, box-shadow 260ms, transform 260ms; }
.gate-field input:focus { outline: none; border-color: transparent; box-shadow: 0 10px 28px rgba(28, 28, 28, 0.08); transform: translateY(-1px); }
.gate-field input::placeholder { color: #a39e96; }
.gate-strength { min-height: 18px; margin: 6px 0 0; color: #6d6a64; font-size: 12px; letter-spacing: 0.08em; }
.gate-pass { position: relative; }
.gate-pass input { padding-right: 40px; }
.gate-eye, .gate-switch button, .gate-theme { border: 0; background: transparent; color: #6d6a64; }
.gate-eye { position: absolute; right: 8px; bottom: 8px; width: 28px; height: 28px; display: grid; place-items: center; padding: 0; }
.gate-theme { position: absolute; z-index: 8; top: 22px; right: 22px; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border-radius: 999px; color: #1c1c1c; background: rgba(255, 255, 255, 0.78); box-shadow: 0 8px 20px rgba(28, 28, 28, 0.06); }
.gate-submit { display: block; width: 100%; margin-top: 22px; height: 44px; border: 0; border-radius: 10px; background: #1c1c1c; color: #f7f6f4; font-weight: 560; letter-spacing: 0.12em; }
.gate-error { min-height: 0; margin: 8px 0 0; color: #9a3b2f; font-size: 13px; }
.gate-error:empty { display: none; }
.gate-switch { display: flex; justify-content: space-between; margin: 10px 0 0; }
.gate-switch button { padding: 4px 0; font-size: 13px; font-weight: 400; }
#gate[data-theme="dark"] { background: #111110; color: #f3f2ef; }
#gate[data-theme="dark"] .gate-grid { background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px), linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px); }
#gate[data-theme="dark"] .gate-strength { color: rgba(243, 242, 239, 0.62); }
#gate[data-theme="dark"] .gate-field input:focus { box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35); }
#gate[data-theme="dark"] .gate-world { background: transparent; }
#gate[data-theme="dark"] .gate-card { color: #f3f2ef; background: rgba(22, 22, 21, 0.82); border: 1px solid rgba(255, 255, 255, 0.08); box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35); }
#gate[data-theme="dark"] .gate-stage.is-settled .gate-motion-title { color: #f3f2ef; text-shadow: none; }
#gate[data-theme="dark"] .gate-motion-line { color: rgba(243, 242, 239, 0.72); }
#gate[data-theme="dark"] .gate-line { color: #f3f2ef; }
#gate[data-theme="dark"] .gate-hello { color: #f3f2ef; }
#gate[data-theme="dark"] .gate-field span { color: rgba(243, 242, 239, 0.66); }
#gate[data-theme="dark"] .gate-field input { border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.04); color: #f7f6f4; }
#gate[data-theme="dark"] .gate-field input::placeholder { color: rgba(243, 242, 239, 0.35); }
#gate[data-theme="dark"] .gate-eye, #gate[data-theme="dark"] .gate-switch button { color: rgba(243, 242, 239, 0.62); }
#gate[data-theme="dark"] .gate-theme { color: #f3f2ef; background: rgba(22, 22, 21, 0.78); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28); }
#gate[data-theme="dark"] .gate-submit { background: #f3f2ef; color: #161616; }
#gate[data-theme="dark"] .gate-error { color: #ffb4a2; }
#gate[data-theme="dark"] .stage-pick { background: rgba(22, 22, 21, 0.7); color: #f3f2ef; border-color: rgba(255, 255, 255, 0.12); }
#gate[data-theme="dark"] .stage-pick:hover { background: rgba(36, 36, 34, 0.88); }
#gate[data-theme="dark"] .stage-pick.on { background: #f3f2ef; color: #161616; border-color: #f3f2ef; }
#gate[data-theme="dark"] .piece-note { color: #f3f2ef; }
#rail {
  position: sticky; top: 0; height: 100vh; width: 232px; flex: 0 0 232px;
  background: rgba(255, 255, 255, .55); border-right: 1px solid rgba(28, 28, 28, .06); overflow: hidden;
  padding: 18px 12px 14px; display: flex; flex-direction: column; align-items: stretch; gap: 8px;
}
#rail .brand { display: flex; flex-direction: row; align-items: flex-end; gap: 8px; width: 100%; padding: 2px 8px 8px; border: 0; background: transparent; text-align: left; }
#rail .brand span { color: var(--muted); font-size: 12px; letter-spacing: .14em; padding-bottom: 6px; }
#rail nav { display: flex; flex-direction: column; gap: 2px; width: 100%; }
#rail .nav-label { margin: 8px 10px 2px; font-size: 12px; letter-spacing: .14em; color: var(--muted); }
#rail .nav-rest { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
#rail button.nav-item {
  display: flex; flex-direction: row; align-items: center; justify-content: flex-start;
  gap: 0; width: 100%; height: 36px; min-height: 36px; white-space: nowrap;
  border: 0; background: transparent; border-radius: 8px; padding: 0 10px; color: #3c3832;
  letter-spacing: 0; font-size: 14px;
}
#rail button.nav-item svg { display: none; }
#rail button.nav-item span { display: inline; line-height: 1; }
#rail button.nav-item:hover { background: rgba(28, 28, 28, .04); }
#rail button.nav-item.on { background: rgba(28, 28, 28, .08); color: var(--ink); font-weight: 600; }
#rail .split { height: 1px; margin: 10px 8px; background: rgba(28, 28, 28, .08); flex: none; }
#threads .threads { display: flex; flex-direction: column; gap: 0; overflow: auto; min-height: 0; flex: 1; }
#threads .thread {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  border-radius: 8px; padding: 7px 10px; color: #6d6a64; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 13px;
}
#threads .thread:hover { background: rgba(28, 28, 28, .04); color: var(--ink); }
#threads .thread.on { background: rgba(28, 28, 28, .08); color: var(--ink); font-weight: 600; }
#threads .thread small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 400; }
#threads .thread-group { margin: 6px 0 2px; }
#threads .thread-group[hidden] { display: none; }
#threads .thread-head { display: flex; align-items: center; gap: 4px; padding: 0 8px; }
#threads .thread-fold { flex: 1; min-width: 0; border: 0; background: transparent; text-align: left; color: var(--ink); font-size: 12px; font-weight: 600; padding: 4px 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#threads .thread-head [data-again],
#threads .thread-head [data-fold] { border: 0; background: transparent; color: var(--muted); font-size: 12px; padding: 0 2px; white-space: nowrap; opacity: 0; }
#threads .thread-group:hover [data-again], #threads .thread-group:hover [data-fold], #threads .thread-group:focus-within [data-again], #threads .thread-group:focus-within [data-fold] { opacity: 1; }
#threads [data-rail-ask], #threads [data-write-goal] { display: block; width: calc(100% - 16px); margin: 0 8px 4px; border: 0; background: transparent; text-align: left; color: var(--ink); font-size: 12px; padding: 0 2px; }
#threads .thread-rows[hidden] { display: none; }
#threads .thread-fold small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 400; }
#threads .thread-empty { margin: 0 12px 6px; color: var(--muted); font-size: 12px; }
#threads .thread-rename { border: 0; background: transparent; color: var(--muted); font-size: 12px; padding: 0 4px; }
#threads .thread-name { width: 100%; border: 0; border-radius: 8px; padding: 7px 10px; background: #fff; font: inherit; font-size: 13px; }
#threads .rail-note { margin: 4px 10px; color: #9a3b2f; font-size: 12px; }
#rail .account { margin-top: auto; padding: 8px 10px 0; display: grid; gap: 6px; }
#rail .account-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#rail .account-name { border: 0; background: transparent; padding: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; text-align: left; }
#rail .account-name.on { color: var(--ink); }
#rail .account-exit { border: 0; background: transparent; color: var(--muted); padding: 0; font-size: 13px; }
#rail .account-exit:hover { color: var(--ink); }
#rail .account button { justify-content: center; }
.canvas {
  flex: 1;
  min-width: 0;
  background: radial-gradient(ellipse 70% 56% at 62% 18%, #f7f6f4 0%, #f3f2ef 58%, #e8e6e1 100%);
}
main { width: min(1180px, calc(100% - 56px)); margin: 0 auto; padding: 36px 0 72px; }
.section-title { margin: 0 0 12px; font-size: 14px; color: #3f3b36; }
.card, .panel {
  background: var(--sheet); border: 1px solid rgba(28, 28, 28, .08); border-radius: 18px;
  box-shadow: 0 24px 60px rgba(28, 28, 28, .05); backdrop-filter: blur(16px);
}
.continue { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 16px 18px; }
.continue b { display: block; margin-bottom: 4px; }
.continue p, .muted { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.activity { list-style: none; margin: 0; padding: 6px; }
.activity li { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.activity li.on { background: #fff; box-shadow: inset 0 0 0 1px #1c1c1c; }
.activity li:last-child { border-bottom: 0; }
.activity button { border: 0; background: transparent; padding: 0; text-align: left; }
.activity button.primary { background: #1c1c1c; color: #f7f6f4; border-radius: 10px; padding: 8px 16px; text-align: center; }
.activity button.ghost { color: #1c1c1c; border: 1px solid rgba(28, 28, 28, .12); border-radius: 10px; padding: 8px 14px; text-align: center; }
.page-head { margin-bottom: 18px; }
.form-note { margin: 0; color: #9a3b2f; font-size: 13px; }
.form-note button { border: 0; background: transparent; color: #9a3b2f; margin-left: 8px; padding: 0; }
.page-head h1 { margin-bottom: 0; }
.page-head .muted button { border: 0; background: transparent; padding: 0; color: var(--ink); font-size: inherit; }
.page-head .desk-reader { width: auto; max-width: none; margin: 8px 0; }
.day { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.day h2, .quiet h2 { margin: 0 0 10px; font-size: 15px; font-weight: 600; letter-spacing: .04em; }
.day .upload { margin-bottom: 12px; }
.quiet { margin-top: 28px; }
.line-form { display: flex; gap: 10px; align-items: center; padding: 12px; margin-bottom: 12px; }
.line-form input { flex: 1; }
.skill-list { padding: 6px 16px; }
.skill-row { display: grid; grid-template-columns: 148px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.skill-row:last-child { border-bottom: 0; }
.skill-row input { padding: 8px 12px; }
.board { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .85fr); gap: 16px; align-items: start; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.grid[hidden], #quiz-others[hidden], .card.empty[hidden] { display: none !important; }
.activity.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.material, .course-card { padding: 16px; display: grid; gap: 8px; align-content: start; }
.material .parse-meta, .material .parse-warning { margin: 0; font-size: 12px; }
.material .parse-warning { color: #9a4d2e; }
.material[hidden], .checkline[hidden], .pick-miss[hidden], #library-miss[hidden] { display: none !important; }
.material .where button { border: 0; background: transparent; padding: 0 0 0 6px; color: var(--ink); font-size: 13px; }
.material-body { margin: 8px 0; white-space: pre-wrap; line-height: 1.7; font-size: 14px; }
.material.on { background: #fff; box-shadow: inset 0 0 0 1px #1c1c1c; }
.material h3, .course-card h3, .panel h2 { margin: 0; font-size: 16px; }
.primary, .ghost {
  border-radius: 10px; padding: 8px 16px; border: 1px solid transparent; letter-spacing: .08em;
}
.primary { background: #1c1c1c; color: #f7f6f4; width: auto; justify-self: start; }
.ghost { background: transparent; border-color: rgba(28, 28, 28, .12); color: #1c1c1c; }
.composer, .upload { display: grid; gap: 10px; padding: 16px; margin-bottom: 16px; }
textarea, input[type="text"], input[type="search"], input[type="number"], select {
  width: 100%; border: 1px solid #e4e2dc; border-radius: 10px; background: #fff; padding: 12px; resize: vertical;
}
textarea:focus, input[type="text"]:focus, input[type="search"]:focus, input[type="number"]:focus, select:focus { outline: none; border-color: rgba(28, 28, 28, .45); }
.studio { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.talk { min-height: 560px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.bubbles { display: grid; gap: 10px; }
.bubble { max-width: 92%; padding: 12px 14px; border-radius: 16px; white-space: pre-wrap; line-height: 1.65; }
.bubble.tutor { background: #f6f5f2; }
.bubble.you { background: #1c1c1c; color: #f7f6f4; justify-self: end; }
.reply { display: grid; gap: 8px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.work { padding: 16px; display: grid; gap: 10px; position: sticky; top: 18px; }
.slot { border-top: 1px solid var(--line); padding-top: 8px; }
.slot span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.passage { white-space: pre-wrap; line-height: 1.7; font-size: 14px; }
.empty { padding: 28px; color: var(--muted); }
h1 { margin: 0 0 8px; font-family: "Songti SC", "Noto Serif SC", serif; font-size: 32px; font-weight: 600; letter-spacing: .04em; }
.lede { margin: 0 0 22px; color: #1c1c1c; line-height: 1.7; }
@media (max-width: 900px) {
  .studio, .grid, .board, .pair, .activity.tiles, .day, .skill-row { grid-template-columns: 1fr; }
  main { width: min(100% - 28px, 1080px); }
  .gate-form-side { left: 0; width: 100%; padding: 16px 16px 18px; align-items: flex-start; }
  .gate-motion { left: 16px; right: 16px; top: 46%; width: auto; transform: none; }
  .gate-motion-title { font-size: clamp(48px, 14vw, 72px); }
  .gate-slot { width: min(420px, 100%); }
}
.shell.desk { height: 100vh; }
.shell.desk .canvas { flex: 1; min-width: 0; display: flex; background: radial-gradient(ellipse 70% 56% at 62% 18%, #f7f6f4 0%, #f3f2ef 58%, #e8e6e1 100%); }
.shell.desk main { width: 100%; height: 100%; margin: 0; padding: 0; display: flex; flex-direction: column; min-height: 0; }
.desk-thread { flex: 1; overflow: auto; display: flex; flex-direction: column; padding: 28px 7% 12px; }
.desk-empty { margin: auto; max-width: 36rem; padding: 12px 8px 28px; color: var(--muted); text-align: center; line-height: 1.7; }
.desk-empty h2 { margin: 0 0 8px; color: var(--ink); font-family: "Songti SC", "Noto Serif SC", serif; font-size: 32px; font-weight: 600; }
.desk-empty p { margin: 0; }
.home-starts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.home-starts button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 12px; font-size: 13px; color: var(--ink); text-align: left; }
.desk-msg { width: 100%; max-width: 1040px; margin: 0 auto 18px; }
.desk-msg.you { display: flex; justify-content: flex-end; }
.desk-msg p { margin: 0; white-space: pre-wrap; }
.desk-msg.you p { margin: 0; }
.desk-msg.tutor p { line-height: 1.75; font-size: 16px; }
.desk-note { max-width: 1040px; margin: 0 auto 8px; min-height: 0; color: #9a3b2f; font-size: 13px; }
.desk-note:empty { display: none; }
.modes { display: flex; gap: 8px; margin-bottom: 12px; }
.modes .on { background: rgba(28, 28, 28, .08); }
.checkline { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.picks { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 6px; }
#stage-title, #stage-ask { width: min(1180px, calc(100% - 56px)); margin: 18px auto 0; }
#stage-ask button { margin-left: 8px; }
#bench-list { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 12px; }
#bench-list .kind { color: var(--muted); font-size: 12px; }
#bench-card { margin-bottom: 12px; }
.stage[hidden], #seen-form[hidden], #revise-form[hidden] { display: none !important; }
.activity li > button:not(.ghost) { display: flex; justify-content: space-between; gap: 12px; width: 100%; }
.activity li > button.where { display: inline; width: auto; margin: 6px 8px 0 0; border: 0; background: transparent; padding: 0; color: var(--muted); font-size: 13px; font-weight: 400; }
.activity form.add-drill { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.activity form.add-drill[hidden] { display: none; }
.activity form.add-drill input { flex: 1; height: 36px; }
.activity li > p > button[data-write-goal] { border: 0; background: transparent; padding: 0; color: var(--muted); font-size: 14px; }
.activity button small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 400; }
.activity .edit[hidden], .activity .ask-task[hidden], .activity .ask-unlink[hidden] { display: none; }
.activity .ask-task, .activity .ask-unlink { margin: 8px 0 0; color: #9a3b2f; }
.material .ask-task, .material .ask-unlink { margin: 8px 0 0; color: #9a3b2f; }
.material .ask-task[hidden], .material .ask-unlink[hidden] { display: none; }
.activity .ghost { margin: 6px 8px 0 0; }
.activity li[data-task] { display: grid; gap: 10px; }
.activity .bit { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.activity .bit .kind { color: var(--muted); font-size: 12px; min-width: 2.5em; }
.activity .bit .ghost { margin: 0; border: 1px solid rgba(28, 28, 28, .12); padding: 6px 10px; }
.activity .bit .more[hidden], .activity .bit [data-more][hidden] { display: none !important; }
.activity .bit form.add-drill { flex: 1 1 100%; }
.activity .bit .ask-unlink { flex: 1 1 100%; }
.desk-place { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 0; width: calc(100% - 48px); max-width: 1040px; margin: 0 auto 8px; }
.desk-place button { border: 0; background: transparent; padding: 0; font-weight: 600; letter-spacing: .08em; }
.desk-place [data-place=materials] { display: contents; }
.desk-place span { margin: 0 22px 0 8px; max-width: 14em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; color: var(--muted); font-size: 13px; }
.desk-place button.desk-note-name { margin: 0 12px 0 0; max-width: 14em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 13px; font-weight: 400; letter-spacing: 0; }
.desk-place button.desk-note-name.on { color: var(--ink); }
.desk-reader { width: calc(100% - 48px); max-width: 1040px; margin: 0 auto 8px; }
.desk-reader[hidden] { display: none; }
.desk-dock { width: calc(100% - 48px); max-width: 1040px; margin: 0 auto 14px; }
.desk-compose { background: rgba(255, 255, 255, .92); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 16px 40px rgba(48, 32, 12, .08); padding: 8px 8px 8px 16px; }
.desk-compose:focus-within { border-color: rgba(28, 28, 28, .28); box-shadow: 0 0 0 4px rgba(28, 28, 28, .04), 0 16px 40px rgba(28, 28, 28, .06); }
.desk-compose textarea { width: 100%; border: 0; outline: none; resize: none; min-height: 44px; max-height: 220px; padding: 10px 0; background: transparent; box-shadow: none; }
.desk-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 36px; }
.desk-send { margin-left: auto; height: 32px; padding: 0 14px; border: 0; border-radius: 10px; background: #1c1c1c; color: #f7f6f4; letter-spacing: .12em; font-weight: 560; }
.desk-send.is-stop { background: transparent; color: #9c3418; box-shadow: inset 0 0 0 1px rgba(156, 52, 24, .45); }
.desk-icon { border: 0; background: transparent; color: var(--muted); padding: 0 2px; font-size: 13px; }
.desk-icon:hover { color: var(--ink); }
.desk-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.desk-chips:empty { display: none; }
.desk-chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 10px; font-size: 12px; color: var(--ink); }
.desk-picker { display: flex; flex-wrap: wrap; gap: 6px; max-height: 280px; margin-bottom: 8px; overflow: auto; }
.desk-picker .desk-find { position: sticky; top: 0; flex: 1 0 100%; height: 34px; border: 0; border-radius: 8px; padding: 0 10px; background: #fff; }
.project-list { display: grid; gap: 10px; align-content: start; }
.learning-plan { display: grid; gap: 10px; margin: 4px 0 2px; padding: 14px; border: 1px solid rgba(28, 28, 28, .12); border-radius: 14px; background: rgba(255, 255, 255, .58); }
.learning-plan h3 { margin: 0; }
.learning-plan .section-heading p { margin: 4px 0 0; }
.learning-units { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; }
.learning-unit { display: grid; gap: 5px; padding: 10px 12px; border: 1px solid rgba(28, 28, 28, .1); border-radius: 11px; background: rgba(250, 249, 247, .88); }
.learning-unit p { margin: 0; }
.learning-unit small { color: var(--muted); }
.learning-unit-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.learning-evidence { display: grid; gap: 8px; margin-top: 6px; padding-top: 8px; border-top: 1px dashed rgba(28, 28, 28, .12); }
.learning-evidence[hidden] { display: none; }
#task-find, #library-find, #quiz-find, #assess-find, .pick-find { width: 100%; height: 40px; border: 0; border-radius: 10px; padding: 0 12px; background: #fff; }
.pick-find { flex: 1 0 100%; height: 34px; }
.desk-picker button[hidden] { display: none !important; }
.desk-msg.you { display: flex; flex-direction: column; align-items: flex-end; }
.desk-body { white-space: normal; }
.desk-msg.you .desk-body { white-space: pre-wrap; }
.desk-body p, .desk-body h1, .desk-body h2, .desk-body h3, .desk-body blockquote { margin: 0 0 8px; }
.desk-body h1, .desk-body h2, .desk-body h3 { font-size: 16px; }
.desk-body ul, .desk-body ol { margin: 0 0 8px; padding-left: 1.2em; }
.desk-body blockquote { padding-left: 12px; border-left: 2px solid rgba(28, 28, 28, .2); }
.desk-body code { font-size: .92em; background: #f3f1ec; padding: 0 4px; border-radius: 4px; }
.desk-table { overflow: auto; margin: 0 0 8px; }
.desk-body table { border-collapse: collapse; font-size: 14px; }
.desk-body th, .desk-body td { border: 1px solid var(--line); padding: 4px 8px; vertical-align: top; }
.desk-msg.you .desk-body { width: fit-content; max-width: min(34rem, 86%); background: #1c1c1c; color: #f7f6f4; border-radius: 16px 16px 4px 16px; padding: 11px 15px; line-height: 1.65; }
.desk-msg.you .desk-body :last-child { margin-bottom: 0; }
.desk-msg.tutor .desk-body { line-height: 1.75; font-size: 16px; }
.studio { margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.desk-shot { display: block; max-width: min(36rem, 100%); margin: 8px 0; border-radius: 12px; }
.desk-tools { margin: 0 0 8px; padding: 0; list-style: none; color: var(--muted); font-size: 12px; }
.desk-tools li { margin: 0 0 2px; }
.desk-more summary { color: var(--muted); font-size: 13px; cursor: pointer; list-style: none; }
.desk-more summary::-webkit-details-marker { display: none; }
.desk-more:not([open]) > :not(summary) { display: none; }
.desk-more select { border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 13px; }
.desk-tools-pick { display: flex; flex-wrap: wrap; gap: 8px 12px; margin: 8px 0; }
.desk-tools-pick label { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.desk-actions { display: flex; gap: 10px; align-items: center; margin-top: 6px; opacity: 0; }
.desk-msg:hover .desk-actions, .desk-msg:focus-within .desk-actions { opacity: 1; }
.desk-actions button, .desk-note button { border: 0; background: transparent; color: var(--muted); padding: 6px 8px; font-size: 13px; }
.desk-actions time { color: var(--muted); font-size: 12px; }
.desk-note button { margin-left: 8px; color: #9a3b2f; }
.desk-pre { margin: 8px 0; padding: 10px 12px; overflow: auto; border-radius: 10px; background: #f3f1ec; font-size: 13px; }
.desk-math { display: inline-flex; align-items: center; margin: 0 .12em; font-family: Georgia, "Times New Roman", serif; font-size: 1.04em; white-space: nowrap; }
.desk-math-fraction { flex-direction: column; line-height: 1.05; vertical-align: middle; }
.desk-math-numerator { padding: 0 .18em; border-bottom: 1px solid currentColor; }
.desk-math-denominator { padding: 0 .18em; }
.desk-math sup { font-size: .72em; line-height: 1; vertical-align: super; }
.activity audio { display: block; width: min(360px, 100%); margin: 8px 0; }
.media-result-image, .media-result-video { display: block; width: min(360px, 100%); max-height: 240px; object-fit: contain; margin: 8px 0; border-radius: 12px; background: var(--panel-strong, #f3f1ec); }
.media-result-link { display: inline-block; margin: 8px 0; }
.research-page-evidence { margin: 8px 0 0; padding-left: 22px; max-height: 360px; overflow: auto; }
.research-page-evidence li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.research-page-evidence p { margin: 4px 0 0; white-space: pre-wrap; }
.desk-msg.tutor.live .desk-body::after { content: ""; display: inline-block; width: 8px; height: 1em; margin-left: 2px; background: currentColor; vertical-align: text-bottom; }
.desk-pending { display: flex; gap: 5px; max-width: 1040px; margin: 0 auto 12px; padding: 8px 0; }
.desk-pending span { width: 6px; height: 6px; border-radius: 50%; background: #8a847c; animation: desk-blink 1s infinite; }
.desk-pending span:nth-child(2) { animation-delay: .15s; }
.desk-pending span:nth-child(3) { animation-delay: .3s; }
@keyframes desk-blink { 50% { opacity: .25; } }
#thread-find { width: 100%; margin: 0 0 8px; height: 34px; border: 0; border-radius: 8px; padding: 0 10px; background: rgba(255, 255, 255, .8); font-size: 13px; }
#thread-find:focus { outline: none; box-shadow: inset 0 0 0 1px rgba(28, 28, 28, .2); }
.thread-row { display: flex; align-items: center; gap: 2px; }
.thread-row .thread { flex: 1; min-width: 0; }
.thread-remove, .thread-ask button { border: 0; background: transparent; color: var(--muted); font-size: 12px; padding: 6px; }
.thread-remove { opacity: 0.7; }
@media (hover: hover) {
  .thread-remove { opacity: 0; }
  .thread-row:hover .thread-remove, .thread-row:focus-within .thread-remove { opacity: 1; }
}
.thread-ask { display: flex; align-items: center; gap: 8px; padding: 0 12px 8px; font-size: 12px; color: var(--muted); }
.thread-ask[hidden] { display: none; }
.thread-none { margin: 8px 12px; color: var(--muted); font-size: 12px; }
.material .ghost { margin-left: 8px; }

/* The conversation history belongs to the primary rail. Keeping it in the
   same surface removes the old second navigation column and leaves the
   conversation canvas as the only content pane. */
#rail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: auto;
  min-width: 0;
}
#rail-nav {
  display: flex;
  flex: 0 0 auto;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
}
#rail-nav .nav-rest { flex: none; min-height: 0; overflow: visible; }
#threads {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-top: 1px solid rgba(42, 32, 18, .1);
  border-radius: 0;
  padding: 12px 0 0;
  background: transparent;
  box-shadow: none;
}
#threads .thread-pane-head { padding: 0 2px; }
#threads .thread-pane-head .nav-item {
  border: 1px solid rgba(42, 32, 18, .14);
  border-radius: 9px;
  background: rgba(255, 252, 247, .9);
  color: #3c3832;
  padding: 6px 10px;
  line-height: 1.2;
}
#threads .thread-pane-head .nav-item:hover { border-color: rgba(28, 28, 28, .36); background: #fff; }
#threads .thread-head [data-again],
#threads .thread-head [data-fold] {
  opacity: 1;
  border: 1px solid rgba(42, 32, 18, .1);
  border-radius: 8px;
  background: rgba(255, 252, 247, .75);
  color: #6d6a64;
  padding: 5px 8px;
  line-height: 1.2;
}
#threads .thread-head [data-again]:hover,
#threads .thread-head [data-fold]:hover { border-color: rgba(28, 28, 28, .32); color: var(--ink); }
#threads [data-rail-ask], #threads [data-write-goal] {
  display: inline-flex;
  width: auto;
  max-width: calc(100% - 16px);
  margin: 2px 8px 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid rgba(42, 32, 18, .1);
  border-radius: 8px;
  background: rgba(255, 252, 247, .78);
  color: #5e584e;
  padding: 6px 9px;
  line-height: 1.2;
}
#threads [data-rail-ask]:hover, #threads [data-write-goal]:hover { border-color: rgba(28, 28, 28, .32); color: var(--ink); }
#threads .thread-rename,
#threads .thread-remove,
#threads .thread-ask button {
  border: 1px solid rgba(42, 32, 18, .1);
  border-radius: 8px;
  background: rgba(255, 252, 247, .76);
  padding: 5px 8px;
  line-height: 1.2;
}
#threads .thread-remove { opacity: 1; }
#threads .thread-ask { flex-wrap: wrap; padding: 6px 8px 8px; }
#thread-find { height: 38px; border: 1px solid rgba(42, 32, 18, .1); border-radius: 10px; }

/* Chat controls read as controls and message content stays inside its pane. */
.desk-icon, .desk-more summary {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(42, 32, 18, .12);
  border-radius: 9px;
  background: rgba(255, 252, 247, .76);
  color: #5e584e;
  line-height: 1.2;
  cursor: pointer;
}
.desk-icon:hover, .desk-more summary:hover { border-color: rgba(28, 28, 28, .32); color: var(--ink); background: #fff; }
.desk-more select { min-height: 32px; padding: 0 7px; border: 1px solid rgba(42, 32, 18, .12); border-radius: 8px; background: rgba(255, 252, 247, .9); }
.desk-body, .desk-body * { max-width: 100%; overflow-wrap: anywhere; word-break: break-word; }
.desk-msg.tutor .desk-body { min-width: 0; }
.desk-msg.you .desk-body { max-width: min(44rem, calc(100% - 16px)); }
.desk-body pre, .desk-pre { max-width: 100%; overflow: auto; white-space: pre-wrap; }
.desk-body table { display: block; max-width: 100%; overflow: auto; }
.desk-compose, .desk-dock, .desk-msg, .desk-place, .desk-note { min-width: 0; }
.home-tools button, .home-outline button { border: 1px solid rgba(42, 32, 18, .1); border-radius: 8px; background: rgba(255, 252, 247, .8); padding: 6px 9px; color: #5e584e; }
.home-tools button:hover, .home-outline button:hover { border-color: rgba(28, 28, 28, .32); color: var(--ink); }

@media (max-width: 900px) {
  #rail { height: auto; }
  #threads { max-height: 42vh; }
}

[hidden] { display: none !important; }
.shell { height: 100vh; overflow: hidden; }
.canvas { height: 100vh; overflow: auto; }
#rail { width: 248px; flex-basis: 248px; }
.current-task { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 4px 10px 12px; font-size: 16px; font-weight: 600; line-height: 1.4; }
.current-task small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 400; }
#threads .thread small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 400; }
.board { grid-template-columns: minmax(0, 720px); }
main { width: min(760px, calc(100% - 64px)); }
.shell.wide main { width: min(1080px, calc(100% - 64px)); }
.shell.wide .board { grid-template-columns: minmax(0, 1fr); }
.start { min-height: calc(100vh - 80px); display: grid; align-content: center; gap: 8px; max-width: 640px; }
.start .kicker { margin: 0; color: var(--muted); letter-spacing: .18em; font-size: 12px; }
.start h1 { font-size: 44px; line-height: 1.25; }
.start form { margin-top: 12px; }
.ask-bar { width: min(1040px, calc(100% - 48px)); margin: 18px auto 0; display: grid; gap: 4px; }
.ask-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ask-title h1 { margin: 0; font-size: 22px; font-family: "Songti SC", "Noto Serif SC", serif; }
.home-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 0; color: var(--muted); font-size: 13px; }
.home-meta:empty { display: none; }
.home-meta button { border: 0; background: transparent; color: var(--ink); padding: 0; font-size: 13px; }
.ask-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.home-tools { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.home-tools button, .home-outline button { border: 0; background: transparent; color: var(--muted); font-size: 13px; padding: 4px 2px; }
.home-tools button:hover, .home-outline button:hover { color: var(--ink); }
.home-find, .home-style textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fff; font: inherit; }
.home-style { display: grid; gap: 8px; }
.home-outline { display: grid; gap: 2px; justify-items: start; }
.home-place { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; color: var(--muted); font-size: 13px; }
.home-place button { border: 0; background: transparent; color: var(--muted); padding: 0; font-size: 13px; }
.home-place:empty { display: none; }
#rail > .nav-item { flex: none; }
#rail .nav-rest { flex: none; }
.hub { display: grid; gap: 12px; }
.hub-title { margin: 22px 0 0; font-size: 18px; font-family: "Songti SC", "Noto Serif SC", serif; }
.hub-card { display: grid; gap: 4px; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 16px 18px; }
.hub-card b { font-size: 16px; }
.hub-card span { color: var(--muted); font-size: 13px; line-height: 1.5; }
.hub-card.on { border-color: var(--ink); }
.bench-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.bench-chip.on { background: var(--ink); color: #fff; }
.bench-frame { width: 100%; height: min(78vh, 920px); border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.bench-choice { display: block; width: 100%; text-align: left; margin: 0 0 8px; }
.word-prompt { margin: 0 0 8px; font-size: 22px; }
.thread-chip { border: 0; background: transparent; color: var(--muted); border-radius: 8px; padding: 4px 8px; }
.thread-chip.on { background: rgba(28, 28, 28, .08); color: var(--ink); font-weight: 600; }
.make-layout { display: grid; gap: 22px; }
.make-stage { display: grid; gap: 12px; }
.stage-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stage-head:not(:has(:not([hidden]))) { display: none; }
iframe.stage { display: block; width: 100%; height: min(68vh, 720px); border: 0; border-radius: 18px; background: #fff; box-shadow: 0 24px 60px rgba(28, 28, 28, .06); }
iframe.stage[hidden] { display: none !important; }
#bench-list { display: block; }
.bench-kind { margin: 0; border-bottom: 1px solid var(--line); }
.bench-kind summary { display: flex; justify-content: space-between; gap: 12px; padding: 12px 2px; cursor: pointer; font-size: 15px; font-weight: 600; }
.bench-kind summary span { color: var(--muted); font-weight: 400; font-size: 13px; }
.bench-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 14px; }
.activity li.on { display: flex; flex-direction: column; gap: 14px; background: transparent; box-shadow: none; }
.activity li.on > b, .activity li.on > p { display: none; }
.activity li.on form.edit { display: grid; gap: 10px; order: 1; }
.activity li.on .actions { order: 2; }
#bench-card h2, .own-page summary, .motion summary { font-size: 15px; font-weight: 600; }
.own-page, #bench-card { padding: 16px 18px; }
.own-page summary, .motion summary { cursor: pointer; }
.motion { margin: 4px 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.step-links { margin: 8px 0 0; }
.step-links button { border: 0; background: transparent; padding: 0; color: var(--ink); }
.step-links .primary { padding: 8px 16px; }
#stage-title, #stage-ask { width: auto; margin: 0; }
.page-head .lede { margin-top: 6px; }
.growth { display: grid; gap: 4px; margin: 10px 8px 0; color: var(--muted); font-size: 12px; }
.growth b, .growth-bar b { color: var(--ink); font-weight: 600; }
.growth button { justify-self: start; margin-top: 4px; border: 0; background: transparent; padding: 0; color: var(--ink); font-weight: 600; text-align: left; }
.growth-bar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.growth-bar button { border: 0; background: #1c1c1c; color: #f7f6f4; border-radius: 10px; padding: 8px 14px; }
.settle { display: grid; gap: 16px; }
.settle .card { padding: 16px 18px; display: grid; gap: 10px; }
.settle h2 { margin: 0; font-size: 16px; }
.ask-bar .lede { margin: 0; }
.step-links { display: flex; gap: 16px; }
.source-list { display: grid; gap: 12px; }
.source-card h2 { margin: 0 0 6px; font-size: 18px; }
.source-card p { margin: 0 0 8px; }
.source-crumb { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 8px; }
.source-crumb button { border: 0; background: transparent; padding: 0; color: var(--ink); }
.source-find { display: flex; gap: 8px; margin: 12px 0; }
.source-find input { flex: 1; }
.source-doors, .source-hits { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.source-doors button, .source-hits button { border: 0; background: #fff; border-radius: 10px; padding: 8px 12px; }
.source-tree { display: grid; gap: 4px; margin-top: 12px; }
.source-tree button { text-align: left; border: 0; background: transparent; padding: 6px 0; border-bottom: 1px solid var(--line); }
.source-code { white-space: pre-wrap; word-break: break-word; background: #fff; border-radius: 16px; padding: 16px; margin-top: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.5; }
.shell {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  gap: 12px;
  height: 100vh;
  padding: 12px;
  overflow: hidden;
  background:
    radial-gradient(900px 480px at 0% -10%, rgba(196, 160, 104, .28), transparent 58%),
    radial-gradient(720px 420px at 100% 0%, rgba(28, 28, 28, .05), transparent 52%),
    #e7e1d6;
}
.shell.with-threads { grid-template-columns: 220px 292px minmax(0, 1fr); }
#rail, #threads, .canvas {
  min-width: 0;
  min-height: 0;
  height: 100%;
  border: 1px solid rgba(255, 252, 247, .85);
  border-radius: 22px;
  background: rgba(255, 252, 247, .78);
  box-shadow: 0 14px 36px rgba(48, 32, 12, .07);
}
#rail {
  position: relative;
  top: auto;
  width: auto;
  flex: none;
  padding: 16px 12px 14px;
  overflow: hidden;
}
#threads {
  display: flex;
  flex-direction: column;
  padding: 14px 10px 12px;
  overflow: hidden;
}
#threads[hidden] { display: none !important; }
.canvas {
  display: flex;
  flex-direction: column;
  overflow: auto;
  background: rgba(255, 252, 247, .72);
}
.shell.desk .canvas { overflow: hidden; background: rgba(255, 252, 247, .84); }
#rail .nav-rest { margin-top: 8px; gap: 2px; flex: 1; min-height: 0; overflow: auto; }
#rail .nav-label, #threads .nav-label {
  margin: 14px 12px 4px;
  font-size: 12px;
  letter-spacing: .16em;
  color: #8d867c;
}
#rail .nav-label:first-child { margin-top: 4px; }
#rail button.nav-item, #threads button.nav-item {
  height: 40px;
  min-height: 40px;
  border-radius: 12px;
  padding: 0 12px;
  color: #5e584e;
}
#rail button.nav-item.on, #threads button.nav-item.on {
  background: rgba(28, 28, 28, .08);
  color: #1c1915;
  font-weight: 650;
}
#rail .account {
  margin-top: 8px;
  padding: 12px 10px 2px;
  border-top: 1px solid rgba(42, 32, 18, .08);
  gap: 4px;
}
#rail .account-set { border: 0; background: transparent; padding: 0; color: #5e584e; font-size: 13px; }
#rail .account-set.on, #rail .account-set:hover, #rail .account-exit:hover { color: #1c1915; }
.thread-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.thread-pane-head .nav-label { margin: 0 0 0 4px; }
.thread-pane-head .nav-item { width: auto; height: 32px; min-height: 32px; padding: 0 10px; font-weight: 650; }
#threads .threads { overflow: hidden; }
#threads .thread-scroll { flex: 1; min-height: 0; overflow: auto; }
main { width: auto; max-width: none; margin: 0; padding: 28px 32px 72px; }
.shell.wide main { width: auto; }
.shell.desk main { width: 100%; padding: 0; }
.page-head .kicker { margin: 0 0 6px; color: #8d867c; letter-spacing: .16em; font-size: 12px; }
.hub-section { display: grid; gap: 12px; margin-top: 28px; }
.hub-title { margin: 0; font-size: 18px; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.path { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; counter-reset: step; }
.path .hub-card { counter-increment: step; }
.path .hub-card::before { content: counter(step); color: #8d867c; font-size: 12px; letter-spacing: .08em; }
.hub-card {
  border-radius: 18px;
  background: rgba(255, 252, 247, .92);
  box-shadow: 0 10px 28px rgba(48, 32, 12, .05);
  padding: 16px 16px 14px;
}
.hub-card:hover { border-color: rgba(28, 28, 28, .28); }
.mode-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.mode-chip {
  display: grid;
  gap: 4px;
  text-align: left;
  border: 1px solid rgba(42, 32, 18, .1);
  border-radius: 16px;
  background: rgba(255, 252, 247, .92);
  padding: 12px 14px;
}
.mode-chip b { font-size: 14px; font-weight: 650; }
.mode-chip span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.mode-chip:hover { border-color: rgba(28, 28, 28, .28); }
.primary, .ghost, .desk-send { letter-spacing: 0; border-radius: 999px; }
.primary { border: 0; background: #1c1915; color: #f6f1e7; }
.ghost { background: rgba(255, 252, 247, .92); border-color: rgba(42, 32, 18, .12); }
.primary:hover { background: #2c2926; }
.ghost:hover { border-color: #1c1915; }
.studio { margin-top: 22px; }
.activity .actions [data-ask-task] { margin-left: auto; color: #9c3418; background: transparent; border-color: transparent; }
.activity .actions [data-ask-task]:hover { color: #9c3418; }
.study-progress { display: flex; align-items: center; gap: 12px; margin-top: 14px; color: var(--muted); font-size: 13px; }
.study-progress [data-study-back] { margin-left: auto; }
.study-card { max-width: 760px; display: grid; gap: 18px; }
.study-messages { display: grid; gap: 12px; list-style: none; margin: 0; padding: 0; }
.study-message { display: grid; gap: 4px; max-width: 88%; padding: 12px 14px; border-radius: 16px; background: rgba(245, 239, 229, .78); }
.study-message.mine { justify-self: end; background: rgba(224, 239, 235, .9); }
.study-message span { color: var(--muted); font-size: 12px; }
.study-message p { margin: 0; line-height: 1.65; white-space: pre-wrap; }
.study-turn { display: grid; gap: 12px; }
.study-done { margin: 0; line-height: 1.7; }
.research-start { max-width: 820px; padding: 20px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.section-heading h2 { margin: 0; }
.research-start form { display: grid; gap: 14px; }
.research-actions { display: flex; align-items: center; gap: 12px; }
.research-list { display: grid; gap: 10px; }
.research-row { width: 100%; display: grid; gap: 8px; padding: 16px 18px; text-align: left; border: 1px solid rgba(42, 32, 18, .1); background: rgba(255, 252, 247, .92); }
.research-row:hover { border-color: rgba(28, 28, 28, .3); transform: translateY(-1px); }
.research-row-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.status-pill { flex: none; padding: 4px 9px; border-radius: 999px; background: rgba(224, 239, 235, .9); color: #315c4e; font-size: 12px; }
.research-preview { color: #5e584e; font-size: 13px; line-height: 1.6; white-space: pre-wrap; }
.research-empty { padding: 18px; }
.research-empty p { margin: 0; line-height: 1.65; }
.research-detail { display: grid; gap: 18px; padding: 22px; }
.research-detail h2 { margin: 0; font-size: 20px; line-height: 1.4; }
.research-detail-actions { display: flex; gap: 10px; }
.research-detail-actions select { min-height: 36px; border: 1px solid rgba(42, 32, 18, .12); border-radius: 999px; padding: 0 12px; background: rgba(255, 252, 247, .92); }
.research-action-note { min-height: 20px; }
.research-block { display: grid; gap: 8px; }
.research-block h3 { margin: 0; font-size: 14px; }
.research-outline, .research-events { margin: 0; padding: 0 0 0 22px; }
.research-outline li, .research-events li { padding: 9px 0; border-bottom: 1px solid var(--line); line-height: 1.6; }
.research-outline li:last-child, .research-events li:last-child { border-bottom: 0; }
.research-outline p, .research-events p { margin: 4px 0 0; white-space: pre-wrap; }
.research-report { padding: 14px 16px; border-radius: 14px; background: rgba(245, 239, 229, .7); line-height: 1.75; }
.research-report p { margin: 0; white-space: pre-wrap; }
.research-sources { margin: 0; padding: 0 0 0 22px; }
.research-sources li { display: grid; gap: 4px; padding: 9px 0; border-bottom: 1px solid var(--line); line-height: 1.5; }
.research-sources li:last-child { border-bottom: 0; }
.research-sources a { color: #315c4e; overflow-wrap: anywhere; }
.research-source-meta { color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.research-sources details { color: var(--muted); font-size: 12px; }
.research-sources details p { margin: 6px 0 0; white-space: pre-wrap; }
.research-page-blocks { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 5px; }
.research-page-block { padding: 6px 8px; border-left: 2px solid rgba(49,92,78,.25); background: rgba(49,92,78,.04); }
.research-page-block p { margin: 3px 0 0; white-space: pre-wrap; }
.research-claims, .research-versions, .research-deliverables { margin: 0; padding: 0 0 0 22px; }
.research-claims li, .research-versions li, .research-deliverables li { padding: 9px 0; border-bottom: 1px solid var(--line); line-height: 1.6; }
.research-claims li:last-child, .research-versions li:last-child, .research-deliverables li:last-child { border-bottom: 0; }
.research-evidence-list { display: grid; gap: 3px; margin-top: 5px; font-size: 12px; }
.research-inline-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(130px, 1fr) minmax(110px, .8fr) auto; gap: 8px; align-items: center; }
.research-inline-form input, .research-inline-form select { min-width: 0; min-height: 36px; box-sizing: border-box; padding: 7px 10px; border: 1px solid rgba(42, 32, 18, .12); border-radius: 10px; background: rgba(255, 252, 247, .92); font: inherit; }
.research-inline-form button { white-space: nowrap; }
.model-directory { margin-top: 10px; border-top: 1px solid var(--line); }
.model-directory summary { padding: 12px 6px; color: var(--muted); font-size: 13px; cursor: pointer; }
.model-directory summary::-webkit-details-marker { color: var(--muted); }
.voice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.voice-form { display: grid; gap: 10px; }
.voice-form input, .voice-form select { min-height: 36px; box-sizing: border-box; padding: 7px 10px; border: 1px solid rgba(42, 32, 18, .12); border-radius: 10px; background: rgba(255, 252, 247, .92); font: inherit; }
.voice-feedback { display: grid; gap: 5px; padding: 11px 12px; border-radius: 12px; background: rgba(224, 239, 235, .72); line-height: 1.55; }
.voice-feedback p { margin: 0; }
.media-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.media-form, .media-capability { display: grid; gap: 10px; }
.media-form input { min-height: 36px; box-sizing: border-box; padding: 7px 10px; border: 1px solid rgba(42, 32, 18, .12); border-radius: 10px; background: rgba(255, 252, 247, .92); font: inherit; }
.capability-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.capability-card { display: grid; gap: 8px; min-width: 0; padding: 14px 15px; border: 1px solid rgba(42, 32, 18, .1); border-radius: 16px; background: rgba(255, 252, 247, .78); }
.capability-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.capability-card p { margin: 0; line-height: 1.55; }
.capability-card .capability-action { justify-self: start; }
.status-pill.is-muted { background: rgba(42, 32, 18, .07); color: var(--muted); }
.status-pill.is-ready { background: rgba(224, 239, 235, .9); color: #315c4e; }
@media (max-width: 700px) {
  .voice-grid { grid-template-columns: 1fr; }
  .media-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .research-detail-actions { flex-wrap: wrap; }
  .research-inline-form { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell, .shell.with-threads { height: auto; overflow: visible; display: flex; flex-direction: column; grid-template-columns: 1fr; }
  #rail, #threads { position: relative; width: 100%; height: auto; flex-basis: auto; }
  #threads { max-height: 42vh; }
  .canvas { height: auto; min-height: 70vh; }
  .start h1 { font-size: 32px; }
  .path { grid-template-columns: 1fr; }
}

/* Final rail layout overrides. History is part of the primary rail. */
.shell { grid-template-columns: 304px minmax(0, 1fr); }
.shell.with-threads { grid-template-columns: 304px minmax(0, 1fr); }
#rail { display: flex; flex-direction: column; gap: 10px; width: auto; min-width: 0; }
#rail-nav { display: flex; flex: 0 0 auto; min-width: 0; min-height: 0; flex-direction: column; }
#rail-nav .nav-rest { flex: none; min-height: 0; overflow: visible; }
#threads { flex: 1 1 auto; min-width: 0; min-height: 0; border: 0; border-top: 1px solid rgba(42, 32, 18, .1); border-radius: 0; padding: 12px 0 0; background: transparent; box-shadow: none; }
#threads .thread-pane-head { padding: 0 2px; }
#threads .thread-pane-head .nav-item { border: 1px solid rgba(42, 32, 18, .14); border-radius: 9px; background: rgba(255, 252, 247, .9); color: #3c3832; padding: 6px 10px; line-height: 1.2; }
#threads .thread-pane-head .nav-item:hover { border-color: rgba(28, 28, 28, .36); background: #fff; }
#threads .thread-head [data-again], #threads .thread-head [data-fold] { opacity: 1; border: 1px solid rgba(42, 32, 18, .1); border-radius: 8px; background: rgba(255, 252, 247, .75); color: #6d6a64; padding: 5px 8px; line-height: 1.2; }
#threads .thread-head [data-again]:hover, #threads .thread-head [data-fold]:hover { border-color: rgba(28, 28, 28, .32); color: var(--ink); }
#threads [data-rail-ask], #threads [data-write-goal] { display: inline-flex; width: auto; max-width: calc(100% - 16px); margin: 2px 8px 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1px solid rgba(42, 32, 18, .1); border-radius: 8px; background: rgba(255, 252, 247, .78); color: #5e584e; padding: 6px 9px; line-height: 1.2; }
#threads [data-rail-ask]:hover, #threads [data-write-goal]:hover { border-color: rgba(28, 28, 28, .32); color: var(--ink); }
#threads .thread-rename, #threads .thread-remove, #threads .thread-ask button { border: 1px solid rgba(42, 32, 18, .1); border-radius: 8px; background: rgba(255, 252, 247, .76); padding: 5px 8px; line-height: 1.2; }
#threads .thread-remove { opacity: 1; }
#threads .thread-ask { flex-wrap: wrap; padding: 6px 8px 8px; }
#thread-find { height: 38px; border: 1px solid rgba(42, 32, 18, .1); border-radius: 10px; }
.desk-icon, .desk-more summary { display: inline-flex; align-items: center; min-height: 32px; padding: 0 10px; border: 1px solid rgba(42, 32, 18, .12); border-radius: 9px; background: rgba(255, 252, 247, .76); color: #5e584e; line-height: 1.2; cursor: pointer; }
.desk-icon:hover, .desk-more summary:hover { border-color: rgba(28, 28, 28, .32); color: var(--ink); background: #fff; }
.desk-more select { min-height: 32px; padding: 0 7px; border: 1px solid rgba(42, 32, 18, .12); border-radius: 8px; background: rgba(255, 252, 247, .9); }
.desk-body, .desk-body * { max-width: 100%; overflow-wrap: anywhere; word-break: break-word; }
.desk-msg.tutor .desk-body { min-width: 0; }
.desk-msg.you .desk-body { max-width: min(44rem, calc(100% - 16px)); }
.desk-body pre, .desk-pre { max-width: 100%; overflow: auto; white-space: pre-wrap; }
.desk-body table { display: block; max-width: 100%; overflow: auto; }
.desk-compose, .desk-dock, .desk-msg, .desk-place, .desk-note { min-width: 0; }
.home-tools button, .home-outline button { border: 1px solid rgba(42, 32, 18, .1); border-radius: 8px; background: rgba(255, 252, 247, .8); padding: 6px 9px; color: #5e584e; }
.home-tools button:hover, .home-outline button:hover { border-color: rgba(28, 28, 28, .32); color: var(--ink); }
@media (max-width: 900px) {
  .shell, .shell.with-threads { grid-template-columns: 1fr; }
  #rail { height: auto; }
  #threads { max-height: 42vh; }
}

@media (min-width: 901px) {
  #rail-nav { max-height: calc(100% - 178px); overflow: auto; }
  #rail-nav .brand { padding-bottom: 4px; }
  #rail-nav .nav-label { margin-top: 8px; margin-bottom: 2px; }
  #rail-nav button.nav-item { height: 34px; min-height: 34px; }
  #rail-nav .account { margin-top: 6px; padding-top: 8px; }
  #threads { min-height: 178px; }
}

/* Composer hierarchy. The input stays quiet, while model, tools and actions
   remain discoverable without turning the whole footer into a second form. */
.desk-dock { position: relative; z-index: 4; }
.desk-compose {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 12px 14px 10px;
  border: 1px solid rgba(42, 32, 18, .14);
  border-radius: 20px;
  background: rgba(255, 253, 249, .94);
  box-shadow: 0 18px 44px rgba(48, 32, 12, .08);
}
.desk-compose:focus-within {
  border-color: rgba(44, 92, 84, .48);
  box-shadow: 0 0 0 4px rgba(44, 92, 84, .08), 0 18px 44px rgba(48, 32, 12, .08);
}
.desk-compose form { min-width: 0; }
.desk-compose textarea {
  min-height: 58px;
  max-height: 220px;
  padding: 5px 2px 11px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.65;
}
.desk-compose textarea::placeholder { color: #918a80; }
.desk-foot {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding-top: 3px;
  border-top: 1px solid rgba(42, 32, 18, .08);
}
.desk-foot > .desk-icon,
.desk-foot > .desk-more > summary {
  min-height: 32px;
  border: 1px solid rgba(42, 32, 18, .13);
  border-radius: 9px;
  background: rgba(255, 252, 247, .86);
  color: #5e584e;
  padding: 0 10px;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}
.desk-foot > .desk-icon:hover,
.desk-foot > .desk-more > summary:hover {
  border-color: rgba(44, 92, 84, .42);
  background: #fff;
  color: #2c5c54;
}
.desk-foot > .desk-icon:focus-visible,
.desk-foot > .desk-more > summary:focus-visible,
.desk-more select:focus-visible,
.desk-tools-pick label:has(input:focus-visible) {
  outline: 3px solid rgba(44, 92, 84, .18);
  outline-offset: 1px;
}
.desk-send {
  min-width: 68px;
  height: 34px;
  margin-left: auto;
  padding: 0 16px;
  border-radius: 999px;
  letter-spacing: .08em;
  box-shadow: 0 6px 16px rgba(28, 28, 28, .12);
}
.desk-send:hover { transform: translateY(-1px); }
.desk-send:active { transform: translateY(0); }
.desk-send.is-stop { box-shadow: none; }
.desk-chips { gap: 6px; padding: 0 0 6px; }
.desk-chip {
  border-color: rgba(44, 92, 84, .18);
  background: rgba(240, 247, 244, .88);
  color: #2c5c54;
}

/* More is an intentional popover, so a long tool list never pushes the
   message composer down or competes with the learner's draft. */
.desk-more { position: relative; z-index: 5; }
.desk-more summary { list-style: none; }
.desk-more summary::-webkit-details-marker { display: none; }
.desk-more summary::after { content: "⌄"; margin-left: 7px; font-size: 12px; opacity: .7; }
.desk-more[open] {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  width: min(520px, calc(100vw - 48px));
  max-height: min(68vh, 560px);
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(42, 32, 18, .15);
  border-radius: 16px;
  background: rgba(255, 253, 249, .98);
  box-shadow: 0 20px 56px rgba(48, 32, 12, .16);
}
.desk-more[open] summary {
  margin: -10px -10px 10px;
  padding: 11px 12px;
  border: 0;
  border-bottom: 1px solid rgba(42, 32, 18, .08);
  border-radius: 16px 16px 0 0;
  background: rgba(247, 244, 238, .88);
  color: var(--ink);
}
.desk-more[open] summary::after { content: "⌃"; }
.desk-more[open] select {
  display: block;
  width: 100%;
  min-height: 38px;
  margin: 0 0 10px;
  padding: 0 11px;
  border: 1px solid rgba(42, 32, 18, .14);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
}
.desk-tools-pick {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 0 0 10px;
  padding: 2px 0 4px;
}
.desk-tools-pick label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid rgba(42, 32, 18, .1);
  border-radius: 10px;
  background: rgba(255, 255, 255, .78);
  color: #5e584e;
  font-size: 13px;
  cursor: pointer;
}
.desk-tools-pick label:hover { border-color: rgba(44, 92, 84, .32); color: #2c5c54; }
.desk-tools-pick input { width: 15px; height: 15px; margin: 0; accent-color: #2c5c54; }
.desk-more[open] > .desk-icon {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin: 2px 5px 0 0;
  padding: 0 10px;
  border: 1px solid rgba(42, 32, 18, .12);
  border-radius: 9px;
  background: rgba(255, 252, 247, .86);
  color: #5e584e;
  font-size: 13px;
}
.desk-more[open] > .desk-icon:hover { border-color: rgba(44, 92, 84, .36); color: #2c5c54; background: #fff; }
.desk-more[open] .desk-tools-pick + .desk-icon { margin-top: 0; }

/* These hooks cover the model selector and network switch added by the
   capability surface without coupling the layout to a particular markup. */
.desk-model-select, .desk-model-trigger, [data-model-select], [data-model-picker] {
  min-height: 32px;
  max-width: 180px;
  border: 1px solid rgba(42, 32, 18, .13);
  border-radius: 9px;
  padding: 0 26px 0 10px;
  background: rgba(255, 252, 247, .86);
  color: #5e584e;
  font-size: 13px;
}
.desk-network {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(42, 32, 18, .12);
  border-radius: 999px;
  background: rgba(255, 252, 247, .76);
  color: #5e584e;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.desk-network:has(input:checked) { border-color: rgba(44, 92, 84, .38); color: #2c5c54; background: rgba(236, 246, 242, .9); }
.desk-network input { width: 15px; height: 15px; margin: 0; accent-color: #2c5c54; }
.desk-model-select:focus-visible, .desk-network:has(input:focus-visible) { outline: 2px solid rgba(44, 92, 84, .42); outline-offset: 2px; }
.desk-web-toggle, [data-web-toggle], [data-tool="web_search"] { accent-color: #2c5c54; }

@media (max-width: 700px) {
  .desk-dock { width: calc(100% - 24px); }
  .desk-compose { border-radius: 16px; padding: 10px 11px 8px; }
  .desk-compose textarea { min-height: 52px; font-size: 15px; }
  .desk-more[open] { left: -1px; width: calc(100vw - 24px); max-height: 58vh; }
  .desk-tools-pick { grid-template-columns: 1fr; }
  .desk-send { min-width: 62px; padding: 0 13px; }
  .desk-model-select { max-width: 150px; flex: 1 1 140px; }
}

/* AI学神 visual system. The learning surface uses a dark instrument-panel
   language so navigation, state, tools and content have a clear hierarchy. */
:root {
  color-scheme: dark;
  --paper: #070b16;
  --sheet: rgba(14, 23, 42, .92);
  --ink: #edf5ff;
  --muted: #94a6c2;
  --line: rgba(148, 163, 184, .18);
  --accent: #67e8f9;
  --accent-strong: #22d3ee;
  --violet: #a78bfa;
  --soft: rgba(30, 41, 59, .72);
  font-family: "Inter", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
}
html, body {
  background: #070b16;
  color: var(--ink);
}
body {
  background:
    radial-gradient(1000px 580px at 72% -14%, rgba(34, 211, 238, .14), transparent 62%),
    radial-gradient(820px 520px at 7% 110%, rgba(124, 58, 237, .16), transparent 65%),
    #070b16;
}
.shell {
  grid-template-columns: 276px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  background: transparent;
}
.shell.with-threads { grid-template-columns: 276px minmax(0, 1fr); }
#rail, #threads, .canvas {
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(15, 23, 42, .96), rgba(8, 15, 30, .92));
  box-shadow: 0 22px 70px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 255, 255, .04);
}
#rail {
  padding: 18px 14px 14px;
  color: var(--ink);
}
#rail .brand {
  min-height: 62px;
  padding: 8px 12px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, .14);
}
#rail .brand .wordmark { color: #f8fbff; filter: drop-shadow(0 0 13px rgba(103, 232, 249, .28)); }
#rail .nav-label, #threads .nav-label {
  margin: 16px 10px 6px;
  color: #6f82a1;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
}
#rail button.nav-item, #threads button.nav-item {
  height: 40px;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0 12px;
  color: #a9bad3;
  font-size: 14px;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
#rail button.nav-item:hover, #threads button.nav-item:hover {
  border-color: rgba(103, 232, 249, .18);
  background: rgba(30, 41, 59, .72);
  color: #e9f9ff;
  transform: translateX(2px);
}
#rail button.nav-item.on, #threads button.nav-item.on {
  border-color: rgba(103, 232, 249, .24);
  background: linear-gradient(100deg, rgba(34, 211, 238, .18), rgba(124, 58, 237, .16));
  color: #ecfeff;
  box-shadow: inset 3px 0 0 var(--accent), 0 8px 20px rgba(34, 211, 238, .08);
}
#rail .account {
  border-top: 1px solid rgba(148, 163, 184, .14);
  padding: 14px 10px 2px;
}
#rail .account-name { color: #eef8ff; }
#rail .account .muted, #rail .account-exit, #rail .account-set { color: #8094b3; }
#threads {
  border: 0;
  border-top: 1px solid rgba(148, 163, 184, .14);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
#threads .thread-pane-head .nav-item,
#threads .thread-head [data-again], #threads .thread-head [data-fold],
#threads .thread-rename, #threads .thread-remove, #threads .thread-ask button,
#threads [data-rail-ask], #threads [data-write-goal] {
  border-color: rgba(148, 163, 184, .16);
  background: rgba(15, 23, 42, .72);
  color: #8fa4c1;
}
#thread-find, #threads .thread-name {
  border: 1px solid rgba(148, 163, 184, .18);
  background: rgba(15, 23, 42, .82);
  color: var(--ink);
}
#threads .thread { color: #8fa4c1; }
#threads .thread:hover, #threads .thread.on { color: #effbff; background: rgba(34, 211, 238, .12); }
.canvas {
  background:
    radial-gradient(780px 480px at 70% 0%, rgba(34, 211, 238, .08), transparent 64%),
    linear-gradient(180deg, rgba(9, 16, 32, .98), rgba(7, 12, 25, .98));
}
.shell.desk .canvas {
  background:
    radial-gradient(780px 480px at 70% 0%, rgba(34, 211, 238, .08), transparent 64%),
    linear-gradient(180deg, rgba(9, 16, 32, .98), rgba(7, 12, 25, .98));
}
.shell.desk main { background: transparent; }
main { color: var(--ink); }
h1, .desk-empty h2 { font-family: "Inter", "PingFang SC", "Noto Sans SC", sans-serif; font-weight: 700; letter-spacing: -.02em; }
.page-head h1, .ask-title h1 { color: #f1f7ff; }
.page-head .kicker, .kicker { color: var(--accent); letter-spacing: .16em; }
.lede, .muted { color: var(--muted); }
.card, .panel, .hub-card, .mode-chip, .capability-card, .research-row, .research-empty {
  border-color: rgba(148, 163, 184, .18);
  background: linear-gradient(145deg, rgba(15, 23, 42, .92), rgba(11, 18, 35, .88));
  box-shadow: 0 18px 50px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .035);
}
.card:hover, .hub-card:hover, .mode-chip:hover, .capability-card:hover {
  border-color: rgba(103, 232, 249, .34);
  box-shadow: 0 18px 55px rgba(0, 0, 0, .28), 0 0 0 1px rgba(103, 232, 249, .06);
}
.primary, .ghost, .desk-send { border-radius: 11px; }
.primary { background: linear-gradient(110deg, #0891b2, #4f46e5); color: #f8fbff; box-shadow: 0 8px 20px rgba(34, 211, 238, .14); }
.primary:hover { background: linear-gradient(110deg, #06b6d4, #6366f1); }
.ghost { border-color: rgba(148, 163, 184, .2); background: rgba(15, 23, 42, .78); color: #b8c9df; }
.ghost:hover { border-color: rgba(103, 232, 249, .38); background: rgba(30, 41, 59, .86); color: #e8fbff; }
textarea, input[type="text"], input[type="search"], input[type="number"], select {
  border-color: rgba(148, 163, 184, .2);
  background: rgba(8, 15, 30, .82);
  color: #eaf4ff;
}
textarea:focus, input[type="text"]:focus, input[type="search"]:focus, input[type="number"]:focus, select:focus {
  border-color: rgba(103, 232, 249, .66);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, .12);
}
.hub-title, .section-title { color: #dce9fa; }
.hub-card b, .capability-card b { color: #eff8ff; }
.hub-card span, .mode-chip span { color: #91a5c4; }
.status-pill { background: rgba(34, 211, 238, .13); color: #8ff3ff; }
.status-pill.is-muted { background: rgba(148, 163, 184, .12); color: #9aabc3; }
.path .hub-card::before { color: var(--accent); }
.desk-thread { padding: 34px clamp(20px, 7vw, 108px) 18px; }
.desk-empty h2 { font-size: 38px; color: #f3f8ff; }
.desk-empty { max-width: 48rem; }
.home-starts button, .desk-chip {
  border-color: rgba(103, 232, 249, .2);
  background: rgba(15, 23, 42, .78);
  color: #b8c9df;
}
.home-starts button:hover, .desk-chip:hover { border-color: rgba(103, 232, 249, .5); color: #ecfeff; background: rgba(8, 47, 73, .72); }
.desk-msg.you .desk-body { background: linear-gradient(135deg, #164e63, #312e81); color: #f2fbff; box-shadow: 0 10px 26px rgba(8, 47, 73, .28); }
.desk-msg.tutor .desk-body { color: #d9e8fb; }
.desk-body code, .desk-pre { background: rgba(2, 6, 23, .82); color: #b9f5ff; }
.desk-body blockquote { border-left-color: var(--accent); color: #9fb6d3; }
.desk-actions button, .desk-actions time { color: #6f82a1; }
.desk-dock { width: min(1120px, calc(100% - 32px)); }
.desk-compose {
  border-color: rgba(103, 232, 249, .24);
  background: linear-gradient(145deg, rgba(15, 23, 42, .96), rgba(8, 15, 30, .95));
  box-shadow: 0 20px 60px rgba(0, 0, 0, .32), 0 0 0 1px rgba(103, 232, 249, .04);
}
.desk-compose:focus-within { border-color: rgba(103, 232, 249, .58); box-shadow: 0 0 0 4px rgba(34, 211, 238, .1), 0 20px 60px rgba(0, 0, 0, .3); }
.desk-compose textarea { color: #eaf4ff; }
.desk-compose textarea::placeholder { color: #7085a4; }
.desk-foot { border-top-color: rgba(148, 163, 184, .14); }
.desk-foot > .desk-icon, .desk-foot > .desk-more > summary, .desk-network, .desk-model-select, .desk-more select {
  border-color: rgba(148, 163, 184, .2);
  background: rgba(15, 23, 42, .78);
  color: #a9bbd4;
}
.desk-foot > .desk-icon:hover, .desk-foot > .desk-more > summary:hover { border-color: rgba(103, 232, 249, .5); color: #e8fbff; background: rgba(8, 47, 73, .7); }
.desk-send { background: linear-gradient(110deg, #0891b2, #4f46e5); }
.desk-send.is-stop { color: #fda4af; box-shadow: inset 0 0 0 1px rgba(251, 113, 133, .48); }
.desk-network:has(input:checked) { border-color: rgba(103, 232, 249, .52); color: #8ff3ff; background: rgba(8, 47, 73, .7); }
.desk-more[open] { border-color: rgba(103, 232, 249, .34); background: rgba(9, 17, 34, .98); box-shadow: 0 24px 70px rgba(0, 0, 0, .52); }
.desk-more[open] summary { background: rgba(15, 23, 42, .98); color: #eaf4ff; }
.desk-tools-pick label { border-color: rgba(148, 163, 184, .18); background: rgba(15, 23, 42, .7); color: #a9bbd4; }
.desk-tools-pick label:hover { border-color: rgba(103, 232, 249, .4); color: #e8fbff; }
.desk-tools-pick input { accent-color: var(--accent-strong); }
.ask-bar { width: min(1120px, calc(100% - 32px)); }
.ask-title h1 { font-size: 23px; }
.home-meta, .home-place { color: #7f94b3; }
.home-place button, .home-meta button { color: #91eaf5; }
.learning-plan, .learning-unit { border-color: rgba(148, 163, 184, .2); background: rgba(15, 23, 42, .72); }
.research-report { background: rgba(8, 47, 73, .24); color: #d8e8fb; }
.research-source-meta, .research-sources a { color: #8feaf5; }
.voice-feedback { background: rgba(8, 47, 73, .42); }
.media-result-image, .media-result-video { background: rgba(2, 6, 23, .78); }
.stage-pick { border-color: rgba(103, 232, 249, .25); background: rgba(15, 23, 42, .76); color: #c9d7eb; }
.stage-pick:hover { background: rgba(8, 47, 73, .76); }
.stage-pick.on { background: linear-gradient(110deg, #0891b2, #4f46e5); border-color: transparent; color: #fff; }
#gate[data-theme="light"] .stage-pick { border-color: rgba(28, 28, 28, .12); background: rgba(255, 255, 255, .76); color: #1c1c1c; }
#gate[data-theme="light"] .stage-pick:hover { background: #fff; }
#gate[data-theme="light"] .stage-pick.on { background: #1c1c1c; color: #f7f6f4; }
@media (max-width: 900px) {
  .shell, .shell.with-threads { grid-template-columns: 1fr; padding: 8px; }
  #rail, #threads, .canvas { border-radius: 18px; }
  #rail { height: auto; }
  #rail-nav .nav-rest { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  #rail .nav-label { grid-column: 1 / -1; }
  #threads { max-height: 38vh; }
  .desk-empty h2 { font-size: 30px; }
}

/* Phone and tablet pass. Keep the app scrollable, protect mobile safe areas,
   and make every control reachable with touch instead of relying on hover. */
@media (min-width: 901px) and (max-width: 1180px) {
  .shell, .shell.with-threads { grid-template-columns: 236px minmax(0, 1fr); }
  #rail { padding-inline: 10px; }
  main { padding-inline: 22px; }
  .desk-thread { padding-inline: 28px; }
  .desk-dock, .ask-bar { width: min(100% - 28px, 980px); }
}
@media (max-width: 900px) {
  html, body { min-height: 100%; overflow-x: hidden; }
  .shell, .shell.with-threads {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
    padding: 8px;
  }
  #rail {
    position: relative;
    width: 100%;
    height: auto;
    max-height: none;
    flex: none;
    overflow: visible;
    padding: 12px 10px;
  }
  #rail-nav { max-height: none; overflow: visible; }
  #rail-nav .brand { min-height: 48px; padding: 4px 10px 10px; }
  #rail-nav .nav-rest {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    max-height: none;
    overflow: visible;
  }
  #rail .nav-label { grid-column: 1 / -1; margin: 12px 8px 2px; }
  #rail button.nav-item { min-height: 42px; height: 42px; }
  #rail .account { margin-top: 10px; }
  #threads {
    width: 100%;
    max-height: min(36dvh, 320px);
    min-height: 120px;
    flex: none;
    overflow: hidden;
    padding-top: 10px;
  }
  #threads .thread-scroll { max-height: 220px; }
  .canvas {
    width: 100%;
    height: auto;
    min-height: 72dvh;
    overflow: visible;
  }
  main { width: 100%; padding: 20px 14px 40px; }
  .shell.desk .canvas {
    height: auto;
    min-height: 72dvh;
    overflow: visible;
  }
  .shell.desk main { height: auto; min-height: 72dvh; overflow: visible; }
  .desk-thread {
    min-height: 42dvh;
    height: auto;
    padding: 22px 14px 12px;
  }
  .desk-empty { padding: 20px 4px 28px; }
  .desk-empty h2 { font-size: clamp(26px, 8vw, 34px); }
  .desk-msg.you .desk-body { max-width: 92%; }
  .desk-msg.tutor .desk-body { font-size: 15px; }
  .desk-place, .desk-reader, .desk-note, .ask-bar { width: 100%; max-width: none; }
  .desk-dock {
    width: 100%;
    margin-bottom: max(10px, env(safe-area-inset-bottom));
  }
  .desk-compose { border-radius: 16px; padding: 10px 10px 8px; }
  .desk-compose textarea { min-height: 54px; max-height: 180px; font-size: 16px; }
  .desk-foot { gap: 6px; }
  .desk-foot > .desk-icon, .desk-foot > .desk-more > summary,
  .desk-network, .desk-model-select { min-height: 40px; }
  .desk-model-select { flex: 1 1 150px; max-width: none; }
  .desk-send { min-height: 40px; }
  .desk-more[open] {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(64px + env(safe-area-inset-bottom));
    width: auto;
    max-height: min(70dvh, 560px);
    z-index: 30;
  }
  .desk-tools-pick { grid-template-columns: 1fr; }
  .desk-more[open] > .desk-icon { min-height: 40px; }
  .hub-grid, .capability-grid, .media-grid, .voice-grid, .board, .pair, .grid { grid-template-columns: 1fr; }
  .path { grid-template-columns: 1fr; }
  .activity.tiles { grid-template-columns: 1fr; }
  .line-form { flex-wrap: wrap; align-items: stretch; }
  .line-form input, .line-form button { min-height: 42px; }
  .research-detail-actions { flex-wrap: wrap; }
  .research-detail-actions button { flex: 1 1 140px; min-height: 42px; }
  .research-inline-form { grid-template-columns: 1fr; }
  .research-inline-form button { min-height: 42px; }
  .actions { gap: 6px; }
  .actions button { min-height: 42px; }
  iframe.bench-frame { height: min(68dvh, 620px); border-radius: 14px; }
  iframe.stage { height: min(70dvh, 620px); border-radius: 14px; }
}
@media (max-width: 600px) {
  .shell { padding: 4px; gap: 8px; }
  #rail, #threads, .canvas { border-radius: 16px; }
  #rail { padding: 10px 8px; }
  #rail-nav .nav-rest { grid-template-columns: 1fr 1fr; }
  #rail button.nav-item { padding-inline: 10px; font-size: 13px; }
  #threads { max-height: 30dvh; }
  #threads .thread-scroll { max-height: 160px; }
  main { padding: 18px 10px 32px; }
  .page-head h1 { font-size: clamp(24px, 7vw, 32px); }
  .page-head .lede { font-size: 14px; }
  .ask-title { align-items: flex-start; flex-direction: column; }
  .ask-title .ghost { width: 100%; }
  .desk-foot { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; }
  .desk-network { justify-content: center; padding-inline: 8px; }
  .desk-send { margin-left: 0; }
  .desk-more { grid-column: 1 / -1; }
  .desk-more > summary { width: 100%; justify-content: center; }
  .desk-empty { margin-top: 5dvh; }
  .desk-empty .home-starts { flex-direction: column; align-items: stretch; }
  .desk-empty .home-starts button { width: 100%; }
  .desk-msg.you .desk-body { max-width: 96%; }
  .desk-actions { flex-wrap: wrap; opacity: 1; }
  .stage-picks { max-width: calc(100vw - 24px); }
  .stage-pick { min-height: 40px; }
  .piece-note { font-size: 14px; padding-inline: 16px; }
  .gate-form-side { padding: 12px; }
  .gate-card { padding: 20px 18px 14px; }
  .gate-motion { top: 6vh; }
  .gate-motion-title { font-size: clamp(42px, 15vw, 68px); }
  .gate-motion-line { font-size: 13px; }
  .stage-ui { bottom: max(14px, env(safe-area-inset-bottom)); }
  .stage-picks { gap: 6px; }
  .stage-pick { padding: 7px 11px; font-size: 12px; }
}

.media-model {
  display: grid;
  gap: 6px;
  margin: 10px 0;
  color: var(--muted);
  font-size: 12px;
}
.media-model-select { width: 100%; min-height: 36px; }
@media (pointer: coarse) {
  button, summary, select, input, textarea { touch-action: manipulation; }
  button, .stage-pick, .hub-card, .mode-chip { -webkit-tap-highlight-color: rgba(103, 232, 249, .18); }
  .desk-actions { opacity: 1; }
}

/* 2026 studio skin. Inspired by adaptive Liquid Glass surfaces, Material 3
   expressive hierarchy, and shadcn/Radix's quiet, composable control language.
   The result keeps the product technical while removing the synthetic neon
   treatment from the primary learning path. */
:root {
  --ink: #eef3f7;
  --muted: #a9b4c2;
  --line: rgba(234, 242, 248, .14);
  --accent: #a7ded4;
  --accent-strong: #8bcfc2;
  --violet: #c7c0ee;
  --soft: rgba(255, 255, 255, .06);
}
body {
  background:
    radial-gradient(720px 500px at 15% -10%, rgba(167, 222, 212, .08), transparent 68%),
    radial-gradient(800px 560px at 92% 0%, rgba(199, 192, 238, .08), transparent 70%),
    #10151e;
}
.shell {
  background:
    radial-gradient(520px 340px at 0% 0%, rgba(167, 222, 212, .07), transparent 70%),
    transparent;
}
#rail, #threads, .canvas {
  border-color: rgba(234, 242, 248, .13);
  background: linear-gradient(165deg, rgba(31, 39, 52, .86), rgba(17, 23, 33, .92));
  box-shadow: 0 18px 52px rgba(0, 0, 0, .26), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.canvas, .shell.desk .canvas {
  background:
    radial-gradient(820px 560px at 72% 0%, rgba(167, 222, 212, .045), transparent 68%),
    linear-gradient(180deg, #131a25, #0f151e);
}
#rail .brand .wordmark { filter: none; color: #f3f6f8; }
#rail .nav-label, #threads .nav-label { color: #8995a5; letter-spacing: .14em; }
#rail button.nav-item, #threads button.nav-item { color: #b4bfcc; }
#rail button.nav-item:hover, #threads button.nav-item:hover {
  border-color: rgba(167, 222, 212, .24);
  background: rgba(255, 255, 255, .055);
  color: #f1f6f8;
  transform: none;
}
#rail button.nav-item.on, #threads button.nav-item.on {
  border-color: rgba(167, 222, 212, .22);
  background: rgba(167, 222, 212, .12);
  color: #f3fbf8;
  box-shadow: inset 2px 0 0 var(--accent), 0 8px 22px rgba(0, 0, 0, .14);
}
#threads .thread:hover, #threads .thread.on { background: rgba(167, 222, 212, .1); color: #f1f7f5; }
.card, .panel, .hub-card, .mode-chip, .capability-card, .research-row, .research-empty {
  border-color: rgba(234, 242, 248, .14);
  background: linear-gradient(155deg, rgba(31, 39, 52, .76), rgba(22, 29, 40, .8));
  box-shadow: 0 14px 34px rgba(0, 0, 0, .16), inset 0 1px 0 rgba(255, 255, 255, .035);
}
.card:hover, .hub-card:hover, .mode-chip:hover, .capability-card:hover {
  border-color: rgba(167, 222, 212, .3);
  box-shadow: 0 16px 36px rgba(0, 0, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.primary {
  background: #e5f1ee;
  color: #18282d;
  box-shadow: 0 7px 18px rgba(0, 0, 0, .16);
}
.primary:hover { background: #f2faf7; }
.ghost {
  border-color: rgba(234, 242, 248, .17);
  background: rgba(255, 255, 255, .055);
  color: #d0d9e3;
}
.ghost:hover { border-color: rgba(167, 222, 212, .4); background: rgba(167, 222, 212, .1); color: #f1faf7; }
textarea, input[type="text"], input[type="search"], input[type="number"], select {
  border-color: rgba(234, 242, 248, .16);
  background: rgba(13, 19, 28, .58);
  color: #f0f4f7;
}
textarea:focus, input[type="text"]:focus, input[type="search"]:focus, input[type="number"]:focus, select:focus {
  border-color: rgba(167, 222, 212, .62);
  box-shadow: 0 0 0 3px rgba(167, 222, 212, .1);
}
.desk-msg.you .desk-body {
  background: #dcece8;
  color: #16262c;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .16);
}
.home-starts button, .desk-chip {
  border-color: rgba(234, 242, 248, .16);
  background: rgba(255, 255, 255, .055);
  color: #ced8e1;
}
.home-starts button:hover, .desk-chip:hover {
  border-color: rgba(167, 222, 212, .36);
  background: rgba(167, 222, 212, .1);
  color: #f1faf7;
}
.desk-compose {
  border-color: rgba(234, 242, 248, .18);
  background: rgba(25, 33, 45, .86);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.desk-compose:focus-within {
  border-color: rgba(167, 222, 212, .52);
  box-shadow: 0 0 0 4px rgba(167, 222, 212, .08), 0 18px 44px rgba(0, 0, 0, .24);
}
.desk-foot > .desk-icon, .desk-foot > .desk-more > summary, .desk-network, .desk-model-select, .desk-more select {
  border-color: rgba(234, 242, 248, .16);
  background: rgba(255, 255, 255, .055);
  color: #c2ccd6;
}
.desk-foot > .desk-icon:hover, .desk-foot > .desk-more > summary:hover {
  border-color: rgba(167, 222, 212, .4);
  background: rgba(167, 222, 212, .1);
  color: #f0faf7;
}
.desk-send { background: #e5f1ee; color: #18282d; box-shadow: 0 7px 18px rgba(0, 0, 0, .16); }
.desk-send:hover { background: #f2faf7; }
.desk-network:has(input:checked) { border-color: rgba(167, 222, 212, .48); background: rgba(167, 222, 212, .1); color: #e2f5f0; }
.desk-more[open] { border-color: rgba(167, 222, 212, .28); background: rgba(19, 26, 37, .98); box-shadow: 0 22px 58px rgba(0, 0, 0, .4); }
.desk-more[open] summary { background: rgba(255, 255, 255, .055); color: #eef6f5; }
.desk-tools-pick label { border-color: rgba(234, 242, 248, .14); background: rgba(255, 255, 255, .045); color: #c5d0d9; }
.desk-tools-pick label:hover { border-color: rgba(167, 222, 212, .34); background: rgba(167, 222, 212, .08); color: #eef8f5; }
.desk-tools-pick input { accent-color: var(--accent-strong); }
.status-pill { background: rgba(167, 222, 212, .12); color: #c8eee5; }
.status-pill.is-muted { background: rgba(255, 255, 255, .08); color: #abb7c4; }
.research-report { background: rgba(167, 222, 212, .07); }
.voice-feedback { background: rgba(167, 222, 212, .1); }

/* Keep the entry experience in the same studio language as the workbench. */
#gate[data-theme="dark"] .gate-stage {
  background:
    radial-gradient(620px 420px at 66% 36%, rgba(167, 222, 212, .12), transparent 68%),
    radial-gradient(680px 480px at 22% 78%, rgba(199, 192, 238, .09), transparent 70%),
    #0f151e;
}
#gate[data-theme="dark"] .gate-grid {
  opacity: .48;
  background-image:
    linear-gradient(rgba(234, 242, 248, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(234, 242, 248, .055) 1px, transparent 1px),
    linear-gradient(rgba(234, 242, 248, .022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(234, 242, 248, .022) 1px, transparent 1px);
}
#gate[data-theme="dark"] .gate-card {
  background: linear-gradient(155deg, rgba(31, 39, 52, .9), rgba(18, 25, 35, .92));
  border-color: rgba(234, 242, 248, .16);
  box-shadow: 0 24px 58px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .05);
}
#gate[data-theme="dark"] .gate-field input {
  border-color: rgba(234, 242, 248, .16);
  background: rgba(10, 16, 24, .56);
}
#gate[data-theme="dark"] .gate-field input:focus {
  border-color: rgba(167, 222, 212, .62);
  box-shadow: 0 0 0 3px rgba(167, 222, 212, .1);
  transform: none;
}
#gate[data-theme="dark"] .gate-submit {
  background: #e5f1ee;
  color: #18282d;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .18);
}
#gate[data-theme="dark"] .gate-submit:hover { background: #f2faf7; }
#gate[data-theme="dark"] .gate-theme {
  border: 1px solid rgba(234, 242, 248, .14);
  background: rgba(255, 255, 255, .06);
}
#gate[data-theme="dark"] .stage-pick {
  border-color: rgba(234, 242, 248, .16);
  background: rgba(255, 255, 255, .055);
  color: #c8d2dc;
}
#gate[data-theme="dark"] .stage-pick:hover {
  border-color: rgba(167, 222, 212, .38);
  background: rgba(167, 222, 212, .1);
}
#gate[data-theme="dark"] .stage-pick.on {
  border-color: rgba(167, 222, 212, .52);
  background: rgba(167, 222, 212, .16);
  color: #effaf7;
}

.onboarding-shell .canvas {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse 70% 70% at 50% 18%, #202d3d 0%, #111923 62%, #0c121a 100%);
}
.onboarding-shell main {
  width: min(680px, calc(100% - 40px));
  padding: 36px 0;
}
.onboarding-card {
  padding: clamp(28px, 5vw, 54px);
  border: 1px solid rgba(234, 242, 248, .15);
  border-radius: 28px;
  background: linear-gradient(150deg, rgba(31, 44, 60, .96), rgba(17, 25, 35, .96));
  box-shadow: 0 28px 90px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .05);
  color: #eef6f5;
}
.onboarding-kicker { margin: 0 0 12px; color: #9edccf; letter-spacing: .12em; font-size: 12px; }
.onboarding-card h1 { margin: 0; color: #f4fbfa; font-size: clamp(28px, 5vw, 44px); line-height: 1.12; }
.onboarding-copy { max-width: 520px; margin: 18px 0 0; color: #cfdae3; line-height: 1.8; }
.onboarding-copy.muted { color: #94a5b5; font-size: 14px; }
.onboarding-action { margin-top: 30px; min-width: 150px; }
.onboarding-form { display: grid; gap: 18px; margin-top: 28px; }
.onboarding-form .field-label { display: grid; gap: 8px; color: #d8e3e9; }
.onboarding-form input, .onboarding-form select {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid rgba(234, 242, 248, .16);
  border-radius: 12px;
  background: rgba(8, 14, 22, .55);
  color: #f1f7fb;
}
.onboarding-form input:focus, .onboarding-form select:focus { outline: none; border-color: rgba(167, 222, 212, .62); box-shadow: 0 0 0 3px rgba(167, 222, 212, .1); }
.onboarding-hint { margin: -4px 0 0; color: #9aabb9; font-size: 13px; line-height: 1.6; }
.onboarding-subjects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.onboarding-subjects[hidden] { display: none; }
.onboarding-subject-toggle { justify-self: start; }
.goal-setup-card textarea { resize: vertical; min-height: 112px; padding: 12px 13px; border: 1px solid rgba(234, 242, 248, .16); border-radius: 12px; background: rgba(8, 14, 22, .55); color: #f1f7fb; font: inherit; line-height: 1.6; }
.goal-subject-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.goal-subject-chip, .goal-project-card { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 12px; border: 1px solid rgba(234, 242, 248, .15); border-radius: 14px; background: rgba(255, 255, 255, .045); color: #d8e3e9; cursor: pointer; }
.goal-subject-chip:has(input:checked), .goal-project-card:has(input:checked) { border-color: rgba(167, 222, 212, .58); background: rgba(167, 222, 212, .13); color: #effaf7; }
.goal-subject-chip input, .goal-project-card input { accent-color: #9edccf; }
.goal-project-list { display: grid; gap: 12px; }
.goal-project-card { align-items: flex-start; }
.goal-project-card span { display: grid; gap: 4px; }
.goal-project-card small { color: #9aabb9; line-height: 1.5; }
.learner-profile-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0 0 18px; padding: 18px 20px; }
.learner-profile-card h2 { margin: 4px 0 0; font-size: 20px; }
.learner-profile-card .kicker { margin: 0; }
.profile-edit-form { display: grid; gap: 12px; width: min(100%, 520px); margin-left: auto; }
@media (max-width: 620px) {
  .goal-subject-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .learner-profile-card { align-items: flex-start; flex-direction: column; }
  .profile-edit-form { width: 100%; margin-left: 0; }
}
.onboarding-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }
.onboarding-error { min-height: 18px; margin: 0; color: #ffb7ad; font-size: 13px; }
@media (max-width: 620px) {
  .onboarding-shell main { width: min(100% - 24px, 680px); padding: 18px 0 28px; }
  .onboarding-card { padding: 26px 20px; border-radius: 22px; }
  .onboarding-subjects { grid-template-columns: 1fr; }
}

/* The onboarding shell hides the normal rail. Collapse the rail grid track as
   well so the canvas owns the full viewport on wide screens. */
.shell.onboarding-shell {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 0 !important;
  padding: 0 !important;
  height: 100vh !important;
  min-height: 100vh !important;
  overflow: auto !important;
}
.onboarding-shell .canvas {
  grid-column: 1 !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 100vh !important;
  height: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  overflow: auto !important;
}
.onboarding-shell main {
  width: min(900px, calc(100% - 64px)) !important;
  max-width: none !important;
  margin: 0 auto !important;
  padding: 72px 0 88px !important;
}
.onboarding-card {
  width: 100%;
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(44px, 7vw, 84px);
  border-radius: 32px;
}
.onboarding-card h1 {
  max-width: 780px;
  font-size: clamp(38px, 5vw, 62px);
  line-height: 1.12;
  word-break: keep-all;
  overflow-wrap: normal;
}
.onboarding-copy {
  max-width: 680px;
  font-size: 18px;
  line-height: 1.8;
}
.onboarding-copy.muted { max-width: 620px; font-size: 14px; }
.onboarding-form { max-width: 720px; }
.goal-setup-card { min-height: 520px; }
.onboarding-utility { display: flex; justify-content: space-between; gap: 16px; max-width: 720px; margin-top: 28px; padding-top: 18px; border-top: 1px solid rgba(234, 242, 248, .1); }
.onboarding-utility-link { border: 0; padding: 0; background: transparent; color: #8ea1b9; font-size: 13px; }
.onboarding-utility-link:hover { color: #d9f8f2; }
@media (max-width: 900px) {
  .onboarding-shell main { width: min(100% - 28px, 680px) !important; padding: 28px 0 48px !important; }
  .onboarding-card { min-height: 0; padding: 32px 24px; border-radius: 24px; }
  .onboarding-card h1 { font-size: clamp(34px, 9vw, 48px); }
  .onboarding-copy { font-size: 16px; }
  .onboarding-utility { flex-direction: column; align-items: flex-start; }
}

/* 学生入口使用明亮、像学习桌面的颜色。保持信息层级清楚，降低工具后台感。 */
.onboarding-shell .canvas {
  position: relative !important;
  isolation: isolate;
  background: #fff8ed !important;
  color: #25324a;
}
.onboarding-shell .canvas::before,
.onboarding-shell .canvas::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(1px);
}
.onboarding-shell .canvas::before {
  width: 420px;
  height: 420px;
  top: -180px;
  right: 6vw;
  background: #d9f3ed;
}
.onboarding-shell .canvas::after {
  width: 300px;
  height: 300px;
  bottom: -150px;
  left: 7vw;
  background: #ffe0cf;
}
.onboarding-card {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border: 1px solid #eadfce;
  background: rgba(255, 255, 255, .94);
  color: #25324a;
  box-shadow: 0 22px 60px rgba(104, 75, 45, .12), 0 2px 0 rgba(255, 255, 255, .8) inset;
}
.onboarding-card button,
.onboarding-card select,
.onboarding-card input {
  position: relative;
  z-index: 2;
  pointer-events: auto;
}
.onboarding-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 7px;
  background: linear-gradient(90deg, #ff8066 0 34%, #ffd166 34% 66%, #63cdbb 66% 100%);
}
.onboarding-kicker {
  width: fit-content;
  margin-bottom: 18px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #fff0e9;
  color: #e45d47;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
}
.onboarding-card h1 {
  color: #25324a;
  letter-spacing: -.035em;
}
.onboarding-copy { color: #536078; }
.onboarding-copy.muted { color: #7e8799; }
.onboarding-form .field-label { color: #34405a; font-weight: 650; }
.onboarding-form input,
.onboarding-form select,
.goal-setup-card textarea {
  border: 1px solid #dfe4ed;
  background: #fbfcff;
  color: #25324a;
  box-shadow: 0 2px 0 rgba(37, 50, 74, .02) inset;
}
.onboarding-form input:focus,
.onboarding-form select:focus,
.goal-setup-card textarea:focus {
  border-color: #63cdbb;
  box-shadow: 0 0 0 4px rgba(99, 205, 187, .16);
}
.onboarding-hint { color: #7e8799; }
.onboarding-card .primary {
  background: #25324a;
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 50, 74, .18);
}
.onboarding-card .primary:hover { background: #344665; }
.onboarding-card .ghost,
.onboarding-utility-link {
  border-color: #dfe4ed;
  color: #5e6a80;
}
.onboarding-card .ghost:hover,
.onboarding-utility-link:hover { color: #e45d47; border-color: #f3b5a7; }
.onboarding-utility { border-top-color: #eee4d7; }
.onboarding-utility-link { color: #7e8799; }
.onboarding-utility-link:disabled { cursor: wait; opacity: .58; }
.onboarding-error { color: #d95d4a; }
.goal-subject-chip, .goal-project-card {
  border-color: #e5e8ef;
  background: #fbfcff;
  color: #46526a;
}
.goal-subject-chip:has(input:checked), .goal-project-card:has(input:checked) {
  border-color: #63cdbb;
  background: #e9f8f4;
  color: #25324a;
}
.goal-subject-chip input, .goal-project-card input { accent-color: #ff8066; }

#gate:not([data-theme="dark"]) {
  background: #fff8ed;
  color: #25324a;
}
#gate:not([data-theme="dark"]) .gate-stage {
  background: radial-gradient(circle at 70% 28%, #fffdf8 0%, #fff8ed 58%, #f8eadf 100%);
}
#gate:not([data-theme="dark"]) .gate-form-side { background: rgba(255, 255, 255, .26); }
#gate:not([data-theme="dark"]) .gate-card {
  border: 1px solid #eadfce;
  border-radius: 24px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 22px 60px rgba(104, 75, 45, .13);
}
#gate:not([data-theme="dark"]) .gate-card::before {
  content: "一起把题做会";
  display: inline-flex;
  margin-bottom: 16px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff0e9;
  color: #e45d47;
  font-size: 12px;
  font-weight: 700;
}
#gate:not([data-theme="dark"]) .gate-submit {
  border-radius: 14px;
  background: #25324a;
  box-shadow: 0 8px 18px rgba(37, 50, 74, .18);
}
#gate:not([data-theme="dark"]) .gate-submit:hover { background: #344665; }
#gate:not([data-theme="dark"]) .gate-field input:focus { border-color: #63cdbb; box-shadow: 0 0 0 4px rgba(99, 205, 187, .16); }
