/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* === DESIGN TOKENS === */
:root {
  /* Surfaces — warm dark ink (chroma toward warm hue) */
  --bg:        oklch(0.16 0.012 35);
  --surface:   oklch(0.21 0.010 35);
  --surface-2: oklch(0.26 0.008 35);
  --hairline:  oklch(0.32 0.012 35);

  /* Ink (text) — warm cream */
  --ink:    oklch(0.94 0.012 80);
  --ink-2:  oklch(0.78 0.018 70);
  --ink-3:  oklch(0.55 0.015 60);

  /* Accent — Japanese vermillion (朱 shu) */
  --shu:        oklch(0.66 0.19 28);
  --shu-hover:  oklch(0.72 0.19 28);
  --shu-glow:   oklch(0.66 0.19 28 / 0.18);
  --shu-quiet:  oklch(0.66 0.19 28 / 0.4);

  /* Functional */
  --good: oklch(0.78 0.14 142);
  --bad:  oklch(0.66 0.21 25);
  --warn: oklch(0.82 0.16 80);

  /* Type */
  --serif-jp: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", "Times New Roman", serif;
  --sans:     "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono:     ui-monospace, "SF Mono", Menlo, monospace;

  /* Easing — ease-out-quart, ease-out-quint */
  --ease:      cubic-bezier(0.22, 1, 0.36, 1);
  --ease-fast: cubic-bezier(0.16, 1, 0.3, 1);
}

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 1100px 720px at 50% -240px,
      oklch(0.24 0.018 35 / 0.55), transparent 60%),
    var(--bg);
}

#app {
  max-width: 760px;
  margin: 0 auto;
  padding: 36px 24px 96px;
}

/* === TOPBAR === */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 28px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--hairline);
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.brand .jp {
  font-family: var(--serif-jp);
  font-size: 28px;
  font-weight: 700;
  color: var(--shu);
  letter-spacing: 0.04em;
  line-height: 1;
}
.brand .latin {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-3);
}
.stats {
  display: flex;
  gap: 28px;
  font-feature-settings: "tnum";
}
.stats span {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-3);
}
.stats b {
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
  font-feature-settings: "tnum";
}
.back {
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--ink-3);
  padding: 6px 16px 7px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 200ms var(--ease), border-color 200ms var(--ease);
}
.back:hover { color: var(--shu); border-color: var(--shu-quiet); }

/* === SECTION HEADERS === */
h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-2);
  margin: 56px 0 8px;
}
h2:first-child { margin-top: 0; }
h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hairline);
}

/* === HOME — SECTION ROWS (editorial, not card grid) === */
.section-row {
  display: flex;
  align-items: stretch;
  gap: 32px;
  padding: 22px 0 26px;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
  cursor: pointer;
  border-radius: 10px;
  transition: background 240ms var(--ease);
  border-bottom: 1px solid var(--hairline);
  border-radius: 0;
}
.section-row:last-of-type { border-bottom: none; }
.section-row:hover { background: var(--surface); border-radius: 10px; border-bottom-color: transparent; }
.section-row .meta { flex: 1; display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.section-row .title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  line-height: 1.2;
}
.section-row .sub {
  font-size: 13.5px;
  color: var(--ink-3);
  line-height: 1.55;
  max-width: 56ch;
}
.section-row .glyph-row {
  font-family: var(--serif-jp);
  font-size: 32px;
  color: var(--ink-2);
  letter-spacing: 0.22em;
  margin-top: 6px;
  line-height: 1;
}
.section-row .end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  min-width: 130px;
}
.section-row .pct {
  font-size: 38px;
  font-weight: 200;
  letter-spacing: -0.04em;
  font-feature-settings: "tnum";
  color: var(--ink);
  line-height: 1;
}
.section-row .pct .of { font-size: 14px; color: var(--ink-3); margin-left: 2px; }
.section-row .progress-bar {
  width: 130px;
  height: 2px;
  background: var(--hairline);
  position: relative;
  overflow: hidden;
}
.section-row .progress-bar::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--shu);
  width: var(--p, 0%);
  transition: width 700ms var(--ease);
}
.section-row .arrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--shu);
  display: inline-flex;
  gap: 6px;
}
.section-row.locked { cursor: not-allowed; opacity: 0.35; }
.section-row.locked:hover { background: transparent; }

