:root {
  /* Holographic palette */
  --mint: #ADEDC2;
  --ice: #C4F4F9;
  --sky: #63BFF4;
  --magenta: #E949DB;
  /* Derived tints/shades of the same palette */
  --bg: #EAFBF6;
  --panel: #FFFFFF;
  --panel-2: #DFF4F8;
  --line: #C4E4EC;
  --text: #163A52;
  --muted: #537A94;
  --sky-deep: #176BAD;
}
/* Kairos is a light holographic theme by design; tokens stay identical in
   both schemes so the widget reads the same on every device. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #EAFBF6; }
}
:root[data-theme="dark"] { --bg: #EAFBF6; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  background-image: linear-gradient(160deg, var(--ice) 0%, var(--bg) 38%, var(--mint) 100%);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
}

header {
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 6px;
}
.brand { display: flex; align-items: center; gap: 9px; }
.bolt { width: 15px; height: 21px; fill: url(#boltGrad); }
h1 { margin: 0; font-size: 20px; letter-spacing: 2.5px; text-transform: uppercase; font-weight: 700; color: var(--text); }
#install-btn {
  background: var(--panel); color: var(--sky-deep); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 13px; font: 600 13px/1 inherit; cursor: pointer;
}
#install-btn:hover { border-color: var(--sky); }

main {
  width: 100%;
  max-width: 480px;
  padding: 6px 16px calc(18px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 15px;
  box-shadow: 0 2px 10px rgba(99, 191, 244, .10);
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
h2 { margin: 0; font-size: 13px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); font-weight: 650; }
h3 { margin: 12px 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; }

/* hero */
.hero {
  text-align: center; padding: 20px 15px;
  background-image: linear-gradient(135deg, var(--panel) 55%, var(--ice) 100%);
}
.hero-empty { color: var(--muted); font-size: 14px; }
.hero-title { font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.hero-time {
  margin-top: 6px; font-size: 40px; font-weight: 750; color: var(--magenta);
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.hero-time small { font-size: 15px; font-weight: 400; color: var(--muted); margin: 0 7px 0 2px; }
.hero-date { margin-top: 4px; font-size: 12.5px; color: var(--muted); }

/* countdown list */
.add-toggle {
  width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--sky-deep); font-size: 19px; line-height: 1;
  cursor: pointer; font-weight: 600;
}
.add-toggle:hover { border-color: var(--sky); }
.cd-list, .plan-list { list-style: none; margin: 0; padding: 0; }
.cd-list li, .plan-list li {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 2px; border-bottom: 1px solid var(--line); font-size: 14.5px;
}
.cd-list li:last-child, .plan-list li:last-child { border-bottom: 0; }
.cd-list .grow, .plan-list .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-remaining { color: var(--sky-deep); font-weight: 650; font-variant-numeric: tabular-nums; font-size: 13.5px; }
.cd-remaining.past { color: var(--muted); }
.icon-btn {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 15px; padding: 4px 6px; border-radius: 6px;
}
.icon-btn:hover { color: var(--text); background: var(--panel-2); }
.icon-btn.del:hover { color: var(--magenta); }
.empty { color: var(--muted); font-size: 13.5px; padding: 6px 0; }

/* forms */
.add-form { margin: 4px 0 10px; }
.add-form input {
  width: 100%; background: var(--panel); border: 1px solid var(--line);
  color: var(--text); border-radius: 9px; padding: 10px 11px; margin-bottom: 7px;
  font: inherit;
}
.add-form input:focus { outline: 2px solid var(--sky); outline-offset: -1px; }
.add-form .row { display: flex; gap: 7px; }
.add-form .row input { flex: 1; margin-bottom: 0; }
button.primary {
  background: var(--mint); color: var(--text); border: none; border-radius: 9px;
  padding: 10px 16px; font: 650 14px/1 inherit; cursor: pointer;
}
button.primary:hover { filter: brightness(1.04); }
.edit-box { width: 100%; padding: 4px 0 8px; }
.edit-box .row { display: flex; gap: 7px; margin-top: 2px; }
.edit-box input {
  width: 100%; background: var(--panel); border: 1px solid var(--line);
  color: var(--text); border-radius: 9px; padding: 9px 10px; margin-bottom: 7px; font: inherit;
}
button.ghost {
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--line);
  border-radius: 9px; padding: 9px 14px; font: 600 13px/1 inherit; cursor: pointer;
}
button.ghost:hover { color: var(--text); }

/* calendar */
.month-label { font-size: 15px; color: var(--text); text-transform: none; letter-spacing: .3px; }
.nav {
  width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--sky-deep); font-size: 17px; cursor: pointer;
}
.nav:hover { border-color: var(--sky); }
.weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.weekdays { color: var(--muted); font-size: 11px; text-align: center; margin-bottom: 4px; }
.cal-grid button {
  aspect-ratio: 1; border-radius: 10px; border: 1px solid transparent;
  background: none; color: var(--text); font: inherit; font-size: 14px;
  cursor: pointer; position: relative; padding: 0;
}
.cal-grid button.other { color: var(--muted); opacity: .45; }
.cal-grid button:hover { background: var(--panel-2); }
.cal-grid button.today { border-color: var(--magenta); font-weight: 700; }
.cal-grid button.selected { background: var(--sky); color: var(--text); font-weight: 700; }
.cal-grid .dot {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 4px;
  width: 4.5px; height: 4.5px; border-radius: 50%; background: var(--magenta);
}
.cal-grid button.selected .dot { background: var(--panel); }

