:root {
  color-scheme: dark;
  --bg: #0b131d;
  --panel: #141f2b;
  --panel-raised: #1a2837;
  --line: #304052;
  --text: #f3f0e9;
  --muted: #b0bdcc;
  --accent: #ffac68;
  --accent-dark: #d77c37;
  --success: #a6dcba;
  --danger: #ffb3ae;
  --radius: 18px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 24px; }
body { margin: 0; color: var(--text); background: radial-gradient(ellipse at 92% 0%, #233446 0, transparent 36%), var(--bg); font-size: 16px; line-height: 1.6; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); text-underline-offset: 4px; }
a:hover { color: #ffcca5; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 2px; }
::selection { background: #ffac6845; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.035em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; }
h2 { font-size: 1.65rem; font-weight: 750; margin-bottom: 14px; }
h3 { font-size: 1.05rem; letter-spacing: -.015em; }
p + p { margin-top: 12px; }
small, .small { font-size: .875rem; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.eyebrow { font-size: .68rem; font-weight: 800; letter-spacing: .16em; line-height: 1.5; }
.eyebrow + h1, .eyebrow + h2 { margin-top: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 10; background: var(--accent); color: var(--bg); padding: 12px 18px; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.site-header { max-width: 1184px; margin: auto; padding: 28px 32px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font-size: 1rem; font-weight: 750; line-height: 1.35; }
.brand:hover { color: var(--text); }
.brand-mark { display: grid; place-items: center; border: 1px solid var(--accent); color: var(--accent); border-radius: 11px; width: 42px; height: 46px; letter-spacing: -.08em; font-size: 1.05rem; transform: skew(-5deg); flex-shrink: 0; }
.brand-sub { display: block; font-size: .58rem; letter-spacing: .14em; color: var(--muted); margin-top: 5px; }
.member-controls { display: flex; align-items: center; gap: 14px; font-size: .875rem; }
#member-name { max-width: 180px; overflow-wrap: anywhere; }
.shell { max-width: 1184px; padding: 16px 32px 56px; margin: auto; min-height: calc(100vh - 220px); }
.shell:focus { outline: none; }
.card { background: linear-gradient(145deg, #182431, var(--panel) 70%); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.section-block { margin-top: 24px; scroll-margin-top: 24px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-heading h2 { margin-bottom: 0; }
.tag { display: inline-flex; flex-shrink: 0; align-items: center; padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; font-size: .62rem; font-weight: 750; letter-spacing: .065em; color: var(--muted); }
.notice { border: 1px solid #6f674d; background: #362f23; color: #ffdbb2; padding: 15px 18px; border-radius: 10px; margin-bottom: 20px; overflow-wrap: anywhere; }
.notice.compact { font-size: .875rem; padding: 12px 14px; margin: 12px 0; }
.notice.error, .form-message.error { border-color: #805453; background: #372327; color: var(--danger); }
.form-message { padding: 12px; margin: 18px 0 12px; border: 1px solid #466454; border-radius: 8px; font-size: .875rem; color: var(--success); background: #20332c; }
.loading-panel { padding: 60px 20px; text-align: center; color: var(--muted); }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 9px; padding: 11px 18px; font-size: .875rem; font-weight: 750; text-decoration: none; line-height: 1.3; transition: background .15s ease, border-color .15s ease; }
.button.primary { background: var(--accent); color: #1a1713; border-color: var(--accent); }
.button.primary:hover:not(:disabled) { background: #ffc18f; border-color: #ffc18f; color: #1a1713; }
.button.secondary { color: var(--text); border-color: #526276; background: transparent; }
.button.secondary:hover:not(:disabled) { background: #26384a; }
.button.quiet { color: var(--muted); border-color: var(--line); background: transparent; padding: 9px 13px; }
.button.quiet:hover:not(:disabled) { color: var(--text); background: #26384a; }
.button.full { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 12px; }
label { display: block; font-size: .875rem; font-weight: 650; margin: 18px 0 7px; }
input:not([type="checkbox"]), select, textarea { display: block; width: 100%; max-width: 100%; min-height: 46px; background: #0e1722; border: 1px solid #46556a; border-radius: 8px; color: var(--text); padding: 10px 12px; }
input::placeholder, textarea::placeholder { color: #8f9caf; opacity: 1; }
input:disabled, textarea:disabled, select:disabled { opacity: .55; cursor: not-allowed; }
textarea { resize: vertical; min-height: 96px; }
input[type="checkbox"] { accent-color: var(--accent); width: 22px; height: 22px; margin: 2px 0 0; flex-shrink: 0; cursor: pointer; }
input[type="number"] { appearance: textfield; }
.field-help { font-size: .78rem; color: var(--muted); line-height: 1.55; margin-top: 8px; }
fieldset { padding: 0; border: 0; margin: 0; min-width: 0; }
fieldset:disabled label { cursor: default; }
form > .button[type="submit"] { margin-top: 20px; }
.auth-layout { display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: clamp(32px, 6vw, 84px); padding: 46px 0 60px; }
.hero h1 { font-size: clamp(3.7rem, 7vw, 6.3rem); line-height: .99; letter-spacing: -.065em; margin: 24px 0; }
.hero-copy { max-width: 390px; font-size: 1.15rem; color: #c7d2df; line-height: 1.65; }
.hero-rule { width: 64px; height: 4px; background: var(--accent); margin: 34px 0 28px; }
.pillars { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; margin-bottom: 24px; max-width: 350px; }
.pillars > span { font-size: .7rem; color: var(--accent); font-weight: 700; }
.pillars strong { color: var(--text); font-size: .9rem; margin-left: 8px; }
.hero > .small { max-width: 390px; }
.access-card { padding: clamp(24px, 3vw, 40px); box-shadow: 0 24px 80px #0002; }
.access-card form { margin-top: 22px; }
.access-card form + p { margin-top: 24px; }
.access-card h2 { font-size: 2rem; }
.dashboard-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 24px 0 30px; }
.dashboard-heading h1 { margin: 12px 0; overflow-wrap: anywhere; }
.date-badge { text-align: center; border-left: 1px solid var(--line); padding-left: 28px; color: var(--muted); font-size: .65rem; letter-spacing: .13em; line-height: 1.5; flex-shrink: 0; }
.date-badge strong { display: block; font-size: 1.8rem; font-weight: 800; color: var(--accent); letter-spacing: -.05em; }
.section-nav { display: flex; gap: 8px; overflow-x: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px 0; scrollbar-width: thin; }
.section-nav a { color: var(--muted); text-decoration: none; padding: 11px 13px; font-size: .8rem; font-weight: 650; white-space: nowrap; border-radius: 6px; }
.section-nav a:hover, .section-nav a:focus-visible { background: var(--panel-raised); color: var(--text); }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 16px; margin: 24px 0; }
.stat { display: flex; flex-direction: column; justify-content: center; background: #131f2b; border: 1px solid var(--line); padding: 22px 24px; border-radius: 12px; }
.stat-value { font-size: 2.1rem; font-weight: 800; letter-spacing: -.055em; line-height: 1.2; }
.stat-value span { font-size: .8rem; font-weight: 450; letter-spacing: normal; color: var(--muted); margin-left: 8px; }
.stat-label { color: var(--muted); font-size: .8rem; margin: 6px 0 0; }
.progress-stat .stat-label { margin: 0 0 10px; }
progress { appearance: none; width: 100%; height: 7px; border: 0; border-radius: 10px; overflow: hidden; background: #334152; }
progress::-webkit-progress-bar { background: #334152; border-radius: 10px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 10px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 10px; }
.progress-stat .small { font-size: .72rem; margin-top: 10px; }
.goal-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 20px 0; }
.goal-card { background: #101a26; border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.category-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; background: #302b26; border: 1px solid #7b5a3f; border-radius: 8px; font-weight: 800; font-size: .68rem; letter-spacing: .02em; color: var(--accent); margin-bottom: 16px; }
.goal-card h3 { font-size: .95rem; margin-bottom: 9px; }
.goal-card p { color: var(--muted); font-size: .83rem; overflow-wrap: anywhere; }
.goal-chooser { background: #101a26; border: 1px solid var(--line); padding: 0 16px 18px; border-radius: 10px; }
.goal-chooser legend { padding: 0 8px; font-size: .9rem; font-weight: 750; color: var(--accent); }
.goal-chooser label { font-size: .75rem; margin-top: 14px; }
.goal-chooser select, .goal-chooser input { font-size: .8rem; padding: 9px; }
.target-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.target-row > div { min-width: 0; }
.dashboard-columns { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.main-column, .side-column { min-width: 0; }
.dashboard-columns .section-block:first-child { margin-top: 0; }
.score-badge { width: 72px; height: 76px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #302b26; border: 1px solid #7b5a3f; border-radius: 12px; color: var(--accent); flex-shrink: 0; }
.score-badge output { font-size: 2rem; font-weight: 800; line-height: 1.1; }
.score-badge span { font-size: .62rem; letter-spacing: .05em; font-weight: 700; margin-top: 4px; }
.date-select { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.date-select label { margin: 0; font-size: .78rem; }
.date-select input { width: 166px; font-size: .8rem; }
.date-select .tag { margin-left: auto; }
.check-item { display: flex; align-items: flex-start; gap: 13px; padding: 16px 0; margin: 0; border-bottom: 1px solid #2d3b4c; cursor: pointer; }
.check-item > span:not(.point-label) { min-width: 0; flex: 1; }
.check-item strong { display: block; font-size: .875rem; line-height: 1.5; }
.check-detail { display: block; color: var(--muted); font-size: .8rem; font-weight: 400; line-height: 1.5; margin-top: 3px; overflow-wrap: anywhere; }
.check-item:has(input:checked) strong { color: var(--accent); }
.point-label { color: var(--muted); font-size: .7rem; font-weight: 700; padding-top: 2px; }
.bonus-item { border-bottom: 0; background: #2d2b252b; margin-top: 8px; }
#draft-status { margin: 12px 0 18px; font-size: .78rem; }
.history-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; margin-top: 20px; }
.history-day { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 63px; padding: 7px 2px; color: var(--muted); background: #101a26; border: 1px solid #3c4a5c; border-radius: 8px; }
.history-day.logged { color: var(--accent); background: #332c24; border-color: #806043; }
.history-day[aria-pressed="true"] { border: 2px solid var(--accent); box-shadow: 0 0 0 2px #ffac6817; }
.history-day:hover:not(:disabled) { background: #2a394a; }
.history-day:disabled { opacity: .38; }
.day-number { font-size: .8rem; font-weight: 700; }
.day-score { font-size: .63rem; margin-top: 3px; }
.history-key { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 17px; font-size: .65rem; color: var(--muted); }
.key-dot { display: inline-block; width: 7px; height: 7px; border-radius: 2px; border: 1px solid #7a8a9d; margin-right: 5px; }
.key-dot.logged { background: var(--accent); border-color: var(--accent); }
.leaderboard { padding: 0; margin: 20px 0 0; list-style: none; }
.leader-row { display: flex; align-items: center; gap: 12px; padding: 15px 0; border-top: 1px solid var(--line); }
.rank { font-size: .72rem; color: var(--accent); font-weight: 750; font-variant-numeric: tabular-nums; }
.leader-detail { flex: 1; min-width: 0; }
.leader-detail strong { display: block; font-size: .9rem; overflow-wrap: anywhere; }
.leader-detail .small { display: block; font-size: .7rem; }
.leader-points { flex-shrink: 0; font-size: .85rem; font-weight: 750; }
.shift-section > .small { line-height: 1.7; }
.shift-card { border-left: 2px solid var(--accent); padding: 4px 0 4px 16px; min-width: 0; overflow-wrap: anywhere; }
.shift-card h3 { line-height: 1.4; margin-bottom: 9px; }
.shift-card p { font-size: .875rem; }
.shift-card p + p { margin-top: 8px; }
.shift-reason { color: var(--muted); white-space: pre-wrap; }
#shift-summary { margin-top: 24px; }
#shift-summary > p { margin-top: 16px; }
.announcements { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 22px; }
.empty-state { color: var(--muted); font-size: .875rem; padding: 12px 0; }
.announcements > .empty-state { grid-column: 1 / -1; }
#admin-section h3 { margin-top: 28px; margin-bottom: 14px; }
.member-list, .invite-list { list-style: none; padding: 0; margin: 0; }
.member-row, .invite-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; border-top: 1px solid var(--line); font-size: .875rem; }
.member-row > div { min-width: 0; }
.member-row strong, .member-row .small { display: block; overflow-wrap: anywhere; }
.member-row button { flex-shrink: 0; }
.invite-row .small { text-align: right; }
.generated-link { background: #0e1823; border: 1px solid #7b5a3f; border-radius: 12px; padding: 18px; margin: 20px 0; }
.generated-link label { margin-top: 0; }
.generated-link .button { margin-top: 12px; }
.site-footer { max-width: 1120px; margin: 0 auto; padding: 24px 0 34px; border-top: 1px solid var(--line); color: var(--muted); font-size: .7rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; }
dialog { width: min(620px, calc(100% - 32px)); max-height: 90vh; border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 28px; color: var(--text); }
dialog::backdrop { background: #000b; }
dialog textarea { margin: 18px 0; }

@media (max-width: 1000px) {
  .goal-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-columns { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; }
  .dashboard-columns .card { padding: 22px; }
  .section-heading > .tag { white-space: normal; text-align: center; max-width: 116px; }
  .date-select .tag { margin-left: 0; }
  .site-footer { margin-left: 32px; margin-right: 32px; }
}
@media (max-width: 760px) {
  .site-header { padding: 20px; }
  .shell { padding: 10px 20px 40px; }
  .auth-layout { grid-template-columns: 1fr; padding-top: 22px; gap: 34px; }
  .hero h1 { font-size: clamp(3.6rem, 12vw, 5.3rem); }
  .hero-copy { max-width: 500px; }
  .hero > .small { max-width: 500px; }
  .hero-rule { margin: 24px 0; }
  .access-card { max-width: 560px; width: 100%; }
  .dashboard-columns { grid-template-columns: 1fr; gap: 24px; }
  .dashboard-columns .card { padding: 24px; }
  .side-column { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 20px; }
  .side-column .section-block { margin-top: 0; }
  .side-column .card { padding: 20px; }
  .stats-grid { gap: 10px; }
  .stat { padding: 18px; }
  .stat-value { font-size: 1.8rem; }
  .progress-stat { padding: 18px 14px; }
  .date-badge { padding-left: 18px; }
  .announcements { gap: 24px; }
  #member-name { display: none; }
  .site-footer { margin-left: 20px; margin-right: 20px; }
}
@media (max-width: 540px) {
  .site-header { gap: 12px; }
  .brand { font-size: .87rem; gap: 9px; }
  .brand-mark { width: 35px; height: 40px; }
  .brand-sub { font-size: .51rem; }
  #private-badge { font-size: .6rem; letter-spacing: .08em; }
  .member-controls .button { font-size: .75rem; padding: 9px 10px; }
  .hero .eyebrow { font-size: .66rem; }
  .card { padding: 22px; border-radius: 14px; }
  .dashboard-heading { align-items: flex-start; padding: 18px 0 24px; }
  .dashboard-heading h1 { font-size: 2.1rem; }
  .dashboard-heading .eyebrow { font-size: .61rem; }
  .dashboard-heading .muted { font-size: .875rem; }
  .date-badge { display: none; }
  .section-nav { margin-left: -20px; margin-right: -20px; padding-left: 14px; padding-right: 14px; }
  .section-nav a { padding: 11px 9px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 2rem; }
  .progress-stat { grid-column: 1 / -1; padding: 14px 18px; }
  .progress-stat .stat-label { font-size: .72rem; }
  .progress-stat .small { margin-top: 6px; }
  .goal-grid { gap: 10px; }
  .goal-card { padding: 14px; }
  .goal-card h3 { font-size: .875rem; }
  .goal-card p { font-size: .8rem; }
  #goal-choosers { grid-template-columns: 1fr; gap: 18px; }
  .goal-chooser { padding: 0 16px 18px; }
  .goal-chooser select, .goal-chooser input { font-size: 1rem; }
  .section-heading { gap: 12px; }
  .section-heading > .tag { max-width: 92px; font-size: .53rem; padding: 5px 6px; }
  h2 { font-size: 1.45rem; }
  .section-heading .eyebrow { font-size: .58rem; }
  .dashboard-columns .card { padding: 20px; }
  .score-badge { width: 61px; height: 67px; }
  .date-select label { width: 100%; }
  .date-select input { flex: 1; min-width: 145px; font-size: 1rem; }
  .date-select .tag { font-size: .55rem; }
  .button-row { flex-direction: column; }
  .button-row .button { width: 100%; }
  .side-column { display: block; }
  .side-column .section-block + .section-block { margin-top: 24px; }
  .history-grid { gap: 5px; }
  .history-day { min-height: 58px; }
  .announcements { grid-template-columns: 1fr; }
  #admin-section .section-heading { flex-direction: column; align-items: stretch; }
  #admin-section .section-heading .button { margin-top: 8px; }
  .member-row { flex-wrap: wrap; gap: 10px; }
  .member-row > div { flex: 1 1 150px; }
  .member-row button { font-size: .75rem; }
  .invite-row { align-items: flex-start; }
  .site-footer { flex-direction: column; font-size: .68rem; }
  input:not([type="checkbox"]), textarea, select { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
