:root {
  color-scheme: dark;
  --vellum-deep: #1A1409;
  --ember-gold: #C8912A;
  --seal-red: #8B1A1A;
  --paper: #241b0e;
  --paper-2: #2f2414;
  --paper-3: #3a2b17;
  --ink: #f7ead0;
  --ink-2: #ead6a7;
  --ink-3: #b99658;
  --ink-4: #7b6234;
  --rule: rgba(200, 145, 42, 0.28);
  --rule-soft: rgba(200, 145, 42, 0.16);
  --seal: var(--seal-red);
  --seal-2: #ad2a22;
  --moss: #514421;
  --serif: 'Cinzel', 'Noto Serif KR', Georgia, serif;
  --sans: 'Lora', 'Noto Serif KR', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --bg: var(--vellum-deep);
  --surface: rgba(42, 32, 17, 0.82);
  --surface-strong: #2d2213;
  --muted: #a8864b;
  --line: var(--rule);
  --primary: var(--ember-gold);
  --primary-ink: #1A1409;
  --warning: var(--seal-2);
  --danger: #e05a42;
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.45);
  font-family: var(--sans);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 50% -10%, rgba(200, 145, 42, 0.12) 0, rgba(200, 145, 42, 0) 28rem),
    radial-gradient(circle at 15% 15%, rgba(139, 26, 26, 0.2) 0, rgba(139, 26, 26, 0) 22rem),
    linear-gradient(135deg, #110d06 0%, var(--vellum-deep) 46%, #090704 100%);
  color: var(--ink);
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

button,
.button {
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0.65rem 1rem;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

button:hover:not(:disabled),
.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(26, 24, 21, 0.08);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 3px;
}

.primary {
  background: var(--ember-gold);
  color: var(--primary-ink);
  border-color: var(--ember-gold);
  box-shadow: 0 12px 26px rgba(200, 145, 42, 0.18);
}

.secondary {
  background: var(--paper-3);
  color: var(--ink-2);
  border-color: var(--rule);
}

.ghost {
  background: transparent;
  color: var(--ink-3);
  border: 1px solid var(--rule);
}

.ghost.danger {
  color: var(--danger);
}

#app {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.2rem;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.auth-panel {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  min-width: min(100%, 380px);
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--rule);
  border-radius: 18px;
  background: rgba(251, 247, 238, 0.72);
  color: var(--ink-3);
}

.sync-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.5rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: rgba(251, 247, 238, 0.7);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

button.sync-badge {
  cursor: pointer;
}

.sync-badge-actionable:hover {
  border-color: rgba(138, 58, 37, 0.35);
}

.sync-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--ink-4);
}

.sync-tone-neutral .sync-dot,
.sync-tone-progress .sync-dot {
  background: var(--ink-4);
}

.sync-tone-synced .sync-dot {
  background: var(--ink-2);
}

.sync-tone-retryable .sync-dot,
.sync-tone-stale .sync-dot {
  background: var(--seal-2);
}

.sync-tone-error .sync-dot {
  background: var(--seal);
}

.sync-badge-label-short {
  display: none;
}

.sync-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(138, 58, 37, 0.22);
  border-radius: 18px;
  background: rgba(243, 237, 224, 0.82);
}

.sync-notice-copy p {
  margin: 0.25rem 0 0;
}

.sync-notice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.auth-copy {
  min-width: 0;
}

.auth-label {
  display: block;
  font-size: 0.94rem;
  color: var(--ink-2);
}

.auth-helper {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--ink-3);
}

.auth-actions {
  display: flex;
  justify-content: flex-end;
}

.auth-inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.auth-inline-form input {
  min-width: 180px;
  min-height: 2.6rem;
}

.auth-action {
  white-space: nowrap;
}

.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;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.45rem;
  font-family: var(--serif);
  font-size: clamp(2rem, 4.2vw, 3.45rem);
  color: var(--ember-gold);
  letter-spacing: 0.42em;
  text-shadow: 0 0 28px rgba(200, 145, 42, 0.16);
  line-height: 1;
  word-break: keep-all;
  overflow-wrap: normal;
}

