:root {
  --paper: #f4efe4;
  --paper-deep: #e9dfcd;
  --card: #fbf8f1;
  --ink: #1d2a24;
  --ink-soft: #35463d;
  --muted: #6b766f;
  --green: #245447;
  --green-deep: #173b31;
  --green-soft: #dfeae2;
  --coral: #c66d48;
  --gold: #c6a05b;
  --line: rgba(29, 42, 36, 0.13);
  --line-strong: rgba(29, 42, 36, 0.22);
  --shadow: 0 24px 60px -24px rgba(36, 49, 42, 0.35);
  --font-display: "Iowan Old Style", "Palatino Linotype", "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --font-body: "Segoe UI", "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", sans-serif;
  --font-mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --radius: 26px;
  --shell: 1180px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, rgba(198, 160, 91, 0.15), transparent 28rem),
    radial-gradient(circle at 92% 28%, rgba(36, 84, 71, 0.09), transparent 30rem),
    var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    repeating-linear-gradient(0deg, rgba(29, 42, 36, 0.025) 0, rgba(29, 42, 36, 0.025) 1px, transparent 1px, transparent 4px);
  mix-blend-mode: multiply;
}

::selection {
  background: var(--green);
  color: var(--card);
}

img,
svg {
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 3px;
}

.shell {
  width: min(calc(100% - 64px), var(--shell));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--card);
  transform: translateY(-160%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid transparent;
  background: rgba(244, 239, 228, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 82px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--card);
  background: var(--green);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
}

.brand-mark.small {
  width: 36px;
  height: 36px;
}

.brand-type {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-type strong {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.brand-type small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  margin-left: auto;
  margin-right: 10px;
}

.site-nav a {
  position: relative;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -7px;
  height: 1px;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms ease;
}

.site-nav a:hover::after {
  transform: scaleX(1);
}

.server-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(251, 248, 241, 0.72);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(198, 160, 91, 0.15);
}

.server-pill.is-online .dot {
  background: #4f9b6f;
  box-shadow: 0 0 0 4px rgba(79, 155, 111, 0.15);
}

.server-pill.is-offline .dot {
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(198, 109, 72, 0.14);
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(400px, 470px);
  gap: clamp(40px, 7vw, 94px);
  align-items: center;
  padding-top: 76px;
  padding-bottom: 92px;
}

.hero-copy {
  position: relative;
  max-width: 620px;
  padding-top: 8px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.21em;
  text-transform: uppercase;
}

.eyebrow-line {
  display: inline-block;
  width: 32px;
  height: 1px;
  background: var(--coral);
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(66px, 8vw, 104px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.hero h1 em {
  color: var(--green);
  font-weight: 500;
}

.hero-lead {
  max-width: 470px;
  margin: 30px 0 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.9;
}

.hero-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 40px 0 0;
  padding: 26px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.hero-points li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.point-icon {
  display: grid;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--green);
  background: rgba(251, 248, 241, 0.55);
}

.point-icon svg {
  width: 18px;
  height: 18px;
}

.hero-points strong,
.hero-points small {
  display: block;
}

.hero-points strong {
  margin-top: 1px;
  font-size: 13px;
  font-weight: 700;
}

.hero-points small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.hero-quote {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 46px;
  color: var(--muted);
}

.quote-mark {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 0.6;
}

.hero-quote p {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 17px;
  font-style: italic;
}

.quote-caption {
  margin-left: 4px;
  font-size: 10px;
  letter-spacing: 0.08em;
}

/* ---------- Entry card ---------- */

.entry-wrap {
  position: relative;
}

.entry-card {
  position: relative;
  padding: clamp(26px, 3.4vw, 36px);
  border: 1px solid rgba(29, 42, 36, 0.14);
  border-radius: 30px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.55), transparent 45%),
    var(--card);
  box-shadow: var(--shadow);
}