/* === SET PICKER === */
.set-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 16px;
}
.set-card {
  position: relative;
  background: var(--surface);
  border: 1.5px solid transparent;
  border-radius: 12px;
  padding: 16px 18px 14px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--ink);
  transition: border-color 200ms var(--ease), background 200ms var(--ease), transform 200ms var(--ease);
}
.set-card:hover { border-color: var(--shu-quiet); transform: translateY(-1px); }
.set-card.selected {
  background: var(--shu-glow);
  border-color: var(--shu);
}
.set-card.selected::after {
  content: "✓";
  position: absolute;
  top: 12px;
  right: 14px;
  color: var(--shu);
  font-weight: 700;
  font-size: 13px;
}
.set-card .set-title {
  font-size: 15.5px;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: -0.005em;
  padding-right: 28px;
}
.set-card .set-meta {
  font-size: 12px;
  color: var(--ink-3);
  font-feature-settings: "tnum";
  letter-spacing: 0.02em;
}

/* === DRILL SCREEN === */
.drill {
  text-align: center;
  padding: 16px 0 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.progress-thin {
  width: 100%;
  max-width: 520px;
  height: 3px;
  background: var(--hairline);
  border-radius: 2px;
  position: relative;
  margin-bottom: 56px;
  overflow: hidden;
}
.progress-thin .fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--shu);
  border-radius: 2px;
  transition: width 360ms var(--ease);
}
.progress-thin .marks {
  position: absolute;
  inset: 0;
  display: flex;
  pointer-events: none;
}
.progress-thin .marks span {
  flex: 1;
  border-right: 1px solid var(--bg);
}
.progress-thin .marks span:last-child { border-right: none; }

.prompt-meta {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-3);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.prompt-meta .lesson-tag {
  color: var(--shu);
  font-weight: 700;
  font-feature-settings: "tnum";
}
.prompt-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); }

.instruction {
  font-size: 13.5px;
  color: var(--ink-2);
  margin: 0 0 4px;
  letter-spacing: 0.01em;
}
.context-prompt {
  font-size: 19px;
  color: var(--ink);
  margin: 8px auto 28px;
  max-width: 540px;
  line-height: 1.5;
  font-weight: 400;
  letter-spacing: -0.005em;
}

.prompt {
  font-family: var(--serif-jp);
  color: var(--ink);
  margin: 8px 0 40px;
  line-height: 1.05;
  font-weight: 500;
}
.prompt.kana { font-size: 168px; letter-spacing: -0.01em; }
.prompt.vocab { font-size: 64px; line-height: 1.15; letter-spacing: -0.01em; }
.prompt.sentence {
  font-size: 36px;
  line-height: 1.5;
  font-weight: 400;
  word-break: keep-all;
  max-width: 600px;
  margin: 8px auto 36px;
}

.input {
  width: 100%;
  max-width: 360px;
  font-size: 28px;
  padding: 10px 12px 14px;
  text-align: center;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--hairline);
  color: var(--ink);
  outline: none;
  font-family: var(--sans);
  letter-spacing: 0.06em;
  caret-color: var(--shu);
  transition: border-color 200ms var(--ease);
}
.input:focus { border-bottom-color: var(--shu); }
.input.right { border-bottom-color: var(--good); }
.input.wrong { border-bottom-color: var(--bad); }

.feedback {
  margin-top: 18px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  min-height: 24px;
}
.feedback.right { color: var(--good); }
.feedback.wrong { color: var(--bad); }
.feedback b {
  font-family: var(--serif-jp);
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0;
  margin-left: 14px;
  text-transform: none;
}