h2 {
  margin-bottom: 0.8rem;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 3vw, 2rem);
  color: var(--ink);
  letter-spacing: 0.02em;
}

.eyebrow {
  margin-bottom: 0.4rem;
  color: var(--ember-gold);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.subtle,
.card p,
.task-body p {
  color: var(--muted);
  line-height: 1.5;
}

.subtle {
  word-break: keep-all;
}

.nav {
  display: flex;
  gap: 0.35rem;
  padding: 0.32rem;
  background: rgba(36, 27, 14, 0.72);
  border: 1px solid var(--rule);
  border-radius: 999px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink-3);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.5rem 0.82rem 0.5rem 0.58rem;
  font-weight: 700;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background: rgba(251, 247, 238, 0.72);
  border-color: var(--rule-soft);
  color: var(--ink-2);
}

.chapter-dot {
  width: 1.75rem;
  height: 1.75rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: 50%;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1;
}

.chapter-copy {
  display: grid;
  gap: 0.05rem;
  line-height: 1;
}

.chapter-title {
  font-family: var(--serif);
  font-size: 0.98rem;
}

.chapter-label {
  color: var(--ink-3);
  font-size: 0.68rem;
  font-weight: 700;
}

.nav-link.active {
  background: rgba(42, 32, 17, 0.92);
  border-color: rgba(200, 145, 42, 0.42);
  color: var(--ink);
}

.nav-link.active .chapter-dot {
  background: var(--ember-gold);
  border-color: var(--ember-gold);
  color: var(--vellum-deep);
}

.nav-link.active .chapter-label {
  color: var(--seal);
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.4rem;
}

.status-strip span,
.pill,
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--rule-soft);
  background: rgba(200, 145, 42, 0.08);
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
}

.badge.open {
  color: var(--seal);
  border-color: rgba(138, 58, 37, 0.28);
}

.badge.done {
  color: var(--ink-2);
}

.badge.missed {
  color: var(--seal-2);
}

.badge.carried,
.badge.muted {
  color: var(--ink-4);
}

.grid {
  display: grid;
  gap: 1rem;
}

.two-columns {
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
}

.card,
.focus-card {
  background:
    linear-gradient(145deg, rgba(50, 38, 20, 0.86), rgba(28, 21, 11, 0.94));
  border: 1px solid var(--rule);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: clamp(1.1rem, 3vw, 1.7rem);
  margin-bottom: 1rem;
}

.card.soft {
  background: rgba(200, 145, 42, 0.08);
  box-shadow: none;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.task-form {
  display: grid;
  gap: 0.85rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--rule-soft);
}

.mission-slot-list {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0 0;
  display: grid;
  gap: 0.62rem;
}

.mission-slot {
  display: grid;
  grid-template-columns: 2.35rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  min-height: 3.45rem;
  padding: 0.72rem 0.82rem;
  border: 1px solid var(--rule-soft);
  border-radius: 14px;
  background: rgba(26, 20, 9, 0.58);
}

.slot-roman {
  color: var(--ember-gold);
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
}

.active-slot {
  border-color: rgba(200, 145, 42, 0.78);
  box-shadow: inset 3px 0 0 rgba(200, 145, 42, 0.82), 0 0 0 1px rgba(200, 145, 42, 0.08);
}

.active-slot .slot-roman::after {
  content: '';
  display: inline-block;
  width: 0.42rem;
  height: 1rem;
  margin-left: 0.38rem;
  border-radius: 999px;
  background: var(--ember-gold);
  vertical-align: -0.18rem;
  animation: cursor-blink 1.05s steps(2, start) infinite;
}

.filled-slot {
  background: linear-gradient(90deg, rgba(200, 145, 42, 0.13), rgba(26, 20, 9, 0.52));
}

.empty-slot {
  opacity: 0.62;
}

.slot-copy {
  min-width: 0;
}

.slot-copy strong {
  display: block;
  color: var(--ink);
  line-height: 1.25;
}

.slot-copy p {
  margin: 0.18rem 0 0;
  color: var(--ink-3);
  font-size: 0.88rem;
}

.empty-lines {
  display: grid;
  gap: 0.55rem;
}

