:root {
  color-scheme: light;
  --bg: #f5f3ee;
  --surface: #ffffff;
  --surface-muted: #f0eee8;
  --text: #1f2726;
  --muted: #68706b;
  --line: #ded9cc;
  --accent: #286f6c;
  --accent-strong: #184f4d;
  --gold: #c4832b;
  --rose: #b85c5a;
  --blue: #3d6b9c;
  --shadow: 0 18px 50px rgba(31, 39, 38, 0.08);
  --panel-soft: #fcfbf8;
  --field-bg: #ffffff;
  --ring-center: #ffffff;
  --ring-track: #e7e2d8;
  --sidebar-bg: #243332;
  --sidebar-text: #f8f4eb;
  --sidebar-muted: rgba(248, 244, 235, 0.68);
  --sidebar-chip: rgba(248, 244, 235, 0.1);
  --preview-insight-bg: #f5f8f7;
  --preview-insight-text: #1f2726;
  --preview-insight-muted: #68706b;
  --warning-bg: #fff8eb;
  --danger-bg: #fff1ef;
  --success-bg: #f5f8f7;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.dark-theme {
  color-scheme: dark;
  --bg: #101715;
  --surface: #17211f;
  --surface-muted: #22302d;
  --text: #eef6f1;
  --muted: #a9b8b1;
  --line: #31423d;
  --accent: #6fcac0;
  --accent-strong: #9ee7dc;
  --gold: #e2b464;
  --rose: #dc827e;
  --blue: #7da6d6;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  --panel-soft: #1b2825;
  --field-bg: #111a18;
  --ring-center: #17211f;
  --ring-track: #2b3935;
  --sidebar-bg: #0d1211;
  --sidebar-text: #f5f1e8;
  --sidebar-muted: rgba(245, 241, 232, 0.68);
  --sidebar-chip: rgba(245, 241, 232, 0.09);
  --preview-insight-bg: #1e2d2a;
  --preview-insight-text: #eef6f1;
  --preview-insight-muted: #a9b8b1;
  --warning-bg: rgba(226, 180, 100, 0.13);
  --danger-bg: rgba(220, 130, 126, 0.13);
  --success-bg: rgba(111, 202, 192, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  grid-template-columns: 280px 1fr;
  background: var(--bg);
  color: var(--text);
}

body.auth-locked {
  display: block;
  grid-template-columns: none;
}

.auth-gate {
  display: none;
}

.auth-locked .sidebar,
.auth-locked .app-shell {
  display: none;
}

.auth-locked .auth-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(40, 111, 108, 0.12), rgba(196, 131, 43, 0.08) 44%, rgba(61, 107, 156, 0.08)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(245, 243, 238, 0) 360px),
    var(--bg);
}

body.dark-theme.auth-locked .auth-gate {
  background:
    linear-gradient(135deg, rgba(111, 202, 192, 0.12), rgba(226, 180, 100, 0.08) 44%, rgba(125, 166, 214, 0.08)),
    linear-gradient(180deg, rgba(16, 23, 21, 0.2), rgba(16, 23, 21, 0) 360px),
    var(--bg);
}

.auth-unlocked .auth-gate {
  display: none;
}

.auth-gate-shell {
  width: min(1240px, 100%);
  display: grid;
  grid-template-columns: minmax(380px, 0.78fr) minmax(0, 1.22fr);
  gap: 20px;
  align-items: stretch;
}

.auth-card {
  grid-column: 1;
  grid-row: 1;
}

.auth-intro {
  grid-column: 2;
  grid-row: 1;
}

.auth-intro,
.auth-card {
  min-width: 0;
}

.auth-intro {
  display: grid;
  gap: 20px;
  align-content: start;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(246, 248, 246, 0.92)),
    #fcfbf8;
  box-shadow: 0 24px 70px rgba(31, 39, 38, 0.1);
}

body.dark-theme .auth-intro {
  background:
    linear-gradient(145deg, rgba(23, 33, 31, 0.98), rgba(20, 30, 28, 0.94)),
    var(--surface);
}

.auth-brand {
  color: var(--text);
}

.auth-brand .brand-mark {
  border-color: var(--line);
  background: var(--accent);
  color: #fff;
}

.auth-brand p {
  color: var(--muted);
}

.auth-intro h2,
.auth-card h2 {
  margin: 0 0 10px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.03;
}

.auth-card h2 {
  font-size: clamp(28px, 3.1vw, 38px);
}

.auth-intro p:not(.eyebrow),
.auth-card p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.6;
}

.auth-product-preview {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 249, 0.96)),
    #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

body.dark-theme .auth-product-preview,
body.dark-theme .auth-card {
  background:
    linear-gradient(180deg, rgba(23, 33, 31, 0.98), rgba(19, 28, 26, 0.96)),
    var(--surface);
}

.preview-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.preview-topline span {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(40, 111, 108, 0.1);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
}

.preview-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.preview-metrics div {
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 12px;
  border: 1px solid rgba(222, 217, 204, 0.86);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(245, 248, 247, 0.92)),
    #fff;
}

.preview-metrics span,
.preview-metrics em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.preview-metrics strong {
  font-size: 26px;
  line-height: 1;
}

.preview-main {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(190px, 0.75fr);
  gap: 12px;
}

.appearance-preview {
  display: grid;
  grid-template-columns: 142px 1fr;
  gap: 20px;
  align-items: center;
  min-width: 0;
}

.appearance-figure,
.profile-appearance {
  position: relative;
  min-height: 168px;
  border-radius: 8px;
  background:
    url("assets/zoku-avatar.png") center / cover no-repeat,
    linear-gradient(180deg, rgba(40, 111, 108, 0.16), rgba(61, 107, 156, 0.12));
  overflow: hidden;
}

.appearance-figure span,
.profile-appearance span {
  display: none;
}

.profile-appearance.has-photo {
  background-size: cover;
  background-position: center;
}

.profile-appearance.has-photo span {
  display: none;
}

.appearance-tags,
.profile-card-tags,
.profile-feature-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.appearance-tags span,
.profile-card-tags span {
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(40, 111, 108, 0.1);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.preview-insight {
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--preview-insight-bg);
  color: var(--preview-insight-text);
}

.preview-insight p {
  color: var(--preview-insight-muted);
  line-height: 1.45;
}