.entry-card::before {
  content: "";
  position: absolute;
  top: 13px;
  right: 14px;
  bottom: 13px;
  left: 14px;
  z-index: 0;
  border: 1px solid rgba(29, 42, 36, 0.055);
  border-radius: 22px;
  pointer-events: none;
}

.entry-card > * {
  position: relative;
  z-index: 1;
}

.entry-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 27px;
}

.card-kicker {
  margin: 0 0 7px;
  color: var(--coral);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.card-kicker.light {
  color: rgba(244, 239, 228, 0.6);
}

.entry-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.entry-number {
  color: var(--paper-deep);
  font-family: var(--font-display);
  font-size: 46px;
  font-style: italic;
  line-height: 0.85;
  letter-spacing: -0.04em;
  user-select: none;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.field-label {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.field-label small {
  margin-left: 4px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.field-hint {
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: 0.02em;
  text-align: right;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 15px;
  z-index: 1;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: var(--muted);
  pointer-events: none;
}

.input-icon svg {
  width: 18px;
  height: 18px;
}

.input-wrap input {
  width: 100%;
  height: 52px;
  padding: 0 15px 0 45px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: rgba(244, 239, 228, 0.6);
  color: var(--ink);
  font-size: 15px;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.input-wrap input::placeholder {
  color: #9ca59f;
}

.input-wrap input:hover {
  border-color: var(--line-strong);
}

.input-wrap:focus-within input {
  border-color: var(--green);
  background: var(--card);
  box-shadow: 0 0 0 4px rgba(36, 84, 71, 0.09);
}

.input-wrap:focus-within .input-icon {
  color: var(--green);
}

.pages-wrap input {
  padding-right: 48px;
  font-variant-numeric: tabular-nums;
}

.pages-wrap input::-webkit-outer-spin-button,
.pages-wrap input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.pages-wrap input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.input-suffix {
  position: absolute;
  right: 16px;
  color: var(--muted);
  font-size: 12px;
  pointer-events: none;
}

.file-preview {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 4px 0 18px;
  padding: 10px 13px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: rgba(233, 223, 205, 0.3);
  color: var(--muted);
  font-size: 10.5px;
}

.file-preview-icon {
  color: var(--green);
}

.file-preview-icon svg {
  width: 16px;
  height: 16px;
}

.file-preview code {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 10.5px;
  overflow-wrap: anywhere;
}

.submit-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  overflow: hidden;
  border: 0;
  border-radius: 13px;
  background: var(--green);
  color: var(--card);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition:
    background 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.submit-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.12) 50%, transparent 70%);
  transform: translateX(-110%);
  transition: transform 520ms ease;
}

.submit-button:hover:not(:disabled) {
  background: var(--green-deep);
  box-shadow: 0 14px 30px -14px rgba(23, 59, 49, 0.75);
  transform: translateY(-1px);
}

.submit-button:hover:not(:disabled)::after {
  transform: translateX(110%);
}

.submit-button:active:not(:disabled) {
  transform: translateY(0);
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.78;
}

.submit-arrow {
  transition: transform 180ms ease;
}

.submit-arrow svg {
  width: 19px;
  height: 19px;
}

.submit-button:hover:not(:disabled) .submit-arrow {
  transform: translateX(4px);
}

.submit-loader {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--card);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.submit-button.is-loading .submit-loader {
  display: block;
}

.submit-button.is-loading .submit-arrow {
  display: none;
}

.form-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.5;
  text-align: center;
}

.form-note svg {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  color: var(--green);
}

.entry-stamp {
  position: absolute;
  top: 50%;
  right: -30px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  color: rgba(29, 42, 36, 0.28);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.2em;
  transform: translateY(-50%) rotate(90deg);
  transform-origin: center;
  user-select: none;
}

/* ---------- Ticker ---------- */

.ticker {
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--ink);
  color: rgba(244, 239, 228, 0.74);
}

.ticker-track {
  display: flex;
  width: max-content;
  align-items: center;
  gap: 30px;
  padding: 14px 0;
  animation: ticker 38s linear infinite;
}