.empty-lines span {
  display: block;
  height: 1px;
  background: linear-gradient(90deg, rgba(200, 145, 42, 0.36), rgba(200, 145, 42, 0));
}

.slot-seal {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, #b9342a, var(--seal-red));
  box-shadow: 0 0 18px rgba(139, 26, 26, 0.34);
}

.slot-form {
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr) auto;
  align-items: center;
  gap: 0.55rem;
  padding-top: 0;
  border-top: 0;
}

.slot-form input {
  min-height: 2.65rem;
}

.slot-form .primary {
  min-height: 2.65rem;
  white-space: nowrap;
}

.mission-progress {
  display: grid;
  gap: 0.55rem;
  margin-top: 1rem;
}

.progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ember-gold);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.progress-track {
  height: 0.18rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(200, 145, 42, 0.18);
}

.progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ember-gold), rgba(200, 145, 42, 0.36));
}

@keyframes cursor-blink {
  0%, 45% { opacity: 1; }
  46%, 100% { opacity: 0; }
}

label {
  display: grid;
  gap: 0.45rem;
  color: var(--ink-3);
  font-size: 0.9rem;
  font-weight: 800;
}

input {
  width: 100%;
  border: 1px solid rgba(200, 145, 42, 0.28);
  border-radius: 14px;
  background: rgba(26, 20, 9, 0.74);
  color: var(--ink);
  min-height: 3rem;
  padding: 0 1rem;
  outline: none;
}

input:focus {
  border-color: var(--seal);
  box-shadow: 0 0 0 4px rgba(138, 58, 37, 0.1);
}

input::placeholder {
  color: var(--ink-4);
  opacity: 1;
}

.notice,
.empty {
  border: 1px solid var(--rule-soft);
  border-radius: 18px;
  background: rgba(235, 227, 210, 0.5);
  color: var(--ink-3);
  padding: 1rem;
}

.storage-notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  border: 1px solid var(--rule-soft);
  border-radius: 18px;
  background: rgba(235, 227, 210, 0.5);
  color: var(--ink);
  padding: 0.9rem 1rem;
}

.storage-notice > div {
  min-width: 0;
}

.storage-notice strong {
  display: block;
  line-height: 1.45;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.storage-notice p,
.storage-footnote {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.storage-notice-close {
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0;
  border-radius: 999px;
  flex: 0 0 auto;
}

.storage-footnote {
  padding-top: 0.9rem;
  border-top: 1px solid var(--rule-soft);
  font-size: 0.92rem;
}

.task-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

.task-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: center;
  border: 1px solid var(--rule-soft);
  background: rgba(26, 20, 9, 0.48);
  border-radius: 18px;
  padding: 0.75rem;
}

.task-row.status-done,
.task-row.status-carried {
  opacity: 0.72;
}

.rank {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: rgba(200, 145, 42, 0.12);
  color: var(--ember-gold);
  font-family: var(--serif);
  font-weight: 900;
}

.task-title-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.3rem;
}

.task-body p {
  margin-bottom: 0;
}

.row-actions,
.review-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.focus-card {
  display: grid;
  gap: 1.1rem;
  min-height: 340px;
  align-content: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 18%, rgba(139, 26, 26, 0.38) 0, rgba(139, 26, 26, 0) 9rem),
    linear-gradient(145deg, #20180c, #0f0b05);
  color: var(--ink);
}

.focus-card::before {
  content: '';
  position: absolute;
  top: clamp(1.1rem, 3vw, 1.7rem);
  bottom: clamp(1.1rem, 3vw, 1.7rem);
  left: clamp(1.1rem, 3vw, 1.7rem);
  width: 3px;
  border-radius: 999px;
  background: var(--seal);
}

.focus-card > * {
  position: relative;
  margin-left: clamp(0.9rem, 2vw, 1.35rem);
}

.focus-card .eyebrow,
.focus-card .subtle {
  color: rgba(243, 237, 224, 0.68);
}

.brief-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.seal-device {
  width: 3.7rem;
  height: 3.7rem;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(139, 26, 26, 0.78);
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(173, 42, 34, 0.72), rgba(139, 26, 26, 0.3));
  color: var(--ink-2);
  font-family: var(--serif);
  font-weight: 900;
  box-shadow: 0 0 26px rgba(139, 26, 26, 0.34);
}