.preview-chart-line {
  height: 82px;
  display: flex;
  align-items: flex-end;
  gap: 7px;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-muted);
}

.preview-chart-line span {
  flex: 1;
  min-width: 8px;
  border-radius: 999px 999px 3px 3px;
  background: linear-gradient(180deg, #e3b366, #7fc0b8);
}

.preview-habits,
.auth-capabilities {
  display: grid;
  gap: 10px;
}

.preview-habits {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.preview-habits span {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: linear-gradient(180deg, #f5f8f7, #eef3f1);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
}

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

.auth-capabilities div {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 122px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 247, 243, 0.96)),
    #fff;
}

.auth-capabilities span {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
}

.auth-capabilities p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.account-session-card span {
  color: var(--muted);
  line-height: 1.45;
}

.auth-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 16px;
  overflow: hidden;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(252, 251, 248, 0.96)),
    var(--surface);
}

.auth-card > *:not(.auth-card-glow) {
  position: relative;
  z-index: 1;
}

.auth-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.auth-card-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(40, 111, 108, 0.16), transparent 36%),
    radial-gradient(circle at 92% 8%, rgba(196, 131, 43, 0.22), transparent 28%);
}

body.dark-theme .auth-card-glow {
  background:
    linear-gradient(90deg, rgba(111, 202, 192, 0.12), transparent 38%),
    radial-gradient(circle at 92% 8%, rgba(226, 180, 100, 0.16), transparent 30%);
}

