@import url("fonts.css");
/* Rondo tokens. Mobile mirrors these in metaboloop-mobile/src/theme.ts. */
:root {
  --canvas: #ffffff;
  --panel: #f4f5f8;
  --surface: #ffffff;
  --fg: #141a3f;
  --muted: #5a6078;
  --line: #e2e4ec;
  --primary: #3040c8;
  --primary-hover: #2733a8;
  --on-primary: #ffffff;
  --deep: #141a3f;
  --on-deep: #ffffff;
  --on-deep-muted: #aeb5d2;
  --yuja: #ecd93a;
  --mint: #a8ecd6;
  --peach: #ffd2b8;
  --lilac: #d9d2ff;
  --ink: #141a3f;
  --urgent: #a32a1c;
  --urgent-bg: #fbe4df;
  --care: #8f4a08;
  --care-bg: #fcebd6;
  --ring-rest: #cfd2e2;
  --font: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --r-button: 12px;
  --r-small: 16px;
  --r-panel: 20px;
  --r-block: 28px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0f1433;
    --panel: #1b2250;
    --surface: #1b2250;
    --fg: #eef0f8;
    --muted: #aeb5d2;
    --line: #333c75;
    --primary: #8ea0ff;
    --primary-hover: #a6b4ff;
    --on-primary: #141a3f;
    --deep: #1b2250;
    --urgent: #f4a697;
    --urgent-bg: #4a1f24;
    --care: #f2c18c;
    --care-bg: #43331f;
    --ring-rest: #3d467f;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--canvas);
  color: var(--fg);
  font-size: 16px;
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
button, input, select, textarea { font: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}
[hidden] { display: none !important; }
.skip { position: fixed; top: -70px; background: var(--surface); padding: 12px; z-index: 50; }
.skip:focus { top: 0; }

/* Frame */
.sidebar {
  width: 232px; position: fixed; inset: 0 auto 0 0; background: var(--canvas);
  border-right: 1px solid var(--line); padding: 28px 16px; display: flex; flex-direction: column; overflow-y: auto;
}
.brand { font-size: 24px; text-decoration: none; font-weight: 700; letter-spacing: -.04em; display: flex; align-items: center; gap: 8px; padding: 0 10px; margin-bottom: 26px; }
.logo-mark { width: 28px; height: 28px; flex: none; }
.header-brand { display: none; padding: 0; margin: 0; font-size: 21px; }
.header-brand .logo-mark { width: 24px; height: 24px; }
nav { display: grid; gap: 4px; }
.nav {
  border: 0; background: transparent; text-align: left; color: var(--muted); border-radius: var(--r-button);
  padding: 11px 12px; display: flex; gap: 12px; align-items: center; font-size: 15px; font-weight: 500; min-height: 46px;
}
.nav svg { width: 20px; height: 20px; flex: none; }
.nav:hover { background: var(--panel); }
.nav.active { background: var(--panel); color: var(--fg); font-weight: 600; }
.sidebar-bottom { margin-top: auto; padding: 18px 10px 0; display: grid; gap: 6px; justify-items: start; }
.sidebar-bottom p { font-size: 14px; color: var(--muted); margin: 0; }
.demo-pill { font-size: 12px; font-weight: 600; background: var(--panel); padding: 4px 9px; border-radius: 999px; color: var(--muted); }
.shell { margin-left: 232px; }
header { min-height: 68px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 40px; background: var(--canvas); }
.breadcrumb { font-size: 15px; color: var(--muted); }
.breadcrumb b { color: var(--fg); font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--muted); }
.avatar { border: 0; background: var(--panel); color: var(--fg); border-radius: 50%; width: 44px; height: 44px; font-weight: 700; }
main { padding: 36px 40px 24px; max-width: 1160px; margin: auto; min-height: calc(100vh - 150px); outline: none; }
main.bare { padding-top: 12px; }
footer { padding: 18px 40px 26px; display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 14px; }

