/* ============================================================
   Home Diet — minimal, flat, lightweight. Dark base + green accent.
   No web fonts, no glow, no animations, no blur. Runs anywhere.
   ============================================================ */

:root {
  --bg:        #0D1117;
  --bg-deep:   #0A0D12;
  --card:      #161B22;
  --card-2:    #1B222B;
  --border:    #283039;
  --border-soft:#1E252E;

  --text:      #E8EDF2;
  --text-dim:  #9AA5B1;
  --text-faint:#828d9b;

  --accent:    #3FC98A;
  --accent-ink:#08130D;
  --accent-soft:rgba(63,201,138,0.14);
  --accent-line:rgba(63,201,138,0.42);

  --green:     #3FC98A;
  --green-soft:rgba(63,201,138,0.14);
  --red:       #FF6B6B;
  --red-soft:  rgba(255,107,107,0.14);
  --blue:      #5AA0FF;
  --blue-soft: rgba(90,160,255,0.14);
  --amber:     #E8A838;
  --amber-soft:rgba(232,168,56,0.16);

  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --radius: 14px;
  --radius-sm: 10px;
  --app-max: 540px;
  --nav-h: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
.hidden { display: none !important; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--text-dim); }
.small { font-size: 0.82rem; }
::selection { background: var(--accent-soft); }

/* ============================ AUTH ============================ */
.auth-screen { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 300px; text-align: center; }
.auth-brand { margin-bottom: 18px; }
.auth-mark {
  display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 13px;
  background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent);
}
.auth-brand h1 { font-size: 1.35rem; font-weight: 700; margin-top: 12px; letter-spacing: -0.01em; }
.auth-tag { color: var(--text-dim); font-size: 0.85rem; margin-top: 2px; }
#auth-form { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; text-align: left; }
.auth-hint { font-size: 0.78rem; color: var(--text-faint); min-height: 1em; }
.auth-hint.error { color: var(--red); }
.auth-footer { display: none; }

/* ======================= PROFILE PICKER ======================= */
.profile-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.profile-inner { width: 100%; max-width: 440px; text-align: center; padding-top: env(safe-area-inset-top, 0px); }
.profile-brand { margin-bottom: 26px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.profile-brand .brand-mark { width: 46px; height: 46px; border-radius: 13px; }
.profile-brand h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 16px; justify-content: center; }
.profile-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 9px;
  background: none; border: none; cursor: pointer; padding: 8px 4px; color: var(--text);
}
.profile-tile .profile-name { font-size: 0.9rem; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-tile.add .profile-add-mark {
  width: 72px; height: 72px; border-radius: 20px; display: grid; place-items: center;
  background: var(--card); border: 1px dashed var(--border); color: var(--text-dim);
}
.profile-tile.add { color: var(--text-dim); }
.profile-edit { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); color: var(--accent-ink); background: var(--accent); border-radius: 50%; padding: 4px; display: grid; place-items: center; opacity: 0.95; }
.profile-del { position: absolute; top: -4px; right: 0; background: var(--red); color: #fff; border: 2px solid var(--bg); border-radius: 50%; width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; }
.link-btn { margin-top: 28px; background: none; border: none; color: var(--text-dim); font-family: var(--font-ui); font-weight: 600; font-size: 0.86rem; cursor: pointer; padding: 8px; }
.link-btn:hover { color: var(--text); }

/* ============================ AVATAR ============================ */
.avatar { display: inline-grid; place-items: center; border-radius: 50%; color: #0D1117; font-weight: 700; flex: none; line-height: 1; }

/* ============================ APP SHELL ============================ */
.app { max-width: var(--app-max); margin: 0 auto; min-height: 100vh; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 12px); }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px; padding-top: calc(11px + env(safe-area-inset-top, 0px));
  background: var(--bg); border-bottom: 1px solid var(--border-soft);
}
.topbar-actions { display: flex; align-items: center; gap: 2px; }
.member-chip { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--border); border-radius: 22px; padding: 4px 10px 4px 4px; cursor: pointer; color: var(--text); max-width: 60%; }
.member-chip .member-name { font-weight: 600; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-chip .member-switch { color: var(--text-faint); display: grid; place-items: center; }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: transparent; border: 1px solid transparent; color: var(--text-dim); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--card); color: var(--text); }
.icon-btn.danger:hover { color: var(--red); }

.views { padding: 16px 14px; position: relative; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 2px 8px; }
.view-head h2 { font-weight: 700; font-size: 1.2rem; letter-spacing: -0.01em; }
.section-label { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); font-weight: 700; margin: 20px 2px 4px; }

/* ============================ CARDS ============================ */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2 { font-weight: 700; font-size: 1.04rem; letter-spacing: -0.01em; }
.stack > * + * { margin-top: 10px; }

