:root {
  color-scheme: light;
  --paper: #fff;
  --canvas: #f6f6f5;
  --panel: #fff;
  --ink: #202020;
  --secondary: #777;
  --faint: #969696;
  --line: #e7e7e5;
  --control: #fff;
  --accent: #242424;
  --on-accent: #fff;
  --hover: #ededeb;
  --danger: #af3737;
  --radius: 8px;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #161616;
  --canvas: #101010;
  --panel: #191919;
  --ink: #ededeb;
  --secondary: #a1a19e;
  --faint: #8a8a87;
  --line: #30302e;
  --control: #202020;
  --accent: #ededeb;
  --on-accent: #161616;
  --hover: #282827;
  --danger: #f19696;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font:
    14px/1.6 "Helvetica Neue",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea,
summary {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -1px;
  line-height: 1.4;
  margin-bottom: 12px;
}
h2 {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 12px;
}
p {
  color: var(--secondary);
}
[hidden] {
  display: none !important;
}
.sidebar {
  width: 228px;
  position: fixed;
  inset: 0 auto 0 0;
  background: var(--paper);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 32px 20px 16px;
}
.brand {
  display: flex;
  align-items: center;
  font-weight: 750;
  font-size: 25px;
  letter-spacing: -1.2px;
  line-height: 1;
}
.brand-light {
  font-weight: 400;
}
.brand-mark {
  height: 30px;
  width: 30px;
  border: 1.5px solid var(--ink);
  border-radius: 7px;
  margin-right: 10px;
  font-size: 20px;
  display: grid;
  place-content: center;
  position: relative;
}
.brand-mark span {
  position: absolute;
  right: 4px;
  bottom: 1px;
  font-size: 14px;
}
.brand-dot {
  color: var(--secondary);
}
.workspace-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--faint);
  margin: 48px 12px 16px;
}
.sidebar nav {
  display: grid;
  gap: 6px;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 6px;
  color: var(--secondary);
  font-size: 13px;
}
.sidebar nav a:hover {
  background: var(--canvas);
  color: var(--ink);
}
.sidebar nav a.selected {
  background: var(--accent);
  color: var(--on-accent);
}
.nav-icon {
  font-size: 21px;
  line-height: 1;
  width: 22px;
  text-align: center;
}
.nav-end {
  margin-left: auto;
}
.nav-divider {
  height: 1px;
  background: var(--line);
  margin: 18px 12px;
}
.sidebar-note {
  padding: 24px 12px;
  margin-top: auto;
}
.tiny-label {
  font-size: 10px;
  letter-spacing: 1.4px;
  font-weight: 500;
}
.sidebar-note .tiny-label {
  font-size: 8px;
  color: var(--faint);
}
.sidebar-note p {
  font-size: 15px;
  line-height: 1.9;
  margin: 12px 0 18px;
  font-family: "Songti SC", "Noto Serif CJK SC", serif;
}
.note-lines {
  height: 24px;
  background: repeating-linear-gradient(
    transparent 0,
    transparent 11px,
    var(--line) 11px,
    var(--line) 12px
  );
  max-width: 120px;
}
.sidebar-bottom {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.ghost {
  background: transparent;
  border: 0;
  color: var(--secondary);
  border-radius: 6px;
  padding: 10px;
}
.ghost:hover {
  background: var(--hover);
  color: var(--ink);
}
.theme-toggle {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.profile {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}
.profile strong {
  font-size: 12px;
  display: block;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile small {
  display: block;
  font-size: 10px;
  color: var(--faint);
}
.profile form {
  margin-left: auto;
}
.avatar {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 12px;
}
.logout {
  font-size: 20px;
}
.shell {
  margin-left: 228px;
}
.topbar {
  height: 68px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  background: var(--paper);
  font-size: 11px;
  color: var(--faint);
}
.topbar strong {
  font-weight: 400;
  color: var(--secondary);
  margin-left: 8px;
}
.top-note {
  font-family: "Songti SC", serif;
  font-size: 12px;
}
main {
  max-width: 1540px;
  margin: auto;
  padding: 36px 40px 48px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 28px;
}
.page-heading p {
  font-size: 13px;
  margin-bottom: 0;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 2.4px;
  color: var(--faint);
  font-weight: 600;
  margin-bottom: 12px;
}
.subtle {
  color: var(--faint);
}
.button {
  border: 1px solid transparent;
  border-radius: 6px;
  min-height: 42px;
  padding: 10px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
}
.primary {
  background: var(--accent);
  color: var(--on-accent);
}
.primary:hover {
  opacity: 0.85;
}
.secondary {
  border-color: var(--line);
  background: var(--paper);
  color: var(--ink);
}
.secondary:hover {
  background: var(--hover);
}
.studio {
  display: grid;
  grid-template-columns: minmax(310px, 400px) minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}
.editor {
  padding: 24px;
  border-right: 1px solid var(--line);
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.section-heading h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 15px;
}
.step {
  font-size: 10px;
  color: var(--faint);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.badge {
  display: inline-block;
  font-size: 9px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--secondary);
  white-space: nowrap;
}
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--canvas);
  border-radius: 6px;
  padding: 4px;
  margin-bottom: 20px;
  gap: 4px;
}
.tabs button {
  border: 1px solid transparent;
  border-radius: 4px;
  background: none;
  color: var(--secondary);
  padding: 8px;
  font-size: 12px;
  min-height: 38px;
}
.tabs button[aria-selected="true"] {
  background: var(--paper);
  border-color: var(--line);
  color: var(--ink);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11px;
  font-weight: 500;
  margin-bottom: 16px;
}
.field > span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.field small {
  font-size: 10px;
  font-weight: 400;
  color: var(--faint);
}
input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--control);
  color: var(--ink);
  min-width: 0;
  width: 100%;
  padding: 10px 12px;
  font-size: 12px;
  min-height: 42px;
}
textarea {
  resize: vertical;
  line-height: 1.9;
  min-height: 165px;
  font-size: 14px;
  font-weight: 400;
}
input::placeholder,
textarea::placeholder {
  color: var(--faint);
}
.input-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--faint);
  font-size: 10px;
  margin-top: -12px;
}
.input-meta b {
  font-weight: 500;
  color: var(--ink);
}
.input-meta span {
  margin-right: auto;
}
.text-button {
  border: 0;
  background: none;
  color: var(--secondary);
  padding: 8px 0;
  min-height: 40px;
  font-size: 11px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.text-button:hover {
  color: var(--ink);
  text-decoration: underline;
}
.settings-heading {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 24px;
}
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.range-field output {
  color: var(--secondary);
  font-variant-numeric: tabular-nums;
  font-size: 10px;
}
.range-field input {
  padding: 0;
  min-height: 16px;
  height: 16px;
  accent-color: var(--ink);
  border: 0;
}
.editor-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
  margin-top: 24px;
}
.help {
  font-size: 11px;
  line-height: 1.8;
  color: var(--faint);
  font-weight: 400;
}
.center {
  text-align: center;
  margin: 12px 0 0;
}
.preview-panel {
  background: var(--canvas);
  padding: 0 28px 20px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.preview-toolbar {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--secondary);
  font-size: 10px;
}
.preview-toolbar .tiny-label {
  font-size: 10px;
  letter-spacing: 1px;
}
.paper-stage {
  flex: 1;
  min-height: 620px;
  max-height: 1050px;
  display: flex;
  justify-content: center;
  align-items: stretch;
}
.empty-paper,
.pdf-preview {
  background: white;
  color: #262626;
  border: 1px solid #e1e1df;
  width: 100%;
  min-width: 0;
  max-width: 794px;
  box-shadow: 0 4px 18px #00000006;
}
.empty-paper {
  padding: 36px 30px;
  display: flex;
  flex-direction: column;
}
.paper-brand {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #333;
  font-size: 10px;
  letter-spacing: 2px;
  padding-bottom: 16px;
}
.paper-brand span {
  font-size: 7px;
  color: #999;
  letter-spacing: 1px;
}
.empty-paper h2 {
  font-size: 22px;
  font-family: "Songti SC", "Noto Serif CJK SC", serif;
  margin: 40px 0 8px;
  font-weight: 400;
}
.empty-paper p {
  font-size: 10px;
  color: #aaa;
}
.specimen {
  font-size: 76px;
  font-family: Georgia, "Songti SC", serif;
  color: #dededb;
  letter-spacing: -5px;
  white-space: nowrap;
  margin: 42px 0 18px;
}
.specimen span {
  font-size: 60px;
}
.empty-rules {
  height: 175px;
  background: repeating-linear-gradient(
    transparent 0,
    transparent 34px,
    #eeeeeb 34px,
    #eeeeeb 35px
  );
}
.empty-paper > small {
  font-size: 7px;
  letter-spacing: 1.7px;
  color: #aaa;
  margin-top: auto;
  padding-top: 40px;
}
.preview-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--faint);
  font-size: 9px;
  padding-top: 20px;
}
.preview-foot span:last-child {
  font-size: 8px;
  letter-spacing: 1px;
}
.upload {
  border: 1px dashed var(--faint);
  border-radius: 6px;
  background: var(--canvas);
  text-align: center;
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 24px 12px;
  margin-bottom: 16px;
  cursor: pointer;
}
.upload:hover,
.upload.dragging {
  background: var(--hover);
}
.upload-icon {
  font-size: 28px;
}
.upload strong {
  font-size: 12px;
  margin: 4px 0;
}
.upload small {
  font-size: 9px;
  color: var(--secondary);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.upload:focus-within {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.flash {
  border: 1px solid var(--line);
  padding: 14px 18px;
  background: var(--paper);
  margin-bottom: 20px;
  border-radius: 6px;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.flash.error,
.danger {
  color: var(--danger);
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 10px);
  background: var(--accent);
  color: var(--on-accent);
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.15s,
    transform 0.15s;
  z-index: 100;
  max-width: 90vw;
}
#toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
#toast.error {
  border: 1px solid var(--danger);
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
  scroll-margin-top: 24px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  margin-bottom: 24px;
}
.stats > div {
  padding: 24px;
  border-right: 1px solid var(--line);
}
.stats > div:last-child {
  border: 0;
}
.stats span {
  display: block;
  color: var(--secondary);
  font-size: 12px;
}
.stats strong {
  font-size: 32px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.admin-nav {
  display: flex;
  gap: 24px;
  margin: 0 0 24px;
  font-size: 12px;
  color: var(--secondary);
}
.admin-nav a:hover {
  color: var(--ink);
}
.inline-form {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 16px;
  margin: 20px 0;
}
.inline-form .field {
  margin: 0;
  flex: 1;
  min-width: 120px;
}
.inline-form .button {
  margin-bottom: 0;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}
th {
  font-size: 10px;
  color: var(--faint);
  font-weight: 500;
  white-space: nowrap;
}
td,
th {
  padding: 16px 12px;
  border-bottom: 1px solid var(--line);
}
td:first-child,
th:first-child {
  padding-left: 0;
}
td:last-child,
th:last-child {
  padding-right: 0;
}
td {
  vertical-align: top;
}
td strong {
  font-size: 12px;
  font-weight: 500;
}
.block {
  display: block;
  color: var(--faint);
  margin-top: 4px;
}
.row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.row form {
  margin: 0;
}
.row details {
  font-size: 11px;
  max-width: 240px;
}
summary {
  cursor: pointer;
  min-height: 40px;
  line-height: 40px;
  color: var(--secondary);
}
.reset-form {
  display: grid;
  gap: 8px;
}
.admin-create {
  margin-top: 20px;
}
.empty-cell {
  text-align: center;
  color: var(--faint);
  padding: 32px;
}
.storage-path {
  overflow-wrap: anywhere;
  font-size: 12px;
}
.account-panel {
  max-width: 560px;
}
.account-panel .profile {
  margin: 0;
}
.account-panel .profile h2 {
  margin: 0;
}
.account-panel .profile p {
  font-size: 12px;
  margin: 4px 0;
}
.account-panel .avatar {
  width: 48px;
  height: 48px;
  font-size: 18px;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 28px 0;
}
.library-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.saved-sheet {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 20px;
  min-width: 0;
}
.saved-sheet h2 {
  font-size: 17px;
  margin: 20px 0 8px;
  overflow-wrap: anywhere;
}
.saved-sheet p {
  font-size: 11px;
}
.sheet-mini {
  background: var(--canvas);
  padding: 16px 20px;
  height: 155px;
}
.sheet-mini > span {
  font-size: 9px;
  color: var(--faint);
}
.sheet-mini > div {
  font-family: Georgia, "Songti SC", serif;
  font-size: 30px;
  color: var(--secondary);
}
.sheet-mini i {
  display: block;
  border-bottom: 1px solid var(--line);
  margin: 10px 0;
}
.saved-sheet .row {
  justify-content: space-between;
}
.empty-state {
  text-align: center;
  padding: 80px 24px;
  border: 1px dashed var(--line);
  border-radius: 8px;
}
.empty-state h2 {
  font-size: 22px;
}
.empty-state p {
  font-size: 13px;
}
.empty-symbol {
  display: block;
  font-size: 44px;
  color: var(--faint);
  margin-bottom: 20px;
}
.auth-header {
  height: 100px;
  padding: 0 6vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.auth-shell main {
  padding: 40px 6vw;
}
.auth-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 10%;
  align-items: center;
  max-width: 1080px;
  margin: 30px auto;
}
.auth-story h1 {
  font-family: "Songti SC", "Noto Serif CJK SC", serif;
  font-size: 48px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -1px;
  margin: 24px 0;
}
.auth-story p {
  font-size: 13px;
  line-height: 2;
}
.auth-specimen {
  display: flex;
  flex-direction: column;
  max-width: 360px;
  margin: 36px 0;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 40px;
  line-height: 1.9;
}
.auth-specimen span {
  border-bottom: 1px solid var(--line);
}
.auth-specimen span:nth-child(2) {
  color: var(--secondary);
}
.auth-specimen span:nth-child(3) {
  color: var(--line);
}
.auth-story > .tiny-label {
  color: var(--faint);
  font-size: 8px;
  letter-spacing: 2px;
}
.auth-card {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 10px;
  padding: 36px;
}
.auth-card h2 {
  font-size: 24px;
  margin-bottom: 8px;
}
.auth-card > p {
  font-size: 12px;
}
.auth-card form {
  margin-top: 28px;
}
.auth-card .field {
  margin-bottom: 20px;
}
.full {
  width: 100%;
}
.auth-switch {
  text-align: center;
  font-size: 11px;
  margin: 24px 0 0;
}
.auth-switch a {
  text-decoration: underline;
  color: var(--ink);
}
.auth-card .help {
  font-size: 10px;
  text-align: center;
  margin: 16px 0 0;
}
@media (min-width: 1600px) {
  main {
    padding-top: 48px;
  }
  .studio {
    grid-template-columns: 420px minmax(0, 1fr);
  }
  .editor {
    padding: 32px;
  }
  .preview-panel {
    padding: 0 48px 24px;
  }
  .paper-stage {
    min-height: 830px;
  }
  .empty-paper {
    padding: 48px;
  }
  .empty-paper h2 {
    font-size: 28px;
  }
  .specimen {
    font-size: 100px;
  }
}
@media (max-width: 1150px) {
  .sidebar {
    width: 196px;
    padding: 28px 16px 16px;
  }
  .shell {
    margin-left: 196px;
  }
  main {
    padding: 28px 24px;
  }
  .topbar {
    padding: 0 24px;
  }
  .studio {
    grid-template-columns: 330px minmax(0, 1fr);
  }
  .editor {
    padding: 20px;
  }
  .preview-panel {
    padding: 0 16px 20px;
  }
  .empty-paper {
    padding: 28px 20px;
  }
  .empty-paper h2 {
    font-size: 18px;
  }
  .specimen {
    font-size: 55px;
  }
  .specimen span {
    font-size: 40px;
  }
  .paper-brand span {
    display: none;
  }
  .preview-foot span:last-child {
    display: none;
  }
  .page-heading h1 {
    font-size: 28px;
  }
  .library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .sidebar {
    width: 176px;
    padding: 24px 12px 12px;
  }
  .sidebar .brand {
    font-size: 21px;
  }
  .brand-mark {
    display: none;
  }
  .shell {
    margin-left: 176px;
  }
  .studio {
    grid-template-columns: 1fr;
  }
  .editor {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 24px;
  }
  .preview-panel {
    padding: 0 24px 24px;
  }
  .paper-stage {
    min-height: 650px;
  }
  .sidebar-note {
    padding: 16px 8px;
  }
  .top-note {
    display: none;
  }
  .page-heading {
    align-items: start;
  }
  .page-heading > .button {
    padding: 8px 12px;
  }
  .auth-layout {
    gap: 6%;
    grid-template-columns: 1fr 370px;
  }
  .auth-story h1 {
    font-size: 36px;
  }
  .auth-card {
    padding: 28px;
  }
}
@media (max-width: 640px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 16px 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    display: block;
  }
  .sidebar .brand {
    font-size: 24px;
    margin-bottom: 16px;
  }
  .sidebar nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
  }
  .sidebar nav a {
    white-space: nowrap;
    padding: 8px 10px;
    font-size: 11px;
    min-height: 40px;
  }
  .nav-icon {
    font-size: 18px;
    width: 18px;
  }
  .nav-end,
  .workspace-label,
  .nav-divider,
  .sidebar-note,
  .sidebar-bottom .profile {
    display: none;
  }
  .sidebar-bottom {
    position: absolute;
    right: 16px;
    top: 6px;
    border: 0;
    padding: 0;
  }
  .sidebar-bottom .theme-toggle {
    font-size: 10px;
  }
  .shell {
    margin: 0;
  }
  .topbar {
    height: 44px;
    padding: 0 20px;
    font-size: 10px;
  }
  main {
    padding: 24px 16px;
  }
  .page-heading {
    gap: 12px;
    margin-bottom: 24px;
  }
  .page-heading h1 {
    font-size: 25px;
    letter-spacing: -0.5px;
  }
  .page-heading p {
    font-size: 11px;
  }
  .page-heading .button {
    font-size: 10px;
    min-height: 36px;
    padding: 6px 10px;
  }
  .eyebrow {
    font-size: 8px;
    letter-spacing: 1.7px;
  }
  .editor {
    padding: 20px;
  }
  .preview-panel {
    padding: 0 16px 16px;
  }
  .paper-stage {
    min-height: 570px;
  }
  .empty-paper {
    padding: 28px 24px;
  }
  .empty-paper h2 {
    font-size: 20px;
  }
  .specimen {
    font-size: 70px;
  }
  .specimen span {
    font-size: 52px;
  }
  .preview-foot {
    font-size: 8px;
  }
  .library-grid {
    grid-template-columns: 1fr;
  }
  .panel {
    padding: 20px;
  }
  .stats > div {
    padding: 16px;
  }
  .stats strong {
    font-size: 26px;
  }
  .stats span {
    font-size: 10px;
  }
  .admin-nav {
    gap: 20px;
    font-size: 11px;
  }
  .inline-form .field {
    min-width: 110px;
  }
  .inline-form .button {
    width: 100%;
  }
  .auth-header {
    height: 80px;
    padding: 0 24px;
  }
  .auth-shell main {
    padding: 12px 20px 40px;
  }
  .auth-layout {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin: 16px auto;
  }
  .auth-story {
    width: 100%;
  }
  .auth-story h1 {
    font-size: 32px;
    margin: 12px 0;
  }
  .auth-story p {
    font-size: 12px;
    margin-bottom: 0;
  }
  .auth-story .auth-specimen,
  .auth-story > .tiny-label {
    display: none;
  }
  .auth-card {
    width: 100%;
    max-width: 440px;
    padding: 28px;
  }
  .empty-state {
    padding: 56px 16px;
  }
  .empty-state h2 {
    font-size: 19px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
  button:active:not(:disabled) {
    transform: none;
  }
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  font-size: 12px;
  color: var(--secondary);
  white-space: nowrap;
}
.checkbox-field input {
  width: 16px;
  min-height: 16px;
  height: 16px;
  accent-color: var(--ink);
}
.tabs {
  grid-template-columns: repeat(3, 1fr);
}
.tabs button {
  padding: 8px 4px;
  font-size: 11px;
}
.camera-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: 90dvh;
  overflow: auto;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
}
dialog::backdrop {
  background: #0009;
}
dialog video {
  width: 100%;
  max-height: 55vh;
  background: #111;
  border-radius: 6px;
}
dialog textarea {
  min-height: 200px;
}
dialog .section-heading {
  margin-bottom: 16px;
}
dialog .section-heading h2 {
  font-size: 18px;
}
.correction-review {
  padding: 12px;
  background: var(--canvas);
  border-radius: 6px;
  margin: 12px 0;
}
.correction-review summary {
  font-size: 11px;
}
.correction-review textarea {
  min-height: 90px;
}
.crop-stage {
  position: relative;
  margin: 24px auto;
  touch-action: none;
}
.crop-stage canvas {
  display: block;
  width: 100%;
  height: auto;
}
.crop-handle {
  position: absolute;
  width: 28px;
  height: 28px;
  min-height: 28px;
  border-radius: 50%;
  border: 3px solid white;
  background: #24a987;
  transform: translate(-50%, -50%);
  touch-action: none;
  padding: 0;
  box-shadow: 0 0 0 1px #222;
}
.crop-handle:active:not(:disabled) {
  transform: translate(-50%, -50%);
}

.pdf-preview {
  align-self: flex-start;
  line-height: 0;
}
.pdf-preview canvas {
  display: block;
  width: 100%;
  height: auto;
}
.pdf-page-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 12px;
  font-size: 12px;
}
.pdf-page-controls[hidden] {
  display: none;
}
.paper-stage {
  min-height: 0;
  max-height: none;
}
.empty-paper {
  min-height: 620px;
}

.brand {
  gap: 9px;
}
.brand-symbol {
  display: block;
  position: relative;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 9px;
  background: white;
}
.brand-symbol img {
  position: absolute;
  width: 72px;
  height: 72px;
  max-width: none;
  left: -14px;
  top: -6px;
}

.pdf-loading {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 18px;
  width: 100%;
  color: var(--muted, #777);
  font-size: 14px;
}
.pdf-loading[hidden] { display: none; }
.pdf-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: pdf-spin 1s linear infinite;
}
@keyframes pdf-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pdf-spinner { animation: none; } }
