/* Asistente — own styles. GlassKit (glasskit.css) gives the floating layer: tab bar, sheets, toasts, inputs. */

:root {
  --gl-color-primary: #007aff;
  --gl-color-primary-dark: #0056c7;
  --accent: #007aff;
  --accent-soft: rgba(0, 122, 255, .12);
  --bg: #F2F2F7;
  --card: #FFFFFF;
  --text: #000000;
  --text-2: #3C3C43;
  --muted: #6C6C70;
  --faint: #AEAEB2;
  --sep: #E5E5EA;
  --fill: #E3E3E8;
  --track: #E5E5EA;
  --morning: #5856D6;
  --morning-soft: #E6E6FA;
  --morning-ink: #3634A3;
  --afternoon: #FF9500;
  --afternoon-soft: #FFE9D6;
  --afternoon-ink: #A33F00;
  --free: #34C759;
  --free-soft: #DDF5E3;
  --free-ink: #1B7A33;
  --warn-soft: #FFE9D6;
  --warn-ink: #A33F00;
  --danger: #FF3B30;
  --highlight: #F2F8FF;
  --work-row: #FFF6EE;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

[data-theme="dark"] {
  --gl-color-primary: #0a84ff;
  --gl-color-primary-dark: #0060df;
  --accent: #0a84ff;
  --accent-soft: rgba(10, 132, 255, .2);
  --bg: #000000;
  --card: #1C1C1E;
  --text: #FFFFFF;
  --text-2: #EBEBF5;
  --muted: #98989F;
  --faint: #636366;
  --sep: #38383A;
  --fill: #2C2C2E;
  --track: #3A3A3C;
  --morning-soft: #2B2A55;
  --morning-ink: #B4B3FF;
  --afternoon-soft: #4A2D0B;
  --afternoon-ink: #FFC27A;
  --free-soft: #173B21;
  --free-ink: #7EE29B;
  --warn-soft: #4A2D0B;
  --warn-ink: #FFC27A;
  --danger: #FF453A;
  --highlight: #0B2340;
  --work-row: #2A1E10;
}

html, body { margin: 0; padding: 0; background: var(--bg); }
body {
  font-family: var(--font);
  color: var(--text);
  text-align: left;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); }
button { font-family: inherit; }

.page {
  max-width: 560px;
  margin: 0 auto;
  box-sizing: border-box;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 16px calc(120px + env(safe-area-inset-bottom, 0px));
}

/* Header */
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.eyebrow { font-size: 15px; color: var(--muted); }
.title { font-size: 34px; font-weight: 700; margin: 2px 0 0; letter-spacing: -.4px; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 17px; min-height: 44px; text-decoration: none; color: var(--accent); background: none; border: none; padding: 0; cursor: pointer; }
.lead { font-size: 15px; color: var(--muted); margin: 4px 0 0; }

.btnr {
  width: 44px; height: 44px; border-radius: 50%; border: none; flex: none;
  background: var(--card); color: var(--accent);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08); text-decoration: none;
}
.btnr.fill { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(0, 122, 255, .35); }
.btnr:active, .chip:active, .row-btn:active { opacity: .6; }