.auth-card-status {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.admin-hidden {
  display: none !important;
}

.hidden {
  display: none !important;
}

.auth-card-status div,
.auth-card-note,
.auth-recovery-panel,
.auth-legal-preview {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.auth-card-status span,
.auth-card-note span,
.auth-avatar-field p,
.auth-legal-preview p {
  color: var(--muted);
  line-height: 1.45;
}

.auth-mode-grid {
  display: grid;
  gap: 16px;
}

.auth-mode-panel {
  display: grid;
  gap: 14px;
  position: relative;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.auth-mode-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-top: 4px solid transparent;
}

.auth-register-panel {
  border-color: rgba(40, 111, 108, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(246, 250, 248, 0.86)),
    rgba(255, 255, 255, 0.78);
}

.auth-register-panel::before {
  border-top-color: var(--accent);
}

.auth-login-panel {
  order: -1;
  align-self: start;
  background:
    linear-gradient(180deg, rgba(252, 251, 248, 0.92), rgba(255, 255, 255, 0.8)),
    rgba(255, 255, 255, 0.74);
}

.auth-login-panel::before {
  border-top-color: var(--gold);
}

.auth-mode-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.auth-mode-head h3 {
  margin-top: 3px;
  font-size: 24px;
}

.auth-mode-head > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(40, 111, 108, 0.12);
  color: var(--accent-strong);
  font-weight: 850;
}

.auth-mode-copy {
  color: var(--muted);
  line-height: 1.5;
}

.auth-legal-gate {
  display: grid;
  gap: 10px;
}

.auth-legal-gate > button {
  justify-self: start;
}

.auth-legal-preview {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.auth-legal-preview div {
  display: grid;
  align-content: start;
  gap: 6px;
}

.auth-legal-preview p {
  margin: 0;
}

.auth-recovery-panel {
  gap: 12px;
}

.recovery-method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
  gap: 12px;
}

.recovery-method-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.recovery-method-card h4 {
  margin: 0;
  font-size: 18px;
}

.recovery-method-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.recovery-code-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.recovery-code-list code {
  display: block;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(40, 111, 108, 0.08);
  color: var(--accent-strong);
  font-weight: 850;
  text-align: center;
  letter-spacing: 0;
}

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

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

.recovery-method-card .auth-gate-form,
.recovery-method-card .auth-login-form {
  grid-template-columns: 1fr;
}

.auth-avatar-field {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.auth-avatar-preview {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background:
    url("assets/zoku-avatar.png") center / cover no-repeat,
    linear-gradient(180deg, rgba(40, 111, 108, 0.14), rgba(61, 107, 156, 0.11));
  background-size: cover, cover;
  background-position: center, center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.auth-avatar-preview span {
  display: none;
}

.auth-avatar-preview.has-photo span {
  display: none;
}

.auth-avatar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.profile-avatar-workbench {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.profile-avatar-preview {
  width: 118px;
  height: 118px;
  box-shadow: 0 16px 35px rgba(10, 43, 40, 0.12);
}

.date-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.date-control span {
  min-width: 86px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(40, 111, 108, 0.1);
  color: var(--ink);
  font-weight: 850;
  text-align: center;
}

.date-control input {
  width: 36px;
  min-width: 36px;
  height: 32px;
  border: 0;
  padding: 6px 4px;
  background: transparent;
  color: transparent;
  cursor: pointer;
}

.date-control input::-webkit-datetime-edit {
  display: none;
}

.date-control input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  margin: 0;
}

.tutorial-hero {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

.tutorial-zoku {
  min-height: 128px;
}

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

.tutorial-card {
  display: grid;
  gap: 10px;
  align-content: start;
}

.tutorial-card span {
  width: max-content;
  padding: 6px 9px;
  border-radius: 6px;
  background: var(--chip-bg);
  color: var(--accent-strong);
  font-weight: 950;
  font-size: 12px;
}

.tutorial-card h3,
.tutorial-card p {
  margin: 0;
}

.zoku-notification-panel .supporter-icon-preview {
  object-fit: contain;
  background: rgba(40, 111, 108, 0.08);
}

button,
input,
select,
textarea {
  font: inherit;
  min-width: 0;
  max-width: 100%;
}

.sidebar {
  min-height: 100vh;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: #f8f4eb;
  color: #243332;
  font-weight: 800;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.panel h3,
.panel p {
  margin: 0;
}

.brand h1 {
  font-size: 19px;
  line-height: 1.2;
}

.brand p {
  margin-top: 4px;
  color: var(--sidebar-muted);
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  color: rgba(248, 244, 235, 0.76);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  color: #243332;
  background: #f8f4eb;
}

.sidebar-summary {
  margin-top: 0;
  padding: 16px;
  border-radius: 8px;
  background: var(--sidebar-chip);
  position: sticky;
  top: 18px;
}

.sidebar-summary span,
.eyebrow {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar-summary span {
  color: rgba(248, 244, 235, 0.58);
}

.sidebar-summary strong {
  display: block;
  line-height: 1.45;
}

.app-shell {
  min-width: 0;
  padding: 28px;
}

.topbar {
  min-height: 70px;
  display: grid;
  grid-template-columns: minmax(210px, auto) minmax(220px, 1fr) max-content;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.topbar h2 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.topbar-ad-slot {
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 760;
  text-align: center;
}

.save-status {
  min-width: 132px;
  color: var(--muted);
  font-size: 0.84rem;
  text-align: right;
}

.report-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.report-tabs {
  display: flex;
  gap: 8px;
}

.donate-hero {
  margin-bottom: 18px;
  background:
    linear-gradient(135deg, rgba(40, 111, 108, 0.1), rgba(196, 131, 43, 0.12)),
    var(--surface);
}

.donate-hero h3 {
  margin-bottom: 10px;
  font-size: 30px;
}

.donate-hero p:not(.eyebrow) {
  max-width: 820px;
  color: var(--muted);
  line-height: 1.6;
}

.donate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.donate-card {
  display: grid;
  gap: 18px;
}

.donate-value {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fcfbf8;
}

.donate-value strong {
  font-size: 23px;
  letter-spacing: 0.02em;
}

.donate-value span {
  color: var(--muted);
}

.calendar-title {
  margin-bottom: 12px;
  font-size: 22px;
  font-weight: 850;
  text-transform: capitalize;
}

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

.calendar-weekdays {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.calendar-weekdays span {
  padding: 0 4px;
}

.calendar-cell {
  min-height: 76px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fcfbf8;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.calendar-cell.empty {
  border-color: transparent;
  background: transparent;
  cursor: default;
}

.calendar-cell span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.calendar-cell.low {
  background: rgba(184, 92, 90, 0.08);
}

.calendar-cell.medium {
  background: rgba(196, 131, 43, 0.14);
}

.calendar-cell.high {
  background: rgba(40, 111, 108, 0.16);
}

.calendar-cell.selected {
  outline: 3px solid rgba(40, 111, 108, 0.25);
  border-color: var(--accent);
}

.tab-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfbf8;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
}

.tab-button.active {
  border-color: var(--accent);
  background: rgba(40, 111, 108, 0.12);
  color: var(--accent-strong);
}

.primary-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.primary-button {
  padding: 0 18px;
  background: var(--accent);
  color: #fff;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.primary-button:disabled,
.icon-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.icon-button {
  padding: 0 14px;
  background: var(--surface-muted);
  color: var(--text);
}

.theme-toggle-button,
.auth-theme-button {
  white-space: nowrap;
}

.auth-theme-button {
  width: fit-content;
}

.bug-report-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.support-status-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
}

.support-status-button::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 0 3px rgba(184, 92, 90, 0.16);
}

.support-status-button.online::before {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(40, 111, 108, 0.16);
}

body.dark-theme .support-status-button.online::before {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(111, 202, 192, 0.18);
}

.support-wait {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 20, 18, 0.58);
  backdrop-filter: blur(6px);
}

.app-modal {
  width: min(920px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  box-shadow: 0 24px 70px rgba(8, 20, 18, 0.26);
}

.modal-head,
.modal-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-actions {
  align-items: center;
  justify-content: flex-start;
  margin-top: 12px;
}

.support-chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr);
  gap: 14px;
  margin-top: 14px;
}

.support-thread {
  display: grid;
  gap: 10px;
  min-height: 260px;
  max-height: 460px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.support-ticket-head,
.support-message > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.support-ticket-head strong,
.support-message strong {
  color: var(--text);
}

.support-message {
  display: grid;
  gap: 6px;
  width: min(82%, 560px);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.support-message.from-user {
  justify-self: end;
  border-color: rgba(105, 209, 200, 0.42);
}

.support-message p {
  margin: 0;
  line-height: 1.45;
}

.support-message img,
.modal-image-preview {
  width: min(260px, 100%);
  max-height: 180px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.support-compose,
.report-modal {
  display: grid;
  gap: 12px;
}

.file-drop {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.global-zoku-widget {
  margin-bottom: 16px;
}

body.auth-locked .global-zoku-widget {
  display: none;
}

.moderation-notice {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(185, 74, 72, 0.34);
  border-left: 5px solid var(--rose);
  border-radius: 8px;
  background: var(--danger-bg);
}

.moderation-notice > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.moderation-notice span {
  display: grid;
  gap: 3px;
  min-width: min(280px, 100%);
  padding: 9px 10px;
  border: 1px solid rgba(185, 74, 72, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.54);
  color: var(--muted);
}

body.dark-theme .moderation-notice span {
  background: rgba(16, 23, 21, 0.54);
}

.moderation-notice em {
  color: var(--text);
  font-style: normal;
}

.section {
  display: none;
}

.section.active {
  display: grid;
  gap: 18px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.35fr repeat(3, minmax(160px, 1fr));
  gap: 16px;
}

.zoku-widget {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(105, 209, 200, 0.14), rgba(196, 131, 43, 0.08)),
    var(--surface);
}

.zoku-widget::after {
  content: "";
  position: absolute;
  inset: 12px 12px auto auto;
  width: 96px;
  height: 96px;
  border: 1px solid rgba(105, 209, 200, 0.18);
  border-radius: 50%;
  pointer-events: none;
}

.zoku-widget[data-mood="alert"] {
  border-color: rgba(196, 131, 43, 0.52);
  background:
    linear-gradient(135deg, rgba(196, 131, 43, 0.16), rgba(105, 209, 200, 0.06)),
    var(--surface);
}

.zoku-widget[data-mood="plan"] {
  border-color: rgba(105, 209, 200, 0.44);
  background:
    linear-gradient(135deg, rgba(105, 209, 200, 0.18), rgba(71, 118, 188, 0.08)),
    var(--surface);
}

.zoku-portrait {
  width: 104px;
  height: 104px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.zoku-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  transform: scale(1.28);
  transition: transform 180ms ease, object-position 180ms ease;
}

.zoku-widget[data-mood="plan"] .zoku-portrait img {
  object-position: 51% 28%;
}

.zoku-widget[data-mood="alert"] .zoku-portrait img {
  object-position: 50% 20%;
}

.zoku-widget p:not(.eyebrow) {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.55;
}

.zoku-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.zoku-tags span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--chip);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
}

.zoku-tags span::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(105, 209, 200, 0.12);
}

.zoku-widget[data-mood="alert"] .zoku-tags span::before {
  background: var(--warning);
  box-shadow: 0 0 0 3px rgba(196, 131, 43, 0.15);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 16px;
}

.training-layout {
  grid-template-columns: 1fr;
  align-items: start;
}

.workout-log-panel {
  order: -1;
}

.training-layout > .panel {
  grid-column: 1 / -1;
}

.workout-log-panel {
  padding: 16px 20px;
}

.workout-log-panel .panel-head {
  margin-bottom: 10px;
}

.workout-log-panel .workout-list {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow-wrap: anywhere;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.panel h3 {
  font-size: 20px;
}

.score-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.score-panel strong {
  display: block;
  font-size: 42px;
  line-height: 1;
}

.score-panel span,
.metric span,
.goal-progress p {
  color: var(--muted);
}

.ring {
  width: 92px;
  height: 92px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--ring-center) 54%, transparent 55%),
    conic-gradient(var(--accent) calc(var(--value) * 1%), var(--ring-track) 0);
  color: var(--accent-strong);
  font-weight: 850;
}

.metric {
  display: grid;
  align-content: center;
  gap: 8px;
}

.metric p {
  color: var(--muted);
  font-weight: 750;
}

.metric strong {
  font-size: 30px;
  line-height: 1;
}

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

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

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

.source-search {
  grid-template-columns: 2fr 1fr 0.7fr;
}

.barcode-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}

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

.recipe-form {
  grid-template-columns: 1fr 180px;
}

.wide-field {
  grid-column: span 2;
}

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

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
}

input:focus,
select:focus {
  outline: 2px solid rgba(40, 111, 108, 0.18);
  border-color: var(--accent);
}

.checklist {
  display: grid;
  gap: 10px;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfbf8;
  color: var(--text);
  font-weight: 720;
}

.check-item.auto-check {
  background: #f5f8f7;
}

.check-item.auto-check.done {
  border-color: rgba(40, 111, 108, 0.35);
  background: rgba(40, 111, 108, 0.08);
}

.check-item.auto-check.warning {
  border-color: rgba(196, 131, 43, 0.45);
  background: #fff8eb;
}

.check-item.auto-check.alert {
  border-color: rgba(176, 64, 64, 0.45);
  background: #fff1ef;
}

.check-copy {
  display: grid;
  gap: 3px;
}

.check-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.check-copy em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 650;
  line-height: 1.35;
}

.check-item input {
  width: 18px;
  height: 18px;
  min-height: auto;
  margin-top: 2px;
  accent-color: var(--accent);
}

.check-item input:disabled {
  opacity: 1;
}

.advisor-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.evidence-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.source-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(196, 131, 43, 0.35);
  border-radius: 8px;
  background: #fff8eb;
  color: var(--text);
  line-height: 1.45;
}

