:root {
  color-scheme: dark;
  --bg: #0b0f19; --card: #151d2f; --text: #f1f5f9; --muted: #a1afc3;
  --border: #263247; --accent: #38bdf8; --active: #192638; --on-accent: #0b0f19;
  --notice: #3b2a20; --warning: #ffc182;
  font: 16px/1.5 system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f8fafc; --card: #fff; --text: #0f172a; --muted: #475569;
    --border: #dce4ee; --accent: #1b365d; --active: #eaf1fa; --on-accent: #fff;
    --notice: #fff3e8; --warning: #81401a;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--text); background: var(--bg); display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: 100svh; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { min-height: 44px; cursor: pointer; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
button:disabled { opacity: .6; cursor: wait; }
.sidebar { position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; gap: 32px; padding: 32px 22px; background: var(--card); border-right: 1px solid var(--border); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); font-size: 1.45rem; font-weight: 850; letter-spacing: -.025em; text-decoration: none; }
.brand img { border-radius: 12px; }
nav { display: grid; gap: 8px; }
nav button { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border: 0; border-radius: 12px; text-align: left; background: transparent; color: var(--text); font-weight: 650; }
nav button span { display: inline-grid; width: 18px; place-items: center; font-size: 1.25rem; }
nav button:hover, nav button[aria-current="page"] { background: var(--active); color: var(--accent); }
.logout { margin-top: auto; align-self: flex-start; }
.account-nav { align-self: flex-start; }
main { width: min(100%, 1100px); margin-inline: auto; padding: clamp(24px, 4.8vw, 65px); }
.page-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
h1 { font-size: clamp(2.2rem, 4.5vw, 3.25rem); letter-spacing: -.045em; line-height: 1.08; margin: 0; }
h2 { font-size: 1.08rem; margin: 0 0 9px; }
.timestamp, .muted { color: var(--muted); }
.timestamp { font-size: .76rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 6px; }
.primary, .secondary { border-radius: 10px; padding: 7px 14px; font-weight: 700; }
.primary { color: var(--on-accent); background: var(--accent); border: 1px solid transparent; }
.secondary { color: var(--text); background: transparent; border: 1px solid var(--border); }
.secondary:hover { background: var(--active); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 18px; }
.connect { max-width: 480px; margin: min(13vh, 96px) auto 0; padding: clamp(20px, 5vw, 34px); }
.connect p { color: var(--muted); }
.connect form { display: grid; gap: 9px; margin: 24px 0 13px; }
.connect input { min-height: 46px; width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg); color: var(--text); }
.google-login { display: block; text-align: center; text-decoration: none; min-height: 44px; margin-block: 22px 16px; }
.connect details { margin: 16px 0; }
.connect summary { cursor: pointer; }
.privacy-link { display: block; margin-top: 18px; font-size: .88rem; }
.account-view { margin-top: 0; }
.account-view fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }
.account-view fieldset label { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.account-view input[type=checkbox] { min-height: auto; width: 18px; height: 18px; accent-color: var(--accent); }
.account-actions { display: grid; gap: 8px; margin-top: 18px; }
.account-actions p { margin: 0; overflow-wrap: anywhere; }
.privacy-page { display: block; }
.privacy-page main { max-width: 760px; }
.privacy-page h1 { margin-block: 22px; }
.notice { border-radius: 12px; padding: 11px 15px; background: var(--active); color: var(--accent); }
.warning, .feedback:not(:empty) { background: var(--notice); color: var(--warning); }
.feedback:not(:empty) { border-radius: 12px; padding: 12px 16px; }
#content { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.rows { padding: 4px 17px; }
.row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.row + .row { border-top: 1px solid var(--border); }
.row-text { flex: 1; min-width: 0; border: 0; color: inherit; background: transparent; text-align: left; padding: 11px 0; }
.row-text:hover strong { color: var(--accent); }
.row-text strong, .row-text small { overflow: hidden; text-overflow: ellipsis; display: block; white-space: nowrap; }
.row-text small { color: var(--muted); }
.row-arrow { color: var(--muted); padding-right: 4px; }
.check { width: 44px; flex: 0 0 44px; padding: 0; border: 0; color: var(--accent); font-size: 1.3rem; background: transparent; }
.more { width: 100%; border: 0; border-top: 1px solid var(--border); padding: 10px 0; display: flex; justify-content: space-between; color: var(--accent); background: transparent; font-weight: 700; }
.source-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.source-title .muted { text-align: right; }
.source-report p { margin: 5px 0; }
.source-report + .source-report { margin-top: 10px; }
dialog { width: min(560px, calc(100vw - 28px)); max-height: 90svh; border: 1px solid var(--border); background: var(--card); color: var(--text); border-radius: 18px; padding: 22px; }
dialog::backdrop { background: #020617a8; }
dialog form { text-align: right; }
dialog p { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 720px) {
  body { display: block; }
  .sidebar { position: sticky; z-index: 1; height: auto; flex-direction: row; align-items: center; padding: 10px 17px; border: 0; border-bottom: 1px solid var(--border); }
  .brand img { width: 34px; height: 34px; }
  .logout { margin: 0 0 0 auto; align-self: center; }
  .account-nav { margin-left: auto; align-self: center; }
  .account-nav:not([hidden]) + .logout { margin-left: 0; }
  .sidebar:has(.account-nav:not([hidden])) { gap: 9px; }
  main { padding: 24px 16px calc(88px + env(safe-area-inset-bottom)); }
  nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-around; padding: 6px 10px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--card); }
  nav button { flex: 1; justify-content: center; gap: 0; flex-direction: column; font-size: .81rem; }
  .rows { padding-inline: 12px; }
}