.hint-line {
  margin-top: 16px;
  font-size: 14px;
  color: var(--warn);
  max-width: 520px;
  line-height: 1.55;
  letter-spacing: 0;
}

.idk-btn {
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--ink-3);
  padding: 7px 18px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-top: 28px;
  transition: color 180ms var(--ease), border-color 180ms var(--ease);
}
.idk-btn:hover { color: var(--warn); border-color: var(--warn); }
.idk-btn .kbd { margin-left: 10px; opacity: 0.7; }

/* Wölfle hand-drawn mnemonic shown on wrong-state for kana drills. */
.mnemonic {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  background: oklch(0.98 0.012 90);
  border-radius: 12px;
  max-width: 520px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.18);
  animation: mnem-fade-in 320ms var(--ease);
}
.mnemonic-img {
  width: 150px;
  height: auto;
  border-radius: 6px;
  flex-shrink: 0;
  background: #fff;
}
.mnemonic-caption {
  font-family: var(--sans);
  font-size: 16px;
  color: #1a1a1a;
  line-height: 1.4;
  font-weight: 500;
}
@keyframes mnem-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Confetti burst on correct answer — 18 particles fly out & fade. */
.confetti {
  position: fixed;
  top: 38%;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 9999;
}
.confetti span {
  position: absolute;
  top: 0;
  left: 0;
  width: 10px;
  height: 14px;
  background: var(--c);
  border-radius: 2px;
  transform: translate(-50%, -50%);
  animation: confetti-fly var(--d) cubic-bezier(0.16, 0.84, 0.44, 1) forwards;
}
@keyframes confetti-fly {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.3) rotate(0deg); }
  10%  { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.9) rotate(var(--rot)); }
}

/* Green glow flash on the prompt for correct answers (kana-mode is most prominent). */
.input.right {
  border-color: var(--good) !important;
  color: var(--good);
  box-shadow: 0 0 28px oklch(0.78 0.14 142 / 0.45);
  animation: right-flash 650ms var(--ease);
}
@keyframes right-flash {
  0%   { box-shadow: 0 0 0 oklch(0.78 0.14 142 / 0); }
  20%  { box-shadow: 0 0 32px oklch(0.78 0.14 142 / 0.6); }
  100% { box-shadow: 0 0 18px oklch(0.78 0.14 142 / 0.3); }
}

.next-btn {
  display: inline-block;
  padding: 10px 26px;
  background: var(--shu);
  color: #fff;
  border: none;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 180ms var(--ease);
}
.next-btn:hover { background: var(--shu-hover); }

/* Self-rating action rows — schwierig / einfach / kann ich. */
.ask-actions, .wrong-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
  align-items: center;
}
.ask-actions { margin-top: 28px; }
.rate-btn {
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--ink-2);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.04em;
  transition: color 150ms var(--ease), border-color 150ms var(--ease), background 150ms var(--ease);
}
.rate-btn:hover { color: var(--ink); }
.rate-cando { border-color: oklch(0.78 0.14 142 / 0.5); color: var(--good); }
.rate-cando:hover { background: oklch(0.78 0.14 142 / 0.10); border-color: var(--good); }
.rate-hard { border-color: oklch(0.82 0.16 80 / 0.5); color: var(--warn); }
.rate-hard:hover { background: oklch(0.82 0.16 80 / 0.10); border-color: var(--warn); }
.rate-hard.on {
  background: oklch(0.82 0.16 80 / 0.18);
  border-color: var(--warn);
  color: var(--warn);
  font-weight: 600;
  box-shadow: 0 0 0 1px var(--warn) inset;
}
.ask-actions .idk-btn { margin-top: 0; }

.kbd-tip {
  margin-top: 36px;
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}
.kbd {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--hairline);
  padding: 1px 7px 2px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
  vertical-align: middle;
}

