:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #eff3ef;
  background: #111619;
  --bg: #111619;
  --surface: #1b2226;
  --surface-raised: #242d32;
  --line: #343e41;
  --ink: #eff3ef;
  --muted: #aebbb9;
  --accent: #c8e7d1;
  --blue: #b7d5f5;
  --tint: #263d34;
  --gradient: radial-gradient(ellipse at 95% 0%, #edf1b0 0, transparent 58%),
              linear-gradient(130deg, #d5e8c9 9%, #c7dce1 63%, #d9d6ed 100%);
  --serif: Georgia, serif;
}
.theme-night {
  --bg: #161522;
  --surface: #232233;
  --surface-raised: #2d2b41;
  --line: #47425a;
  --accent: #dfd3fb;
  --blue: #c6d4ff;
  --tint: #38324e;
  --gradient: radial-gradient(ellipse at 95% 0%, #f1d5ed 0, transparent 60%),
              linear-gradient(130deg, #e0d3f4, #c8d7f2 67%, #e9e0f5);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { border: 0; color: inherit; cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.shell { min-height: 100dvh; }
.shell { max-width: 1440px; margin: auto; display: grid; grid-template-columns: 212px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 34px; padding: 32px 18px 24px; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 23px; font-weight: 780; letter-spacing: -.85px; }
.brand-mark, .avatar, .icon-button, .goal-settings { display: inline-grid; place-items: center; flex: 0 0 auto; }
.brand-mark { width: 37px; height: 37px; border-radius: 13px; background: var(--accent); color: #17281f; }
.brand-mark svg { width: 19px; }
.nav { display: grid; gap: 5px; }
.nav button { display: flex; align-items: center; gap: 10px; min-height: 45px; padding: 9px 12px; border-radius: 12px; background: transparent; text-align: left; color: var(--muted); }
.nav button:hover, .nav button.active { background: var(--tint); color: var(--accent); }
.nav-count { margin-left: auto; font-size: 12px; }
.user-mini { margin-top: auto; display: flex; align-items: center; gap: 9px; font-size: 14px; overflow-wrap: anywhere; }
.user-mini small { display: block; color: var(--muted); }
.avatar, .icon-button { height: 42px; width: 42px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-raised); color: var(--accent); font-weight: 700; }
.main { min-width: 0; padding: 30px clamp(22px, 4vw, 56px) 52px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 22px; }
.breadcrumb { color: var(--muted); font-size: 14px; }
.top-actions { display: flex; gap: 8px; }
.mobile-brand, .mobile-nav, .quick-add { display: none; }
.demo-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; color: var(--muted); }
.demo-bar button, .text-button, .rank-footer { background: transparent; color: var(--blue); }
.demo-bar button { min-height: 28px; text-align: right; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 23px; }
.page-heading > div, .dashboard-main { min-width: 0; }
h1 { font-size: clamp(28px, 4vw, 49px); font-weight: 750; letter-spacing: -.047em; line-height: 1.06; overflow-wrap: anywhere; }
.home-date, .eyebrow { color: var(--muted); font-size: 13px; margin-bottom: 7px; }
.subtitle { margin-top: 9px; max-width: 55ch; color: var(--muted); font-size: 14px; line-height: 1.55; }
.button, .text-button, .rank-footer { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 14px; }
.button { min-height: 43px; padding: 9px 15px; border-radius: 12px; background: var(--accent); color: #14231a; font-weight: 700; text-align: center; }
.button svg, .text-button svg, .rank-footer svg { width: 17px; height: 17px; }
.button.secondary, .button.soft { border: 1px solid var(--line); background: var(--surface-raised); color: var(--ink); }
.button.danger { background: #492c34; color: #ffd0d2; }
.button:not(:disabled):hover, .icon-button:hover, .top-avatar:hover { filter: brightness(1.1); }
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(225px, 290px); gap: 23px; align-items: start; }
.goal-card { padding: clamp(17px, 2.4vw, 28px); border-radius: 23px; background: var(--gradient); color: #182825; }
.goal-heading, .goal-summary-line, .reading-card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.goal-heading p { font-size: 13px; margin-bottom: 4px; color: #344640; }
.goal-heading h2 { font-size: clamp(21px, 3vw, 32px); letter-spacing: -.035em; line-height: 1.08; }
.goal-settings { width: 42px; height: 42px; background: #21322a; color: #f1f7ec; border-radius: 14px; }
.goal-summary { padding: 12px 14px 14px; margin-top: 19px; border-radius: 14px; color: #eff3ef; background: #202b2b; }
.goal-summary-line > span, .goal-summary-line small { color: #c1cfca; font-size: 13px; font-weight: 500; }
.goal-summary-line strong { font-size: 25px; letter-spacing: -.035em; white-space: nowrap; line-height: 1.1; }
.goal-summary-line small { letter-spacing: 0; }
.goal-track { height: 6px; margin-top: 11px; background: #455553; border-radius: 999px; overflow: hidden; }
.goal-track span, .progress i { display: block; height: 100%; border-radius: inherit; background: var(--gradient); }
.reading-cards { margin: 13px 0 25px; display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.reading-card { display: grid; align-content: start; gap: 4px; border: 1px solid var(--line); border-radius: 16px; padding: 13px; background: var(--surface); text-align: left; }
.reading-card:hover, .book-card:hover { border-color: var(--accent); }
.reading-now { background: var(--tint); }
.reading-card-top > svg { width: 16px; color: var(--muted); }
.reading-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: #172923; color: var(--accent); }
.reading-done .reading-icon { background: #26384a; color: var(--blue); }
.reading-icon svg { width: 17px; height: 17px; }
.reading-card strong { margin-top: 4px; font-size: 24px; letter-spacing: -.045em; }
.reading-card > span:last-child { color: var(--muted); font-size: 13px; line-height: 1.3; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.section-head h2 { font-size: 19px; letter-spacing: -.02em; }
.text-button { min-height: 36px; padding: 4px; }
.tabs { display: flex; gap: 5px; overflow: auto; margin-bottom: 13px; padding: 4px 3px; scrollbar-width: thin; }
.tabs button { flex: 0 0 auto; min-height: 37px; padding: 7px 11px; border: 1px solid transparent; border-radius: 10px; background: var(--surface); color: var(--muted); font-size: 13px; white-space: nowrap; }
.tabs button.active { background: var(--tint); border-color: var(--line); color: var(--accent); font-weight: 700; }
.tabs span { margin-left: 5px; color: var(--muted); font-size: 11px; }
.shelf-grid, .right-rail, .reader-list { display: grid; gap: 10px; min-width: 0; }
.book-card { width: 100%; display: grid; grid-template-columns: 43px minmax(0, 1fr) 18px; gap: 11px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); text-align: left; }
.book-card > svg { width: 17px; color: var(--muted); }
.book-info { display: grid; justify-items: start; gap: 4px; min-width: 0; }
.book-info > strong { font-size: 15px; line-height: 1.23; overflow-wrap: anywhere; }
.book-author { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.book-status { display: inline-flex; align-items: center; gap: 4px; margin-top: 3px; padding: 3px 7px; border-radius: 6px; background: #293c35; color: #cbe7d1; font-size: 12px; }
.book-status svg { width: 12px; height: 12px; }
.book-status.reading { background: #293c50; color: #c3def8; }
.book-status.planned { background: #393748; color: #ddd6f1; }
.progress { width: min(100%, 160px); height: 3px; margin-top: 3px; border-radius: 5px; background: var(--line); }
.cover { position: relative; display: flex; flex-direction: column; justify-content: center; overflow: hidden; width: 100%; height: 57px; padding: 5px; border-radius: 3px 6px 6px 3px; box-shadow: inset 2px 0 #ffffff20; background: var(--cover-bg); color: var(--cover-ink); }
.cover-title { position: relative; font: 8px/1.1 var(--serif); overflow-wrap: anywhere; overflow: hidden; }
.cover-author, .cover-publisher { display: none; }
.cover-decoration { position: absolute; width: 26px; height: 26px; border: 1px solid currentColor; opacity: .18; border-radius: 50%; right: -7px; bottom: -3px; box-shadow: 0 0 0 3px; }
.cover.forest { --cover-bg: #315c4e; --cover-ink: #f3ebce; }
.cover.orange { --cover-bg: #a64d39; --cover-ink: #fff0d7; }
.cover.blue { --cover-bg: #375571; --cover-ink: #eef6ff; }
.cover.plum { --cover-bg: #774f74; --cover-ink: #fae9ef; }
.cover.sand { --cover-bg: #d7c39b; --cover-ink: #26352e; }
.right-rail { gap: 13px; }
.panel, .profile-card, .reader-row, .empty { min-width: 0; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 17px; }
.panel .section-head h2 { font-size: 16px; }
.panel .section-head > svg, .share-panel > svg { color: var(--accent); }
.rank-person { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.rank-person .avatar, .reader-person .avatar { width: 33px; height: 33px; font-size: 12px; }
.rank-person .avatar { color: #26352e; }
.rank-person .name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.rank-person small { display: block; margin-top: 2px; }
.rank-num, .label, .rank-person small { color: var(--muted); font-size: 11px; }
.rank-footer { width: 100%; min-height: 40px; margin-top: 14px; border-top: 1px solid var(--line); }
.share-panel { background: var(--tint); }
.share-panel h3 { font-size: 17px; margin-top: 9px; }
.share-panel p { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.share-panel .button { margin-top: 13px; width: 100%; }
.empty { text-align: center; border-style: dashed; padding: 28px 16px; }
.empty > svg { color: var(--accent); margin-bottom: 8px; }
.empty p { margin: 8px 0 14px; color: var(--muted); line-height: 1.5; }
.searchbox { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 9px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--muted); }
.searchbox input { min-width: 0; width: 100%; min-height: 30px; background: transparent; border: none; color: var(--ink); }
.searchbox:focus-within { outline: 2px solid var(--blue); }
.searchbox input:focus-visible { outline: none; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .82; }
.ranking-intro, .premium-banner, .share-preview { padding: 14px; margin-bottom: 13px; border-radius: 14px; background: var(--tint); color: var(--ink); font-size: 14px; line-height: 1.6; }
.reader-row.mine { border-color: var(--accent); }
.reader-top, .reader-person { display: flex; align-items: center; gap: 10px; }
.reader-place { color: var(--blue); min-width: 22px; }
.reader-person { flex: 1; min-width: 0; text-align: left; background: transparent; padding: 0; overflow-wrap: anywhere; }
.reader-person small, .reader-score span { display: block; color: var(--muted); font-size: 12px; }
.reader-score { text-align: right; }
.reader-score b { font-size: 24px; }
.reader-details { margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line); }
.channel-badge { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; max-width: 100%; padding: 8px 10px; border-radius: 8px; background: var(--tint); color: var(--accent); font-size: 13px; overflow-wrap: anywhere; }
.channel-badge svg { width: 15px; }
.channel-empty, .reader-books > span, .reader-books small, .reader-books p { color: var(--muted); font-size: 12px; }
.reader-books { margin: 12px 0; }
.reader-books > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 5px; font-size: 14px; overflow-wrap: anywhere; }
.profile-grid, .form-grid { display: grid; gap: 13px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.profile-card h2 { font-size: 18px; margin-bottom: 14px; }
.channel-settings { margin-top: 13px; max-width: 650px; }
.channel-settings .channel-badge { margin-bottom: 12px; }
.field { display: grid; gap: 7px; margin-bottom: 13px; color: var(--muted); font-size: 14px; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--ink); font-size: 16px; }
.field textarea { min-height: 83px; resize: vertical; }
.check { display: flex; align-items: flex-start; gap: 9px; margin: 13px 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.check input { accent-color: var(--accent); flex-shrink: 0; width: 17px; height: 17px; }
.help, .sample-note { color: var(--muted); font-size: 14px; line-height: 1.52; margin: 9px 0 13px; }
.sample-note { font-size: 12px; }
.premium-banner { display: flex; gap: 10px; }
.premium-banner > svg { color: var(--accent); }
.premium-banner p, .product small { color: var(--muted); }
.product { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 12px 0; border-bottom: 1px solid var(--line); font-weight: 650; }
.product small { display: block; margin-top: 4px; font-size: 12px; font-weight: 400; }
.product .button { flex-shrink: 0; }
.view-only { margin-bottom: 12px; }
dialog { width: min(calc(100% - 26px), 480px); max-height: min(90dvh, 760px); padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--ink); overflow: auto; }
dialog::backdrop { background: #06090ac7; backdrop-filter: blur(4px); }
.modal-heading { display: flex; align-items: start; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.modal-heading h2 { font-size: 23px; letter-spacing: -.02em; overflow-wrap: anywhere; }
.modal-heading button { display: grid; place-items: center; flex: 0 0 37px; height: 37px; border-radius: 50%; background: var(--surface-raised); }
.modal-actions, .two-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.modal-actions .button, .two-buttons .button { flex: 1; }
.share-preview h3 { font-size: 21px; overflow-wrap: anywhere; }
.mini-covers { display: flex; gap: 7px; margin: 9px 0; }
.mini-covers .cover { width: min(57px, 23%); height: 74px; }
.mini-covers .cover-title { font-size: 11px; }
.form-error { color: #ffb7ba; font-size: 13px; }
.form-error:not(:empty) { margin: 8px 0; }
.loading { display: grid; justify-items: center; align-content: center; gap: 14px; min-height: 100dvh; padding: 14px; color: var(--muted); text-align: center; }
.error-banner { background: #492c34; color: #ffd0d2; border-radius: 12px; padding: 13px; }
#toast { position: fixed; z-index: 30; bottom: 22px; left: 50%; transform: translate(-50%, 14px); width: max-content; max-width: 90vw; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-raised); opacity: 0; pointer-events: none; transition: .2s; }
#toast.toast-visible { transform: translate(-50%, 0); opacity: 1; }
@media (max-width: 990px) {
  .shell { grid-template-columns: 170px minmax(0, 1fr); }
  .content-grid { grid-template-columns: 1fr; gap: 17px; }
}
@media (max-width: 720px) {
  .shell { display: block; }
  .sidebar, .breadcrumb, .home-add { display: none; }
  .main { padding: 13px max(16px, env(safe-area-inset-right)) calc(100px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .mobile-brand { display: flex; }
  .topbar { margin-bottom: 13px; }
  .demo-bar { margin-bottom: 16px; }
  .page-heading { align-items: center; gap: 9px; margin-bottom: 16px; }
  .page-heading > .button:not(.home-add) { font-size: 0; width: 43px; padding: 0; flex-shrink: 0; }
  .page-heading > .button svg { width: 21px; height: 21px; }
  .goal-card { border-radius: 20px; }
  .reading-cards { margin: 10px 0 17px; gap: 9px; }
  .reading-card { padding: 10px; }
  .tabs button { padding-inline: 7px; }
  .profile-grid { grid-template-columns: 1fr; }
  .mobile-nav {
    position: fixed; inset: auto max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    z-index: 20; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 5px;
    border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: 0 10px 28px #090d1090;
  }
  .mobile-nav button { display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 47px; padding: 3px; border-radius: 14px; background: transparent; color: var(--muted); font-size: 11px; }
  .mobile-nav button.active { background: var(--tint); color: var(--accent); font-weight: 700; }
  .quick-add {
    display: grid; place-items: center; position: fixed; z-index: 19;
    bottom: calc(78px + env(safe-area-inset-bottom)); right: max(17px, env(safe-area-inset-right));
    width: 49px; height: 49px; border-radius: 16px; background: var(--blue); color: #182d42; box-shadow: 0 6px 20px #080d1090;
  }
  .quick-add svg { width: 25px; height: 25px; }
  #toast { bottom: calc(82px + env(safe-area-inset-bottom)); }
}
@media (max-width: 355px) {
  .tabs button { padding-inline: 8px; }
  .tabs span { display: none; }
  .reader-top, .reader-person { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }

.goal-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 40px;
}
.varaq {
  display: block;
  width: clamp(76px, 15vw, 118px);
  height: auto;
  pointer-events: none;
}
.goal-heading .varaq { width: clamp(86px, 18vw, 136px); }
.goal-heading .goal-settings { width: 40px; height: 40px; align-self: start; }
.goal-summary { margin-top: 8px; }
.companion-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 13px;
  padding: 10px 13px 10px 16px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--tint);
}
.companion-card h2 { font-size: 18px; letter-spacing: -.02em; }
.companion-card p, .rank-rules { font-size: 13px; line-height: 1.45; color: var(--muted); }
.companion-card p { margin-top: 5px; }
.companion-ranking { background: var(--surface-raised); }
.rank-rules { margin: 0 3px 12px; }
@media (max-width: 355px) {
  .goal-heading { gap: 5px; grid-template-columns: minmax(0, 1fr) auto 36px; }
  .goal-heading .goal-settings { width: 36px; height: 36px; }
}
