:root {
  color-scheme: light;
  --bg: #f7f8f5;
  --surface: #ffffff;
  --surface-strong: #edf4ef;
  --ink: #182221;
  --muted: #66706d;
  --line: #dfe6e1;
  --brand: #225b5a;
  --brand-2: #7a9b76;
  --gold: #f3c96b;
  --coral: #d86e5f;
  --shadow: 0 14px 34px rgba(29, 45, 43, 0.11);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  padding: max(14px, env(safe-area-inset-top)) 14px calc(82px + env(safe-area-inset-bottom));
}

.onboarding {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(247, 248, 245, 0.96);
}

.onboarding[hidden] {
  display: none;
}

.onboarding-card {
  width: min(460px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.onboarding-card h2 {
  margin: 0;
  font-size: 25px;
  line-height: 1.2;
}

.onboarding-card label {
  margin-top: 14px;
}

.choice-group {
  margin-top: 16px;
}

.choice-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.choice-card {
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  font-weight: 800;
}

.choice-card.selected {
  border-color: var(--brand);
  background: var(--surface-strong);
  color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.topbar,
.panel-heading,
.button-row,
.top-actions {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 16px;
  max-width: 920px;
  margin: 0 auto 12px;
}

.topbar h1,
.panel h2,
.status-panel strong {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: 23px;
  line-height: 1.1;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
  line-height: 1.55;
}

.helper-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.save-notice {
  min-height: 22px;
  margin: 0;
  color: var(--brand);
  font-weight: 800;
}

.top-actions {
  gap: 8px;
}

.icon-button {
  min-width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 750;
}

.language-badge {
  display: grid;
  place-items: center;
  min-width: 58px;
  height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

main {
  max-width: 920px;
  margin: 0 auto;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.status-panel {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 12px;
  align-items: center;
  padding: 15px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow);
}

.status-panel .eyebrow,
.status-panel .muted {
  color: rgba(255, 255, 255, 0.78);
}

.status-panel strong {
  display: block;
  font-size: 24px;
  line-height: 1.1;
}

.score-ring {
  display: grid;
  place-items: center;
  width: 88px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--gold) 0deg, rgba(255,255,255,0.22) 0deg);
}

.score-ring span {
  display: grid;
  place-items: center;
  width: 62px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 24px;
  font-weight: 800;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.quick-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.quick-card {
  min-height: 86px;
  padding: 10px;
  text-align: left;
}

.quick-card strong,
.quick-card small {
  display: block;
}

.quick-card small {
  margin-top: 4px;
  color: var(--muted);
}

.quick-icon {
  display: grid;
  place-items: center;
  width: 28px;
  aspect-ratio: 1;
  margin-bottom: 8px;
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--brand);
  font-size: 17px;
  font-weight: 800;
}

.panel {
  padding: 14px;
  margin-top: 10px;
}

.reminder-panel {
  border-color: rgba(34, 91, 90, 0.24);
  background: var(--surface-strong);
}

.reminder-panel h2 {
  font-size: 18px;
}

.reminder-button {
  min-width: 132px;
}

.reminder-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.reminder-summary article,
.reminder-insight {
  padding: 10px;
  border: 1px solid rgba(34, 91, 90, 0.18);
  border-radius: 8px;
  background: #fff;
}

.reminder-summary strong {
  display: block;
  color: var(--brand);
  font-size: 18px;
}

.reminder-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.subtle-top {
  margin-top: 10px;
}

.mode-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.mode-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand);
  font-weight: 850;
}

.mode-button.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.reminder-insight {
  margin-top: 12px;
  color: var(--brand);
  font-weight: 800;
  line-height: 1.5;
}

.reminder-insight summary {
  cursor: pointer;
  list-style-position: inside;
}

.micro-detail-body {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding-left: 18px;
  color: var(--muted);
}

.micro-detail-body strong {
  color: var(--brand);
  font-size: 12px;
}

.micro-detail-body span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
}

.tracking-setup-panel h2 {
  font-size: 22px;
}

.compact-setup-panel {
  padding: 14px;
}

.compact-setup-panel h2 {
  margin-bottom: 4px;
  font-size: 18px;
}

.compact-setup-panel > .muted {
  margin: 0;
  font-size: 13px;
}

.compact-setup-panel .setup-grid {
  gap: 8px;
  margin-top: 10px;
}

.compact-setup-panel .setup-card {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px;
}

.compact-setup-panel .setup-card .muted,
.compact-setup-panel .notify-sound-note {
  display: none;
}

.compact-setup-panel .setup-status {
  margin-top: 3px;
}

.today-routine-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 10px 12px;
  align-items: center;
}

.today-routine-panel .eyebrow,
.today-routine-panel h2,
.today-routine-panel .muted,
.today-routine-panel .routine-status {
  grid-column: 1;
}