/* === MULTIPLE CHOICE === */
.mc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}
.mc-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1.5px solid transparent;
  border-radius: 10px;
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms var(--ease), background 160ms var(--ease), transform 160ms var(--ease);
  min-height: 60px;
}
.mc-btn:hover:not(:disabled) {
  border-color: var(--shu-quiet);
  background: var(--surface-2);
  transform: translateY(-1px);
}
.mc-btn:disabled { cursor: default; }
.mc-btn.right { border-color: var(--good); background: oklch(0.78 0.14 142 / 0.10); }
.mc-btn.wrong { border-color: var(--bad);  background: oklch(0.66 0.21 25 / 0.10); }
.mc-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--ink-3);
  flex-shrink: 0;
}
.mc-btn:hover:not(:disabled) .mc-num { color: var(--shu); border-color: var(--shu-quiet); }
.mc-btn.right .mc-num { background: var(--good); color: oklch(0.18 0.012 35); border-color: var(--good); }
.mc-btn.wrong .mc-num { background: var(--bad);  color: oklch(0.18 0.012 35); border-color: var(--bad); }
.mc-text { flex: 1; }

/* === COMPLETE === */
.complete {
  text-align: center;
  padding: 48px 0 24px;
  animation: completeIn 700ms var(--ease);
}
@keyframes completeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.complete .glyph {
  font-family: var(--serif-jp);
  font-size: 120px;
  color: var(--shu);
  margin-bottom: 16px;
  font-weight: 500;
  line-height: 1;
}
.complete .score {
  font-size: 64px;
  font-weight: 200;
  letter-spacing: -0.04em;
  font-feature-settings: "tnum";
  color: var(--ink);
  line-height: 1;
  margin-bottom: 6px;
}
.complete .score b { color: var(--shu); font-weight: 600; }
.complete .total { color: var(--ink-3); font-size: 18px; }
.complete .xp {
  font-size: 11px;
  color: var(--warn);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin: 18px 0 36px;
}

/* === BUTTONS === */
.btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn {
  padding: 13px 26px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 180ms var(--ease), transform 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease);
}
.btn-primary {
  background: var(--shu);
  color: oklch(0.97 0.01 60);
}
.btn-primary:hover:not(:disabled) {
  background: var(--shu-hover);
  transform: translateY(-1px);
}
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-secondary {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--hairline);
}
.btn-secondary:hover { color: var(--ink); border-color: var(--shu-quiet); }

/* === CHIPS === */
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--ink-2);
  padding: 6px 14px 7px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.04em;
  transition: all 160ms var(--ease);
}
.chip:hover { color: var(--ink); border-color: var(--shu-quiet); }
.chip.on { background: var(--shu); color: oklch(0.97 0.01 60); border-color: var(--shu); }

/* === GRAMMAR === */
.grammar-lesson { margin-bottom: 24px; }
.grammar-lesson h3 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--shu);
  margin: 28px 0 12px;
}
.topic-intro {
  font-size: 12.5px;
  color: var(--ink-2);
  margin: 6px 0 8px;
  line-height: 1.55;
  font-weight: 400;
  white-space: pre-line;
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--hairline) transparent;
}
.topic-intro::-webkit-scrollbar { width: 4px; }
.topic-intro::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 2px; }

/* Mündlich exam-day highlight */
.section-row.exam-row {
  border-color: var(--shu-quiet);
  background:
    linear-gradient(135deg, var(--shu-glow) 0%, transparent 50%),
    var(--surface);
}
.section-row.exam-row .title { color: var(--shu); }
.section-row.exam-row .arrow { color: var(--shu-hover); }
.picker-bar {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, var(--bg) 75%, transparent);
  padding: 24px 0 8px;
  margin-top: 32px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.picker-bar .spacer { flex: 1; }

/* === LESSON CHIP (drill prompt) === */
.lesson-chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px 3px;
  background: transparent;
  color: var(--shu);
  border: 1px solid var(--shu-quiet);
  border-radius: 4px;
  vertical-align: middle;
  margin-right: 14px;
  letter-spacing: 0.12em;
  font-family: var(--sans);
}

