:root {
  color-scheme: dark;
  --page: #111315;
  --panel: #181b1e;
  --panel-2: #1d2024;
  --border: #30353a;
  --border-soft: #272c30;
  --text: #f0eee9;
  --muted: #a6acae;
  --subtle: #747b7e;
  --accent: #c4aa72;
  --accent-soft: rgba(196, 170, 114, 0.16);
  --good: #93aa95;
  --paused: #d6c47f;
  --danger: #c98e86;
  --shadow: 0 20px 50px rgba(0,0,0,.18);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--page); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 0%, rgba(196,170,114,.07), transparent 30rem),
    radial-gradient(circle at 95% 15%, rgba(255,255,255,.035), transparent 26rem),
    var(--page);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input { font: inherit; }
button { color: inherit; }

.page-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 52px 0 40px; }
.site-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; margin-bottom: 24px; }
.eyebrow, .section-kicker { margin: 0 0 8px; font-size: 11px; line-height: 1; letter-spacing: .18em; color: var(--accent); font-weight: 650; }
h1 { margin: 0; font-size: clamp(34px, 5vw, 58px); line-height: .98; letter-spacing: -.045em; font-weight: 720; }
.subtitle { max-width: 760px; margin: 16px 0 0; color: var(--muted); font-size: 16px; line-height: 1.55; }