.ticker-track span {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ticker-track i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
}

/* ---------- Sections ---------- */

.section {
  padding-top: 92px;
  padding-bottom: 26px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 32px;
}

.section-heading .eyebrow {
  margin-bottom: 13px;
}

.section-heading h2 {
  max-width: 670px;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(35px, 4.2vw, 50px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.section-heading h2 em {
  color: var(--green);
  font-weight: 500;
}

.section-note {
  padding-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.ghost-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

.ghost-button svg {
  width: 16px;
  height: 16px;
}

.ghost-button:hover {
  border-color: var(--green);
  background: var(--green);
  color: var(--card);
}

.ghost-button.is-loading svg {
  animation: spin 800ms linear infinite;
}

.ghost-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

/* ---------- Dashboard ---------- */

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 22px;
  align-items: stretch;
}

.sync-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
  padding: 30px;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 88% 6%, rgba(198, 160, 91, 0.17), transparent 16rem),
    var(--green-deep);
  color: var(--card);
  box-shadow: 0 22px 50px -32px rgba(23, 59, 49, 0.8);
}

.sync-card::before {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -110px;
  width: 280px;
  height: 280px;
  border: 1px solid rgba(244, 239, 228, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.sync-card > * {
  position: relative;
  z-index: 1;
}

.sync-orb {
  position: absolute;
  top: 25px;
  right: 26px;
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  color: var(--card);
}

.sync-orb svg {
  position: relative;
  z-index: 2;
  width: 43px;
  height: 43px;
}

.orb-ring {
  position: absolute;
  border: 1px solid rgba(244, 239, 228, 0.14);
  border-radius: 50%;
}

.ring-one {
  inset: 0;
  animation: pulse 5s ease-in-out infinite;
}

.ring-two {
  inset: 9px;
  border-color: rgba(198, 160, 91, 0.25);
}

.sync-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #86cda1;
  box-shadow: 0 0 0 4px rgba(134, 205, 161, 0.12);
}

.status-dot.is-error {
  background: #e5a184;
  box-shadow: 0 0 0 4px rgba(229, 161, 132, 0.13);
}

.sync-description {
  max-width: 330px;
  margin: 10px 0 23px;
  color: rgba(244, 239, 228, 0.7);
  font-size: 12px;
  line-height: 1.75;
}

.path-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding: 12px 13px;
  border: 1px solid rgba(244, 239, 228, 0.14);
  border-radius: 11px;
  background: rgba(244, 239, 228, 0.055);
}

.path-box > div {
  min-width: 0;
}