/* ============================ DAY / MONTH NAV ============================ */
.day-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.day-label { flex: 1; background: none; border: none; cursor: pointer; color: var(--text); display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px; }
.day-label.static { cursor: default; }
.day-label-main { font-weight: 700; font-size: 1.04rem; }
.day-label-sub { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint); }

/* ====================== NUTRIENT BARS (Today) ====================== */
.nbars { display: flex; flex-direction: column; gap: 14px; }
.nbar-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.nbar-name { font-weight: 600; font-size: 0.9rem; }
.nbar-val { font-size: 0.84rem; color: var(--text-dim); }
.nbar-track { height: 8px; background: var(--bg-deep); border-radius: 6px; overflow: hidden; border: 1px solid var(--border-soft); }
.nbar-fill { height: 100%; background: var(--accent); border-radius: 6px; min-width: 2px; }
.nbar-fill.over { background: var(--amber); }
.nbar-fill.empty { background: transparent; }
.nbar-rem { font-size: 0.72rem; color: var(--text-faint); margin-top: 4px; text-align: right; }
.nbar-rem.over { color: var(--amber); }

/* ============================ PLAN (Today guide) ============================ */
.plan-slots { display: flex; flex-direction: column; gap: 12px; }
.plan-slot { border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 11px 12px; background: var(--bg-deep); }
.plan-slot-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.plan-dot { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--border); flex: none; display: grid; place-items: center; color: var(--accent-ink); }
.plan-dot.done { background: var(--accent); border-color: var(--accent); }
.plan-slot-label { font-weight: 700; font-size: 0.9rem; }
.plan-slot-time { color: var(--text-faint); font-size: 0.75rem; }
.plan-slot-head .btn-xs { margin-left: auto; }
.plan-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.plan-chip { font-size: 0.78rem; padding: 4px 9px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--border); color: var(--text-dim); }
.plan-note { margin-top: 7px; font-size: 0.78rem; color: var(--text-faint); font-style: italic; }

/* ============================ LOG LIST (Today) ============================ */
.log-list { display: flex; flex-direction: column; }
.log-row { display: flex; align-items: center; gap: 10px; padding: 11px 2px; border-bottom: 1px solid var(--border-soft); cursor: pointer; }
.log-row:last-child { border-bottom: none; }
.log-main { flex: 1; min-width: 0; }
.log-top { display: flex; align-items: center; gap: 8px; }
.log-name { font-weight: 600; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-slot { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 7px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); flex: none; }
.log-sub { font-size: 0.76rem; color: var(--text-dim); margin-top: 2px; }
.log-nutri { font-size: 0.72rem; color: var(--text-faint); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================ FAB ============================ */
.fab {
  position: fixed; right: max(16px, calc(50% - var(--app-max)/2 + 16px));
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 16px); z-index: 45;
  display: inline-flex; align-items: center; gap: 7px; padding: 13px 18px 13px 15px; border-radius: 28px;
  background: var(--accent); color: var(--accent-ink); border: none; cursor: pointer;
  font-family: var(--font-ui); font-weight: 700; font-size: 0.92rem; box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}
.fab svg { width: 20px; height: 20px; }

/* ============================ FORMS ============================ */
.form { display: flex; flex-direction: column; gap: 15px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 0.8rem; color: var(--text-dim); font-weight: 600; }
.field-hint { font-size: 0.74rem; color: var(--text-faint); }
.serving-row { display: flex; gap: 10px; }
.serving-row > .field { flex: 1; min-width: 0; }
.input {
  width: 100%; background: var(--bg-deep); border: 1px solid var(--border); color: var(--text);
  font-family: var(--font-ui); font-size: 16px; padding: 12px 13px; border-radius: 10px; outline: none;
}
.input::placeholder { color: var(--text-faint); }
.input:focus { border-color: var(--accent-line); }
.input.mono { font-family: var(--font-mono); }
.input.hidden { display: none !important; }
.textarea { resize: vertical; min-height: 46px; }
.select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239AA5B1' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px;
}
input[type="date"], input[type="time"], input[type="datetime-local"] { color-scheme: dark; }

/* nutrient input grid (food editor / goals) */
.nutri-grid { display: flex; flex-direction: column; gap: 9px; }
.nutri-row { display: flex; align-items: center; gap: 12px; }
.nutri-label { flex: 1; font-size: 0.88rem; color: var(--text-dim); font-weight: 600; }
.nutri-row .input { width: 120px; flex: none; text-align: right; }