.today-routine-panel h2 {
  font-size: 18px;
}

.today-routine-panel .muted {
  margin: 0;
  font-size: 13px;
}

.today-routine-panel .timer {
  grid-column: 2;
  grid-row: 1 / span 4;
  width: 92px;
  margin: 0;
  border-width: 7px;
  font-size: 21px;
}

.today-routine-panel .routine-status {
  min-height: 0;
  margin: 0;
  text-align: left;
  font-size: 12px;
}

.today-routine-panel .button-row {
  grid-column: 1 / -1;
  justify-content: stretch;
  gap: 8px;
}

.today-routine-panel .button-row button {
  flex: 1;
  min-width: 0;
  padding-inline: 8px;
}

.setup-grid {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.setup-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(34, 91, 90, 0.16);
  border-radius: 8px;
  background: var(--surface-strong);
}

.setup-card strong,
.setup-card span {
  display: block;
}

.setup-action {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 34px;
  padding: 0 8px 0 10px;
  border: 1px solid rgba(34, 91, 90, 0.22);
  border-radius: 8px;
  background: #fff;
  color: var(--brand);
  white-space: nowrap;
  font-size: 13px;
  font-weight: 850;
}

.setup-action span[aria-hidden="true"] {
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.setup-status {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.setup-status.ready {
  color: var(--brand);
}

.notify-sound-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
}

.notify-sound-note.ready {
  color: #4f746b;
}

.focus-panel {
  border-color: rgba(34, 91, 90, 0.36);
  box-shadow: 0 0 0 2px rgba(34, 91, 90, 0.08);
}

.knowledge-panel textarea {
  margin-top: 2px;
}

.knowledge-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.knowledge-chip,
.text-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

.knowledge-chip {
  padding: 0 10px;
}

.text-button {
  justify-self: start;
  padding: 0 12px;
}

.knowledge-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.knowledge-card,
.knowledge-answer {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.knowledge-answer {
  border-color: rgba(34, 91, 90, 0.24);
  background: var(--surface-strong);
}

.knowledge-card summary,
.knowledge-answer summary {
  display: block;
  margin-bottom: 6px;
}

.knowledge-card summary,
.knowledge-answer summary {
  color: var(--ink);
  cursor: pointer;
  font-weight: 850;
  list-style-position: inside;
}

.knowledge-card:not([open]) summary,
.knowledge-answer:not([open]) summary {
  margin-bottom: 0;
}

.knowledge-card p,
.knowledge-answer p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.knowledge-answer dl {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
}

.knowledge-answer dt {
  color: var(--brand);
  font-size: 12px;
  font-weight: 850;
}

.knowledge-answer dd {
  margin: 3px 0 0;
  color: var(--ink);
  line-height: 1.5;
}

.knowledge-card small {
  display: block;
  margin-top: 8px;
  color: var(--brand);
  font-weight: 750;
  line-height: 1.45;
}

.compact-answer:not([open]) {
  padding-block: 10px;
}

.compact-answer p {
  margin-top: 4px;
  font-size: 13px;
}

.panel-heading {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel h2 {
  font-size: 20px;
  line-height: 1.25;
}

.primary,
.secondary {
  min-height: 44px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 760;
}

.primary {
  border: 0;
  background: var(--brand);
  color: #fff;
}

.secondary {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--brand);
}

.reminder-row,
.form-grid,
.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric-grid .metric-card:first-child {
  grid-column: 1 / -1;
}

.community-hero {
  background: var(--surface-strong);
}

.community-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.community-stats article {
  padding: 12px;
  border: 1px solid rgba(34, 91, 90, 0.16);
  border-radius: 8px;
  background: #fff;
}

.community-stats strong,
.community-stats span {
  display: block;
}

.community-stats strong {
  color: var(--brand);
  font-size: 24px;
  line-height: 1.1;
}

.community-stats span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.leaderboard-list,
.community-feed {
  display: grid;
  gap: 8px;
}

.leaderboard-item,
.feed-item {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.leaderboard-item {
  grid-template-columns: 44px 36px minmax(0, 1fr) auto;
}

.leaderboard-item.is-me {
  border-color: rgba(34, 91, 90, 0.36);
  background: var(--surface-strong);
}

.rank {
  display: grid;
  place-items: center;
  width: 38px;
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 850;
}

.leaderboard-item strong,
.leaderboard-item small,
.feed-item strong,
.feed-item small {
  display: block;
}

.leaderboard-item small,
.feed-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.leaderboard-score {
  min-width: 68px;
  text-align: right;
}

.leaderboard-score strong {
  color: var(--brand);
  font-size: 20px;
}

.community-avatar,
.feed-avatar {
  width: 34px;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-strong);
}

.community-avatar.initials {
  display: grid;
  place-items: center;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.feed-item {
  grid-template-columns: 28px minmax(0, 1fr);
}

.feed-item > span {
  display: grid;
  place-items: center;
  width: 26px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--brand);
  font-weight: 900;
}

.profile-editor {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin-top: 14px;
}

.avatar-preview {
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 76px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--brand);
  font-size: 22px;
  font-weight: 900;
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-panel canvas {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 3 / 4;
  display: block;
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.compact-leaderboard-panel,
.compact-feed-panel {
  padding-block: 16px;
}

.poster-profile-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-top: 14px;
}

.compact-avatar {
  width: 58px;
  font-size: 18px;
}

.poster-profile-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 0.7fr);
  gap: 10px;
}

