/* Life Admin, Handled — Ivory & Ink v2 (The Planner Edition family system) */
@font-face { font-family: "Fraunces"; src: local("Fraunces"), local("Georgia"); font-display: swap; }
:root {
  --navy: #1C2E47; --ivory: #FAF6EF; --gold: #C2A059; --dark-gold: #8A6A12;
  --ink: #22303F; --muted: #5C6B7A; --card: #FFFFFF; --line: #E5DCC8;
  --radius: 18px; --fs: 16px;
}
html[data-theme="ink"] { --ivory: #14202F; --card: #1C2E47; --ink: #F2ECDF; --muted: #B9C4CE; --line: #33506F; --dark-gold: #D9B96A; }
html[data-textsize="2"] { --fs: 17.5px; } html[data-textsize="3"] { --fs: 19px; } html[data-textsize="4"] { --fs: 21px; }
html[data-font="dyslexia"] body { font-family: Verdana, Tahoma, sans-serif; letter-spacing: .02em; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--ivory); color: var(--ink); font-family: "Segoe UI", system-ui, -apple-system, sans-serif; font-size: var(--fs); line-height: 1.5; }
h1, h2, h3, .serif { font-family: Fraunces, Georgia, "Times New Roman", serif; color: var(--navy); }
html[data-theme="ink"] h1, html[data-theme="ink"] h2, html[data-theme="ink"] h3 { color: var(--ivory); }
.demo-ribbon { background: var(--navy); color: var(--ivory); text-align: center; padding: .35rem .5rem; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem 1.1rem; border-bottom: 2px solid var(--gold); flex-wrap: wrap; }
.brand { display: flex; gap: .8rem; align-items: center; min-width: 0; }
.brand-mark { width: 48px; height: 48px; border-radius: 50%; background: var(--navy); color: var(--gold); display: grid; place-items: center; font-family: Georgia, serif; font-weight: bold; border: 2px solid var(--gold); flex: none; }
.brand h1 { margin: 0; font-size: 1.45rem; }
.tagline { margin: 0; color: var(--muted); font-size: .9rem; }
.top-actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.badge { background: var(--gold); color: #1C2E47; border-radius: 999px; padding: .25rem .7rem; font-size: .82rem; font-weight: 600; }
.layout { display: block; }
.nav { display: flex; }
.nav button { min-height: 48px; border: none; background: transparent; color: var(--ink); font: inherit; cursor: pointer; padding: .6rem .5rem; }
.nav button[aria-current="page"] { color: var(--dark-gold); font-weight: 700; box-shadow: inset 0 -3px 0 var(--gold); }
.main { padding: 1.1rem; max-width: 860px; margin: 0 auto; width: 100%; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; box-shadow: 0 4px 18px rgba(28,46,71,.07); margin-bottom: 1rem; }
.btn { min-height: 48px; border-radius: 999px; border: 1px solid var(--navy); background: var(--navy); color: #FAF6EF; padding: .6rem 1.2rem; font: inherit; cursor: pointer; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1C2E47; font-weight: 700; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.small { min-height: 40px; padding: .35rem .9rem; font-size: .92rem; }
.btn:focus-visible, .nav button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--dark-gold); outline-offset: 2px; }
.today-card { text-align: left; }
.today-title { font-size: 1.7rem; margin: .3rem 0; }
.reason { color: var(--muted); font-size: 1.05rem; }
.energy-row { display: flex; gap: .5rem; flex-wrap: wrap; margin: .8rem 0; }
.energy-row button { min-height: 48px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: .5rem 1rem; font: inherit; cursor: pointer; }
.energy-row button[aria-pressed="true"] { background: var(--navy); color: #FAF6EF; border-color: var(--navy); }
.action-row { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }
.item-row { display: flex; justify-content: space-between; gap: .8rem; align-items: center; padding: .7rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.item-row:last-child { border-bottom: none; }
.item-meta { color: var(--muted); font-size: .9rem; }
.pill { display: inline-block; border: 1px solid var(--gold); color: var(--dark-gold); border-radius: 999px; padding: .05rem .6rem; font-size: .8rem; font-weight: 600; }
label { display: block; font-weight: 600; margin: .7rem 0 .3rem; }
input, select, textarea { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 12px; padding: .55rem .7rem; font: inherit; background: var(--card); color: var(--ink); }
textarea { min-height: 80px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.month-grid .cell { min-height: 52px; border: 1px solid var(--line); border-radius: 10px; padding: 3px; font-size: .78rem; overflow: hidden; background: var(--card); }
.month-grid .cell .dot { display: block; color: var(--dark-gold); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 92px; background: var(--navy); color: #FAF6EF; border-radius: 999px; padding: .7rem 1.1rem; display: flex; gap: .8rem; align-items: center; z-index: 60; max-width: 92vw; flex-wrap: wrap; justify-content: center; }
.toast button { background: var(--gold); border: none; border-radius: 999px; min-height: 40px; padding: .3rem .9rem; font: inherit; font-weight: 700; cursor: pointer; }
.overlay { position: fixed; inset: 0; background: rgba(20,32,47,.55); display: grid; place-items: center; z-index: 70; padding: 1rem; }
.overlay .sheet { background: var(--card); border-radius: var(--radius); padding: 1.4rem; max-width: 520px; width: 100%; max-height: 88vh; overflow: auto; }
.hint { background: #FDF6E0; border: 1px solid var(--gold); color: #5C4A08; border-radius: 12px; padding: .6rem .8rem; margin-top: .5rem; }
html[data-theme="ink"] .hint { background: #2A3B52; color: var(--ivory); }
.quiet { color: var(--muted); }
.linklike { background: none; border: none; color: var(--dark-gold); font: inherit; text-decoration: underline; cursor: pointer; min-height: 48px; }
/* Bottom tab bar ONLY below 1024px; sidebar ONLY at 1024px+ */
@media (max-width: 1023.98px) {
  .nav { position: fixed; bottom: 0; left: 0; right: 0; background: var(--card); border-top: 1px solid var(--line); z-index: 50; padding-bottom: env(safe-area-inset-bottom); justify-content: space-around; }
  .nav button { flex: 1; font-size: .86rem; }
  .main { padding-bottom: 96px; }
  .toast { bottom: 108px; }
}
@media (min-width: 1024px) {
  .layout { display: grid; grid-template-columns: 220px 1fr; align-items: start; }
  .nav { flex-direction: column; position: sticky; top: 0; padding: 1rem .6rem; gap: .3rem; }
  .nav button { text-align: left; border-radius: 12px; padding-left: 1rem; }
  .nav button[aria-current="page"] { box-shadow: inset 3px 0 0 var(--gold); background: var(--card); }
  .main { margin: 0; max-width: 900px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
html[data-motion="reduce"] * { transition: none !important; animation: none !important; }
@media print {
  .nav, .top-actions, .demo-ribbon, .toast, .no-print { display: none !important; }
  body { background: #fff; } .card { box-shadow: none; break-inside: avoid; }
}
