/* Shared visual language with packaging/site/site.css: graph-paper desk, white sheets, navy controls. */
:root {
  color-scheme: light;
  --bg: #eef3f8; --desk-top: #f8fbfe; --card: #fff; --sheet-2: #f5f8fb;
  --ink: #1f1c18; --quiet: #5f5a50; --line: #dce5ed; --line-2: #cbd8e3;
  --accent: #1f4f7b; --accent-hover: #183f63; --warn: #805d20; --bad: #a33a2b; --ok: #437158;
  --shadow: 0 5px 20px rgba(30,62,92,.055), 0 1px 2px rgba(30,62,92,.035);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --display: "Songti SC", "STSong", "Noto Serif SC", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-family: var(--font); color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body {
  margin: 0; min-height: 100vh; font: 15px/1.75 var(--font); color: var(--ink);
  background-color: var(--bg);
  background-image: linear-gradient(rgba(31,79,123,.06) 1px, transparent 1px), linear-gradient(90deg,rgba(31,79,123,.06) 1px,transparent 1px), linear-gradient(rgba(31,79,123,.028) 1px,transparent 1px), linear-gradient(90deg,rgba(31,79,123,.028) 1px,transparent 1px), linear-gradient(180deg,var(--desk-top),var(--bg) 900px);
  background-size: 120px 120px,120px 120px,24px 24px,24px 24px,100% 100%; background-position: -1px -1px;
}
a { color: var(--accent); text-underline-offset: 4px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.skip-link { position: fixed; top: 8px; left: 16px; z-index: 100; padding: 10px 16px; background: #fff; transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.top { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); background: rgba(248,251,254,.97); }
.top-inner { max-width: 1120px; margin: auto; padding: 0 24px; display: flex; gap: 32px; align-items: center; min-height: 64px; }
.brand { display: inline-flex; gap: 10px; align-items: center; flex: none; text-decoration: none; color: var(--ink); }
.brand svg { width: 28px; height: 28px; color: var(--accent); }
.brand > span:first-of-type { font: 700 20px/1.4 var(--display); letter-spacing: .06em; }
.brand .brand-section { border-left: 1px solid var(--line-2); padding-left: 14px; margin-left: 4px; font: 14px/1.4 var(--font); color: var(--quiet); }
.tabs { display: flex; align-self: stretch; gap: 28px; flex: 1; }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--quiet); padding: 0 2px; min-height: 64px; font-size: 14px; white-space: nowrap; }
.tabs button[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--accent); font-weight: 600; }
.tabs button:hover { background: transparent; color: var(--accent); }
.who { display: flex; align-items: center; gap: 14px; font-size: 13px; min-width: 0; }
#who { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .link { border-left: 1px solid var(--line-2); border-radius: 0; padding-left: 14px; font-size: 13px; }
main { max-width: 1120px; margin: 0 auto; padding: 48px 24px 80px; }
.page-heading { margin-bottom: 28px; }
h1, h2, h3, h4 { overflow-wrap: anywhere; color: var(--ink); }
h1, h2 { font-family: var(--display); font-weight: 700; letter-spacing: .02em; }
h1 { font-size: clamp(30px,4vw,40px); line-height: 1.3; margin: 0; }
h2 { font-size: 24px; line-height: 1.4; margin: 0 0 14px; }
h3 { font-size: 17px; line-height: 1.5; margin: 18px 0 8px; font-weight: 600; }
h4 { font-size: 15px; margin: 14px 0 6px; }
p { margin: 10px 0; overflow-wrap: anywhere; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); padding: 28px 32px; margin: 0 0 24px; min-width: 0; }
.card > :last-child { margin-bottom: 0; }
.quiet { color: var(--quiet); font-size: 13px; line-height: 1.75; }
.setup-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 24px; align-items: stretch; }
.setup-grid:has(.custom-form) { align-items: start; }
.create-class #new-class { display: grid; gap: 16px; margin: 20px 0 16px; }
.create-class label { display: grid; gap: 8px; }
.create-class button { width: 100%; }
.class-head { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 12px; }
.class-head h2 { flex: 1; margin: 0; }
.teaching-class > .class-head h2 { flex-basis: 100%; }
.row { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: end; margin: 14px 0; }
label { display: inline-flex; gap: 8px; align-items: center; max-width: 100%; font-size: 14px; }
input,select,textarea { font: 14px/1.5 var(--font); color: var(--ink); padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 5px; background: #fff; min-height: 44px; max-width: 100%; min-width: 0; }
input::placeholder,textarea::placeholder { color: #69747f; opacity: 1; }
input:hover,select:hover,textarea:hover { border-color: #879db0; }
input[type="checkbox"] { min-height: auto; accent-color: var(--accent); }
textarea { resize: vertical; }
button { font: 600 14px/1.4 var(--font); min-height: 44px; padding: 10px 16px; border: 1px solid var(--line-2); border-radius: 5px; background: #fff; color: var(--accent); cursor: pointer; transition: background-color .15s,border-color .15s; }
button:hover { background: var(--sheet-2); border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { background: var(--accent-hover); }
button.danger { color: var(--bad); }
button.danger:hover { border-color: var(--bad); background: #fff7f5; }
button.link { border: 0; background: transparent; padding: 6px 8px; font-weight: 500; }
button:disabled { opacity: .55; cursor: wait; }
.notice { padding: 14px 18px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--sheet-2); color: var(--accent); margin: 0 0 24px; }
.notice[data-tone="bad"] { background: #fff3f0; color: var(--bad); border-color: #e8c5bd; }
.notice[data-tone="ok"] { color: #365e46; border-color: #c5d8ca; background: #f0f6f1; }
.note { white-space: pre-wrap; border-left: 2px solid var(--line-2); padding-left: 14px; }
.plain { list-style: none; padding: 0; margin: 8px 0; }
.plain li { padding: 3px 0; }
.fact.warn { color: var(--warn); }
.fact.bad { color: var(--bad); }
.assignment { color: var(--ink); }
.code { font: 500 18px/1.5 var(--mono); letter-spacing: .1em; background: var(--sheet-2); border: 1px solid var(--line); padding: 3px 10px; border-radius: 4px; }
.class-tools { padding-bottom: 20px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.progress > h3 { margin-top: 0; }
.summary { border-top: 1px solid var(--line); padding: 18px 0; overflow-wrap: anywhere; }
.summary-head { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.assignment-block { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 8px; }
details { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
summary { cursor: pointer; font-size: 15px; font-weight: 600; min-height: 32px; color: var(--accent); }
.table-scroll { width: 100%; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; margin-top: 16px; font-size: 13px; }
th,td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { white-space: nowrap; font-weight: 600; background: var(--sheet-2); }
.publish { display: grid; gap: 12px; max-width: 560px; margin-top: 16px; }
.publish label { flex-wrap: wrap; }
.publish > input,.publish > textarea,.publish > select { width: 100%; }
.custom-form { display: grid; gap: 16px; margin: 20px 0; padding: 24px; border: 1px solid var(--line); border-radius: 5px; background: var(--sheet-2); }
.custom-form .field { display: grid; gap: 6px; }
.custom-form .field > span { font-size: 13px; color: var(--quiet); }
.custom-form .pair { display: flex; flex-wrap: wrap; gap: 8px; }
.custom-form .pair input { flex: 1 1 8em; min-width: 0; }
.custom-task { border-top: 1px solid var(--line); padding: 16px 0; }
.custom-task-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.custom-task-head strong { flex: 1; min-width: 120px; }
.account { font-weight: 600; font-size: 18px; color: var(--accent); }
body.narrow { display: flex; justify-content: center; padding: 64px 20px; }
main.card { max-width: 600px; width: 100%; margin: 0; padding: 32px; }
main.card h1 { font-size: 28px; margin-bottom: 20px; }
main.card form { margin-top: 24px; }
@media (max-width: 900px) {
  .top-inner { gap: 22px; }
  .tabs { gap: 20px; }
  .brand .brand-section { display: none; }
  .setup-grid { grid-template-columns: minmax(0,1fr); gap: 0; }
}
@media (max-width: 600px) {
  .top-inner { flex-wrap: wrap; padding: 0 20px; gap: 0 16px; }
  .brand { min-height: 60px; }
  .who { margin-left: auto; }
  #who { max-width: 112px; }
  .tabs { order: 3; flex-basis: 100%; justify-content: space-between; gap: 20px; }
  .tabs button { min-height: 48px; padding: 0 10px; }
  main { padding: 28px 16px 48px; }
  .page-heading { margin-bottom: 22px; }
  .card { padding: 22px 20px; margin-bottom: 20px; }
  h2 { font-size: 22px; }
  .row > label { display: grid; gap: 6px; flex: 1 1 100%; }
  .row > label > input { width: 100%; }
  .class-head { gap: 8px 10px; }
  .class-head > button { padding-inline: 12px; }
  .custom-form { padding: 16px 12px; }
  .custom-task-head strong { flex-basis: 100%; }
  .class-tools { gap: 8px; }
  .class-tools button { flex: 1 1 auto; font-size: 13px; padding-inline: 10px; }
  th,td { white-space: nowrap; }
  body.narrow { padding: 28px 16px; }
  main.card { padding: 24px 20px; }
}
@media (prefers-reduced-motion: reduce) { button { transition: none; } }

/* Icon-only add/remove actions: full touch target, visible hover/focus, accessible names in JS. */
button.icon-button { display: inline-flex; justify-content: center; align-items: center; width: 44px; height: 44px; padding: 0; flex: 0 0 44px; border-color: var(--line-2); background: #fff; }
button.icon-button svg { width: 20px; height: 20px; pointer-events: none; }
.custom-form .field > .icon-button { justify-self: start; }
.custom-form .pair > .icon-button { align-self: end; }

.welcome-brand { font: 600 15px/1.5 var(--display); color: var(--accent); margin-bottom: 24px; }
.welcome-action { margin: 28px 0 16px; }
a.login-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 12px 20px; border-radius: 5px; background: var(--accent); color: white; text-decoration: none; font: 600 14px/1.5 var(--font); }
a.login-button:hover { background: var(--accent-hover); }