/* plans */
.plan-list input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--sky); }
.plan-list li.done .grow { text-decoration: line-through; color: var(--muted); }

/* ad slot */
.ad-slot {
  min-height: 66px; border-radius: 14px; border: 1px dashed var(--sky);
  background: var(--panel);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.ad-slot .ad-ph { color: var(--muted); font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase; }
.ad-slot ins { display: block; width: 100%; }
.ad-slot.filled { border: none; background: none; }

/* house ads: each creative carries its advertiser's own brand colors */
.house-ad {
  position: relative; display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 72px; padding: 13px 15px; border-radius: 14px;
  text-decoration: none;
}
.ad-tag {
  position: absolute; top: 7px; right: 10px;
  font-size: 9px; letter-spacing: 1px; text-transform: uppercase;
  color: rgba(255, 255, 255, .55); border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 4px; padding: 1px 5px;
}
.ha-mark { flex-shrink: 0; width: 30px; height: 30px; }
.ha-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ha-brand { font-size: 10.5px; letter-spacing: 1.6px; text-transform: uppercase; font-weight: 700; }
.ha-tagline { font-size: 15px; font-weight: 750; line-height: 1.2; }
.ha-copy { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ha-cta {
  flex-shrink: 0; border-radius: 9px; padding: 9px 13px;
  font-size: 12.5px; font-weight: 700; white-space: nowrap;
}

/* Powerhouse Digital: ink / bone / voltage / steel */
.ad-powerhouse { background: #0A0A0B; }
.ad-powerhouse .ha-brand { color: #EDEBE6; }
.ad-powerhouse .ha-tagline { color: #1CE7D0; letter-spacing: .4px; }
.ad-powerhouse .ha-copy { color: #8A8F98; }
.ad-powerhouse .ha-cta { background: #1CE7D0; color: #0A0A0B; }

/* Keryx: night + orange->pink->purple gradient */
.ad-keryx { background: #171721; }
.ad-keryx .ha-keryx-mark {
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: #FF7130; line-height: 1;
}
.ad-keryx .ha-keryx-mark span { color: #FF3C68; }
.ad-keryx .ha-brand { color: #FFFFFF; }
.ad-keryx .ha-tagline {
  background: linear-gradient(90deg, #FF7130, #FF3C68, #872B97);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ad-keryx .ha-copy { color: #9d9daa; }
.ad-keryx .ha-cta { background: linear-gradient(90deg, #FF7130, #FF3C68); color: #171721; }

/* Pull Different: dark data platform, cyan + indigo */
.ad-pulldifferent { background: #111114; }
.ad-pulldifferent .ha-brand { color: #fafafa; }
.ad-pulldifferent .ha-tagline { color: #22d3ee; }
.ad-pulldifferent .ha-copy { color: #8b8b95; }
.ad-pulldifferent .ha-cta { background: #22d3ee; color: #111114; }

/* Lessons Told: editorial light, indigo signal */
.ad-lessonstold { background: #faf8f3; border: 1px solid #e5e1d8; }
.ad-lessonstold .ha-brand { color: #0a0a0a; }
.ad-lessonstold .ha-tagline { color: #0a0a0a; font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 600; }
.ad-lessonstold .ha-copy { color: #6b675e; }
.ad-lessonstold .ha-cta { background: #4a5cff; color: #ffffff; }
.ad-lessonstold .ad-tag { color: rgba(10, 10, 10, .45); border-color: rgba(10, 10, 10, .22); }

/* EXECUTE: ink terminal, bone */
.ad-exqt { background: #0a0a0c; }
.ad-exqt .ha-brand { color: #f4f1ea; font-family: ui-monospace, Consolas, monospace; letter-spacing: 2px; }
.ad-exqt .ha-tagline { color: #f4f1ea; }
.ad-exqt .ha-copy { color: #86868e; }
.ad-exqt .ha-cta { background: #f4f1ea; color: #0a0a0c; }
.ad-exqt .ha-exqt-mark {
  display: flex; align-items: center; justify-content: center;
  font: 700 18px ui-monospace, Consolas, monospace; color: #f4f1ea;
}
.blink { animation: kblink 1.1s steps(1) infinite; }
@keyframes kblink { 50% { opacity: 0; } }

/* Cardonomics: ink + gold */
.ad-cardonomics { background: #14101d; }
.ad-cardonomics .ha-brand { color: #e8e6ef; }
.ad-cardonomics .ha-tagline { color: #FFC24B; }
.ad-cardonomics .ha-copy { color: #8a83a0; }
.ad-cardonomics .ha-cta { background: #FFC24B; color: #14101d; }

@media (max-width: 420px) {
  .ha-copy { display: none; }
}

footer { text-align: center; color: var(--muted); font-size: 11.5px; padding: 4px 0 10px; }

@media (min-width: 720px) {
  header, main { max-width: 520px; }
  .hero-time { font-size: 48px; }
}