.brief-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  max-width: 620px;
  margin: 0;
}

.brief-stats div {
  border: 1px solid rgba(200, 145, 42, 0.2);
  border-radius: 16px;
  background: rgba(200, 145, 42, 0.1);
  padding: 0.8rem;
  text-align: center;
}

.brief-stats dt {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brief-stats dd {
  margin: 0.24rem 0 0;
  color: var(--ember-gold);
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 900;
}

.brief-mission-list {
  list-style: none;
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
}

.brief-mission {
  display: grid;
  grid-template-columns: 2.35rem minmax(0, 1fr) 2rem;
  align-items: center;
  gap: 0.8rem;
  border: 1px solid var(--rule-soft);
  border-radius: 16px;
  background: rgba(26, 20, 9, 0.5);
  padding: 0.8rem;
}

.brief-mission.current {
  border-color: rgba(200, 145, 42, 0.76);
  background: rgba(200, 145, 42, 0.12);
}

.brief-mission.status-done {
  opacity: 0.72;
  text-decoration: line-through;
  text-decoration-color: rgba(200, 145, 42, 0.38);
}

.brief-mission p {
  margin: 0.2rem 0 0;
  color: var(--ink-3);
  font-size: 0.9rem;
}

.brief-check {
  width: 1.65rem;
  height: 1.65rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule-soft);
  border-radius: 50%;
  color: var(--ember-gold);
}

.focus-card h2 {
  max-width: 900px;
  margin-bottom: 0;
  color: #f7ead0;
  font-size: clamp(2.4rem, 7vw, 5.2rem);
  line-height: 0.95;
}

.next-step {
  display: grid;
  gap: 0.4rem;
  max-width: 760px;
  border: 1px solid rgba(200, 145, 42, 0.18);
  border-radius: 18px;
  background: rgba(200, 145, 42, 0.08);
  padding: 1rem;
}

.next-step span {
  color: rgba(243, 237, 224, 0.66);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 800;
}

.next-step strong {
  color: var(--ink);
  font-size: clamp(1.1rem, 3vw, 1.7rem);
}

.focus-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.focus-actions .secondary {
  background: rgba(243, 237, 224, 0.12);
  color: var(--paper);
  border-color: rgba(243, 237, 224, 0.18);
}

.focus-actions .ghost {
  color: var(--paper);
  border-color: rgba(243, 237, 224, 0.26);
}

.center-card {
  text-align: center;
  display: grid;
  justify-items: center;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0;
}

.summary-grid div {
  border: 1px solid var(--rule-soft);
  border-radius: 18px;
  background: rgba(251, 247, 238, 0.54);
  padding: 1rem;
}

.summary-grid dt {
  color: var(--ink-4);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 800;
}

.summary-grid dd {
  margin: 0.3rem 0 0;
  color: var(--ink-2);
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 700;
}

.archive-streak-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-color: rgba(200, 145, 42, 0.5);
}

.archive-streak-banner h2 {
  margin: 0;
  color: var(--ember-gold);
  font-size: clamp(2.4rem, 7vw, 4.6rem);
}

.archive-streak-banner p:last-child {
  margin: 0;
  color: var(--ink-3);
  font-family: var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.archive-seal {
  width: 3.5rem;
  height: 3.5rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: rgba(200, 145, 42, 0.12);
  color: var(--ink-2);
  font-size: 1.4rem;
}

.archive-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.45rem;
}

.calendar-weekday {
  color: var(--ink-4);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 800;
  text-align: center;
}

.calendar-day {
  min-height: 3.1rem;
  display: grid;
  place-items: center;
  position: relative;
  border: 1px solid var(--rule-soft);
  border-radius: 12px;
  background: rgba(26, 20, 9, 0.52);
  color: var(--ink-3);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.82rem;
}

.calendar-day.blank {
  visibility: hidden;
}

.calendar-day.selected {
  border-color: var(--ember-gold);
  color: var(--ember-gold);
}

.calendar-day.sealed i {
  width: 0.72rem;
  height: 0.72rem;
  position: absolute;
  top: 0.38rem;
  right: 0.38rem;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 34%, #b9342a, var(--seal-red));
  box-shadow: 0 0 12px rgba(139, 26, 26, 0.35);
}