.card { background: linear-gradient(180deg, rgba(255,255,255,.018), transparent 80%), var(--panel); border: 1px solid var(--border-soft); border-radius: 18px; box-shadow: var(--shadow); }
.setup-card { padding: 18px; margin-bottom: 18px; }
#trackerForm { display: grid; grid-template-columns: minmax(260px, 1fr) 190px auto; gap: 12px; align-items: end; }
.field { min-width: 0; }
.field label { display: block; margin: 0 0 8px 3px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.field label span { color: var(--subtle); font-weight: 500; }
.input-wrap { position: relative; }
input { width: 100%; height: 48px; border: 1px solid var(--border); border-radius: 12px; background: #121416; color: var(--text); outline: none; padding: 0 14px; transition: border-color .16s, box-shadow .16s, background .16s; }
input::placeholder { color: #6f7679; }
input:focus { border-color: rgba(196,170,114,.7); box-shadow: 0 0 0 3px rgba(196,170,114,.08); background: #141719; }
.primary-button { height: 48px; border: 0; border-radius: 12px; background: var(--accent); color: #171512; font-weight: 650; padding: 0 22px; cursor: pointer; transition: transform .15s, filter .15s; white-space: nowrap; }
.primary-button:hover { filter: brightness(1.06); transform: translateY(-1px); }
.primary-button:disabled { opacity: .55; cursor: wait; transform: none; }
.setup-message { margin: 12px 3px 0; color: var(--subtle); font-size: 12px; }
.setup-message.is-error { color: var(--danger); }

.suggestions { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 7px); border: 1px solid var(--border); border-radius: 12px; background: #171a1d; box-shadow: 0 16px 45px rgba(0,0,0,.42); overflow: hidden; }
.suggestion { width: 100%; border: 0; border-bottom: 1px solid var(--border-soft); background: transparent; padding: 12px 14px; text-align: left; cursor: pointer; }
.suggestion:last-child { border-bottom: 0; }
.suggestion:hover { background: rgba(255,255,255,.045); }
.suggestion strong { display: block; }
.suggestion span { color: var(--subtle); font-size: 11px; }

.status-pill, .mini-status { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: rgba(24,27,30,.85); border-radius: 999px; color: var(--muted); white-space: nowrap; }
.status-pill { padding: 9px 12px; font-size: 12px; }
.mini-status { padding: 6px 9px; font-size: 11px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--subtle); box-shadow: 0 0 0 3px rgba(116,123,126,.12); }
.is-live .status-dot { background: var(--good); box-shadow: 0 0 0 3px rgba(147,170,149,.13); }
.is-paused .status-dot { background: var(--paused); box-shadow: 0 0 0 3px rgba(214,196,127,.12); }
.is-error .status-dot { background: var(--danger); box-shadow: 0 0 0 3px rgba(201,142,134,.12); }

.empty-state { padding: 32px 28px; text-align: center; color: var(--muted); }
.empty-state[hidden] { display: none; }
.empty-state h2 { color: var(--text); margin: 0 0 8px; }
.empty-state p:last-child { margin: 0; font-size: 13px; }

.trackers { display: grid; gap: 32px; }
.account-tracker { display: grid; gap: 14px; scroll-margin-top: 18px; }
.account-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; }
.account-identity { min-width: 0; }
.account-identity .section-kicker { margin-bottom: 5px; }
.account-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.account-title-row h2 { font-size: 22px; }
.account-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.compact-target { display: inline-flex; align-items: center; gap: 8px; color: var(--subtle); font-size: 11px; font-weight: 700; }
.compact-target input { width: 104px; height: 34px; padding: 0 10px; border-radius: 9px; font-size: 12px; }
.danger-button:hover { color: var(--danger) !important; }

.tracker-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.span-12 { grid-column: span 12; }
.span-7 { grid-column: span 7; }
.span-5 { grid-column: span 5; }
.span-3 { grid-column: span 3; }
.activity-card, .goal-card { min-height: 276px; padding: 24px; }
.card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.card-heading.compact { align-items: center; }
h2 { margin: 0; font-size: 27px; line-height: 1.16; letter-spacing: -.025em; }
.muted { margin: 11px 0 0; color: var(--muted); line-height: 1.5; }
.activity-icon-wrap { width: 66px; height: 66px; flex: 0 0 66px; padding: 8px; box-sizing: border-box; overflow: hidden; border-radius: 14px; background: #121416; border: 1px solid var(--border-soft); }
.activity-icon { display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; }
.activity-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 34px; }
.activity-meta > div { min-width: 0; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.activity-meta span, .detail-label { display: block; margin-bottom: 5px; color: var(--subtle); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; font-weight: 650; }
.activity-meta strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }

.text-button { border: 0; background: transparent; color: var(--muted); font-size: 12px; padding: 5px 0; cursor: pointer; }
.text-button:hover:not(:disabled) { color: var(--text); }
.text-button:disabled { opacity: .4; cursor: default; }
.progress-labels { display: flex; justify-content: space-between; gap: 15px; margin-top: 34px; color: var(--muted); font-size: 12px; }
.progress-labels strong { color: var(--text); }
.progress-track { height: 12px; margin-top: 10px; overflow: hidden; border-radius: 999px; background: #101214; border: 1px solid var(--border-soft); }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #9d895f, var(--accent)); transition: width .45s ease; }
.goal-numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 23px; }
.goal-numbers span { min-width: 0; }
.goal-numbers small { display: block; color: var(--subtle); font-size: 10px; margin-bottom: 5px; }
.goal-numbers strong { font-size: 13px; }

.metric { min-height: 146px; padding: 20px; }
.metric p { margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.metric > strong { display: block; margin: 13px 0 8px; font-size: clamp(23px, 3vw, 34px); line-height: 1; letter-spacing: -.04em; }
.metric > span { color: var(--subtle); font-size: 11px; }
.details-card { padding: 18px 20px; }
.details-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 16px; }
.details-row > div { min-width: 0; }
.details-row strong { display: block; font-size: 12px; overflow-wrap: anywhere; }
.how-it-works { padding: 20px 8px 0; color: var(--subtle); font-size: 11px; line-height: 1.55; text-align: center; }

@media (max-width: 900px) {
  .page-shell { padding-top: 34px; }
  .site-header { display: block; }
  .status-pill { margin-top: 18px; }
  #trackerForm { grid-template-columns: 1fr 160px; }
  .primary-button { grid-column: 1 / -1; }
  .account-toolbar { align-items: flex-start; flex-direction: column; }
  .account-actions { justify-content: flex-start; }
  .span-7, .span-5 { grid-column: span 12; }
  .span-3 { grid-column: span 6; }
}

@media (max-width: 580px) {
  .page-shell { width: min(100% - 20px, 1180px); padding-top: 24px; }
  h1 { font-size: 38px; }
  #trackerForm { grid-template-columns: 1fr; }
  .primary-button { grid-column: auto; }
  .account-actions { width: 100%; gap: 10px 14px; }
  .compact-target { width: 100%; justify-content: space-between; }
  .compact-target input { width: 140px; }
  .span-3 { grid-column: span 12; }
  .activity-card, .goal-card { min-height: 0; padding: 20px; }
  .activity-meta { grid-template-columns: 1fr; margin-top: 26px; }
  .goal-numbers, .details-row { grid-template-columns: 1fr; }
  .goal-numbers { gap: 12px; }
  .details-row { gap: 14px; }
  .activity-icon-wrap { width: 56px; height: 56px; flex-basis: 56px; }
}