.source-disclaimer strong {
  flex: 0 0 auto;
  color: #8a5a19;
  white-space: nowrap;
}

.source-disclaimer span {
  color: var(--muted);
}

.trusted-source-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.trusted-source-head {
  margin-bottom: 12px;
}

.trusted-source-head h4 {
  font-size: 17px;
}

.trusted-source-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.preset-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.exercise-builder {
  margin-top: 22px;
}

.compact-head {
  margin-bottom: 12px;
}

.exercise-draft,
.workout-list,
.exercise-list {
  display: grid;
  gap: 10px;
}

.exercise-row {
  display: grid;
  grid-template-columns: minmax(130px, 1.4fr) repeat(3, minmax(64px, 0.7fr)) 78px;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfbf8;
}

.remove-exercise {
  min-height: 42px;
  padding: 0 8px;
}

.preset-button,
.ghost-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfbf8;
  color: var(--text);
  cursor: pointer;
  font-weight: 750;
}

.preset-button {
  padding: 0 12px;
}

.preset-button small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.25;
}

.recipe-preset-strip,
.exercise-preset-strip {
  margin-top: 14px;
}

.workout-preset-strip,
.exercise-preset-strip {
  max-height: 220px;
}

.catalog-search {
  margin: 14px 0 12px;
}

.food-library-toolbar,
.exercise-filter-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(170px, auto) minmax(170px, auto);
  gap: 10px;
  align-items: center;
  margin: 14px 0 12px;
}

.exercise-filter-row {
  grid-template-columns: minmax(220px, 1fr) minmax(170px, auto);
  margin: 0 0 12px;
}

.food-library-toolbar .catalog-search,
.exercise-filter-row .catalog-search {
  margin: 0;
}

.allergen-box {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.recipe-preset-filter {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(105, 209, 200, 0.06);
}

.allergen-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.allergen-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-weight: 800;
  cursor: pointer;
}

.allergen-chip input {
  width: 16px;
  height: 16px;
  min-height: auto;
  accent-color: var(--accent);
}

.food-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

.food-badges.compact {
  margin-top: 6px;
}

.allergen-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid rgba(196, 131, 43, 0.32);
  border-radius: 999px;
  background: rgba(196, 131, 43, 0.11);
  color: var(--gold);
  font-size: 12px;
  font-weight: 850;
}

.exercise-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 14px;
  align-items: start;
}

.muscle-map {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  overflow: hidden;
}

.muscle-map p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.35;
}

.muscle-svg {
  width: 100%;
  max-height: 260px;
}

.muscle-caption {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-anchor: middle;
  text-transform: uppercase;
}

.muscle-base {
  fill: rgba(105, 209, 200, 0.1);
  stroke: rgba(105, 209, 200, 0.26);
  stroke-width: 1.7;
}

.muscle-outline {
  fill: rgba(26, 67, 60, 0.8);
  stroke: rgba(105, 209, 200, 0.28);
  stroke-width: 1.8;
}

.muscle-shadow {
  fill: none;
  stroke: rgba(0, 0, 0, 0.18);
  stroke-width: 9;
  stroke-linecap: round;
}

.muscle-zone {
  fill: rgba(105, 209, 200, 0.06);
  stroke: rgba(105, 209, 200, 0.28);
  stroke-width: 1.35;
  transition: fill 0.18s ease, stroke 0.18s ease, opacity 0.18s ease;
}

.muscle-zone.base {
  fill: rgba(105, 209, 200, 0.1);
}

