:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --surface-soft: #f0f1ec;
  --ink: #20231e;
  --muted: #777c73;
  --line: #e1e3dc;
  --green: #2d6a4f;
  --green-soft: #e2eee7;
  --green-bright: #b7ef73;
  --orange: #e6864c;
  --red: #d7675b;
  --blue: #5778b8;
  --shadow: 0 18px 48px rgba(42, 47, 38, .07);
  --sidebar: 108px;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
svg { display: block; }
.hidden { display: none !important; }

.loading {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  background: #1d211c;
  transition: opacity .25s ease;
}

.loading.done { opacity: 0; pointer-events: none; }

.logo-mark {
  color: #fff;
  font-size: 25px;
  font-weight: 850;
  letter-spacing: -2px;
  line-height: 1;
  text-decoration: none;
}

.logo-mark span {
  color: var(--green-bright);
  font-size: 14px;
  letter-spacing: -.7px;
}

.logo-mark--dark { color: var(--ink); font-size: 32px; }
.logo-mark--dark span { font-size: 18px; }

.overline {
  margin: 0;
  color: #969c92;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1.6px;
}

.login-screen {
  display: grid;
  grid-template-columns: minmax(420px, .8fr) minmax(0, 1.2fr);
  min-height: 100vh;
}

.login-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(42px, 8vw, 120px);
  background: var(--bg);
}

.login-card > .overline { margin: 70px 0 13px; }

.login-card h1 {
  margin: 0;
  font-size: clamp(39px, 4.4vw, 64px);
  letter-spacing: -4px;
  line-height: 1.08;
}

.login-intro {
  margin: 19px 0 38px;
  color: var(--muted);
}

.login-card form {
  display: grid;
  gap: 17px;
  max-width: 400px;
}

label {
  display: grid;
  gap: 8px;
  color: #5f655c;
  font-size: 11px;
  font-weight: 650;
}

input, select, textarea {
  width: 100%;
  border: 1px solid #d9dcd4;
  border-radius: 10px;
  outline: 0;
  color: var(--ink);
  background: var(--surface);
  transition: border-color .18s, box-shadow .18s;
}

input, select { height: 47px; padding: 0 13px; }
textarea { padding: 13px; resize: vertical; }

input:focus, select:focus, textarea:focus {
  border-color: #6d947f;
  box-shadow: 0 0 0 3px rgba(45, 106, 79, .1);
}

input::placeholder, textarea::placeholder { color: #b1b5ad; }

.primary-button, .secondary-button, .quiet-button, .file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 17px;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
  transition: transform .15s, background .15s, border-color .15s;
}