/* === STREAK PULSE === */
@keyframes statBump {
  0%   { transform: scale(1);    color: var(--ink); }
  35%  { transform: scale(1.22); color: var(--shu); }
  100% { transform: scale(1);    color: var(--ink); }
}
.stats b.bumped { animation: statBump 700ms var(--ease); display: inline-block; }

/* === RESPONSIVE === */
@media (max-width: 560px) {
  #app { padding: 20px 16px 80px; }
  .topbar { padding-bottom: 20px; margin-bottom: 24px; }
  .stats { gap: 16px; }
  .prompt.kana     { font-size: 116px; }
  .prompt.vocab    { font-size: 44px; }
  .prompt.sentence { font-size: 26px; }
  .set-grid { grid-template-columns: 1fr; }
  .mc-grid  { grid-template-columns: 1fr; }
  .section-row { flex-direction: column; gap: 14px; padding: 18px 12px; margin: 0 -12px; }
  .section-row .end { align-items: flex-start; flex-direction: row; gap: 16px; }
  .section-row .progress-bar { width: 100px; }
  .complete .glyph { font-size: 96px; }
  .complete .score { font-size: 52px; }
}

/* === SYNC WIDGET === */
#sync-badge {
  position: fixed; bottom: 14px; right: 14px; z-index: 1000;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px;
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--hairline); cursor: pointer;
  font: 500 12px/1 "Inter", system-ui, sans-serif;
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.25);
}
#sync-badge:hover { color: var(--ink); border-color: var(--ink-3); }
#sync-badge-icon { font-size: 13px; opacity: 0.8; }
#sync-badge-status { letter-spacing: 0.02em; }
#sync-badge-status[data-status="saving"] { color: var(--shu); }
#sync-badge-status[data-status="error"]  { color: #ff7a7a; }
#sync-badge-status[data-status="off"]    { color: var(--ink-3); }

#sync-dialog {
  position: fixed; inset: 0; z-index: 1001;
  background: rgb(0 0 0 / 0.55); backdrop-filter: blur(2px);
  display: none; align-items: center; justify-content: center;
  padding: 16px;
}
#sync-dialog.open { display: flex; }
#sync-dialog-card {
  width: 100%; max-width: 420px;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 14px; padding: 18px;
  font: 400 14px/1.4 "Inter", system-ui, sans-serif; color: var(--ink);
  box-shadow: 0 24px 80px rgb(0 0 0 / 0.5);
}
#sync-dialog-card h3 { font-size: 16px; margin-bottom: 4px; }
#sync-dialog-card .sync-hint { color: var(--ink-2); font-size: 12px; margin-bottom: 12px; }
#sync-dialog-card .sync-label { color: var(--ink-3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }
#sync-dialog-card .sync-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; flex-wrap: wrap; }
#sync-dialog-card .sync-row-buttons { justify-content: flex-end; }
#sync-dialog-card code {
  flex: 1; min-width: 0; padding: 6px 10px; border-radius: 6px;
  background: var(--bg); color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
  word-break: break-all;
}
#sync-dialog-card input {
  flex: 1; min-width: 0; padding: 8px 10px; border-radius: 8px;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--hairline);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em;
}
#sync-dialog-card input:focus { outline: none; border-color: var(--shu); }
#sync-dialog-card button {
  padding: 7px 12px; border-radius: 8px; cursor: pointer;
  background: var(--surface-2); color: var(--ink); border: 1px solid var(--hairline);
  font: 500 12px/1 "Inter", system-ui, sans-serif;
}
#sync-dialog-card button:hover { border-color: var(--ink-3); }
#sync-dialog-card .sync-danger { color: #ff9a9a; }
#sync-dialog-card .sync-sep { height: 1px; background: var(--hairline); margin: 12px 0; }
