:root {
  color-scheme: light;
  --bg: #f2f4f6;
  --surface: #ffffff;
  --surface-sub: #f9fafb;
  --line: #e5e8eb;
  --couple: #d1245c;
  --couple-soft: #ffe8ef;
  --sat: #3d73e0;
  --text-strong: #191f28;
  --text-sub: #4e5968;
  --text-faint: #646f7d;
  --accent: #3182f6;
  --accent-hover: #1b64da;
  --accent-fill: #1b64da;
  --accent-fill-hover: #1957c2;
  --bad-ink: #d42a3a;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --accent-soft: #e8f3ff;
  --series-1: #3182f6;
  --series-2: #eb6834;
  --good: #03b26c;
  --good-soft: #e5f8ef;
  --warn: #c98500;
  --warn-soft: #fff5de;
  --bad: #f04452;
  --bad-soft: #ffeeee;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #101013;
    --surface: #1c1c21;
    --surface-sub: #26262c;
    --line: #2f2f37;
    --couple: #ff94b3;
    --couple-soft: #3a1f29;
    --sat: #7da6ff;
    --text-strong: #f4f4f6;
    --text-sub: #b0b0b8;
    --text-faint: #8f8f99;
    --accent: #4593fc;
    --accent-hover: #64a8ff;
    --accent-fill: #2a72e0;
    --accent-fill-hover: #3a80ec;
    --bad-ink: #c93542;
    --accent-soft: #15294a;
    --series-1: #4593fc;
    --series-2: #d95926;
    --good: #18c47e;
    --good-soft: #10301f;
    --warn: #e0a31a;
    --warn-soft: #33290f;
    --bad: #fa616d;
    --bad-soft: #3a1a1e;
  }
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #101013;
    --surface: #1c1c21;
    --surface-sub: #26262c;
    --line: #2f2f37;
    --couple: #ff94b3;
    --couple-soft: #3a1f29;
    --sat: #7da6ff;
    --text-strong: #f4f4f6;
    --text-sub: #b0b0b8;
    --text-faint: #8f8f99;
    --accent: #4593fc;
    --accent-hover: #64a8ff;
    --accent-fill: #2a72e0;
    --accent-fill-hover: #3a80ec;
    --bad-ink: #c93542;
    --accent-soft: #15294a;
    --series-1: #4593fc;
    --series-2: #d95926;
    --good: #18c47e;
    --good-soft: #10301f;
    --warn: #e0a31a;
    --warn-soft: #33290f;
    --bad: #fa616d;
    --bad-soft: #3a1a1e;
  }

* { box-sizing: border-box; }

html, body, #root { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-strong);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum";
}

button, input, textarea { font: inherit; color: inherit; }

.shell { display: flex; height: 100%; }

.side {
  width: 232px;
  flex: none;
  padding: 24px 12px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; font-size: 20px; font-weight: 600; color: var(--text-strong); padding: 0 12px 20px; letter-spacing: -0.01em; }

.nav {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--text-sub);
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
  white-space: nowrap;
}
.nav:hover { background: var(--surface-sub); }
.nav.active { background: var(--accent-soft); color: var(--accent); }

.side-foot { margin-top: auto; }
.version { padding: 0 12px 4px; color: var(--text-faint); font-size: 12px; }
.link-button { background: none; border: 0; height: 36px; padding: 0 12px; color: var(--text-faint); cursor: pointer; font-weight: 500; border-radius: 10px; width: 100%; text-align: left; }
.link-button:hover { background: var(--surface-sub); }

.main { flex: 1; min-width: 0; overflow-y: auto; padding: 32px 32px 64px; }
.main.flush { padding: 0; overflow: hidden; }
.content { max-width: 1160px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }

.page-title { font-size: 26px; font-weight: 600; color: var(--text-strong); margin: 0; letter-spacing: -0.02em; }
.page-sub { color: var(--text-sub); margin: 4px 0 0; }

.card { background: var(--surface); border-radius: 20px; padding: 24px; min-width: 0; }
.card-title { font-size: 17px; font-weight: 600; color: var(--text-strong); margin: 0 0 16px; }

.grid { display: grid; gap: 16px; }
.grid-tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.grid-charts { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }

.tile-label { color: var(--text-sub); font-size: 14px; font-weight: 500; }
.tile-value { font-size: 28px; font-weight: 600; color: var(--text-strong); letter-spacing: -0.02em; margin-top: 4px; }
.tile-note { color: var(--text-faint); font-size: 13px; margin-top: 2px; }