.muscle-zone.active {
  fill: rgba(211, 62, 62, 0.82);
  stroke: rgba(255, 149, 137, 0.88);
}

.zone-back {
  opacity: 0.58;
}

.zone-mobility {
  stroke-dasharray: 5 5;
  stroke-linecap: round;
  fill: none;
}

.zone-mobility.active {
  fill: none;
  stroke: rgba(211, 62, 62, 0.9);
}

.muscle-detail {
  fill: none;
  stroke: rgba(105, 209, 200, 0.22);
  stroke-width: 1.25;
  stroke-linecap: round;
}

.compact-preset-strip {
  max-height: 176px;
  overflow: auto;
  padding-right: 4px;
}

.preset-button:hover,
.ghost-button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.meal-list {
  display: grid;
  gap: 14px;
}

.meal-group {
  display: grid;
  gap: 8px;
}

.meal-head,
.food-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.workout-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfbf8;
}

.workout-note {
  color: var(--muted);
  line-height: 1.45;
}

.exercise-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-muted);
}

.exercise-summary span {
  color: var(--muted);
}

.source-list,
.source-results,
.saved-foods {
  display: grid;
  gap: 12px;
}

.saved-foods {
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
}

.security-log {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  max-height: 360px;
  overflow: auto;
}

.security-event {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfbf8;
}

.security-event > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.security-event span,
.event-meta span {
  color: var(--muted);
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.event-meta span {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--surface-muted);
  font-size: 0.78rem;
}

.source-card,
.source-result,
.saved-food {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfbf8;
}

.source-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  color: var(--text);
  text-decoration: none;
}

.source-card:hover {
  border-color: var(--accent);
}

.source-card span,
.source-note,
.source-result span {
  color: var(--muted);
  line-height: 1.45;
}

.supporter-panel p:not(.eyebrow),
.achievement-card p {
  color: var(--muted);
  line-height: 1.45;
}

.supporter-icon-preview {
  width: 74px;
  height: 74px;
  flex: 0 0 auto;
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(13, 27, 34, 0.14);
}

.supporter-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 8px 4px 5px;
  border: 1px solid rgba(105, 209, 200, 0.42);
  border-radius: 999px;
  background: rgba(105, 209, 200, 0.12);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.supporter-badge img {
  width: 22px;
  height: 22px;
  border-radius: 7px;
}

.post-author {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.achievement-list {
  display: grid;
  gap: 18px;
}

.achievement-group {
  display: grid;
  gap: 10px;
}

.achievement-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}

.achievement-group-head strong {
  font-size: 1rem;
}

.achievement-group-head span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.achievement-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.achievement-card.locked {
  opacity: 0.58;
}

.achievement-card.unlocked {
  border-color: rgba(105, 209, 200, 0.58);
  background: linear-gradient(135deg, rgba(105, 209, 200, 0.16), rgba(196, 131, 43, 0.08));
}

.achievement-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
}

.achievement-card.locked .achievement-icon {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--line);
}

.supporter-achievement .achievement-icon {
  background: #c4832b;
}

.community-rules {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(196, 131, 43, 0.35);
  border-radius: 8px;
  background: rgba(196, 131, 43, 0.08);
}

.community-rules-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.community-rules-head span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(196, 131, 43, 0.16);
  color: var(--gold);
  font-size: 12px;
  font-weight: 850;
}

.community-rules p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.post-comments,
.direct-message-list,
.direct-thread {
  display: grid;
  gap: 10px;
}

.post-comments {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.post-comment,
.direct-message-card,
.direct-thread-message {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.post-comment > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.86rem;
}

.comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.direct-message-card {
  display: grid;
  gap: 10px;
}

.direct-thread-message.from-me {
  border-color: rgba(40, 111, 108, 0.35);
  background: rgba(40, 111, 108, 0.09);
}

.source-note {
  margin: 14px 0 0;
}

.source-result,
.saved-food {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
}

.source-result div:first-child,
.saved-food div:first-child {
  display: grid;
  gap: 5px;
}

.source-macros {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.source-macros span {
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--surface-muted);
  font-weight: 750;
}

.saved-food-macros span {
  white-space: nowrap;
}

.source-add {
  min-width: 96px;
}

.source-actions,
.saved-food-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.source-save {
  min-width: 96px;
}

.saved-food-actions input {
  width: 92px;
}

.label-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
  gap: 18px;
  align-items: start;
}

.label-upload {
  display: grid;
  gap: 12px;
}

#labelPreview,
#productPreview {
  display: none;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfbf8;
}

#labelPreview.visible,
#productPreview.visible {
  display: block;
}

.product-photo-field {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.ocr-text {
  margin-top: 14px;
}

textarea {
  width: 100%;
  min-height: 130px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: var(--text);
}

.missing-box {
  display: none;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(184, 92, 90, 0.35);
  border-radius: 8px;
  background: rgba(184, 92, 90, 0.08);
}

.missing-box:not(:empty) {
  display: grid;
  gap: 5px;
}

.missing-box span {
  color: var(--muted);
}

.missing-box.ok {
  border-color: rgba(40, 111, 108, 0.35);
  background: rgba(40, 111, 108, 0.08);
}

.recipe-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 18px;
  align-items: start;
}

.recipe-ingredients {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.recipe-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 120px auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfbf8;
}

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

.mini-metric {
  min-height: 82px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfbf8;
}

.mini-metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.mini-metric strong {
  font-size: 24px;
}

.recipe-summary .source-note {
  grid-column: 1 / -1;
}

.profile-habits-panel {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.habit-option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.habit-option {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfbf8;
  color: var(--text);
}

.habit-option input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

.community-form {
  grid-template-columns: 1fr 1fr;
}

.privacy-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: var(--text);
}

.privacy-toggle input {
  width: 18px;
  height: 18px;
  min-height: auto;
  accent-color: var(--accent);
}

.legal-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfbf8;
  font-weight: 720;
  line-height: 1.45;
}

.legal-consent input {
  width: 18px;
  height: 18px;
  min-height: auto;
  margin-top: 2px;
  accent-color: var(--accent);
}

.legal-hero p,
.legal-card p {
  color: var(--muted);
  line-height: 1.55;
}

.legal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.legal-card {
  display: grid;
  align-content: start;
  gap: 8px;
}

.legal-badge {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(40, 111, 108, 0.1);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
}