.file-button input {
  padding-top: 10px;
}

.trend-insight {
  margin: 14px 0 0;
  padding: 12px;
  border: 1px solid rgba(34, 91, 90, 0.18);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--brand);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.55;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

select,
input {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 12px;
}

.daily-form {
  display: grid;
  gap: 12px;
}

.daily-check-panel .panel-heading {
  margin-bottom: 8px;
}

.daily-check-panel textarea,
#trendView .knowledge-panel textarea {
  min-height: 76px;
}

.compact-grid {
  max-width: 420px;
}

.daily-form label:has(input[type="range"]) {
  grid-template-columns: 74px 1fr 34px;
  align-items: center;
}

input[type="range"] {
  padding: 0;
  accent-color: var(--brand);
}

.recovery-fieldset {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.recovery-fieldset legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.checkbox-card {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.checkbox-card input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--brand);
}

.action-hero {
  background: var(--surface-strong);
}

.timer {
  margin: 22px auto;
  width: min(230px, 70vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 12px solid #fff;
  border-radius: 50%;
  color: var(--brand);
  font-size: 44px;
  font-weight: 850;
  box-shadow: inset 0 0 0 1px var(--line);
}

.routine-status {
  min-height: 22px;
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  text-align: center;
}

.button-row {
  justify-content: center;
  gap: 10px;
}

.button-row.left {
  justify-content: flex-start;
}

.full-width {
  width: 100%;
  margin-top: 16px;
}

.routine-list,
.action-list,
.log-list,
.photo-grid {
  display: grid;
  gap: 10px;
}

.routine-item,
.action-item,
.log-item,
.metric-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.routine-item strong,
.action-item strong,
.log-item strong,
.metric-card strong {
  display: block;
  margin-bottom: 4px;
}

.action-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.action-item strong {
  margin-bottom: 0;
}

.action-item span {
  text-align: right;
}

.log-item details {
  margin-top: 10px;
}

.log-item summary {
  color: var(--brand);
  cursor: pointer;
  font-weight: 800;
}

.log-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 0;
}

.log-detail-grid div {
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-strong);
}

.log-detail-grid dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.log-detail-grid dd {
  margin: 4px 0 0;
  font-weight: 850;
}

.photo-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

.photo-card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  aspect-ratio: 3 / 4;
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-card span {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(24, 34, 33, 0.72);
  color: #fff;
  font-size: 11px;
}

.warning-panel {
  border-color: #efc3bb;
  background: #fff8f6;
}

.warning-intro {
  margin: 8px 0 0;
  color: #5b3430;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
}

.settings-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.support-grid {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 14px;
}

.legal-links a,
.legal-links button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

.legal-link-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.legal-link-grid a,
.legal-link-grid button {
  display: grid;
  min-height: 48px;
  place-items: center;
  border: 1px solid rgba(34, 91, 90, 0.16);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--brand);
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
}

.legal-link-grid button {
  width: 100%;
}

.sheet-open {
  overflow: hidden;
}

.legal-sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  align-items: end;
  padding: 18px 14px max(18px, env(safe-area-inset-bottom));
  background: rgba(24, 34, 33, 0.38);
}

.legal-sheet-card {
  width: min(560px, 100%);
  max-height: min(78vh, 640px);
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 20px 50px rgba(24, 34, 33, 0.24);
}

.legal-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line);
}

.legal-sheet-header h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
}

.legal-sheet-body {
  overflow: auto;
  padding: 12px 14px 16px;
}

.legal-sheet-body p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.6;
}

.subscription-panel {
  border-color: rgba(34, 91, 90, 0.24);
  background: var(--surface-strong);
}

.data-guard-panel {
  display: grid;
  gap: 10px;
  border-color: rgba(34, 91, 90, 0.24);
  background: #f3f8f4;
}

.data-guard-panel h2 {
  font-size: 18px;
}

.data-guard-panel .button-row {
  margin-top: 0;
}

.backup-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.backup-status-grid article {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(34, 91, 90, 0.14);
  border-radius: 8px;
  background: #fff;
}