.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-label { fill: var(--text-faint); font-size: 11px; }
.chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .series-1 { stroke: var(--series-1); }
.chart .series-2 { stroke: var(--series-2); }
.chart .dot-1 { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.chart .dot-2 { fill: var(--series-2); stroke: var(--surface); stroke-width: 2; }
.chart .cross { stroke: var(--text-faint); stroke-width: 1; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.chart-head .card-title { margin: 0; }
.chart-now { color: var(--text-strong); font-weight: 600; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--text-sub); margin-top: 8px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; }
.swatch-1 { background: var(--series-1); }
.swatch-2 { background: var(--series-2); }
.tooltip {
  position: absolute;
  top: 8px;
  pointer-events: none;
  background: var(--text-strong);
  color: var(--surface);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 2;
}
.empty { color: var(--text-faint); padding: 32px 0; text-align: center; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 8px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-good { color: var(--good); background: var(--good-soft); }
.badge-warn { color: var(--warn); background: var(--warn-soft); }
.badge-bad { color: var(--bad); background: var(--bad-soft); }
.badge-off { color: var(--text-sub); background: var(--surface-sub); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; color: var(--text-faint); font-size: 13px; padding: 8px 12px 8px 0; white-space: nowrap; }
td { padding: 10px 12px 10px 0; border-top: 1px solid var(--line); white-space: nowrap; }
td.name { color: var(--text-strong); font-weight: 500; }
td.dim, tr.stopped td { color: var(--text-faint); }
td.num, th.num { text-align: right; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
.kv .k { color: var(--text-sub); }
.kv .v { margin: 0; color: var(--text-strong); font-weight: 500; word-break: break-all; }

.login { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 12px; }
.field { width: 100%; padding: 12px 16px; border: 0; border-radius: 12px; background: var(--surface-sub); outline: 2px solid transparent; }
.field:focus { outline-color: var(--accent); }
.button { border: 0; border-radius: 12px; padding: 12px 20px; font-weight: 600; background: var(--accent-fill); color: #fff; cursor: pointer; transition: background-color 0.15s var(--ease), transform 0.15s var(--ease); }
.button:hover { background: var(--accent-fill-hover); }
.button:active:not(:disabled) { transform: scale(0.98); }
a.button { display: block; text-align: center; text-decoration: none; }
.button:disabled { opacity: 0.45; cursor: default; }
.button-sub { background: var(--surface-sub); color: var(--text-strong); }
.button-sub:hover { background: var(--line); }
.error { color: var(--bad); font-size: 14px; }

.chat { display: grid; grid-template-columns: 1fr 268px; gap: 16px; height: calc(100vh - 100px); max-width: 1160px; margin: 0 auto; }
.chat-main { display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }
.messages { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.bubble { padding: 12px 16px; border-radius: 16px; max-width: 82%; white-space: pre-wrap; word-break: break-word; }
.bubble-user { align-self: flex-end; background: var(--accent-fill); color: #fff; }
.bubble-assistant { align-self: flex-start; background: var(--surface-sub); color: var(--text-strong); }
.bubble-meta { align-self: flex-start; color: var(--text-faint); font-size: 12px; margin-top: -4px; }
.composer { display: flex; gap: 8px; padding: 16px; border-top: 1px solid var(--line); align-items: flex-end; }
.composer textarea { flex: 1; resize: none; }
.settings { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.settings label { display: flex; flex-direction: column; gap: 4px; color: var(--text-sub); font-size: 14px; font-weight: 500; }

.frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }

@media (max-width: 820px) {
  .shell { flex-direction: column; }
  .side { width: auto; flex-direction: row; padding: 8px 16px; overflow-x: auto; align-items: center; }
  .brand { padding: 0 12px 0 0; font-size: 17px; }
  .side-foot { margin: 0 0 0 auto; display: flex; align-items: center; }
  .version { padding: 0 4px; }
  .side-foot .link-button { white-space: nowrap; }
  .main { padding: 20px 16px 48px; }
  .grid-charts { grid-template-columns: 1fr; }
  .chat { grid-template-columns: 1fr; height: auto; }
  .chat-main { height: 70vh; }
}

.image-layout { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
.image-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; min-width: 0; }
.image-result { display: block; width: 100%; height: auto; border-radius: 12px; background: var(--surface-sub); }
.image-prompt { color: var(--text-strong); margin-top: 12px; word-break: break-word; }
.image-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--text-faint); font-size: 13px; margin-top: 4px; }
.image-save { color: var(--accent-fill); font-weight: 600; text-decoration: none; white-space: nowrap; }
.option-label { color: var(--text-sub); font-size: 14px; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 0; border-radius: 10px; padding: 8px 12px; background: var(--surface-sub); color: var(--text-strong); cursor: pointer; font-size: 13px; font-weight: 500; transition: background-color 0.15s var(--ease), color 0.15s var(--ease); }
.chip.active { background: var(--text-strong); color: var(--surface); }

@media (max-width: 820px) {
  .image-layout { grid-template-columns: 1fr; }
}

.notice { color: var(--good); font-size: 14px; }
.check { flex-direction: row !important; align-items: center; gap: 8px !important; }
.button-danger { background: var(--bad-ink); }
.button-danger:hover { background: var(--bad-ink); opacity: 0.9; }
.chip:disabled { opacity: 0.45; cursor: default; }

.brand-icon { width: 28px; height: 28px; }
.login-icon { width: 56px; height: 56px; }

.power { max-width: 420px; }


.nav-children { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 4px; }
.nav.nav-child { height: 32px; padding: 0 12px 0 28px; font-size: 14px; }
.nav.nav-parent.active { background: transparent; color: var(--couple); }
.couple-subnav { display: none; }
.nav.nav-child.active { background: var(--couple-soft); color: var(--couple); }

.main.tone-couple {
  --c-accent: #ff5c8a;
  --c-accent-strong: #f03e73;
  --c-soft: #ffe8ef;
  --c-bg: #fff6f8;
  --c-card: #ffffff;
  --c-line: #f6dde4;
  --c-text: #3a2a30;
  --c-sub: #8c7179;
  --c-plan: #ff5c8a;
  --c-record: #2bbf9b;
  --c-anniversary: #ff9f43;
  --c-milestone: #8b7cf6;
  --c-plan-soft: #ffe8ef;
  --c-milestone-soft: #eeebff;
  --c-anniversary-soft: #fff1e2;
  --c-accent-ink: #d1245c;
  --c-accent-ink-hover: #b81e4f;
  --c-plan-ink: #d1245c;
  --c-record-ink: #0f7f66;
  --c-anniversary-ink: #b35600;
  --c-milestone-ink: #6b5ce7;
  --c-on-ink: #ffffff;
  --c-hero: #c92a5f;
  background: var(--c-bg);
  color: var(--c-text);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav.nav-child.active { background: #3a1f29; color: #ff94b3; }
  :root:not([data-theme="light"]) .main.tone-couple {
    --c-accent: #ff7aa0;
    --c-accent-strong: #ff94b3;
    --c-soft: #3a1f29;
    --c-bg: #17121a;
    --c-card: #221a24;
    --c-line: #33262f;
    --c-text: #f3e9ee;
    --c-sub: #b39aa5;
    --c-plan: #ff7aa0;
    --c-record: #3fd3ae;
    --c-anniversary: #ffb469;
    --c-milestone: #a397ff;
    --c-plan-soft: #3a1f29;
    --c-milestone-soft: #2a2545;
    --c-anniversary-soft: #3a2a1a;
    --c-accent-ink: #ff7aa0;
    --c-accent-ink-hover: #ff94b3;
    --c-plan-ink: #ff7aa0;
    --c-record-ink: #3fd3ae;
    --c-anniversary-ink: #ffb469;
    --c-milestone-ink: #a397ff;
    --c-on-ink: #17121a;
    --c-hero: #5a1f35;
  }
}

:root[data-theme="dark"] .nav.nav-child.active { background: #3a1f29; color: #ff94b3; }
  :root[data-theme="dark"] .main.tone-couple {
    --c-accent: #ff7aa0;
    --c-accent-strong: #ff94b3;
    --c-soft: #3a1f29;
    --c-bg: #17121a;
    --c-card: #221a24;
    --c-line: #33262f;
    --c-text: #f3e9ee;
    --c-sub: #b39aa5;
    --c-plan: #ff7aa0;
    --c-record: #3fd3ae;
    --c-anniversary: #ffb469;
    --c-milestone: #a397ff;
    --c-plan-soft: #3a1f29;
    --c-milestone-soft: #2a2545;
    --c-anniversary-soft: #3a2a1a;
    --c-accent-ink: #ff7aa0;
    --c-accent-ink-hover: #ff94b3;
    --c-plan-ink: #ff7aa0;
    --c-record-ink: #3fd3ae;
    --c-anniversary-ink: #ffb469;
    --c-milestone-ink: #a397ff;
    --c-on-ink: #17121a;
    --c-hero: #5a1f35;
  }


.couple { width: 100%; display: flex; flex-direction: column; gap: 16px; }
.couple-head { display: flex; align-items: center; gap: 16px; margin-bottom: 4px; }
.couple-head-icon { width: 52px; height: 52px; border-radius: 16px; object-fit: cover; }
.couple-title { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; color: var(--c-text); }
.couple-sub { color: var(--c-sub); font-size: 14px; }
.couple-toast { align-self: flex-start; padding: 8px 16px; border-radius: 999px; background: var(--c-soft); color: var(--c-accent-strong); font-size: 14px; font-weight: 500; }
.couple-toast.bad { background: var(--bad-soft); color: var(--bad); }
.couple-empty { color: var(--c-sub); text-align: center; padding: 24px 0; font-size: 14px; }
.couple-faint { color: var(--c-sub); font-size: 13px; }

.couple-card { background: var(--c-card); border-radius: 20px; padding: 20px; box-shadow: inset 0 0 0 1px var(--c-line); min-width: 0; }

.couple-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px; border-radius: 20px; color: #fff; background: var(--c-hero); }
.couple-hero-label { font-size: 15px; font-weight: 500; opacity: 0.9; }
.couple-hero-days { font-size: 44px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.couple-hero-since { font-size: 14px; opacity: 0.9; margin-top: 4px; }
.couple-hero-icon { width: 96px; height: 96px; border-radius: 20px; object-fit: cover; flex-shrink: 0; }

.couple-shortcuts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.couple-shortcut { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px; border-radius: 20px; background: var(--c-card); color: var(--c-text); text-decoration: none; font-weight: 500; font-size: 14px; box-shadow: inset 0 0 0 1px var(--c-line); transition: background-color 0.15s var(--ease), transform 0.15s var(--ease); }
.couple-shortcut:hover { background: var(--c-soft); }
.couple-shortcut:active { transform: scale(0.97); }
.couple-shortcut img { width: 56px; height: 56px; border-radius: 16px; object-fit: cover; }

.couple-section { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.couple-section h2 { margin: 0; font-size: 18px; font-weight: 600; color: var(--c-text); }
.couple-month { color: var(--c-sub); font-weight: 500; font-size: 14px; margin-top: 8px; }

.couple-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--c-line); }
.couple-card > .couple-row:first-child { border-top: 0; }
.couple-card.couple-row { border-top: 0; padding: 16px 20px; }
.couple-row-body { flex: 1; min-width: 0; }
.couple-row-title { color: var(--c-text); font-weight: 500; }
.couple-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--c-accent); }
.couple-dot.plan { background: var(--c-plan); }
.couple-dot.record { background: var(--c-record); }
.couple-dot.anniversary { background: var(--c-anniversary); }
.couple-dot.milestone { background: var(--c-milestone); }

.couple-pill { padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.couple-pill.plan, .couple-pill.soft { background: var(--c-plan-soft); color: var(--c-accent-strong); }
.couple-pill.soft { font-weight: 500; }
.couple-pill.milestone { background: var(--c-milestone-soft); color: var(--c-milestone); }
.couple-pill.anniversary { background: var(--c-anniversary-soft); color: var(--c-anniversary); }

.couple-add { align-self: stretch; border: 1px dashed color-mix(in srgb, var(--c-sub) 45%, transparent); background: transparent; color: var(--c-sub); border-radius: 16px; padding: 16px; font-weight: 500; font-size: 15px; cursor: pointer; transition: background-color 0.15s var(--ease), color 0.15s var(--ease); }
.couple-add:hover { background: var(--c-soft); color: var(--c-accent-ink); }

.couple-entry { display: flex; flex-direction: column; gap: 8px; border-left: 4px solid var(--c-record); }
.couple-entry.is-plan { border-left-color: var(--c-plan); }
.couple-entry-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.couple-entry-date { color: var(--c-sub); font-size: 14px; font-weight: 500; }
.couple-entry-title { color: var(--c-text); font-size: 18px; font-weight: 600; word-break: break-word; }
.couple-memo { white-space: pre-wrap; word-break: break-word; line-height: 1.6; }
.couple-entry-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 2px; }
.couple-actions { display: flex; gap: 8px; align-items: center; }
.couple-link { background: none; border: 0; padding: 8px 10px; border-radius: 10px; color: var(--c-accent-ink); font-weight: 500; font-size: 14px; cursor: pointer; }
.couple-link:hover { background: var(--c-soft); }
.couple-link.danger { color: var(--bad); }

.couple-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 4px; }
.couple-thumb { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: var(--c-soft); cursor: zoom-in; }
.couple-thumb-wrap { position: relative; }
.couple-thumb-remove { position: absolute; top: 4px; right: 4px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }

.couple-form { display: flex; flex-direction: column; gap: 12px; }
.couple-form-title { margin: 0; font-size: 17px; font-weight: 600; color: var(--c-text); }
.couple-form label { display: flex; flex-direction: column; gap: 6px; color: var(--c-sub); font-size: 14px; font-weight: 500; }
.couple-label { color: var(--c-sub); font-size: 14px; font-weight: 500; }
.couple-field { width: 100%; min-width: 0; padding: 12px 16px; border: 1px solid var(--c-line); border-radius: 12px; background: var(--c-bg); color: var(--c-text); outline: none; }
.couple-field:focus { border-color: var(--c-accent); }
.couple-when { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.couple-form label.couple-check { flex-direction: row; align-items: center; gap: 8px; color: var(--c-text); }
.couple-form label.couple-file { padding: 16px; border-radius: 12px; background: var(--c-soft); color: var(--c-accent-ink); cursor: pointer; }
.couple-file input { font-size: 13px; color: var(--c-sub); }
.couple-button { border: 0; border-radius: 12px; padding: 12px 20px; font-weight: 600; background: var(--c-accent-ink); color: var(--c-on-ink); cursor: pointer; transition: background-color 0.15s var(--ease), transform 0.15s var(--ease); }
.couple-button:hover { background: var(--c-accent-ink-hover); }
.couple-button:active:not(:disabled) { transform: scale(0.98); }
.couple-button:disabled { opacity: 0.45; cursor: default; }
.couple-button.ghost { background: var(--c-soft); color: var(--c-accent-ink); }
.couple-button.ghost:hover { background: var(--c-line); }

.cal { padding: 16px; }
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cal-month { flex: 1; text-align: center; font-size: 18px; font-weight: 600; color: var(--c-text); }
.cal-nav { width: 36px; height: 36px; border: 0; border-radius: 10px; background: var(--c-soft); color: var(--c-accent-ink); font-size: 20px; line-height: 1; cursor: pointer; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-weekday { text-align: center; font-size: 12px; font-weight: 500; color: var(--c-sub); padding: 4px 0; }
.cal-weekday.sun { color: var(--c-plan); }
.cal-weekday.sat { color: var(--sat); }
.cal-cell { display: flex; flex-direction: column; align-items: stretch; gap: 4px; min-height: 84px; padding: 6px 4px; border: 0; border-radius: 12px; background: transparent; color: var(--c-text); text-align: left; cursor: pointer; font: inherit; min-width: 0; }
.cal-cell.blank { cursor: default; }
.cal-cell:not(.blank):hover { background: var(--c-soft); }
.cal-cell.selected { background: var(--c-soft); box-shadow: inset 0 0 0 2px var(--c-accent); }
.cal-day { font-size: 13px; font-weight: 500; padding-left: 4px; }
.cal-cell.today .cal-day { color: var(--c-on-ink, #fff); background: var(--c-accent-ink, var(--c-accent)); border-radius: 999px; padding: 1px 7px; align-self: flex-start; }
.cal-marks { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-mark { font-size: 11px; font-weight: 500; padding: 1px 5px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--c-on-ink, #fff); background: var(--c-accent-ink, var(--c-accent)); }
.cal-mark.plan { background: var(--c-plan-ink, var(--c-plan)); }
.cal-mark.record { background: var(--c-record-ink, var(--c-record)); }
.cal-mark.anniversary { background: var(--c-anniversary-ink, var(--c-anniversary)); }
.cal-mark.milestone { background: var(--c-milestone-ink, var(--c-milestone)); }
.cal-more { font-size: 11px; color: var(--c-sub); padding-left: 4px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; font-size: 12px; color: var(--c-sub); }
.cal-legend > span { display: inline-flex; align-items: center; gap: 6px; }

.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, 0.88); display: flex; align-items: center; justify-content: center; padding: 16px; cursor: zoom-out; }
.lightbox-image { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; }

@media (max-width: 820px) {
  .nav-children { display: none; }
  .couple-subnav { display: flex; gap: 6px; overflow-x: auto; margin: -4px -16px 2px; padding: 0 16px 4px; }
  .couple-subnav-item { flex: 0 0 auto; padding: 8px 16px; border-radius: 999px; background: var(--c-card); color: var(--c-sub); font-weight: 500; font-size: 14px; text-decoration: none; box-shadow: inset 0 0 0 1px var(--c-line); }
  .couple-subnav-item.active { background: var(--c-accent-ink); color: var(--c-on-ink); box-shadow: none; }
  .couple-field { font-size: 16px; }
  .couple-hero { padding: 20px; }
  .couple-hero-days { font-size: 38px; }
  .couple-hero-icon { width: 76px; height: 76px; }
  .cal { padding: 12px 8px; }
  .cal-grid { gap: 2px; }
  .cal-cell { min-height: 56px; align-items: center; padding: 4px 0; }
  .cal-day { padding-left: 0; }
  .cal-cell.today .cal-day { align-self: center; }
  .cal-marks { flex-direction: row; justify-content: center; gap: 4px; }
  .cal-mark { width: 6px; height: 6px; padding: 0; border-radius: 50%; font-size: 0; }
  .cal-more { display: none; }
}

@media (max-width: 480px) {
  .couple-when { grid-template-columns: minmax(0, 1fr); }
}

.code-block { margin: 0; padding: 14px 16px; border-radius: 12px; background: var(--surface-sub); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; white-space: pre-wrap; word-break: break-all; user-select: all; }
.worklog-list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; color: var(--text-sub); }
.worklog-notes { color: var(--text-strong); }

.schedule { --c-text: var(--text-strong); --c-sub: var(--text-sub); --c-soft: var(--surface-sub); --c-accent: var(--accent); --c-accent-strong: var(--accent); --c-accent-ink: var(--accent-fill); --c-on-ink: #fff; --c-plan: var(--bad); --c-plan-ink: var(--bad-ink); display: flex; flex-direction: column; gap: 16px; }
.schedule .cal-mark.event { background: var(--accent-fill); }
.schedule .cal-mark.couple { background: var(--couple); }
.usage-bars { display: flex; flex-direction: column; gap: 8px; }
.usage-row { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 12px; font-size: 13px; }
.usage-date { color: var(--text-sub); }
.usage-track { height: 8px; border-radius: 999px; background: var(--surface-sub); overflow: hidden; }
.usage-fill { height: 100%; border-radius: 999px; background: var(--accent); min-width: 2px; }
.usage-count { color: var(--text-strong); font-weight: 500; min-width: 32px; text-align: right; }

.heat { display: grid; grid-template-columns: 24px repeat(24, minmax(0, 1fr)); gap: 4px; align-items: center; }
.heat-label { font-size: 12px; color: var(--text-sub); text-align: center; }
.heat-hour { font-size: 11px; color: var(--text-faint); text-align: left; }
.heat-cell { aspect-ratio: 1; border-radius: 4px; background: var(--accent); min-width: 0; }
.heat-cell.empty { background: var(--surface-sub); opacity: 1; }

.place-map-card { padding: 8px; }
.place-map { width: 100%; height: 320px; border-radius: 16px; overflow: hidden; background: var(--c-soft); }
.place-info { padding: 6px 10px; font-size: 13px; font-weight: 600; color: #191f28; white-space: nowrap; }
.place-search { display: flex; gap: 8px; }
.place-search .couple-field { flex: 1; }
.place-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.place-chip { border: 0; border-radius: 999px; padding: 8px 12px; background: var(--c-soft); color: var(--c-accent-ink); font-weight: 500; font-size: 13px; cursor: pointer; transition: background-color 0.15s var(--ease), color 0.15s var(--ease); }
.place-chip.active { background: var(--c-accent-ink); color: var(--c-on-ink); }
.place-row { align-items: flex-start; }
.place-row .couple-row-title a { color: inherit; text-decoration: none; border-bottom: 1px dashed var(--c-line); }
.place-side { display: flex; flex-direction: column; align-items: flex-end; gap: 0; }
.place-edit { margin-top: 10px; }
.place-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (max-width: 720px) { .place-map { height: 240px; } }


.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.page-head-text { min-width: 0; }
.page-actions { display: flex; align-items: center; gap: 8px; }

.segmented { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.segment { border: 0; background: transparent; color: var(--text-sub); font-weight: 500; font-size: 14px; padding: 6px 12px; border-radius: 8px; cursor: pointer; transition: background-color 0.15s var(--ease), color 0.15s var(--ease); }
.segment:hover { color: var(--text-strong); }
.segment.active { background: var(--surface-sub); color: var(--text-strong); box-shadow: inset 0 0 0 1px var(--line); }
.segment:focus-visible, .button:focus-visible, .nav:focus-visible, .chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.card.tile { padding: 20px 24px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat { padding: 16px; border-radius: 12px; background: var(--surface-sub); min-width: 0; }
.stat-value { font-size: 22px; font-weight: 600; color: var(--text-strong); margin-top: 2px; }
.inset { padding: 16px; border-radius: 12px; background: var(--surface-sub); }

.side { overflow-y: auto; }
.nav-list { display: flex; flex-direction: column; gap: 20px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group-label { padding: 0 12px 6px; font-size: 12px; font-weight: 500; color: var(--text-faint); }

.couple-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.couple-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.couple-entries { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 1100px) {
  .couple-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .couple-split.calendar { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
  .couple-split.places { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .couple-sticky { position: sticky; top: 0; }
  .couple-entries { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .places .place-map { height: min(72vh, 680px); }
}

.place-date { display: flex; flex-direction: column; gap: 8px; color: var(--c-sub); font-size: 13px; font-weight: 500; }
.place-results { display: flex; flex-direction: column; max-height: 360px; overflow-y: auto; border-top: 1px solid var(--c-line); }
.place-memo { color: var(--c-text); font-size: 14px; margin-top: 2px; }
.place-visited { color: var(--c-record-ink); font-size: 13px; font-weight: 500; margin-top: 2px; }
.place-visit { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.place-visit .couple-field { width: auto; flex: 1 1 160px; }

@media (max-width: 820px) {
  .nav-list { flex-direction: row; gap: 4px; }
  .nav-group { flex-direction: row; gap: 4px; }
  .nav-group-label { display: none; }
  .page-head { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

.theme-switch { padding: 0 0 12px; }
.theme-switch .segmented { display: flex; width: 100%; }
.theme-switch .segment { flex: 1; padding: 6px 0; font-size: 13px; }

.gallery-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.gallery-upload { position: relative; overflow: hidden; display: inline-flex; align-items: center; }
.gallery-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.gallery-upload:focus-within { outline: 2px solid var(--c-accent, var(--accent)); outline-offset: 2px; }
.couple-thumb-button { display: block; padding: 0; border: 0; background: none; border-radius: 12px; cursor: zoom-in; }
.couple-thumb-button:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }
.lightbox-close { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.lightbox-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.gallery-item { position: relative; display: block; padding: 0; border: 0; border-radius: 12px; overflow: hidden; aspect-ratio: 1; background: var(--c-soft); cursor: zoom-in; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 8px 8px; font-size: 12px; font-weight: 500; color: #fff; text-align: left; background: linear-gradient(transparent, rgba(0, 0, 0, 0.55)); opacity: 0; transition: opacity 0.15s var(--ease); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gallery-item:hover .gallery-caption, .gallery-item:focus-visible .gallery-caption { opacity: 1; }
.gallery-item:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
@media (min-width: 1100px) { .gallery { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); } }
@media (max-width: 820px) {
  .theme-switch { padding: 0 6px; }
  .theme-switch .segment { padding: 5px 8px; }
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .gallery-caption { display: none; }
}
@media (max-width: 820px) { .couple-shortcuts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.wiki { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.wiki-side { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 4px; }
.wiki-home-link { font-weight: 600; color: var(--text-strong); text-decoration: none; padding: 4px 8px; }
.wiki-home-link:hover { color: var(--accent); }
.wiki-search { padding: 10px 12px; font-size: 14px; }
.wiki-group-title { font-size: 13px; font-weight: 500; color: var(--text-sub); padding: 8px 8px 4px; }
.wiki-group-toggle { display: block; width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer; border-radius: 8px; }
.wiki-group-toggle:hover { color: var(--text-strong); }
.wiki-group-toggle:focus-visible { outline: 2px solid var(--accent); }
.wiki-group-toggle::before { content: "▸ "; }
.wiki-group-toggle.open::before { content: "▾ "; }
.wiki-tree { list-style: none; margin: 0; padding: 0; }
.wiki-subtitle { font-size: 12px; color: var(--text-faint); padding: 8px 8px 2px; }
.wiki-tree-link { display: block; padding: 6px 8px; border-radius: 8px; font-size: 13px; color: var(--text-strong); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wiki-tree-link:hover { background: var(--surface-sub); }
.wiki-tree-link.active { background: var(--line); color: var(--text-strong); font-weight: 500; }
.wiki-tree-link:focus-visible, .wiki-home-link:focus-visible, .wiki-toc-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.wiki-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; min-width: 0; }
.wiki-article { padding: 32px; min-width: 0; }
.wiki-crumb { font-size: 13px; color: var(--text-sub); margin-bottom: 8px; }
.wiki-crumb a { color: var(--text-sub); }
.wiki-title { margin: 0 0 8px; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; color: var(--text-strong); word-break: break-all; }
.wiki-lead { margin: 0 0 12px; font-size: 16px; line-height: 1.65; color: var(--text-strong); }
.wiki-tags { margin-bottom: 8px; }
.wiki-meta { font-size: 13px; color: var(--text-faint); padding-bottom: 16px; border-bottom: 1px solid var(--line); word-break: break-all; }
.wiki-body { max-width: 760px; }
.wiki-h { margin: 32px 0 12px; font-size: 19px; font-weight: 600; color: var(--text-strong); scroll-margin-top: 16px; }
.wiki-h3 { margin: 20px 0 8px; font-size: 16px; font-weight: 600; color: var(--text-strong); scroll-margin-top: 16px; }
.wiki-h4 { margin: 16px 0 8px; font-size: 15px; font-weight: 600; color: var(--text-strong); }
.wiki-p { margin: 8px 0; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.wiki-ul { margin: 8px 0; padding-left: 22px; line-height: 1.7; }
.wiki-ul li { margin: 3px 0; overflow-wrap: anywhere; }
.wiki-ul li.depth-1 { margin-left: 20px; list-style-type: circle; }
.wiki-ul li.depth-2, .wiki-ul li.depth-3 { margin-left: 40px; list-style-type: square; }
.wiki-table { margin: 12px 0; }
.wiki-table td, .wiki-table th { vertical-align: top; overflow-wrap: anywhere; }
.wiki-quote { margin: 12px 0; padding: 8px 16px; border-left: 3px solid var(--line); color: var(--text-sub); white-space: pre-wrap; }
.wiki-rule { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.wiki-code { padding: 1px 6px; border-radius: 6px; background: var(--surface-sub); font-size: 0.9em; font-family: ui-monospace, Consolas, monospace; }
.wiki-ref { color: var(--accent); text-decoration: none; border-bottom: 1px dashed currentColor; }
.wiki-ref:hover { border-bottom-style: solid; }
.wiki-missing { color: var(--text-faint); }
.wiki-list { margin: 8px 0; padding-left: 20px; line-height: 1.8; }
.wiki-list a { color: var(--accent); text-decoration: none; }
.wiki-list-text { color: var(--text-sub); }
.wiki-backlinks-title { padding-top: 16px; border-top: 1px solid var(--line); }
.wiki-kinds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 16px 0 8px; }
.wiki-kind { padding: 12px 16px; border-radius: 12px; background: var(--surface-sub); }
.wiki-kind-count { font-size: 22px; font-weight: 600; color: var(--text-strong); }
.wiki-kind-label { font-size: 13px; color: var(--text-sub); }
.wiki-toc { display: none; }
@media (min-width: 1400px) {
  .wiki-main { grid-template-columns: minmax(0, 1fr) 190px; }
  .wiki-toc { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 24px; padding: 4px 0; }
  .wiki-toc-title { font-size: 12px; font-weight: 500; color: var(--text-sub); padding: 0 8px 6px; }
  .wiki-toc-link { font-size: 13px; color: var(--text-sub); text-decoration: none; padding: 3px 8px; border-left: 2px solid var(--line); }
  .wiki-toc-link.level-3 { padding-left: 18px; }
  .wiki-toc-link:hover { color: var(--accent); border-left-color: var(--accent); }
}
@media (max-width: 900px) {
  .wiki { grid-template-columns: minmax(0, 1fr); }
  .wiki-side { position: static; max-height: 40vh; }
  .wiki-article { padding: 20px; }
  .wiki-kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.knowledge { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
.knowledge-list { display: flex; flex-direction: column; gap: 4px; max-height: calc(100vh - 180px); overflow-y: auto; }
.knowledge-detail { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; min-width: 0; }
.knowledge-search { margin-bottom: 8px; }
.knowledge-count { font-size: 13px; color: var(--text-sub); padding: 4px 4px 8px; }
.knowledge-row { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 12px; border-radius: 12px; cursor: pointer; }
.knowledge-row:hover { background: var(--surface-sub); }
.knowledge-row.active { background: var(--line); }
.knowledge-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.knowledge-row-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.knowledge-row-title { font-weight: 500; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-row-meta { flex: none; font-size: 12px; color: var(--text-sub); }
.knowledge-row-text { margin-top: 4px; font-size: 13px; color: var(--text-sub); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.knowledge-title { margin: 0 0 8px; font-size: 20px; font-weight: 600; color: var(--text-strong); word-break: break-all; }
.knowledge-summary { color: var(--text-strong); margin-bottom: 12px; line-height: 1.6; }
.knowledge-tag { padding: 4px 8px; border-radius: 6px; background: var(--surface-sub); color: var(--text-sub); font-size: 12px; font-weight: 500; }
.knowledge-meta { margin-top: 8px; font-size: 13px; color: var(--text-faint); word-break: break-all; }
.knowledge-back { display: none; margin-bottom: 12px; }
.doc { margin-top: 16px; border-top: 1px solid var(--line, var(--surface-sub)); padding-top: 8px; }
.doc-h { margin: 20px 0 8px; font-size: 15px; font-weight: 600; color: var(--text-strong); }
.doc-file { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.doc-p { white-space: pre-wrap; line-height: 1.65; margin: 8px 0; color: var(--text-strong); overflow-wrap: anywhere; }
.doc-code { margin: 12px 0; padding: 12px 16px; border-radius: 12px; background: var(--surface-sub); overflow-x: auto; font-size: 13px; line-height: 1.55; }
@media (max-width: 1099px) {
  .knowledge { grid-template-columns: minmax(0, 1fr); }
  .knowledge-list { max-height: none; }
  .knowledge-detail { position: static; max-height: none; display: none; }
  .knowledge.has-detail .knowledge-list { display: none; }
  .knowledge.has-detail .knowledge-detail { display: block; }
  .knowledge-back { display: inline-block; }
}
.overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.overview-slot { display: flex; min-width: 0; }
.overview-slot > .panel { flex: 1; min-width: 0; }
.overview-slot.wide { grid-column: span 2; }
.panel-loading { flex: 1; min-height: 96px; border-radius: 12px; background: var(--surface-sub); color: var(--text-faint); font-size: 13px; display: flex; align-items: center; justify-content: center; }
@media (max-width: 1299px) { .overview { grid-template-columns: repeat(2, minmax(0, 1fr)); } .overview-slot.wide { grid-column: span 1; } }
@media (max-width: 720px) { .overview { grid-template-columns: minmax(0, 1fr); } }
.panel { display: flex; flex-direction: column; gap: 12px; padding: 20px 24px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-title { text-decoration: none; color: var(--text-strong); border-radius: 8px; }
.panel-title h2 { margin: 0; font-size: 16px; font-weight: 600; transition: color 0.15s var(--ease); }
.panel-title:hover h2 { color: var(--accent); }
.panel-title:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; }
.figure { padding: 12px; border-radius: 12px; background: var(--surface-sub); min-width: 0; }
.figure-value { font-size: 20px; font-weight: 600; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.figure-value.warn { color: var(--warn); }
.figure-label { font-size: 12px; color: var(--text-sub); margin-top: 2px; }
.panel-line { font-size: 14px; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-line.faint { color: var(--text-sub); }
.overview-foot { color: var(--text-faint); font-size: 13px; }

.photo-pin { width: 14px; height: 14px; border-radius: 50%; background: var(--c-record, #2bbf9b); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); cursor: default; }
.photo-pin:not(.inline) { cursor: pointer; transition: transform 0.15s var(--ease); }
.photo-pin:not(.inline):hover { transform: scale(1.15); }
.couple-entry.focused { outline: 3px solid var(--c-record, #2bbf9b); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .photo-pin:not(.inline) { transition: none; } }
.photo-pin.inline { display: inline-block; vertical-align: -2px; margin-right: 6px; }
.map-legend { padding: 8px 8px 4px; font-size: 13px; color: var(--c-sub); }

.search-open { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 4px 16px; padding: 8px 12px; border: 0; border-radius: 10px; background: var(--surface-sub); box-shadow: inset 0 0 0 1px var(--line); color: var(--text-sub); font-size: 14px; font-weight: 500; cursor: pointer; text-align: left; transition: color 0.15s var(--ease); }
.search-open:hover { color: var(--text-strong); }
.search-key { font-size: 12px; color: var(--text-faint); }
.search-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, 0.36); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.search-dialog { width: 100%; max-width: 640px; max-height: 70vh; display: flex; flex-direction: column; background: var(--surface); border-radius: 20px; box-shadow: 0 16px 48px rgba(0, 0, 0, 0.24), inset 0 0 0 1px var(--line); overflow: hidden; }
.search-input { margin: 16px; width: auto; }
.search-results { overflow-y: auto; padding: 0 8px 12px; display: flex; flex-direction: column; }
.search-group { font-size: 12px; font-weight: 600; color: var(--text-faint); padding: 12px 12px 4px; }
.search-hit { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; border: 0; border-radius: 10px; padding: 8px 12px; background: transparent; cursor: pointer; text-align: left; }
.search-hit.active { background: var(--surface-sub); box-shadow: inset 0 0 0 1px var(--line); }
.search-hit-title { color: var(--text-strong); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.search-hit-sub { color: var(--text-faint); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.search-hint { color: var(--text-faint); font-size: 14px; padding: 12px; }

@media (max-width: 820px) {
  .search-open { margin: 0 8px 0 0; padding: 6px 10px; flex: none; }
  .search-key { display: none; }
  .search-backdrop { padding-top: 8vh; }
}

.commit-cal-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.commit-cal-head .empty { padding: 0; }
.commit-cal-wrap { overflow-x: auto; padding-bottom: 4px; }
.commit-cal { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 12px); grid-auto-columns: 12px; gap: 3px; width: max-content; }
.commit-cal-cell { border-radius: 3px; background: var(--accent); }
.commit-cal-cell.empty { background: var(--surface-sub); box-shadow: inset 0 0 0 1px var(--line); }

.wiki-history { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.wiki-history .link-button.active { color: var(--text-strong); font-weight: 600; }
.wiki-diff { width: 100%; margin: 0; padding: 12px 0; border-radius: 12px; background: var(--surface-sub); overflow-x: auto; font-size: 13px; line-height: 1.6; }
.wiki-diff-line { padding: 0 12px; white-space: pre; }
.wiki-diff-line.added { background: var(--good-soft); color: var(--text-strong); }
.wiki-diff-line.removed { background: var(--bad-soft); color: var(--text-strong); }
.wiki-diff-gap { padding: 0 12px; color: var(--text-faint); }

.couple-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.couple-stat { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.couple-stat-value { font-size: 24px; font-weight: 700; color: var(--c-text); letter-spacing: -0.01em; }
.couple-note { margin-top: 12px; }
.tone-couple .usage-fill { background: var(--c-accent); }
.tone-couple .usage-date { color: var(--c-sub); }
.tone-couple .usage-count { color: var(--c-text); }
.usage-bars.wide .usage-row { grid-template-columns: minmax(72px, 140px) 1fr auto; }
.usage-bars.wide .usage-date { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