/* quantity entry (log modal) */
.amount-wrap { display: flex; align-items: center; gap: 8px; background: var(--bg-deep); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.amount-input { flex: 1; width: 100%; background: none; border: none; outline: none; color: var(--text); font-size: 1.6rem; font-weight: 700; min-width: 0; }
.amount-input::placeholder { color: var(--text-faint); }
.amount-cur { font-size: 1.1rem; color: var(--text-dim); font-weight: 600; }
.nutri-preview { display: flex; flex-wrap: wrap; gap: 6px; }
.prev-chip { font-size: 0.74rem; padding: 3px 8px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }

/* food picker (log modal) */
.food-picker { display: flex; flex-direction: column; gap: 6px; max-height: 38vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.food-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; border-radius: 10px; background: var(--bg-deep); border: 1px solid var(--border); color: var(--text); cursor: pointer; text-align: left; }
.food-opt:hover { border-color: var(--text-faint); }
.food-opt.active { border-color: var(--accent); background: var(--accent-soft); }
.food-opt-name { font-weight: 600; font-size: 0.9rem; }
.food-opt-serv { color: var(--text-faint); font-size: 0.78rem; flex: none; }
.food-opt.add { border-style: dashed; color: var(--accent); justify-content: flex-start; gap: 6px; }
.food-opt.add svg { width: 18px; height: 18px; }
.log-details { display: flex; flex-direction: column; gap: 14px; }

/* ============================ BUTTONS ============================ */
.btn { font-family: var(--font-ui); font-weight: 600; font-size: 0.92rem; border-radius: 10px; padding: 12px 16px; cursor: pointer; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: var(--card); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--card-2); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-block { width: 100%; }
.btn-lg { padding: 15px; font-size: 1rem; }
.btn-sm { padding: 8px 12px; font-size: 0.82rem; border-radius: 9px; }
.btn-xs { padding: 5px 10px; font-size: 0.76rem; border-radius: 8px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ============================ LIBRARY ============================ */
.lib-search { margin: 6px 0 12px; }
.lib-item { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 13px 14px; cursor: pointer; }
.lib-info { flex: 1; min-width: 0; }
.lib-name { font-weight: 600; font-size: 0.95rem; }
.lib-serv { font-size: 0.74rem; color: var(--text-faint); margin-top: 2px; }
.lib-sum { font-size: 0.78rem; color: var(--text-dim); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================ PLAN VIEW ============================ */
.plan-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; }
.plan-item.active { border-color: var(--accent-line); }
.plan-item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.plan-item-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.plan-name { font-weight: 700; font-size: 1rem; }
.badge { font-size: 0.6rem; font-weight: 800; letter-spacing: 0.06em; padding: 2px 7px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); }
.plan-item-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.pc-slots { display: flex; flex-direction: column; gap: 6px; }
.pc-slot { display: flex; gap: 10px; font-size: 0.82rem; padding: 5px 0; border-top: 1px solid var(--border-soft); }
.pc-slot-label { font-weight: 600; color: var(--text-dim); flex: none; min-width: 96px; }
.pc-slot-items { color: var(--text-faint); min-width: 0; }

/* ============================ PLAN EDITOR ============================ */
.slot-editors { display: flex; flex-direction: column; gap: 12px; }
.slot-editor { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; background: var(--bg-deep); display: flex; flex-direction: column; gap: 10px; }
.slot-editor-top { display: flex; gap: 8px; align-items: center; }
.slot-editor-top .input[type="text"] { flex: 1; }
.slot-editor-top .input[type="time"] { width: 116px; flex: none; }
.item-editors { display: flex; flex-direction: column; gap: 8px; padding-left: 4px; border-left: 2px solid var(--border); margin-left: 2px; }
.item-editor { display: flex; flex-direction: column; gap: 6px; padding: 4px 0 4px 8px; }
.item-editor-row { display: flex; gap: 8px; align-items: center; }
.item-editor-row .item-food { flex: 1; }
.item-editor-qty { display: flex; gap: 8px; }
.item-editor-qty .item-qty { width: 90px; flex: none; }
.item-editor-qty .item-unit { flex: 1; }

/* ============================ MONTH ============================ */
.month-pick { display: flex; align-items: center; gap: 10px; margin: 4px 2px 12px; }
.month-pick .field-label { flex: none; }
.month-pick .select { flex: 1; }
.stat-row { display: flex; gap: 10px; margin-bottom: 14px; }
.stat { flex: 1; background: var(--bg-deep); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 12px; text-align: center; }
.stat-val { font-size: 1.4rem; font-weight: 700; }
.stat-label { font-size: 0.72rem; color: var(--text-faint); margin-top: 2px; }
.avg-label { margin-bottom: 6px; }
.avg-list { display: flex; flex-direction: column; gap: 4px; }
.avg-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border-soft); }
.avg-row:last-child { border-bottom: none; }
.avg-name { font-size: 0.88rem; }
.avg-val { font-size: 0.86rem; color: var(--text-dim); }