.path-box span {
  display: block;
  margin-bottom: 3px;
  color: rgba(244, 239, 228, 0.5);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.path-box code {
  display: block;
  overflow: hidden;
  color: var(--card);
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phone-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding: 10px 13px;
  border: 1px solid rgba(198, 160, 91, 0.3);
  border-radius: 11px;
  background: rgba(198, 160, 91, 0.1);
}

.phone-box[hidden] {
  display: none;
}

.phone-box > div {
  min-width: 0;
}

.phone-box span {
  display: block;
  margin-bottom: 3px;
  color: rgba(244, 239, 228, 0.5);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.phone-box code {
  display: block;
  overflow: hidden;
  color: #f1d9a9;
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phone-hint {
  display: block;
  margin-top: 3px;
  color: rgba(244, 239, 228, 0.42);
  font-size: 8.5px;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.remote-box {
  border-color: rgba(126, 185, 158, 0.28);
  background: rgba(126, 185, 158, 0.09);
}

.remote-box code {
  color: #bce3cd;
}

.copy-button {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(244, 239, 228, 0.15);
  border-radius: 8px;
  background: transparent;
  color: rgba(244, 239, 228, 0.72);
  cursor: pointer;
  transition:
    background 160ms ease,
    color 160ms ease;
}

.copy-button:hover {
  background: rgba(244, 239, 228, 0.12);
  color: var(--card);
}

.copy-button svg {
  width: 15px;
  height: 15px;
}

.sync-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 22px;
  padding-top: 21px;
  border-top: 1px solid rgba(244, 239, 228, 0.12);
}

.sync-stats div {
  min-width: 0;
}

.sync-stats strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(25px, 2.5vw, 34px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.sync-stats span {
  display: block;
  margin-top: 4px;
  color: rgba(244, 239, 228, 0.54);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.last-sync {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 0;
  color: rgba(244, 239, 228, 0.48);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.last-sync time {
  color: rgba(244, 239, 228, 0.74);
  font-variant-numeric: tabular-nums;
}

.recent-card {
  display: flex;
  flex-direction: column;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.recent-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 19px;
}

.recent-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.count-chip {
  padding: 5px 9px;
  border-radius: 5px;
  background: var(--green-soft);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

th {
  padding: 0 10px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  padding-left: 0;
}

th:last-child,
td:last-child {
  padding-right: 0;
}

td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(29, 42, 36, 0.075);
  color: var(--ink-soft);
  font-size: 12px;
  white-space: nowrap;
}

tbody tr {
  transition: background 140ms ease;
}

tbody tr:hover {
  background: rgba(233, 223, 205, 0.24);
}

td.class-cell {
  font-weight: 600;
}

td.id-cell {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

td.numeric {
  text-align: right;
}

.page-pill {
  display: inline-flex;
  min-width: 38px;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--paper-deep);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

td.time-cell {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.empty-row td {
  padding: 32px 10px;
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
}

.recent-foot {
  margin: auto 0 0;
  padding-top: 16px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.6;
}

/* ---------- Students ---------- */

.students-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.student-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 218px;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(251, 248, 241, 0.72);
  transition:
    transform 200ms ease,
    box-shadow 200ms ease,
    border-color 200ms ease;
}

.student-card:hover {
  border-color: rgba(36, 84, 71, 0.28);
  box-shadow: 0 18px 40px -28px rgba(36, 49, 42, 0.5);
  transform: translateY(-3px);
}

.student-top {
  display: flex;
  align-items: center;
  gap: 11px;
}

.avatar {
  display: grid;
  flex: 0 0 auto;
  width: 39px;
  height: 39px;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: var(--card);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}

.avatar.alt-1 {
  background: var(--coral);
}

.avatar.alt-2 {
  background: var(--gold);
}

.avatar.alt-3 {
  background: #526a7a;
}

.student-identity {
  min-width: 0;
}

.student-identity strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-identity span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.student-file {
  margin-left: auto;
  color: var(--muted);
}

.student-file svg {
  width: 16px;
  height: 16px;
}

.student-total {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 23px;
}

.student-total strong {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
}

.student-total span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.student-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 15px;
}

.page-chip {
  min-width: 26px;
  padding: 3px 6px;
  border: 1px solid rgba(36, 84, 71, 0.12);
  border-radius: 4px;
  background: rgba(223, 234, 226, 0.48);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 9px;
  text-align: center;
}

.page-chip.more {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.student-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 17px;
  border-top: 1px solid rgba(29, 42, 36, 0.08);
  color: var(--muted);
  font-size: 9px;
}

.student-meta code {
  overflow: hidden;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-rank {
  position: absolute;
  top: 18px;
  right: 20px;
  color: rgba(29, 42, 36, 0.16);
  font-family: var(--font-display);
  font-size: 22px;
  font-style: italic;
}

.students-empty {
  display: flex;
  grid-column: 1 / -1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 270px;
  padding: 40px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
}

.students-more {
  grid-column: 1 / -1;
  min-height: 0;
  padding: 24px;
}

.students-more h3 {
  margin-top: 0;
  font-size: 19px;
}

.students-more p {
  margin-bottom: 0;
}

.empty-icon {
  color: var(--green);
  opacity: 0.55;
}

.empty-icon svg {
  width: 52px;
  height: 52px;
}

.students-empty h3 {
  margin: 16px 0 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
}

.students-empty p {
  max-width: 360px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}

.text-link {
  margin-top: 14px;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}

.text-link span {
  display: inline-block;
  transition: transform 160ms ease;
}

.text-link:hover span {
  transform: translateX(4px);
}

/* ---------- Export banner ---------- */

.export-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  margin-top: 76px;
  margin-bottom: 76px;
  padding: 36px 40px;
  overflow: hidden;
  border: 1px solid rgba(36, 84, 71, 0.14);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 80% 20%, rgba(198, 160, 91, 0.18), transparent 18rem),
    var(--paper-deep);
}

.export-tag {
  display: inline-block;
  margin-bottom: 9px;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--green);
  color: var(--card);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.export-copy h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.export-copy p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11.5px;
}

.export-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 180ms ease,
    color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.button svg {
  width: 17px;
  height: 17px;
}

.button:hover {
  transform: translateY(-1px);
}

.button-dark {
  background: var(--ink);
  color: var(--card);
}

.button-dark:hover {
  background: var(--green-deep);
}

.button-light {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink-soft);
}

.button-light:hover {
  border-color: var(--ink);
  background: rgba(251, 248, 241, 0.55);
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 20px;
  padding: 32px 0;
  background: var(--ink);
  color: var(--card);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.footer-brand span:last-child {
  display: flex;
  flex-direction: column;
}

.footer-brand strong {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
}

.footer-brand small {
  margin-top: 2px;
  color: rgba(244, 239, 228, 0.5);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.footer-note,
.footer-year {
  margin: 0;
  color: rgba(244, 239, 228, 0.48);
  font-size: 9px;
  letter-spacing: 0.05em;
}

/* ---------- Dialog ---------- */

.clipboard-helper {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.app-dialog {
  width: min(540px, calc(100vw - 32px));
  max-height: min(88vh, 760px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 26px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 40px 100px -30px rgba(12, 20, 16, 0.6);
}

.app-dialog::backdrop {
  background: rgba(18, 29, 24, 0.58);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.dialog-inner {
  position: relative;
  padding: 36px;
}

.dialog-close {
  position: absolute;
  top: 15px;
  right: 15px;
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    background 160ms ease,
    color 160ms ease;
}

.dialog-close:hover {
  background: var(--paper-deep);
  color: var(--ink);
}

.dialog-close svg {
  width: 16px;
  height: 16px;
}

.dialog-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
}

.dialog-icon svg {
  width: 28px;
  height: 28px;
}

.dialog-icon.is-export {
  background: #f1e2d4;
  color: var(--coral);
}

.dialog-eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.dialog-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.dialog-lead {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}

.summary-box {
  margin-top: 24px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(244, 239, 228, 0.52);
}

.summary-box-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.summary-box code {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
}

.page-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 14px;
}

.page-list .page-chip {
  min-width: 30px;
  padding: 4px 7px;
  font-size: 10px;
}

.dialog-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.dialog-stats div {
  padding: 12px;
  border-radius: 10px;
  background: var(--paper);
  text-align: center;
}

.dialog-stats strong {
  display: block;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
}

.dialog-stats span {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.dialog-actions {
  display: flex;
  gap: 8px;
  margin-top: 24px;
}

.dialog-actions .button {
  flex: 1;
}

.dialog-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.65;
  text-align: center;
}

.download-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.download-icon {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 9px;
  background: #e9eef4;
  color: #2b5797;
}

.download-icon.json {
  background: #f1e8d7;
  color: #8a6427;
}

.download-icon svg {
  width: 20px;
  height: 20px;
}

.download-info {
  min-width: 0;
  flex: 1;
}

.download-info strong {
  display: block;
  font-size: 11px;
}

.download-info span {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.download-row .button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
  font-size: 10px;
}

.share-button {
  width: 100%;
  margin-top: 9px;
}

.warning-note {
  display: flex;
  gap: 9px;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid rgba(198, 109, 72, 0.25);
  border-radius: 10px;
  background: #f7ebe3;
  color: #8c4b2f;
  font-size: 10px;
  line-height: 1.6;
}

/* ---------- Toast ---------- */

.toast-region {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 15px;
  border: 1px solid rgba(244, 239, 228, 0.12);
  border-radius: 10px;
  background: var(--ink);
  color: var(--card);
  box-shadow: 0 15px 40px -18px rgba(12, 20, 16, 0.7);
  font-size: 11.5px;
  line-height: 1.5;
  pointer-events: auto;
  animation: toast-in 240ms ease both;
}

.toast.is-error {
  background: #713c2c;
}

.toast.is-leaving {
  animation: toast-out 200ms ease both;
}

.toast-dot {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8ed1a7;
}

.toast.is-error .toast-dot {
  background: #f0b39b;
}

/* ---------- Motion ---------- */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes ticker {
  to {
    transform: translateX(-50%);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.96);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(370px, 430px);
    gap: 44px;
  }

  .hero h1 {
    font-size: clamp(62px, 7.6vw, 88px);
  }

  .entry-stamp {
    display: none;
  }

  .students-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .site-nav {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 52px;
    padding-top: 54px;
    padding-bottom: 68px;
  }

  .hero-copy {
    max-width: 650px;
  }

  .entry-wrap {
    width: min(100%, 560px);
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .sync-card {
    min-height: 380px;
  }

  .export-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .export-actions {
    width: 100%;
  }
}

@media (max-width: 680px) {
  .shell {
    width: calc(100% - 36px);
  }

  .header-inner {
    min-height: 72px;
  }

  .brand-type small {
    display: none;
  }

  .brand-type strong {
    font-size: 18px;
  }

  .brand-mark {
    width: 37px;
    height: 37px;
  }

  .server-pill {
    padding: 7px 10px;
    font-size: 10px;
  }

  .hero {
    padding-top: 42px;
  }

  .hero h1 {
    font-size: clamp(54px, 16vw, 72px);
  }

  .hero-lead {
    margin-top: 24px;
    font-size: 14.5px;
  }

  .hero-points {
    grid-template-columns: 1fr;
    gap: 13px;
    margin-top: 30px;
    padding-top: 21px;
  }

  .hero-points small {
    font-size: 10px;
  }

  .hero-quote {
    flex-wrap: wrap;
    margin-top: 32px;
  }

  .quote-caption {
    flex-basis: 100%;
    margin-left: 0;
  }

  .entry-card {
    border-radius: 24px;
  }

  .entry-card h2 {
    font-size: 25px;
  }

  .entry-number {
    font-size: 38px;
  }

  .field label {
    display: block;
  }

  .field-hint {
    display: block;
    margin-top: 2px;
    text-align: left;
  }

  .section {
    padding-top: 64px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 24px;
  }

  .section-heading h2 {
    font-size: 36px;
  }

  .section-note {
    display: none;
  }

  .sync-card,
  .recent-card {
    padding: 23px;
    border-radius: 21px;
  }

  .sync-orb {
    top: 20px;
    right: 20px;
    width: 52px;
    height: 52px;
  }

  .sync-orb svg {
    width: 35px;
    height: 35px;
  }

  .students-grid {
    grid-template-columns: 1fr;
  }

  .student-card {
    min-height: 200px;
  }

  .export-banner {
    margin-top: 54px;
    margin-bottom: 54px;
    padding: 27px 23px;
  }

  .export-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .export-actions .button {
    width: 100%;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .footer-note {
    order: 3;
  }

  .dialog-inner {
    padding: 30px 23px;
  }

  .dialog-title {
    font-size: 28px;
  }

  .dialog-actions {
    flex-direction: column;
  }

  .toast-region {
    right: 14px;
    bottom: 14px;
    left: 14px;
    align-items: stretch;
  }

  .toast {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .ticker-track {
    animation: none;
  }
}