/* Content surfaces: solid, never glass */
.card { background: var(--card); border-radius: 22px; padding: 16px; }
.card + .card { margin-top: 12px; }
.mt { margin-top: 12px; }
.mt-l { margin-top: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.grid2 .card + .card { margin-top: 0; }
.sec { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; margin: 24px 16px 8px; }
.foot { font-size: 13px; color: var(--muted); margin: 8px 16px 0; }
.big { font-size: 34px; font-weight: 700; margin-top: 2px; }
.mid { font-size: 22px; font-weight: 700; }
.label { font-size: 15px; color: var(--muted); }
.sub { font-size: 13px; color: var(--muted); }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
a.card { display: block; text-decoration: none; color: var(--text); }

.list { background: var(--card); border-radius: 22px; overflow: hidden; list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 16px; border-bottom: 1px solid var(--sep); }
.list > li:last-child { border-bottom: none; }
.list > li.hl { background: var(--highlight); }
.list > li.work { background: var(--work-row); }
.list > li.past { opacity: .5; }
.list .grow { flex: 1; min-width: 0; }
.list .val { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.list .chev { color: var(--faint); font-size: 22px; line-height: 1; }
.row-btn { all: unset; display: flex; align-items: center; gap: 12px; width: 100%; cursor: pointer; min-height: 24px; }
.tit { font-size: 17px; overflow-wrap: anywhere; }
.hora { width: 48px; flex: none; font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
.add-row { color: var(--accent); cursor: pointer; }
.done-text { text-decoration: line-through; color: var(--muted); }

.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 12px; font-size: 15px; font-weight: 600; }
.pill.morning { background: var(--morning-soft); color: var(--morning-ink); }
.pill.afternoon { background: var(--afternoon-soft); color: var(--afternoon-ink); }
.pill.free { background: var(--free-soft); color: var(--free-ink); }
.pill.now { background: var(--accent); color: #fff; font-size: 13px; padding: 3px 10px; }
.tag { font-size: 13px; font-weight: 600; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.tag.urgent, .tag.warn { background: var(--warn-soft); color: var(--warn-ink); }
.tag.important { background: var(--accent-soft); color: var(--accent); }
.tag.whenever, .tag.grey { background: var(--fill); color: var(--text-2); }
.tag.good { background: var(--free-soft); color: var(--free-ink); }
.tag.split { background: var(--morning-soft); color: var(--morning-ink); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.c-morning { background: var(--morning); }
.c-afternoon { background: var(--afternoon); }
.c-free { background: var(--free); }
.c-sleep { background: #8E8E93; }
.c-meals { background: #C7C7CC; }
.c-planned { background: var(--accent); }
.c-events { background: #AF52DE; }

/* Bars */
.stack { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; margin-top: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.bar { height: 8px; background: var(--track); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.bar > div { height: 100%; border-radius: 4px; background: var(--free); }
.bar > div.over { background: var(--afternoon); }
.bar > div.blue { background: var(--accent); }

/* Tip */
.tip { display: flex; gap: 12px; align-items: flex-start; }
.tip-icon { width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex: none; }
.tip-icon.warn { background: var(--warn-soft); color: var(--warn-ink); }
.tip-icon.good { background: var(--free-soft); color: var(--free-ink); }

/* Check circle */
.chk { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #C7C7CC; flex: none; background: transparent; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #fff; }
.chk.on { background: var(--free); border-color: var(--free); }
.chk-hit { width: 44px; height: 44px; margin: -9px; display: flex; align-items: center; justify-content: center; background: none; border: none; padding: 0; cursor: pointer; flex: none; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-size: 15px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--sep); background: var(--card); color: var(--text); cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* Segmented: GlassKit look, solid track */
.seg { display: flex; background: var(--fill); border-radius: 999px; padding: 3px; margin-top: 16px; }
.seg button { flex: 1; border: none; background: transparent; font-size: 15px; min-height: 36px; border-radius: 999px; color: var(--text); cursor: pointer; padding: 0 6px; }
.seg button[aria-pressed="true"] { background: var(--card); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

/* Switch */
.sw { width: 51px; height: 31px; border-radius: 999px; background: var(--track); position: relative; flex: none; border: none; padding: 0; cursor: pointer; transition: background .2s; }
.sw::after { content: ""; position: absolute; left: 2px; top: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); transition: left .2s; }
.sw[aria-checked="true"] { background: var(--free); }
.sw[aria-checked="true"]::after { left: 22px; }

/* Calendar */
.cal-head, .cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; }
.cal-head { font-size: 13px; color: var(--muted); font-weight: 600; padding-bottom: 6px; }
.cal-day { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; min-height: 44px; background: none; border: none; cursor: pointer; color: var(--text); font: inherit; }
.cal-num { font-size: 17px; width: 32px; height: 32px; line-height: 32px; border-radius: 50%; }
.cal-num.today { background: var(--accent); color: #fff; font-weight: 700; }
.cal-num.sel { outline: 2px solid var(--accent); }
.cal-day.other .cal-num { color: var(--faint); }
.cal-bar { width: 22px; height: 4px; border-radius: 2px; }
.cal-dot { width: 6px; height: 6px; border-radius: 50%; background: #AF52DE; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 8px; }
.cal-nav strong { font-size: 17px; }
.legend-bar { width: 16px; height: 4px; border-radius: 2px; display: inline-block; }

/* Forms inside sheets */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; text-align: left; }
.field > span { font-size: 15px; font-weight: 600; color: var(--text); }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }
.hint { font-size: 13px; color: var(--muted); }
.glass-sheet { text-align: left; color: var(--text); }
.glass-sheet__title { text-align: left; }
.sheet-list { display: flex; flex-direction: column; gap: 8px; }
.sheet-btn { font: inherit; font-size: 17px; min-height: 50px; border-radius: 14px; border: none; background: var(--accent-soft); color: var(--accent); font-weight: 600; cursor: pointer; width: 100%; }
.sheet-btn.danger { background: transparent; color: var(--danger); }
.btn-row { display: flex; gap: 10px; margin-top: 16px; }
.btn { font: inherit; font-size: 17px; font-weight: 600; min-height: 50px; border-radius: 999px; border: none; flex: 1; cursor: pointer; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.soft { background: var(--accent-soft); color: var(--accent); }
.mini { font: inherit; width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--accent-soft); color: var(--accent); font-size: 22px; font-weight: 600; cursor: pointer; flex: none; }
input[type="time"].glass-input, input[type="date"].glass-input { min-width: 0; }

/* Toast with undo */
.glass-toast { justify-content: space-between; }
.toast-undo { background: none; border: none; color: var(--accent); font-weight: 600; font-size: 15px; cursor: pointer; min-height: 32px; }

/* Empty state */
.empty { text-align: center; padding: 28px 16px; }
.empty .tit { font-weight: 600; }
.empty p { color: var(--muted); font-size: 15px; margin: 6px 0 14px; }

/* Tab bar items are links */
.glass-tab-bar__item { text-decoration: none; }
.glass-tab-bar__label { color: var(--muted); }
.glass-tab-bar__icon svg { stroke: var(--muted); }
.glass-tab-bar__item.is-active .glass-tab-bar__label { color: var(--gl-color-primary); font-weight: 600; }

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