.month-days { display: flex; flex-direction: column; gap: 6px; }
.mday { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; cursor: pointer; text-align: left; color: var(--text); }
.mday.none { opacity: 0.6; }
.mday-date { display: flex; flex-direction: column; align-items: center; width: 34px; flex: none; }
.mday-dow { font-size: 0.62rem; text-transform: uppercase; color: var(--text-faint); letter-spacing: 0.04em; }
.mday-num { font-size: 1.05rem; font-weight: 700; }
.mday-body { flex: 1; min-width: 0; }
.mday-track { height: 6px; background: var(--bg-deep); border-radius: 4px; overflow: hidden; }
.mday-fill { height: 100%; border-radius: 4px; background: var(--text-faint); }
.mday-fill.under { background: var(--amber); }
.mday-fill.hit { background: var(--accent); }
.mday-fill.over { background: var(--red); }
.mday-fill.logged { background: var(--blue); }
.mday-val { font-size: 0.72rem; color: var(--text-dim); margin-top: 4px; }
.mday-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--border); }
.mday-dot.under { background: var(--amber); }
.mday-dot.hit { background: var(--accent); }
.mday-dot.over { background: var(--red); }
.mday-dot.logged { background: var(--blue); }

/* ============================ SETTINGS / MANAGE ============================ */
.manage-row { display: flex; gap: 8px; align-items: center; }
.manage-row .input { flex: 1; min-width: 0; }
.manage-row .unit-mini { width: 86px; flex: none; }
.manage-name { flex: 1; font-weight: 600; font-size: 0.92rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.manage-add { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.manage-add .input { flex: 1; min-width: 0; }
.manage-add .unit-mini { width: 86px; flex: none; }
.member-preview { display: flex; justify-content: center; margin-bottom: 6px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch-btn { width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.swatch-btn.active { border-color: var(--text); }

/* ============================ EMPTY STATES ============================ */
.empty { text-align: center; padding: 30px 18px; color: var(--text-faint); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty .ttl { font-size: 1.02rem; font-weight: 700; color: var(--text-dim); }
.empty .sub { font-size: 0.85rem; }

/* ============================ TAB BAR ============================ */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: var(--app-max); z-index: 40;
  display: grid; grid-template-columns: repeat(4, 1fr); background: var(--bg); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: none; cursor: pointer; color: var(--text-faint); padding: 9px 4px 8px; font-family: var(--font-ui); font-size: 0.64rem; font-weight: 600; position: relative; }
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--accent); }
.tab.active::before { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 24px; height: 2px; background: var(--accent); }

/* ============================ MODAL ============================ */
.modal-root { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; background: rgba(5,7,10,0.7); }
.modal { width: 100%; max-width: var(--app-max); background: var(--card); border: 1px solid var(--border); border-bottom: none; border-radius: 18px 18px 0 0; padding: 8px 18px calc(22px + env(safe-area-inset-bottom, 0px)); max-height: 92vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-full { align-self: stretch; height: 100dvh; max-height: none; border-radius: 0; border: none; padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
.modal-full .modal-grab { display: none; }
.modal-grab { width: 38px; height: 4px; border-radius: 4px; background: var(--border); margin: 8px auto 14px; }
.modal h3 { font-weight: 700; font-size: 1.18rem; margin-bottom: 3px; }
.modal .modal-sub { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 14px; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions .btn { flex: 1; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal-head h3 { margin-bottom: 0; }
@media (min-width: 560px) { .modal-root { align-items: center; } .modal { border-radius: 18px; border-bottom: 1px solid var(--border); } }

/* ============================ SEGMENTED ============================ */
.segmented { display: flex; gap: 3px; padding: 3px; background: var(--bg-deep); border: 1px solid var(--border-soft); border-radius: 11px; }
.seg { flex: 1; border: none; background: transparent; cursor: pointer; color: var(--text-dim); font-family: var(--font-ui); font-weight: 600; font-size: 0.8rem; padding: 8px; border-radius: 8px; white-space: nowrap; }
.seg:hover { color: var(--text); }
.seg.active { background: var(--card-2); color: var(--accent); }
.seg[disabled] { opacity: 0.4; cursor: not-allowed; }

/* ============================ EXPORT MODAL ============================ */
.export-opts { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.export-custom { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--border); padding-top: 14px; margin-top: 14px; }

/* ============================ TOASTS ============================ */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 14px); z-index: 80; display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: var(--app-max); padding: 0 16px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; background: var(--card-2); border: 1px solid var(--border); border-radius: 11px; padding: 11px 14px; font-size: 0.87rem; font-weight: 500; }
.toast .tdot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.toast.success .tdot { background: var(--green); }
.toast.error .tdot { background: var(--red); }
.toast.info .tdot { background: var(--accent); }