/* Type */
h1 { font-size: 40px; line-height: 1.18; letter-spacing: -.04em; font-weight: 700; margin: 0 0 8px; text-wrap: balance; }
h2 { font-size: 21px; line-height: 1.3; letter-spacing: -.025em; margin: 0; font-weight: 700; text-wrap: balance; }
h3 { font-size: 17px; line-height: 1.4; letter-spacing: -.015em; margin: 0; font-weight: 600; }
.sub { color: var(--muted); font-size: 16px; margin: 0; }
.muted { color: var(--muted); font-size: 15px; }
.heading-row { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 28px; gap: 12px; }
.date-chip { font-size: 14px; color: var(--muted); white-space: nowrap; padding-bottom: 6px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 32px 0 14px; gap: 12px; }
.section-title span { font-size: 14px; color: var(--muted); }

/* Controls */
.primary, .secondary, .light, .danger {
  border: 0; border-radius: var(--r-button); padding: 0 20px; min-height: 48px; font-size: 16px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none;
}
.primary { background: var(--primary); color: var(--on-primary); }
.primary:hover { background: var(--primary-hover); }
.light { background: var(--yuja); color: var(--ink); }
.secondary { border: 1px solid var(--line); background: var(--surface); color: var(--fg); }
.secondary:hover { background: var(--panel); }
.danger { background: var(--urgent); color: var(--canvas); }
.full { width: 100%; margin-top: 18px; }
.text-button { border: 0; background: none; color: var(--primary); font-size: 15px; font-weight: 500; padding: 4px; min-height: 44px; }
.icon-button { background: transparent; border: 0; font-size: 28px; color: var(--muted); min-width: 44px; min-height: 44px; }
.plus { background: var(--surface); border: 1px solid var(--line); color: var(--fg); border-radius: 50%; height: 44px; width: 44px; min-width: 44px; font-size: 22px; line-height: 1; }
.chip { min-height: 40px; padding: 4px 14px; border: 1px solid var(--primary); border-radius: 20px; background: var(--surface); color: var(--primary); font: inherit; font-size: 15px; }