.privacy-preview,
.community-feed {
  display: grid;
  gap: 12px;
}

.admin-tools {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfbf8;
}

.admin-tools summary {
  cursor: pointer;
  font-weight: 850;
}

.food-moderation-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.food-moderation-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.food-moderation-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.food-moderation-head div:first-child {
  display: grid;
  gap: 4px;
}

.food-moderation-head span,
.food-moderation-head small {
  color: var(--muted);
  line-height: 1.4;
}

.food-moderation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.food-moderation-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.food-moderation-images img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfbf8;
}

.moderation-text {
  min-height: 90px;
  font-size: 12px;
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

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

.account-session-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfbf8;
}

.account-session-card strong {
  font-size: 20px;
}

.profile-card-panel {
  margin-top: 16px;
}

.profile-card-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) minmax(260px, 0.9fr);
  gap: 16px;
  align-items: stretch;
}

.profile-appearance {
  min-height: 210px;
}

.profile-appearance[data-build="muscular"] span {
  width: 68px;
  background: #245f5c;
  box-shadow:
    -34px 20px 0 -16px rgba(40, 111, 108, 0.78),
    34px 20px 0 -16px rgba(40, 111, 108, 0.78),
    0 92px 0 -16px rgba(36, 51, 50, 0.9);
}

.profile-appearance[data-build="soft"] span {
  width: 72px;
  border-radius: 34px 34px 22px 22px;
  background: #3d6b9c;
}

.profile-appearance[data-build="lean"] span {
  width: 46px;
  background: #2e7a55;
}

.profile-card-copy,
.profile-feature-summary {
  display: grid;
  align-content: center;
  gap: 12px;
}

.profile-card-copy strong {
  font-size: 28px;
  line-height: 1.1;
}

.profile-card-copy p {
  color: var(--muted);
  line-height: 1.55;
}

.profile-feature-summary {
  align-content: stretch;
  grid-template-columns: 1fr 1fr;
}

.profile-feature-summary div {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfbf8;
}

.profile-feature-summary span {
  color: var(--muted);
  line-height: 1.4;
  font-size: 13px;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.community-post {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfbf8;
}

.preview-post {
  background: rgba(40, 111, 108, 0.08);
}

.post-head,
.post-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.post-head span {
  color: var(--muted);
}

.community-post p {
  color: var(--text);
  line-height: 1.5;
}

.report-insights,
.report-focus,
.report-comparison,
.calendar-day-details,
.calendar-month-summary {
  display: grid;
  gap: 12px;
}

.report-comparison {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

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

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

.calendar-detail-grid span,
.habit-columns p {
  color: var(--muted);
  line-height: 1.45;
}

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

.habit-columns div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfbf8;
}

.report-insight,
.focus-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfbf8;
}

.report-insight p,
.focus-card p {
  color: var(--muted);
  line-height: 1.45;
}

.focus-card {
  border-left: 4px solid var(--accent);
}

.comparison-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfbf8;
}

.comparison-card span,
.comparison-card em {
  color: var(--muted);
}

.comparison-card em {
  font-style: normal;
  font-weight: 750;
}