.primary-button { color: #fff; background: var(--green); }
.primary-button:hover { background: #245b43; transform: translateY(-1px); }
.secondary-button { border-color: #d8dbd3; background: var(--surface); }
.secondary-button:hover { border-color: #aeb5aa; }
.secondary-button:disabled { color: #a0a59c; cursor: not-allowed; }
.quiet-button { min-height: 36px; color: var(--green); background: var(--green-soft); }
.full-button { width: 100%; }

.error-text {
  min-height: 15px;
  margin: -5px 0;
  color: var(--red);
  font-size: 11px;
}

.login-quote {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  padding: clamp(44px, 7vw, 100px);
  color: #eef1eb;
  background:
    radial-gradient(circle at 68% 24%, rgba(183, 239, 115, .16), transparent 25%),
    #1d211c;
}

.login-quote::before {
  position: absolute;
  top: -11vw;
  right: -9vw;
  width: 42vw;
  height: 42vw;
  border: 1px solid rgba(183, 239, 115, .15);
  border-radius: 50%;
  content: "";
}

.login-quote p {
  position: relative;
  margin: 0 0 24px;
  font-size: clamp(29px, 3.5vw, 52px);
  font-weight: 500;
  letter-spacing: -2.5px;
  line-height: 1.35;
}

.login-quote span { color: #788075; font-size: 10px; letter-spacing: 2px; }

.sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: var(--sidebar);
  padding: 33px 15px 25px;
  background: #1d211c;
}

.sidebar nav {
  display: grid;
  gap: 13px;
  width: 100%;
  margin-top: 76px;
}

.sidebar nav a {
  display: grid;
  height: 61px;
  place-items: center;
  gap: 4px;
  border-radius: 14px;
  color: #798076;
  font-size: 10px;
  font-weight: 650;
  text-decoration: none;
}

.sidebar nav a svg { width: 19px; height: 19px; fill: currentColor; }
.sidebar nav a:hover { color: #dce2d8; background: #272c25; }
.sidebar nav a.active { color: var(--ink); background: var(--green-bright); }

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  color: #686f65;
  font-size: 9px;
}

.sync-dot { width: 6px; height: 6px; border-radius: 50%; background: #6ebd7c; }

.main { min-height: 100vh; margin-left: var(--sidebar); }

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
  padding: 18px clamp(24px, 5vw, 72px);
  border-bottom: 1px solid rgba(219, 222, 214, .85);
  background: rgba(247, 247, 244, .91);
  backdrop-filter: blur(15px);
}

.topbar p { margin: 0 0 5px; color: var(--muted); font-size: 10px; }
.topbar h1 { margin: 0; font-size: 22px; letter-spacing: -1px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.avatar-button {
  display: grid;
  width: 39px;
  height: 39px;
  border: 1px solid var(--line);
  border-radius: 50%;
  place-items: center;
  color: var(--green);
  background: var(--surface);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.content { padding: 30px clamp(24px, 5vw, 72px) 70px; }
.view { display: none; max-width: 1370px; margin: 0 auto; animation: enter .25s ease; }
.view.active { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(4px); } }

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 26px;
}

.day-button {
  display: grid;
  min-height: 65px;
  border: 1px solid transparent;
  border-radius: 12px;
  place-items: center;
  gap: 2px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.day-button span { font-size: 9px; }
.day-button strong { font-size: 16px; }
.day-button:hover { background: var(--surface-soft); }
.day-button.active { color: #fff; background: var(--green); }
.day-button.has-data::after { width: 4px; height: 4px; border-radius: 50%; background: var(--orange); content: ""; }
.day-button.active::after { background: var(--green-bright); }

.today-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, .65fr);
  gap: 32px;
  align-items: start;
}

.journal-column { min-width: 0; }

.composer {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.composer-top { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.composer-top > span { color: var(--muted); font-size: 10px; }

.entry-types { display: flex; gap: 6px; }
.entry-types button, .metric-tabs button {
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.entry-types button.active, .metric-tabs button.active {
  color: var(--green);
  background: var(--green-soft);
}

.composer form { margin-top: 18px; }
.title-input { height: 38px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0; font-size: 17px; font-weight: 700; }
.title-input:focus { border-bottom-color: var(--green); box-shadow: none; }
.composer textarea { min-height: 128px; border: 0; padding: 15px 0; font-size: 14px; line-height: 1.8; }
.composer textarea:focus { box-shadow: none; }

.exercise-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.exercise-fields label > div, .primary-metrics label > div, .secondary-metrics label > div, .unit-field {
  position: relative;
}

.exercise-fields b, .primary-metrics b, .secondary-metrics b, .unit-field b {
  position: absolute;
  top: 50%;
  right: 12px;
  color: #999f96;
  font-size: 9px;
  transform: translateY(-50%);
}

.exercise-fields input, .primary-metrics input, .secondary-metrics input, .unit-field input { padding-right: 48px; }

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
}

.composer-actions > span { color: #a2a79f; font-size: 9px; }

.timeline-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 37px 2px 17px;
}

.timeline-heading h2, .card-title h2, .settings-header h2, .trends-header h2 {
  margin: 6px 0 0;
  font-size: 21px;
  letter-spacing: -.8px;
}

.timeline-heading > span, .card-title > span { color: var(--muted); font-size: 10px; }
.timeline { position: relative; display: grid; gap: 13px; }

.timeline::before {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 10px;
  width: 1px;
  background: #daddd5;
  content: "";
}

.timeline-empty {
  border: 1px dashed #d8dbd3;
  border-radius: 14px;
  padding: 42px 22px;
  color: var(--muted);
  background: rgba(255,255,255,.35);
  font-size: 12px;
  text-align: center;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 21px 1fr auto;
  gap: 14px;
  align-items: start;
}

.timeline-dot {
  z-index: 1;
  width: 9px;
  height: 9px;
  margin: 17px 0 0 6px;
  border: 3px solid var(--bg);
  border-radius: 50%;
  box-sizing: content-box;
  background: var(--green);
}

.timeline-dot.body { background: var(--blue); }
.timeline-dot.meal { background: var(--orange); }
.timeline-dot.note { background: #92978f; }

.timeline-content {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 15px 17px;
  background: var(--surface);
}

.timeline-content header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.timeline-content header span { color: var(--muted); font-size: 9px; }
.timeline-content strong { font-size: 12px; }
.timeline-content p { margin: 8px 0 0; color: #646a61; font-size: 12px; line-height: 1.65; white-space: pre-wrap; }
.timeline-content small { display: inline-block; margin-top: 9px; color: var(--green); font-size: 9px; font-weight: 700; }

.delete-button {
  border: 0;
  padding: 13px 4px;
  color: #a5aaa2;
  background: transparent;
  cursor: pointer;
}

.status-column { position: sticky; top: 118px; display: grid; gap: 16px; }

.status-card, .watch-card, .day-glance, .activity-panel, .insight-panel, .recent-days, .profile-form {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  background: var(--surface);
}

.watch-card {
  overflow: hidden;
  border-color: #30382e;
  color: #eef3eb;
  background:
    radial-gradient(circle at 88% 4%, rgba(183, 239, 115, .17), transparent 33%),
    #20261f;
}

.watch-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.watch-heading .overline { color: #7f8a7a; }
.watch-heading h2 { margin: 6px 0 0; font-size: 21px; letter-spacing: -.8px; }
.watch-heading-actions { display: flex; align-items: center; gap: 6px; }
#watch-state {
  border: 1px solid #414a3e;
  border-radius: 99px;
  padding: 5px 8px;
  color: #9da69a;
  background: #2a3128;
  font-size: 9px;
}
#watch-state.connected { border-color: #58744e; color: var(--green-bright); }
#watch-refresh {
  display: grid;
  width: 28px;
  height: 28px;
  border: 1px solid #414a3e;
  border-radius: 50%;
  padding: 0;
  place-items: center;
  color: #aab3a6;
  background: #2a3128;
  cursor: pointer;
}
#watch-refresh:hover { border-color: #667760; color: var(--green-bright); }
#watch-refresh:disabled { cursor: wait; opacity: .55; }
.watch-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 19px; }
.watch-metrics div {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 3px 8px;
  min-width: 0;
  border: 1px solid #343c32;
  border-radius: 11px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, .035);
}
.watch-metrics div:last-child { grid-column: 1 / -1; }
.watch-metrics span { grid-column: 1 / -1; color: #8f998b; font-size: 9px; }
.watch-metrics strong { overflow: hidden; font-size: 19px; letter-spacing: -.7px; text-overflow: ellipsis; }
.watch-metrics small { color: #8f998b; font-size: 8px; }
.watch-sync { display: flex; align-items: center; gap: 7px; margin-top: 14px; color: #7f897b; font-size: 9px; }
.watch-sync-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green-bright); box-shadow: 0 0 0 4px rgba(183, 239, 115, .08); }

.card-title { display: flex; align-items: start; justify-content: space-between; gap: 15px; }
#checkin-state { border-radius: 99px; padding: 6px 9px; color: var(--muted); background: var(--surface-soft); }
#checkin-state.saved { color: var(--green); background: var(--green-soft); }
.status-card form { margin-top: 23px; }
.primary-metrics, .secondary-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }

.feeling-field { margin: 23px 0 17px; border: 0; padding: 0; }
.feeling-field legend { margin-bottom: 12px; color: #5f655c; font-size: 11px; font-weight: 650; }
.scale-options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.scale-options label { display: block; }
.scale-options input { position: absolute; opacity: 0; pointer-events: none; }
.scale-options span {
  display: grid;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  place-items: center;
  background: var(--bg);
  cursor: pointer;
}
.scale-options input:checked + span { border-color: var(--green); color: #fff; background: var(--green); }
.scale-labels { display: flex; justify-content: space-between; margin-top: 6px; color: #a0a59d; font-size: 9px; }

.disclosure {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 15px 0;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  cursor: pointer;
}

.more-health { margin-bottom: 17px; }
.text-field { margin-top: 12px; }
.text-field textarea { min-height: 64px; }
.day-glance > div { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 17px; }
.day-glance span { display: grid; gap: 3px; border-right: 1px solid var(--line); text-align: center; }
.day-glance span:last-child { border: 0; }
.day-glance b { font-size: 17px; }
.day-glance small { color: var(--muted); font-size: 9px; }

.trends-header { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.trends-header h2, .settings-header h2 { font-size: 30px; letter-spacing: -1.7px; }
.trends-header p:last-child, .settings-header > p:last-child { margin: 9px 0 0; color: var(--muted); font-size: 12px; }
.trends-header select { width: auto; min-width: 130px; background: var(--surface); }
.metric-tabs { display: flex; gap: 6px; margin: 30px 0 15px; }

.chart-panel {
  min-height: 405px;
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 26px;
  background: var(--surface);
}

.chart-meta { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.chart-meta > div { display: flex; align-items: baseline; gap: 7px; }
.chart-meta span { margin-right: 6px; color: var(--muted); font-size: 11px; }
.chart-meta strong { font-size: 31px; letter-spacing: -1.5px; }
.chart-meta small { color: var(--muted); font-size: 10px; }
.chart-meta p { margin: 0; color: var(--muted); font-size: 10px; }
.main-chart { min-height: 300px; margin-top: 24px; }
.main-chart svg { width: 100%; height: 300px; overflow: visible; }
.chart-empty { display: grid; height: 280px; place-items: center; color: var(--muted); font-size: 11px; text-align: center; }
.grid-line { stroke: #e8eae4; stroke-width: 1; }
.axis-label { fill: #969c93; font-size: 9px; }
.trend-area { fill: url("#trendFill"); }
.trend-line { fill: none; stroke: var(--green); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.trend-point { fill: var(--surface); stroke: var(--green); stroke-width: 2; }

.process-grid { display: grid; grid-template-columns: 1.45fr .75fr; gap: 17px; margin-top: 17px; }
.activity-grid { display: grid; grid-template-columns: repeat(12, 1fr); grid-template-rows: repeat(7, 11px); grid-auto-flow: column; gap: 5px; margin-top: 23px; }
.activity-cell { border-radius: 3px; background: #eceee9; }
.activity-cell.l1 { background: #dceadf; }
.activity-cell.l2 { background: #9fcaab; }
.activity-cell.l3 { background: #5d9b76; }
.activity-cell.l4 { background: var(--green); }
.activity-legend { display: flex; align-items: center; justify-content: flex-end; gap: 5px; margin-top: 12px; color: var(--muted); font-size: 9px; }
.activity-legend i { width: 10px; height: 10px; border-radius: 3px; background: #eceee9; }
.activity-legend i:nth-of-type(2) { background: #dceadf; }
.activity-legend i:nth-of-type(3) { background: #9fcaab; }
.activity-legend i:nth-of-type(4) { background: var(--green); }

.insight-panel { color: #eef2ec; background: #242a22; }
.ai-label { display: flex; align-items: center; gap: 8px; color: #9da69a; font-size: 10px; }
.ai-label span { display: grid; width: 28px; height: 28px; border-radius: 8px; place-items: center; color: var(--ink); background: var(--green-bright); font-weight: 800; }
.insight-panel h3 { margin: 25px 0 10px; font-size: 18px; }
.insight-panel p { margin: 0 0 24px; color: #a7afa3; font-size: 11px; line-height: 1.7; }
.insight-panel .secondary-button { border-color: #414a3e; color: #dbe1d7; background: transparent; }
.insight-meta { margin: -12px 0 16px; color: #778071; font-size: 9px; }
.insight-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.insight-actions select {
  width: 112px;
  height: 38px;
  border-color: #414a3e;
  color: #dbe1d7;
  background: #2e352c;
}
.insight-actions .secondary-button { min-height: 38px; padding-inline: 13px; }
.text-button {
  border: 0;
  padding: 8px 2px;
  color: var(--green-bright);
  background: transparent;
  font-size: 10px;
  cursor: pointer;
}
.ai-privacy { display: block; margin-top: 14px; color: #727b6e; font-size: 8px; line-height: 1.5; }

.recent-days { margin-top: 17px; }
.recent-days-list { margin-top: 16px; }
.recent-row { display: grid; grid-template-columns: 110px 1fr repeat(4, minmax(70px, .5fr)); gap: 12px; align-items: center; min-height: 53px; border-bottom: 1px solid #e8eae4; font-size: 10px; }
.recent-row:last-child { border: 0; }
.recent-row > span:not(:first-child) { color: var(--muted); }
.recent-row strong { font-size: 11px; }

.settings-header { margin-bottom: 28px; }
.settings-grid { display: grid; gap: 12px; }
.integration-card { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; border-bottom: 1px solid var(--line); padding: 22px 2px; }
.integration-icon { display: grid; width: 46px; height: 46px; border-radius: 13px; place-items: center; color: #fff; background: var(--ink); font-size: 14px; font-weight: 800; }
.integration-icon.apple { color: #c54a51; background: #f8dfe0; font-size: 19px; }
.integration-icon.device { color: #456ba9; background: #dfe7f7; font-size: 20px; }
.integration-icon.ai { color: var(--ink); background: var(--green-bright); }
.integration-copy > div { display: flex; align-items: center; gap: 10px; }
.integration-copy h3 { margin: 0; font-size: 14px; }
.integration-copy p { margin: 7px 0 4px; color: #62685f; font-size: 11px; }
.integration-copy small { color: #9a9f97; font-size: 9px; }
.status-pill { border-radius: 99px; padding: 4px 7px; color: var(--muted); background: var(--surface-soft); font-size: 9px; }
.status-pill.connected { color: var(--green); background: var(--green-soft); }
.file-button { position: relative; border-color: #d8dbd3; background: var(--surface); }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.profile-form { margin-top: 38px; padding: 27px; }
.form-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 13px; margin-top: 24px; }
.form-submit { display: flex; align-items: center; justify-content: space-between; margin-top: 25px; padding-top: 20px; border-top: 1px solid var(--line); }
.form-submit span { color: var(--muted); font-size: 10px; }

dialog {
  width: min(92vw, 540px);
  max-height: min(84vh, 760px);
  overflow-y: auto;
  border: 0;
  border-radius: 18px;
  padding: 34px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(20, 24, 19, .65); backdrop-filter: blur(4px); }
dialog h2 { margin: 9px 0 18px; font-size: 24px; letter-spacing: -1px; }
dialog > p:not(.overline) { color: var(--muted); font-size: 12px; line-height: 1.75; }
.dialog-close { position: absolute; top: 17px; right: 17px; display: grid; width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 50%; place-items: center; background: transparent; cursor: pointer; }
.dialog-report { display: grid; gap: 18px; margin-top: 22px; }
.dialog-report section { border-top: 1px solid var(--line); padding-top: 16px; }
.dialog-report h3 { margin: 0 0 10px; font-size: 12px; }
.dialog-report ul, .dialog-report ol { display: grid; gap: 8px; margin: 0; padding-left: 19px; color: #555d52; font-size: 11px; line-height: 1.65; }
.data-quality { border-radius: 10px; margin: 0; padding: 11px 13px; color: #667063; background: var(--surface-soft); font-size: 10px; line-height: 1.6; }
.report-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.report-history { display: flex; flex-wrap: wrap; gap: 7px; }
.report-history button { border: 1px solid var(--line); border-radius: 99px; padding: 7px 10px; color: var(--muted); background: var(--surface); font-size: 9px; cursor: pointer; }
.report-history button.active { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.danger-text-button { flex: 0 0 auto; border: 0; padding: 7px 0; color: #a35b5b; background: transparent; font-size: 9px; cursor: pointer; }
.dialog-disclaimer { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 16px; }

.toast {
  position: fixed;
  z-index: 2000;
  right: 24px;
  bottom: 24px;
  max-width: calc(100vw - 32px);
  border-radius: 10px;
  padding: 13px 16px;
  color: #fff;
  background: #252a23;
  box-shadow: var(--shadow);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: .2s;
}
.toast.show { opacity: 1; transform: none; }
.toast.error { background: #a84e45; }

@media (max-width: 1050px) {
  .today-layout { grid-template-columns: 1fr; }
  .status-column { position: static; grid-row: 1; grid-template-columns: 1fr .65fr; }
  .watch-card { grid-column: 1 / -1; }
  .watch-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .watch-metrics div:last-child { grid-column: auto; }
  .journal-column { grid-row: 2; }
  .form-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 760px) {
  :root { --sidebar: 0px; }
  body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .login-screen { grid-template-columns: 1fr; }
  .login-quote { display: none; }
  .login-card { min-height: 100vh; padding: 34px 25px; }
  .login-card > .overline { margin-top: auto; }
  .login-card form { margin-bottom: auto; }
  .sidebar {
    inset: auto 0 0;
    display: block;
    width: auto;
    height: calc(66px + env(safe-area-inset-bottom));
    padding: 7px 15px env(safe-area-inset-bottom);
    border-top: 1px solid #333831;
  }
  .sidebar > .logo-mark, .sidebar-foot { display: none; }
  .sidebar nav { grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 0; }
  .sidebar nav a { height: 52px; gap: 2px; }
  .main { margin-left: 0; }
  .topbar { min-height: 73px; padding: 13px 17px; }
  .topbar h1 { font-size: 19px; }
  .topbar p { display: none; }
  .content { padding: 15px 13px 38px; }
  .week-strip { gap: 3px; margin-bottom: 15px; }
  .day-button { min-height: 57px; border-radius: 10px; }
  .day-button strong { font-size: 14px; }
  .today-layout { gap: 14px; }
  .status-column { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .day-glance { grid-row: 1; padding: 16px; }
  .watch-card { grid-column: auto; grid-row: 2; }
  .watch-metrics { grid-template-columns: 1fr 1fr; }
  .watch-metrics div:last-child { grid-column: 1 / -1; }
  .status-card { grid-row: 3; }
  .composer, .status-card, .watch-card, .day-glance, .chart-panel, .activity-panel, .insight-panel, .recent-days, .profile-form { border-radius: 14px; padding: 18px; }
  .composer-top { align-items: start; flex-direction: column; }
  .entry-types { width: 100%; }
  .entry-types button { flex: 1; padding-inline: 6px; }
  .composer textarea { min-height: 110px; }
  .composer-actions > span { display: none; }
  .composer-actions .primary-button { width: 100%; }
  .timeline-heading { margin-top: 28px; }
  .process-grid { grid-template-columns: 1fr; }
  .trends-header { align-items: start; flex-direction: column; gap: 15px; }
  .metric-tabs { overflow-x: auto; margin-inline: -13px; padding-inline: 13px; }
  .metric-tabs button { flex: 0 0 auto; }
  .chart-panel { min-height: 350px; }
  .chart-meta { align-items: start; flex-direction: column; }
  .main-chart, .main-chart svg { height: 245px; min-height: 245px; }
  .recent-row { grid-template-columns: 85px 1fr 1fr; }
  .recent-row > span:nth-child(n+4) { display: none; }
  .integration-card { grid-template-columns: auto 1fr; }
  .integration-card > .secondary-button, .integration-card > .file-button { grid-column: 1 / -1; width: 100%; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-submit { align-items: stretch; flex-direction: column; gap: 15px; }
  .form-submit .primary-button { width: 100%; }
  .toast { right: 16px; bottom: calc(82px + env(safe-area-inset-bottom)); }
}

@media (max-width: 420px) {
  .primary-metrics, .secondary-metrics, .exercise-fields, .form-grid { grid-template-columns: 1fr; }
  .integration-copy > div { align-items: start; flex-direction: column; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