.backup-status-grid strong,
.backup-status-grid span {
  display: block;
}

.backup-status-grid strong {
  overflow: hidden;
  color: var(--brand);
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backup-status-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.icloud-panel {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid rgba(34, 91, 90, 0.18);
  border-radius: 8px;
  background: #fff;
}

.icloud-panel strong,
.icloud-panel span {
  display: block;
}

.icloud-panel strong {
  color: var(--brand);
  font-size: 15px;
}

.icloud-panel span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.icloud-panel .button-row {
  margin-top: 0;
}

.subscription-teaser-panel {
  border-color: rgba(216, 110, 95, 0.28);
  background: #fff8f6;
}

.subscription-price {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid rgba(34, 91, 90, 0.16);
  border-radius: 8px;
  background: #fff;
}

.subscription-price strong {
  color: var(--brand);
  font-size: 22px;
}

.subscription-price span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.subscription-price.compact {
  margin-bottom: 0;
}

.subscription-benefits {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding-left: 20px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.subscription-restore {
  justify-self: center;
  margin-top: 8px;
}

.subscription-interest {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.subscription-legal {
  text-align: center;
}

.subscription-legal a,
.subscription-legal button {
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-weight: 800;
  text-decoration: none;
}

.inline-legal-link {
  min-height: auto;
  padding: 0 4px;
  border: 0;
  background: transparent;
}

.support-item {
  display: block;
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(34, 91, 90, 0.16);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--text);
  text-align: left;
  text-decoration: none;
}

.support-item strong,
.support-item span {
  display: block;
}

.support-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.qr-placeholder {
  display: grid;
  place-items: center;
  width: 132px;
  aspect-ratio: 1;
  margin-top: 12px;
  border: 1px dashed rgba(34, 91, 90, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(34, 91, 90, 0.08) 50%, transparent 0) 0 0 / 16px 16px,
    linear-gradient(rgba(34, 91, 90, 0.08) 50%, transparent 0) 0 0 / 16px 16px,
    #fff;
  color: var(--brand);
  text-align: center;
}

.qr-placeholder small {
  display: block;
  max-width: 96px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.toggle-row {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.toggle-row input {
  width: 22px;
  min-height: 22px;
  accent-color: var(--brand);
}

.danger-lite {
  border-color: #efc3bb;
}

.warning-panel ul {
  margin: 12px 0 0;
  padding-left: 20px;
  color: #5b3430;
  line-height: 1.5;
}

.warning-panel li + li {
  margin-top: 8px;
}

.text-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--brand);
  font-weight: 760;
  text-decoration: none;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(440px, calc(100vw - 24px));
  min-height: 64px;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.nav-item {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
  padding: 6px 2px;
}

.nav-item span,
.nav-item small {
  display: block;
}

.nav-item span {
  height: 22px;
  font-size: 17px;
}

.nav-item small {
  font-size: 11px;
  line-height: 1.2;
}

.nav-item.active {
  color: var(--brand);
}

.legal-page {
  padding: 20px;
}

.legal-card {
  max-width: 760px;
  margin: 0 auto;
  padding: 22px;
  border-radius: 8px;
  background: #fff;
  line-height: 1.65;
}

@media (max-width: 680px) {
  .app-shell {
    padding-inline: 12px;
  }

  .status-panel {
    grid-template-columns: 1fr 92px;
    padding: 16px;
  }

  .status-panel strong {
    font-size: 25px;
  }

  .score-ring {
    width: 90px;
  }

  .score-ring span {
    width: 64px;
    font-size: 25px;
  }

  .quick-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .quick-card {
    min-height: 78px;
    padding: 8px 6px;
  }

  .quick-card small {
    display: none;
  }

  .quick-card strong {
    font-size: 12px;
    line-height: 1.25;
  }

  .quick-icon {
    width: 26px;
    margin-bottom: 6px;
  }

  .reminder-row,
  .reminder-summary,
  .form-grid,
  .metric-grid,
  .community-stats {
    grid-template-columns: 1fr;
  }

  .leaderboard-item {
    grid-template-columns: 34px 32px minmax(0, 1fr);
  }

  .leaderboard-score {
    grid-column: 3;
    min-width: 0;
    text-align: left;
  }

  .poster-profile-fields {
    grid-template-columns: 1fr;
  }

  .setup-status {
    width: fit-content;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .reminder-button {
    width: 100%;
  }

  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }

  .recovery-fieldset {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-editor {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .avatar-preview {
    width: 64px;
  }

  .today-routine-panel {
    grid-template-columns: minmax(0, 1fr) 82px;
  }

  .today-routine-panel .timer {
    width: 78px;
    font-size: 18px;
  }

  .today-routine-panel .button-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .today-routine-panel .button-row button {
    min-height: 38px;
    font-size: 12px;
  }
}