/* Surfaces */
.card { background: var(--panel); border: 0; border-radius: var(--r-panel); padding: 24px; min-width: 0; }
.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 10px; }
.badge { font-size: 13px; font-weight: 600; border-radius: 999px; padding: 3px 10px; background: var(--surface); color: var(--fg); white-space: nowrap; }
.badge.triage-urgent { background: var(--urgent-bg); color: var(--urgent); }
.badge.triage-attention { background: var(--care-bg); color: var(--care); }
.safe-note { font-size: 15px; background: var(--panel); border-radius: var(--r-small); padding: 14px 16px; color: var(--muted); margin: 18px 0; }
.safe-note strong { color: var(--fg); }
.safe-note p { margin: 4px 0 0; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.test-banner { background: var(--care-bg); color: var(--care); padding: 10px 40px; font-size: 14px; font-weight: 500; line-height: 1.5; }
.notice { background: var(--care-bg); color: var(--care); padding: 12px 16px; border-radius: var(--r-small); margin-bottom: 20px; font-size: 15px; }
.notice-card { margin-bottom: 16px; }
.notice-card .notice { background: none; color: inherit; padding: 0; margin: 0; border-radius: 0; }
.notice-card .notice + .notice { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.notice h3 { margin-bottom: 4px; }

/* Home bento */
.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.tile { background: var(--panel); border-radius: var(--r-panel); padding: 22px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.tile.s2 { grid-column: span 2; } .tile.s3 { grid-column: span 3; } .tile.s4 { grid-column: span 4; } .tile.s6 { grid-column: 1 / -1; }
.tile.y { background: var(--yuja); color: var(--ink); }
.tile.y .muted { color: var(--ink); }
.tile.rows2 { grid-row: span 2; }
.tile p { margin: 0; }
.tile-value { font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1.2; }
.tile-value small { font-size: 15px; font-weight: 500; letter-spacing: 0; color: var(--muted); margin-left: 3px; }
.ring-tile { justify-items: center; text-align: center; }
.ring { width: 100%; max-width: 280px; }
.ring svg { display: block; width: 100%; height: auto; }
.ring-body { fill: none; stroke: var(--primary); }
.ring-face { fill: var(--fg); }
.ring-smile { fill: none; stroke: var(--fg); stroke-linecap: round; }
.ring-dot { stroke-width: 1.4; transition: fill .3s; }
.ring-dot.done { fill: var(--fg); stroke: var(--fg); }
.ring-dot.rest { fill: var(--panel); stroke: var(--ring-rest); }
.ring-dot.now { fill: var(--yuja); stroke: var(--fg); stroke-width: 2; }
.pop { animation: pop .55s cubic-bezier(.3, 1.6, .5, 1); transform-origin: center; transform-box: fill-box; }
.hop { animation: hop .6s ease; transform-origin: center; transform-box: fill-box; }
@keyframes pop { 0% { transform: scale(.2); } 100% { transform: scale(1); } }
@keyframes hop { 40% { transform: translateY(-5%) scale(1.03); } 100% { transform: none; } }
.quick-list { display: grid; gap: 8px; }
.quick-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: var(--surface); border-radius: var(--r-small); gap: 8px; }
.quick-left { display: flex; align-items: center; min-width: 0; }
.quick-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; margin-right: 12px; color: var(--ink); flex: none; background: var(--mint); }
.quick-icon.y { background: var(--yuja); } .quick-icon.p { background: var(--peach); } .quick-icon.l { background: var(--lilac); }
.quick-icon svg { width: 20px; height: 20px; }
.quick-item b { font-size: 16px; font-weight: 600; }
.quick-item p { margin: 0; font-size: 14px; color: var(--muted); }
.tip { margin-top: 14px; background: var(--panel); border-radius: var(--r-panel); padding: 18px 22px; }
.tip p { font-size: 15px; color: var(--muted); margin: 4px 0 0; }

/* Landing */
.land { display: grid; gap: 64px; }
.land-hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 32px; align-items: center; padding-top: 24px; }
.land-hero > div:first-child { display: grid; gap: 18px; justify-items: start; }
.land-hero h1 { font-size: clamp(44px, 7.4vw, 84px); line-height: 1.08; letter-spacing: -.045em; font-weight: 600; margin: 0; }
.land-hero .lead { font-size: 20px; color: var(--muted); margin: 0; max-width: 30em; }
.land-features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.land-feature { background: var(--panel); border-radius: var(--r-small); padding: 14px; display: flex; gap: 12px; align-items: center; font-weight: 600; min-width: 0; }
.land-feature .quick-icon { margin: 0; }
.land-title { text-align: center; display: grid; gap: 10px; justify-items: center; }
.land-title h2 { font-size: clamp(30px, 4.6vw, 46px); letter-spacing: -.035em; font-weight: 600; line-height: 1.18; }
.block { border-radius: var(--r-block); padding: clamp(24px, 5vw, 52px); display: grid; gap: 22px; }
.block h2 { font-size: clamp(30px, 4.6vw, 46px); letter-spacing: -.035em; font-weight: 600; line-height: 1.18; }
.block.deep { background: var(--deep); color: var(--on-deep); }
.block.deep .muted { color: var(--on-deep-muted); }
.block.y { background: var(--yuja); color: var(--ink); justify-items: start; }
.block.y p { max-width: 36em; margin: 0; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.steps li { background: color-mix(in srgb, var(--on-deep) 8%, transparent); border-radius: var(--r-small); padding: 16px; display: grid; gap: 4px; align-content: start; }

/* Records and programme */
.record-list { display: grid; gap: 8px; }
.record { display: flex; justify-content: space-between; padding: 14px 16px; background: var(--surface); border-radius: var(--r-small); gap: 16px; }
.record small { color: var(--muted); display: block; font-size: 14px; }
.empty { text-align: center; padding: 32px 18px; color: var(--muted); display: grid; justify-items: center; gap: 8px; }
.empty .ring { max-width: 112px; }
.empty p { margin: 0; }
.price { font-size: 40px; font-weight: 700; letter-spacing: -.03em; margin: 18px 0; }
.price small { font-size: 15px; letter-spacing: 0; color: var(--muted); font-weight: 500; }
.features { padding-left: 20px; color: var(--muted); line-height: 2; }
.curriculum { margin: 18px 0; background: var(--surface); border-radius: var(--r-small); padding: 12px 16px; }
.curriculum summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.curriculum ol { padding-left: 22px; }
.curriculum li { padding: 7px 0; }
.curriculum p { font-size: 15px; color: var(--muted); margin: 5px 0; }
.curriculum .record-list { margin-top: 15px; }
.stage-note { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--panel); }
.membership { margin-bottom: 16px; }
.message { padding: 13px 16px; margin-bottom: 10px; border-radius: var(--r-small); white-space: pre-wrap; background: var(--surface); max-width: 90%; }
.message.user { margin-left: auto; background: var(--primary); color: var(--on-primary); }
.message small { display: block; font-size: 13px; opacity: .75; margin-bottom: 4px; }
.chat-form { display: flex; gap: 10px; margin-top: 22px; }
.chat-form input { flex: 1; min-width: 0; }
.settings-row { padding: 18px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.settings-row > button, .settings-row .row-actions button { flex-shrink: 0; white-space: nowrap; }
.settings-row > div:first-child { min-width: 0; }
.settings-row:last-child { border: 0; }
.settings-row p { font-size: 15px; color: var(--muted); margin: 4px 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.install-card { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.install-card h2 { margin-bottom: 4px; }

/* Reviewer workbench: denser and without decoration */
.work-row { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--surface); border-radius: 10px; padding: 10px 12px; text-decoration: none; min-height: 56px; }
.work-row .name { font-weight: 600; }
.work-row .why { color: var(--muted); font-size: 14px; display: block; }
.work-row .go { font-size: 14px; font-weight: 600; color: var(--primary); white-space: nowrap; }
.work-row .badge { text-align: center; background: var(--panel); }
.work-row .badge.triage-urgent { background: var(--urgent-bg); }
.work-row .badge.triage-attention { background: var(--care-bg); }
.triage-card { margin-bottom: 16px; }
.triage-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.triage-reasons { margin: 8px 0 0; padding-left: 18px; font-size: 15px; }
.review { border-top: 1px solid var(--line); padding: 16px 0 4px; }
.review textarea { margin-top: 12px; }
.review-form textarea { min-height: 240px; }
.feedback-text { white-space: pre-line; }
.draft-status { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.draft-status .muted { flex-basis: 100%; margin: 0; }
.table-scroll { overflow-x: auto; }
.funnel, .assignments { width: 100%; border-collapse: collapse; font-size: 15px; }
.assignments th[scope="row"] { white-space: nowrap; }
.assignments select { max-width: 100%; font: inherit; }
.funnel th, .funnel td, .assignments th, .assignments td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.funnel td { text-align: right; }

/* Dialog and forms */
dialog { border: 0; border-radius: var(--r-panel); padding: 26px; width: 460px; max-width: calc(100% - 32px); background: var(--canvas); color: var(--fg); }
dialog::backdrop { background: #141a3f8c; }
#modal { max-height: calc(100dvh - 32px); overflow-y: auto; }
.modal-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.field { display: block; font-size: 15px; font-weight: 600; margin-top: 14px; }
.field input, .field select, .field textarea { margin-top: 6px; }
input, select, textarea { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-button); padding: 11px 13px; color: var(--fg); min-height: 48px; }
textarea { resize: vertical; min-height: 96px; }
fieldset.field { border: 0; padding: 0; }
.check { display: flex; align-items: start; gap: 10px; font-size: 15px; margin: 14px 0; }
.check input { width: 20px; height: 20px; min-height: 0; flex-shrink: 0; margin-top: 3px; accent-color: var(--primary); }
.form-error { color: var(--urgent); font-size: 15px; margin: 12px 0; }
.auth-tabs { display: flex; gap: 10px; margin-bottom: 17px; }
.auth-tabs button { flex: 1; }
.divider { height: 1px; background: var(--line); margin: 20px 0; }
#toast { position: fixed; bottom: 25px; left: calc(50% + 116px); transform: translateX(-50%); background: var(--ink); color: #fff; border-radius: var(--r-button); padding: 12px 18px; z-index: 60; }

/* Photo */
.photo-tabs { display: flex; align-items: center; justify-content: space-between; }
.photo-steps { list-style: none; padding: 0; display: flex; gap: 8px; justify-content: space-between; font-size: 14px; color: var(--muted); margin: 18px 0; }
.photo-steps li { padding: 7px 4px; border-bottom: 2px solid var(--line); }
.photo-steps [aria-current] { border-color: var(--primary); font-weight: 700; color: var(--primary); }
.photo-placeholder { padding: 27px; text-align: center; font-size: 48px; color: var(--muted); background: var(--panel); border-radius: var(--r-small); margin: 20px 0; }
.photo-pickers { display: flex; gap: 10px; }
.photo-pickers button { flex: 1; min-height: 48px; }
.photo-file { position: absolute; width: 1px; height: 1px; padding: 0; min-height: 0; opacity: 0; pointer-events: none; }
.meal-preview { display: block; width: 100%; max-height: 250px; object-fit: contain; background: var(--panel); border-radius: var(--r-small); margin: 15px 0; }
.meal-preview.small { max-height: 160px; }
.analysis-progress { display: flex; align-items: center; gap: 10px; margin: 20px 0; }
.spinner { display: inline-block; height: 22px; width: 22px; border: 3px solid var(--ring-rest); border-top-color: var(--primary); border-radius: 50%; animation: turn 1.2s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }
.photo-food-row { padding: 15px; margin: 14px 0; background: var(--panel); border-radius: var(--r-small); }
.food-row-heading { display: flex; gap: 10px; align-items: center; }
.food-row-heading .remove-food { margin-left: auto; min-height: 44px; }
.photo-food-row .field { margin-top: 8px; }
.food-alternatives { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.food-alternatives .muted { margin-right: 2px; }
.meal-items { padding-left: 20px; }
#photo-content { min-width: 0; }

/* Insight */
.insight { margin-top: 14px; }
.metric { margin-top: 12px; }
.metric-top { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.progress-track { height: 8px; border-radius: 10px; background: var(--surface); overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 10px; }
.progress-meta { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); margin-top: 10px; }
.locked { margin-top: 14px; padding: 14px; border: 1px dashed var(--line); border-radius: var(--r-small); }
.locked ul { margin: 6px 0 12px; padding-left: 0; list-style: none; }
.day-meals { padding-left: 18px; }
.body-trend { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.body-trend h3 { margin-bottom: 8px; }
.weight-trend { margin-top: 10px; }
.treatment-field { margin: 16px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.treatment-field legend { padding: 0 6px; font-weight: 700; }

@media (max-width: 1000px) {
  .land-features, .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar { width: 76px; padding: 20px 12px; }
  .brand { padding: 0 8px; }
  .brand-text, .nav-text, .sidebar-bottom { display: none; }
  .nav { justify-content: center; padding: 11px; }
  .shell { margin-left: 76px; }
  #toast { left: calc(50% + 38px); }
}
@media (max-width: 760px) {
  .sidebar { position: fixed; inset: auto 0 0 0; width: auto; height: auto; flex-direction: row; padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); z-index: 30; overflow: visible; }
  .sidebar .brand { display: none; }
  .header-brand { display: flex; }
  .breadcrumb { display: none; }
  nav { display: flex; width: 100%; gap: 2px; }
  .nav { flex: 1 1 0; flex-direction: column; gap: 1px; padding: 6px 2px; font-size: 12px; min-width: 0; }
  .nav .nav-text { display: block; white-space: nowrap; }
  .shell { margin-left: 0; padding-bottom: 72px; }
  header { min-height: 56px; padding: 0 18px; }
  .desktop-label { display: none; }
  main { padding: 22px 16px; }
  .test-banner { padding: 8px 18px; }
  h1 { font-size: 32px; }
  .date-chip { display: none; }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile.s2, .tile.s3 { grid-column: span 1; } .tile.s4, .tile.s6, .tile.wide { grid-column: 1 / -1; }
  .tile { padding: 16px; }
  .split, .land-hero { grid-template-columns: minmax(0, 1fr); }
  .land { gap: 44px; }
  .card { padding: 20px; }
  footer { padding: 15px 18px 20px; flex-direction: column; gap: 5px; }
  #toast { left: 50%; bottom: 84px; width: max-content; max-width: calc(100% - 32px); }
  .settings-row { align-items: start; }
  .chat-form { flex-wrap: wrap; }
  .chat-form input { width: 100%; flex: auto; }
}
@media (max-width: 430px) {
  .work-row { grid-template-columns: minmax(0, 1fr) auto; }
  .work-row .text { grid-column: 1 / -1; grid-row: 2; }
  .land-features, .steps { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
  .pop, .hop { animation: none; }
  .ring-dot { transition: none; }
}