.recent-record-list {
  list-style: none;
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
}

.recent-record-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  border: 1px solid var(--rule-soft);
  border-radius: 14px;
  background: rgba(26, 20, 9, 0.5);
  padding: 0.75rem;
}

.recent-record-list strong,
.recent-record-list span {
  display: block;
}

.recent-record-list span {
  color: var(--ink-3);
  font-size: 0.86rem;
}

.record-seals {
  display: inline-flex !important;
  gap: 0.22rem;
  flex: 0 0 auto;
}

.record-seals i {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: rgba(200, 145, 42, 0.18);
}

.record-seals i.filled {
  background: var(--ember-gold);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(18px);
  opacity: 0;
  pointer-events: none;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  box-shadow: var(--shadow);
  padding: 0.8rem 1rem;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.auth-panel,
.sync-badge,
.sync-notice,
.notice,
.empty,
.storage-notice,
.readonly-banner,
.summary-grid div {
  background: rgba(26, 20, 9, 0.7);
  border-color: var(--rule-soft);
  color: var(--ink);
}

.secondary {
  background: rgba(200, 145, 42, 0.1);
  color: var(--ink-2);
  border-color: var(--rule);
}

.ghost {
  color: var(--ink-3);
  border-color: var(--rule-soft);
}

.route-plan .task-row:first-child,
.route-focus .task-row.status-open:first-child {
  border-color: rgba(200, 145, 42, 0.62);
  box-shadow: inset 0 0 0 1px rgba(200, 145, 42, 0.16);
}

.task-list-card .task-list {
  counter-reset: mission-order;
}

.task-list-card .rank,
.task-row .rank {
  font-variant-numeric: tabular-nums;
}

@media (max-width: 860px) {
  .topbar,
  .card-header,
  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    gap: 0.85rem;
    margin-bottom: 1rem;
  }

  .topbar-actions,
  .header-actions {
    gap: 0.5rem;
  }

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

  .nav,
  .header-actions,
  .auth-panel,
  .sync-badge {
    width: 100%;
    justify-content: space-between;
  }

  .nav-link,
  .header-actions button {
    flex: 1;
    text-align: center;
  }

  .nav-link {
    justify-content: center;
    min-width: 0;
    padding-inline: 0.45rem;
  }

  .nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .chapter-title {
    font-size: 0.86rem;
  }

  .chapter-label {
    display: none;
  }

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

  .status-strip span {
    justify-content: center;
  }

  .status-strip span:first-child {
    grid-column: 1 / -1;
  }

  .auth-panel,
  .sync-notice {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    gap: 0.55rem;
    padding: 0.72rem;
  }

  .auth-helper {
    margin-top: 0.15rem;
    font-size: 0.8rem;
  }

  .sync-notice {
    align-items: stretch;
    flex-direction: column;
  }

  .auth-actions,
  .auth-inline-form {
    width: 100%;
  }

  .auth-inline-form input,
  .auth-inline-form button {
    flex: 1 1 180px;
  }

  .mission-slot {
    grid-template-columns: 2rem minmax(0, 1fr);
    align-items: start;
  }

  .slot-form {
    grid-template-columns: 1fr;
  }

  .slot-seal {
    grid-column: 1 / -1;
    justify-self: end;
  }

  .task-row {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .storage-notice {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
  }

  .row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

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

.readonly-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(138, 58, 37, 0.3);
  border-radius: 20px;
  background: rgba(235, 227, 210, 0.64);
  color: var(--ink);
  padding: 1rem;
}

.readonly-banner p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.empty-review {
  min-height: 260px;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

@media (max-width: 860px) {
  .readonly-banner {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 359px) {
  .auth-inline-form {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-inline-form input,
  .auth-inline-form button,
  .header-actions button,
  .nav-link,
  .sync-badge {
    width: 100%;
  }

  .sync-badge[data-sync-state="synced"] .sync-badge-label {
    display: none;
  }

  .sync-badge[data-sync-state="synced"] .sync-badge-label-short {
    display: inline;
  }
}
