:root {
  --paper: #fff8e7;
  --surface: #fffef9;
  --ink: #141414;
  --muted: #4f4b40;
  --yellow: #ffda35;
  --blue: #a9d5ff;
  --line: 2px solid var(--ink);
  --shadow: 5px 5px 0 var(--ink);
  --space: clamp(1rem, 3vw, 2.5rem);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 Arial, Helvetica, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
button, .button { cursor: pointer; min-height: 44px; padding: .65rem 1rem; border: var(--line); border-radius: 0; background: var(--surface); color: var(--ink); font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; transition: transform 100ms, box-shadow 100ms; }
button:hover:not(:disabled), .button:hover { background: var(--yellow); }
button:active:not(:disabled), .button:active { transform: translate(2px, 2px); box-shadow: none; }
button:disabled { cursor: wait; opacity: .6; }
.primary { background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); }
.secondary { background: var(--blue); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
input:not([type="checkbox"]), select, textarea { display: block; width: 100%; min-height: 48px; border: var(--line); border-radius: 0; padding: .75rem; background: var(--surface); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--ink); flex-shrink: 0; }
input[readonly] { background: var(--paper); }
label { display: block; font-weight: 700; }
label > input, label > select, label > textarea { margin-top: .5rem; font-weight: 400; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.08; text-wrap: balance; }
h1 { font-size: clamp(2.8rem, 7vw, 5.6rem); font-weight: 900; letter-spacing: -.04em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.025em; }
h3 { font-size: 1.125rem; }
a { color: inherit; text-underline-offset: 3px; }
[hidden] { display: none !important; }
.skip { position: absolute; left: 1rem; top: -100px; z-index: 30; padding: .75rem; background: var(--yellow); border: var(--line); }
.skip:focus { top: 1rem; }
.wrap { width: min(1240px, calc(100% - var(--space) * 2)); margin-inline: auto; }
.masthead { border-bottom: var(--line); background: var(--surface); }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1rem; }
.identity { display: flex; align-items: center; gap: .8rem; }
.wordmark { background: var(--ink); color: var(--paper); padding: .4rem .7rem; font-size: 1.5rem; font-weight: 900; letter-spacing: -.04em; }
.school { font-size: .8rem; font-weight: 700; line-height: 1.4; }
.header-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; justify-content: end; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 310px; margin-block: 2rem; border: var(--line); box-shadow: var(--shadow); }
.hero-title { padding: var(--space); background: var(--blue); display: flex; flex-direction: column; justify-content: space-between; gap: 1.6rem; }
.kicker { font-size: .8rem; font-weight: 700; }
.hero-bottom { display: flex; justify-content: space-between; gap: 1rem; font-size: .875rem; font-weight: 700; flex-wrap: wrap; }
.deadline { padding: 1.5rem; background: var(--yellow); border-left: var(--line); display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; }
.date-day { display: block; font-size: 6rem; line-height: .95; font-weight: 900; letter-spacing: -.04em; }
.date-month { font-weight: 900; font-size: 1.35rem; }
.deadline-caption { font-size: .875rem; }
.countdown { border-top: var(--line); padding-top: .75rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: .6rem; flex-wrap: wrap; margin: 2rem 0 1.5rem; }
.tabs button { flex: 1 1 auto; }
.tabs button[aria-current="page"] { background: var(--ink); color: var(--paper); box-shadow: 3px 3px 0 var(--blue); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.5rem; align-items: start; }
.panel { border: var(--line); background: var(--surface); min-width: 0; }
.panel-heading { padding: 1.25rem 1.5rem; border-bottom: var(--line); display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.panel-body { padding: 1.5rem; }
.index { font-weight: 900; font-size: 1.8rem; }
.form-section + .form-section { margin-top: 1.75rem; padding-top: 1.5rem; border-top: var(--line); }
.form-section h3 { margin-bottom: 1rem; }
.fields { display: grid; gap: 1.1rem; }
.two-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
fieldset { border: 0; padding: 0; margin: 1rem 0 0; min-width: 0; }
legend { font-weight: 700; margin-bottom: .5rem; }
.classes { display: flex; gap: .6rem; flex-wrap: wrap; }
.class-option { display: flex; align-items: center; gap: .6rem; min-height: 44px; padding: .5rem .7rem; border: var(--line); font-weight: 400; }
.class-option:has(input:checked) { background: var(--yellow); }
.file-zone { border: 2px dashed var(--ink); padding: 1.5rem; background: var(--paper); }
.file-zone.dragging { background: var(--blue); border-style: solid; }
.file-zone input { background: var(--surface); padding: .5rem; }
input::file-selector-button { background: var(--ink); color: var(--paper); padding: .6rem; border: 0; margin-right: .6rem; font: inherit; cursor: pointer; }
.file-limit { margin-top: .75rem; font-size: .875rem; color: var(--muted); }
.file-list { padding-left: 1.2rem; margin: .75rem 0 0; overflow-wrap: anywhere; font-size: .875rem; }
.form-actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-top: 1.5rem; }
.form-actions .primary { min-width: 200px; }
.aside-title { background: var(--yellow); }
.summary-list { padding: 0; margin: 0; list-style: none; }
.summary-list li { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; gap: 1rem; }
.summary-list li + li { border-top: var(--line); }
.summary-list strong { font-size: 1.65rem; font-weight: 900; }
.aside-note { padding: 1.25rem; border-top: var(--line); font-size: .875rem; }
.template-list { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.status { border: var(--line); padding: 1rem; margin-block: 1rem; background: var(--blue); overflow-wrap: anywhere; }
.status.error { background: var(--yellow); border-style: dashed; }
.status p + p { margin-top: .5rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; padding: 1.25rem; border-bottom: var(--line); }
.toolbar label { flex: 1 1 150px; font-size: .875rem; }
.toolbar .search { flex-grow: 2; }
.toolbar input, .toolbar select { min-height: 44px; }
.table-scroll { width: 100%; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .875rem; text-align: left; }
th { background: var(--paper); font-weight: 700; }
th, td { padding: .9rem 1rem; border-bottom: 1px solid var(--ink); vertical-align: top; }
th { border-bottom: var(--line); }
td { overflow-wrap: anywhere; min-width: 100px; }
td:first-child:has(input) { min-width: 44px; }
td .sub { display: block; margin-top: .25rem; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
.table-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.table-actions button, .table-actions a { font-size: .8rem; padding: .5rem .7rem; }
.status-label { display: inline-block; border: 1px solid var(--ink); padding: .15rem .5rem; font-weight: 700; white-space: nowrap; }
.status-label.done { background: var(--blue); }
.status-label.revision { background: var(--yellow); }
.empty { padding: 2rem 1.5rem; text-align: center; }
.section-gap { margin-top: 1.5rem; }
.footer, .pagination { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; padding: 1.25rem 0; font-size: .8rem; color: var(--muted); }
.pagination { padding-inline: 1.25rem; border-top: var(--line); }
.load-state { padding: 1.5rem; border: var(--line); background: var(--yellow); margin-bottom: 1.5rem; }
.load-state button { margin-top: 1rem; }
.login-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
.login-layout h2 { font-size: clamp(2rem, 4vw, 3rem); }
.login-panel { max-width: 900px; margin: 2rem auto; }
.login-panel .panel-heading { background: var(--yellow); }
.form-section-sm { margin: 1.1rem 0; }
.label-text { display: block; font-weight: 700; margin-bottom: .4rem; }
.method-choices { display: flex; gap: .75rem; flex-wrap: wrap; }
.method-option { flex: 1 1 140px; cursor: pointer; }
.method-option input { cursor: pointer; }
.method-option:has(input:disabled) { opacity: .5; cursor: not-allowed; background: var(--paper); }
.references-filters label { flex-basis: 150px; min-width: 0; }
.reference-state { padding: 1rem 1.25rem; }
.reference-state .status { margin-top: 0; }
.references-search .search { flex-basis: 400px; }
dialog { width: min(640px, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); padding: 0; background: var(--surface); border: var(--line); border-radius: 0; color: var(--ink); box-shadow: 8px 8px 0 var(--ink); }
dialog::backdrop { background: rgb(20 20 20 / .55); }
.dialog-heading { padding: 1.25rem; border-bottom: var(--line); background: var(--blue); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.dialog-heading h2 { font-size: 1.5rem; }
.dialog-heading button { min-width: 44px; }
.dialog-body { padding: 1.5rem; overflow-y: auto; }
.dialog-actions { padding: 1.25rem; border-top: var(--line); display: flex; justify-content: end; flex-wrap: wrap; gap: .75rem; }
.dialog-details { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .6rem 1rem; }
.dialog-details dt { color: var(--muted); }
.dialog-details dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.dialog-fields { display: grid; gap: 1rem; }
#preview-dialog { width: min(1100px, calc(100% - 2rem)); }
#preview-frame { width: 100%; height: 65dvh; border: 0; background: white; display: block; }
#notice { scroll-margin-top: 1rem; }
@media (max-width: 950px) { .workspace { grid-template-columns: minmax(0, 1fr) 260px; } .hero { grid-template-columns: minmax(0, 1fr) 260px; } .panel-body { padding: 1.25rem; } }
@media (max-width: 740px) { .workspace { grid-template-columns: 1fr; } .hero { grid-template-columns: minmax(0, 1fr) 210px; } .deadline { padding: 1rem; } .date-day { font-size: 4.5rem; } .school { max-width: 150px; } .summary-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); } .summary-list li { flex-direction: column; align-items: start; gap: .35rem; padding: 1rem; } .summary-list li + li { border-top: 0; border-left: var(--line); } .login-layout { grid-template-columns: 1fr; gap: 1.25rem; } }
@media (max-width: 520px) { .masthead-inner { align-items: start; } .identity { align-items: start; flex-direction: column; gap: .35rem; } .school { font-size: .7rem; } .header-actions { max-width: 150px; } .header-actions button { padding: .5rem .6rem; font-size: .8rem; } .hero { grid-template-columns: 1fr; margin-top: 1.25rem; } .hero-title { padding: 1.5rem; gap: 1.5rem; } .deadline { border-left: 0; border-top: var(--line); display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: .5rem 1rem; } .deadline > .kicker { grid-column: 1 / -1; } .date-day { font-size: 3.75rem; display: inline; margin-right: .4rem; } .date-month { font-size: 1.05rem; } .deadline-caption { margin-top: .25rem; } .countdown { border-top: 0; padding: 0; text-align: right; font-size: .875rem; } .two-fields { grid-template-columns: 1fr; } .tabs { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; } .tabs button { padding: .6rem .4rem; font-size: .875rem; } .panel-heading { padding: 1rem; } .panel-body { padding: 1rem; } .summary-list li { font-size: .8rem; } .form-actions .primary { width: 100%; } .toolbar { padding: 1rem; } .toolbar label { flex-basis: 100%; } .toolbar > button { flex: 1 1 auto; } .dialog-body { padding: 1rem; } .dialog-details { grid-template-columns: 1fr; gap: .25rem; } .dialog-details dd { margin-bottom: .5rem; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media print { .masthead, .hero, .tabs, .toolbar, .footer, button, dialog { display: none !important; } body { background: white; } .wrap { width: 100%; } .panel { border: 0; } table { font-size: 10pt; } }