.post-stats {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.post-stats span {
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.moderation-delete {
  justify-self: start;
}

.meal-head {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.meal-head span,
.food-row span {
  color: var(--muted);
}

.food-row {
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfbf8;
}

.food-row div {
  display: grid;
  gap: 4px;
}

.ghost-button {
  flex: 0 0 auto;
  padding: 0 10px;
}

.advice {
  min-height: 92px;
  padding: 14px;
  border-radius: 8px;
  background: var(--surface-muted);
  border-left: 4px solid var(--accent);
}

.advice strong {
  display: block;
  margin-bottom: 6px;
}

.advice p {
  color: var(--muted);
  line-height: 1.45;
}

.evidence-card {
  min-height: 160px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfbf8;
  color: var(--text);
  text-decoration: none;
}

.evidence-card:hover,
.trusted-source-card:hover {
  border-color: var(--accent);
}

.evidence-card span,
.trusted-source-card span {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.source-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.source-card-top small {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(40, 111, 108, 0.08);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: right;
}

.evidence-card p,
.evidence-card em,
.trusted-source-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.source-translation {
  color: var(--text);
}

.source-comment {
  margin-top: 3px;
  padding: 10px;
  border-left: 3px solid rgba(40, 111, 108, 0.35);
  border-radius: 6px;
  background: #f5f8f7;
}

.evidence-card em {
  font-style: normal;
  font-weight: 720;
}

.trusted-source-card {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfbf8;
}

.evidence-link {
  width: fit-content;
  min-height: 32px;
  margin-top: auto;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.source-actions {
  align-items: center;
}

.source-update {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-align: right;
}

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

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

.chart-panel canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: clamp(180px, 22vw, 220px);
  min-height: 180px;
}

.chart-stage {
  position: relative;
  min-height: clamp(180px, 22vw, 220px);
}

.chart-panel canvas.is-empty-chart {
  opacity: 0;
}

.chart-empty-state {
  position: absolute;
  inset: 26px 8%;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
  text-align: center;
  pointer-events: none;
}

.chart-empty-state strong {
  font-size: 18px;
  line-height: 1.25;
}

.chart-empty-state span {
  color: var(--muted);
  line-height: 1.45;
}

.chart-empty-state[hidden] {
  display: none;
}

.today-progress-panel {
  overflow: hidden;
  min-height: 320px;
}

.weekly-coach-panel {
  display: grid;
  gap: 16px;
}

.weekly-coach-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.weekly-coach-hero strong {
  display: block;
  margin-bottom: 6px;
  font-size: 24px;
  line-height: 1.15;
}

.weekly-coach-hero p,
.weekly-coach-note,
.weekly-plan-item p {
  color: var(--muted);
  line-height: 1.45;
}

.weekly-coach-hero > span {
  width: 76px;
  height: 76px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 8px solid var(--line);
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
}

.weekly-coach-hero > span.good {
  border-color: var(--accent);
}

.weekly-coach-hero > span.middle {
  border-color: var(--gold);
}

.weekly-coach-hero > span.low {
  border-color: var(--rose);
}

.weekly-coach-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.weekly-plan-item {
  display: grid;
  gap: 8px;
  min-height: 154px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--line);
  border-radius: 8px;
  background: #fcfbf8;
}

.weekly-plan-item strong {
  font-size: 13px;
  text-transform: uppercase;
  color: var(--muted);
}

.weekly-plan-item span {
  color: var(--text);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.1;
}

.weekly-plan-item.done {
  border-left-color: var(--accent);
}

.weekly-plan-item.warning {
  border-left-color: var(--gold);
}

.weekly-plan-item.alert {
  border-left-color: var(--rose);
}

.weekly-coach-note {
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--surface-muted);
  font-weight: 680;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
}

.completion-dot {
  background: var(--accent);
}

.calories-dot {
  background: var(--gold);
}

.movement-dot {
  background: var(--blue);
}

.chart-summary {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 720;
}

.muted {
  color: var(--muted);
}

.history-table {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.goal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 20px;
  align-items: start;
}

.progress-bar {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}

.progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}

.goal-progress strong {
  display: block;
  margin: 18px 0 6px;
  font-size: 24px;
}

.habit-heatmap {
  display: grid;
  grid-template-columns: repeat(7, minmax(28px, 1fr));
  gap: 8px;
}

.heat-day {
  min-height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.heat-day.done {
  background: rgba(40, 111, 108, 0.18);
  color: var(--accent-strong);
}

body.dark-theme .panel,
body.dark-theme .auth-card-status div,
body.dark-theme .auth-card-note,
body.dark-theme .auth-mode-panel,
body.dark-theme .auth-recovery-panel,
body.dark-theme .recovery-method-card,
body.dark-theme .auth-legal-preview,
body.dark-theme .auth-avatar-field,
body.dark-theme .preview-metrics div,
body.dark-theme .auth-capabilities div,
body.dark-theme .tab-button,
body.dark-theme .check-item,
body.dark-theme .exercise-row,
body.dark-theme .preset-button,
body.dark-theme .ghost-button,
body.dark-theme .workout-card,
body.dark-theme .security-event,
body.dark-theme .source-card,
body.dark-theme .source-result,
body.dark-theme .saved-food,
body.dark-theme .recipe-row,
body.dark-theme .mini-metric,
body.dark-theme .legal-consent,
body.dark-theme .admin-tools,
body.dark-theme .food-moderation-card,
body.dark-theme .account-session-card,
body.dark-theme .recovery-code-list code,
body.dark-theme .profile-feature-summary div,
body.dark-theme .community-post,
body.dark-theme .habit-columns div,
body.dark-theme .report-insight,
body.dark-theme .focus-card,
body.dark-theme .comparison-card,
body.dark-theme .food-row,
body.dark-theme .evidence-card,
body.dark-theme .trusted-source-card,
body.dark-theme .calendar-cell,
body.dark-theme .donate-value,
body.dark-theme .weekly-coach-hero,
body.dark-theme .weekly-plan-item,
body.dark-theme .weekly-coach-note,
body.dark-theme .habit-option,
body.dark-theme .post-comment,
body.dark-theme .direct-message-card,
body.dark-theme .direct-thread-message,
body.dark-theme .topbar-ad-slot,
body.dark-theme .community-rules,
body.dark-theme .allergen-box,
body.dark-theme .allergen-chip,
body.dark-theme .muscle-map {
  background: var(--panel-soft);
}

body.dark-theme input,
body.dark-theme select,
body.dark-theme textarea {
  background: var(--field-bg);
  color: var(--text);
}

body.dark-theme .date-control {
  background: var(--field-bg);
}

body.dark-theme .date-control span,
body.dark-theme .tutorial-card span {
  color: var(--text);
  background: rgba(108, 199, 191, 0.14);
}

body.dark-theme input::placeholder,
body.dark-theme textarea::placeholder {
  color: #71827b;
}

body.dark-theme .primary-button {
  color: #0f1816;
}

body.dark-theme .icon-button {
  background: var(--surface-muted);
  color: var(--text);
}

body.dark-theme .nav-item {
  color: rgba(245, 241, 232, 0.78);
}

body.dark-theme .nav-item:hover,
body.dark-theme .nav-item.active {
  color: #0d1211;
  background: var(--sidebar-text);
}

body.dark-theme .source-disclaimer,
body.dark-theme .check-item.auto-check.warning {
  background: var(--warning-bg);
}

body.dark-theme .check-item.auto-check.alert {
  background: var(--danger-bg);
}

body.dark-theme .check-item.auto-check,
body.dark-theme .check-item.auto-check.done,
body.dark-theme .source-comment,
body.dark-theme .preview-post {
  background: var(--success-bg);
}

body.dark-theme #labelPreview,
body.dark-theme #productPreview,
body.dark-theme .food-moderation-images img {
  background: var(--panel-soft);
}

body.dark-theme .calendar-cell.empty {
  background: transparent;
}

body.dark-theme .preview-habits span,
body.dark-theme .appearance-tags span,
body.dark-theme .profile-card-tags span,
body.dark-theme .legal-badge,
body.dark-theme .source-card-top small,
body.dark-theme .post-stats span,
body.dark-theme .source-macros span,
body.dark-theme .event-meta span,
body.dark-theme .heat-day.done {
  background: rgba(111, 202, 192, 0.12);
  color: var(--accent-strong);
}

body.dark-theme .appearance-figure,
body.dark-theme .profile-appearance,
body.dark-theme .auth-avatar-preview {
  background:
    url("assets/zoku-avatar.png") center / cover no-repeat,
    linear-gradient(180deg, rgba(111, 202, 192, 0.15), rgba(125, 166, 214, 0.12));
}

body.dark-theme .auth-avatar-preview {
  background-size: cover, cover;
}

body.dark-theme .auth-register-panel,
body.dark-theme .auth-login-panel {
  background:
    linear-gradient(180deg, rgba(27, 40, 37, 0.98), rgba(23, 33, 31, 0.94)),
    var(--panel-soft);
}

@media (max-width: 1420px) and (min-width: 1181px) {
  .topbar {
    grid-template-columns: minmax(210px, auto) minmax(220px, 1fr);
  }

  .topbar-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 1180px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    padding: 18px;
  }

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

  .sidebar-summary {
    margin-top: 0;
  }

  .topbar {
    grid-template-columns: minmax(180px, auto) 1fr;
  }

  .topbar-actions {
    grid-column: 1 / -1;
  }

  .dashboard-grid,
  .content-grid,
  .auth-gate-shell,
  .donate-grid,
  .legal-grid,
  .goal-layout,
  .advisor-list,
  .evidence-list,
  .trusted-source-list,
  .report-comparison,
  .weekly-coach-grid,
  .habit-option-grid,
  .food-form,
  .workout-form,
  .source-search,
  .barcode-row,
  .custom-food-form,
  .label-layout,
  .recipe-form,
  .recipe-layout,
  .community-form,
  .account-form,
  .profile-card-layout,
  .profile-grid,
  .food-library-toolbar,
  .exercise-tools,
  .calculations {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .exercise-filter-row {
    grid-template-columns: 1fr;
  }

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

  .wide-field {
    grid-column: span 2;
  }

  .auth-gate-shell {
    grid-template-columns: minmax(0, 720px);
    justify-content: center;
  }

  .auth-intro,
  .auth-card {
    grid-column: 1;
  }

  .auth-card {
    grid-row: 1;
  }

  .auth-intro {
    grid-row: 2;
  }
}

@media (max-width: 720px) {
  .section.active {
    gap: 14px;
  }

  .modal-backdrop {
    align-items: stretch;
    padding: 12px;
  }

  .support-chat-layout {
    grid-template-columns: 1fr;
  }

  .support-message {
    width: 100%;
  }

  .app-shell {
    padding: 14px;
  }

  .sidebar {
    gap: 14px;
    padding: 14px;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .brand h1 {
    font-size: 18px;
  }

  .brand p {
    font-size: 12px;
  }

  .topbar {
    align-items: stretch;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
  }

  .dashboard-grid,
  .content-grid,
  .auth-gate-shell,
  .donate-grid,
  .legal-grid,
  .goal-layout,
  .advisor-list,
  .evidence-list,
  .trusted-source-list,
  .report-comparison,
  .weekly-coach-grid,
  .food-form,
  .workout-form,
  .source-search,
  .barcode-row,
  .custom-food-form,
  .label-layout,
  .recipe-form,
  .recipe-layout,
  .community-form,
  .account-form,
  .profile-card-layout,
  .profile-avatar-workbench,
  .tutorial-hero,
  .tutorial-grid,
  .form-grid,
  .profile-grid,
  .auth-legal-preview,
  .recovery-method-grid,
  .food-library-toolbar,
  .exercise-tools,
  .exercise-filter-row,
  .calculations {
    grid-template-columns: 1fr;
  }

  .form-grid.auth-gate-form,
  .form-grid.auth-login-form {
    grid-template-columns: 1fr;
  }

  .date-control {
    width: 100%;
    justify-content: space-between;
  }

  .date-control input {
    width: 36px;
  }

  .nav {
    grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
    gap: 6px;
  }

  .nav-item {
    min-height: 38px;
    padding: 8px 10px;
    text-align: center;
  }

  .sidebar-summary {
    display: none;
  }

  .primary-button,
  .icon-button,
  .ghost-button,
  .tab-button {
    min-width: 0;
    min-height: 40px;
    padding: 8px 12px;
    line-height: 1.2;
    white-space: normal;
  }

  .topbar-actions > span {
    grid-column: 1 / -1;
    text-align: left;
  }

  .topbar-actions .primary-button {
    grid-column: 1 / -1;
  }

  .zoku-widget {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 12px;
  }

  .zoku-portrait {
    width: 76px;
    height: 76px;
  }

  .panel {
    padding: 16px;
  }

  .panel-head {
    gap: 12px;
    margin-bottom: 14px;
  }

  .panel h3 {
    font-size: 18px;
    line-height: 1.2;
  }

  .metric {
    gap: 6px;
  }

  .metric strong {
    font-size: 28px;
    line-height: 1.05;
  }

  .chart-panel canvas,
  .chart-stage {
    height: 160px;
    min-height: 160px;
  }

  .chart-empty-state {
    inset: 12px;
    padding: 14px;
  }

  .chart-empty-state strong {
    font-size: 16px;
  }

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

  .chart-legend {
    justify-content: flex-start;
  }

  .today-progress-panel {
    min-height: auto;
  }

  .wide-field {
    grid-column: auto;
  }

  .auth-locked .auth-gate {
    padding: 12px;
  }

  .auth-intro,
  .auth-card {
    padding: 16px;
  }

  .auth-card {
    order: -1;
  }

  .appearance-preview,
  .preview-main,
  .preview-metrics,
  .profile-card-layout,
  .profile-feature-summary,
  .auth-capabilities,
  .preview-habits,
  .auth-card-status,
  .auth-card-header,
  .auth-avatar-field {
    grid-template-columns: 1fr;
  }

  .appearance-figure,
  .profile-appearance {
    min-height: 170px;
  }

  .food-row {
    align-items: stretch;
    flex-direction: column;
  }

  .exercise-row {
    grid-template-columns: 1fr;
  }

  .source-actions {
    align-items: stretch;
    justify-content: flex-start;
  }

  .source-update {
    text-align: left;
  }

  .food-moderation-head {
    flex-direction: column;
  }

  .food-moderation-actions {
    justify-content: flex-start;
  }

  .food-moderation-images {
    grid-template-columns: 1fr;
  }

  .exercise-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .weekly-coach-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .source-result,
  .saved-food {
    grid-template-columns: 1fr;
  }

  .source-macros,
  .source-actions,
  .saved-food-actions {
    justify-content: flex-start;
  }

  .saved-food-actions {
    flex-wrap: wrap;
  }

  .recipe-row,
  .recipe-summary {
    grid-template-columns: 1fr;
  }

  .post-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-row {
    grid-template-columns: 1fr;
  }

  .report-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-cell {
    min-height: 58px;
    padding: 8px;
  }

  .calendar-detail-grid,
  .habit-columns,
  .calendar-month-summary {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    display: block;
    background: #fff;
  }

  .sidebar,
  .topbar-actions,
  .nav,
  .report-toolbar,
  .panel-actions,
  .icon-button,
  .primary-button {
    display: none !important;
  }

  .app-shell {
    padding: 0;
  }

  .section {
    display: none !important;
  }

  #section-reports {
    display: grid !important;
    gap: 14px;
  }

  .topbar {
    margin-bottom: 12px;
  }

  .panel {
    box-shadow: none;
    break-inside: avoid;
  }

  .dashboard-grid,
  .content-grid,
  .report-comparison {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
