@font-face { font-family: 'Cormorant'; font-weight: 600; font-style: normal; font-display: swap; src: url(../fonts/cormorant-garamond-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Cormorant'; font-weight: 600; font-style: italic; font-display: swap; src: url(../fonts/cormorant-garamond-latin-600-italic.woff2) format('woff2'); }
@font-face { font-family: 'Cormorant'; font-weight: 700; font-style: normal; font-display: swap; src: url(../fonts/cormorant-garamond-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Jost'; font-weight: 400; font-display: swap; src: url(../fonts/jost-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Jost'; font-weight: 500; font-display: swap; src: url(../fonts/jost-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Jost'; font-weight: 600; font-display: swap; src: url(../fonts/jost-latin-600-normal.woff2) format('woff2'); }

:root {
  --bg: #F5EEE1; --card: #FFFAF1; --card2: #FBF3E4; --ink: #2A2232; --muted: #6F6474; --line: #E4D8C2;
  --gold: #A97C22; --gold-soft: #F1E2BC; --terra: #A2472E; --leaf: #3D6A47; --sea: #2C5A78; --plum: #4A3858;
  --danger: #9E3324; --danger-bg: #FBE7E1; --ok: #2F6B3F; --chip: #EEE3CE;
  --quente: #B2452E; --morna: #B07A1E; --fria: #2F6E95;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 4px 14px rgba(60, 40, 20, .06);
  --r: 16px; --tabh: 64px;
  --serif: 'Cormorant', 'Iowan Old Style', Georgia, serif;
  --sans: 'Jost', -apple-system, 'Segoe UI', system-ui, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg: #15111C; --card: #201A29; --card2: #1B1623; --ink: #F0E8DA; --muted: #A99FB2; --line: #352C42;
    --gold: #D8B160; --gold-soft: #3A3020; --terra: #E0876C; --leaf: #8CC09A; --sea: #8DBBDB; --plum: #C7B2DA;
    --danger: #F09C8A; --danger-bg: #3B1E1A; --ok: #8CC09A; --chip: #2C2437;
    --quente: #EE8C74; --morna: #E2B45C; --fria: #86C0E4;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
  }
}
:root[data-theme=dark] {
  --bg: #15111C; --card: #201A29; --card2: #1B1623; --ink: #F0E8DA; --muted: #A99FB2; --line: #352C42;
  --gold: #D8B160; --gold-soft: #3A3020; --terra: #E0876C; --leaf: #8CC09A; --sea: #8DBBDB; --plum: #C7B2DA;
  --danger: #F09C8A; --danger-bg: #3B1E1A; --ok: #8CC09A; --chip: #2C2437;
  --quente: #EE8C74; --morna: #E2B45C; --fria: #86C0E4;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.5 var(--sans); min-height: 100vh; }
a { color: var(--gold); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.12; margin: 0 0 .4em; letter-spacing: .005em; }
h1 { font-size: 2.15rem; } h2 { font-size: 1.6rem; } h3 { font-size: 1.28rem; }
p { margin: .35em 0 .7em; }
small, .small { font-size: .86rem; }
.muted { color: var(--muted); }
.serif { font-family: var(--serif); }
.it { font-style: italic; }
.center { text-align: center; }
.hide { display: none !important; }

/* ── Shell ── */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 8px) 14px 8px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid transparent; }
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .brand { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-weight: 700; font-size: 1.4rem; color: var(--ink); }
.topbar .brand img { width: 28px; height: 28px; border-radius: 8px; }
.topbar .title { flex: 1; font-family: var(--serif); font-weight: 700; font-size: 1.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iconbtn { border: 0; background: transparent; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; cursor: pointer; color: var(--ink); }
.iconbtn:active { background: var(--chip); }
main { max-width: 680px; margin: 0 auto; padding: 6px 14px calc(var(--tabh) + env(safe-area-inset-bottom) + 28px); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar nav { display: flex; width: 100%; max-width: 680px; }
.tabbar a { flex: 1; height: var(--tabh); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: .72rem; font-weight: 500; letter-spacing: .02em; }
.tabbar a .ic { font-size: 1.32rem; line-height: 1; filter: grayscale(.6); opacity: .8; }
.tabbar a.on { color: var(--ink); }
.tabbar a.on .ic { filter: none; opacity: 1; }

/* ── Cards & layout ── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin: 12px 0; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; background: var(--card2); }
.card h2, .card h3 { margin-top: 0; }
.card .kicker, .kicker { font: 600 .74rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin: 0 0 8px; }
.hero { padding: 18px 2px 6px; }
.hero h1 { margin: 0; }
.hero .sub { color: var(--muted); }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stack > * + * { margin-top: 8px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.sep { height: 1px; background: var(--line); margin: 12px 0; }

/* ── Lists ── */
.list { list-style: none; margin: 0; padding: 0; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); color: var(--ink); }
.li:last-child { border-bottom: 0; }
.li .t { font-weight: 500; }
.li .s { color: var(--muted); font-size: .88rem; line-height: 1.35; }
.li .chev { color: var(--muted); margin-left: auto; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; border: 1px solid rgba(0, 0, 0, .15); }
.dots { display: inline-flex; gap: 3px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 600; letter-spacing: .03em; background: var(--chip); color: var(--ink); white-space: nowrap; }
.badge.quente { background: color-mix(in srgb, var(--quente) 16%, transparent); color: var(--quente); }
.badge.morna { background: color-mix(in srgb, var(--morna) 18%, transparent); color: var(--morna); }
.badge.fria { background: color-mix(in srgb, var(--fria) 16%, transparent); color: var(--fria); }
.badge.gold { background: var(--gold-soft); color: var(--gold); }
.badge.warn { background: var(--danger-bg); color: var(--danger); }

/* ── Chips & buttons ── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; margin: 0 -14px; padding-left: 14px; padding-right: 14px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: .9rem; white-space: nowrap; cursor: pointer; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .dot { width: 10px; height: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--ink); background: var(--ink); color: var(--bg); font-weight: 500; cursor: pointer; text-align: center; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn.danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: .88rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:active { transform: scale(.98); }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.star { border: 0; background: transparent; font-size: 1.4rem; cursor: pointer; color: var(--muted); padding: 4px; line-height: 1; }
.star.on { color: var(--gold); }
.speak { border: 1px solid var(--line); background: var(--card); border-radius: 999px; width: 38px; height: 38px; display: inline-grid; place-items: center; cursor: pointer; font-size: 1rem; flex: none; }
.speak:active, .speak.playing { background: var(--gold-soft); border-color: var(--gold); }

/* ── Greeting ── */
.saud { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.saud .t { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.saud .p { color: var(--gold); font-size: .9rem; font-weight: 500; letter-spacing: .02em; }
.saud .m { color: var(--muted); font-size: .86rem; }
.bigsaud .t { font-size: 2.1rem; }

/* ── Forces ── */
.forcehead { border-radius: var(--r); padding: 20px 18px; margin: 12px 0; color: #fff; position: relative; overflow: hidden; }
.forcehead h1 { color: #fff; margin: 0; font-size: 2.4rem; }
.forcehead .aka { opacity: .9; font-size: .92rem; }
.forcehead .saud .t, .forcehead .saud .m { color: #fff; }
.forcehead .saud .p { color: #FFE7A8; }
.forcehead .speak { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .4); color: #fff; }
.forcehead .badge { background: rgba(255, 255, 255, .2); color: #fff; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ftile { border-radius: 14px; padding: 14px 12px; color: #fff; min-height: 92px; display: flex; flex-direction: column; justify-content: flex-end; box-shadow: var(--shadow); }
.ftile .n { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; line-height: 1.05; }
.ftile .g { font-size: .78rem; opacity: .92; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.sw { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; padding: 3px 10px 3px 4px; border-radius: 999px; background: var(--chip); }
.sw i { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .15); display: inline-block; }

/* ── Key/value ── */
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 6px 0; }
dl.kv dt { color: var(--muted); font-size: .86rem; padding-top: 2px; }
dl.kv dd { margin: 0; }

/* ── Callouts ── */
.note { border-left: 3px solid var(--gold); background: var(--gold-soft); padding: 10px 12px; border-radius: 10px; margin: 10px 0; font-size: .93rem; }
.warnbox { border-left: 3px solid var(--danger); background: var(--danger-bg); color: var(--ink); padding: 10px 12px; border-radius: 10px; margin: 10px 0; font-size: .93rem; }
.warnbox b { color: var(--danger); }
.okbox { border-left: 3px solid var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); padding: 10px 12px; border-radius: 10px; margin: 10px 0; font-size: .93rem; }
.suggest { font-size: .82rem; color: var(--muted); font-style: italic; }

/* ── Forms ── */
label.f { display: block; margin: 12px 0 4px; font-size: .85rem; font-weight: 500; color: var(--muted); }
input[type=text], input[type=search], input[type=number], input[type=date], input[type=time], input[type=password], select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); font-size: 16px; }
textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--gold) 50%, transparent); border-color: var(--gold); }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--gold); flex: none; margin-top: 1px; }
.search { position: relative; }
.search input { padding-left: 38px; }
.search::before { content: '⌕'; position: absolute; left: 13px; top: 8px; font-size: 1.3rem; color: var(--muted); }
.scale { display: flex; gap: 6px; }
.scale button { flex: 1; min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
.scale button.on { background: var(--gold); color: #fff; border-color: var(--gold); }

/* ── Today ── */
.sky { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sky .cell { background: var(--card2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.sky .big { font-size: 1.9rem; line-height: 1; }
.sky .lbl { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.sky .val { font-family: var(--serif); font-size: 1.25rem; font-weight: 700; line-height: 1.15; }
.moonbar { height: 6px; border-radius: 4px; background: var(--chip); overflow: hidden; margin-top: 6px; }
.moonbar i { display: block; height: 100%; background: var(--gold); }
.sugg { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.sugg:last-child { border-bottom: 0; }
.sugg .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--chip); font-size: 1.25rem; flex: none; }
.sugg .l { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.sugg .v { font-weight: 500; line-height: 1.3; }
.weekstrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 4px; }
.weekstrip a { text-align: center; padding: 8px 0; border-radius: 12px; color: var(--ink); font-size: .78rem; }
.weekstrip a b { display: block; font-size: 1.05rem; }
.weekstrip a.on { background: var(--ink); color: var(--bg); }
.hourlist .li { padding: 7px 2px; font-size: .92rem; }
.hourlist .li.now { background: var(--gold-soft); border-radius: 10px; padding-left: 8px; }

/* ── Calendar ── */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal .h { text-align: center; font-size: .72rem; font-weight: 600; color: var(--muted); letter-spacing: .06em; padding: 4px 0; }
.cal a { min-height: 58px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); color: var(--ink); padding: 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .9rem; position: relative; }
.cal a.out { opacity: .35; }
.cal a.today { border-color: var(--gold); box-shadow: 0 0 0 1.5px var(--gold) inset; }
.cal a .mk { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; font-size: .72rem; line-height: 1; }
.cal a .fd { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }

/* ── Cards (baralho) ── */
.tcard { width: 168px; aspect-ratio: 2 / 3.1; margin: 8px auto; border-radius: 16px; background: linear-gradient(160deg, #3a2a4f, #1f1830); border: 2px solid var(--gold); color: #F5E8C8; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 14px; box-shadow: 0 10px 28px rgba(0, 0, 0, .25); cursor: pointer; }
.tcard .num { font-family: var(--serif); font-size: 1rem; opacity: .8; }
.tcard .em { font-size: 3.2rem; margin: 10px 0; }
.tcard .pt { font-family: var(--serif); font-size: 1.4rem; font-weight: 700; line-height: 1.05; }
.tcard .en { font-size: .8rem; opacity: .8; }
.tcard.back { background: repeating-linear-gradient(45deg, #2a1f3a 0 10px, #30244a 10px 20px); }
.tcard.back .em { font-size: 2.6rem; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.three .tcard { width: 100%; padding: 8px; }
.three .tcard .em { font-size: 2rem; margin: 6px 0; }
.three .tcard .pt { font-size: 1.05rem; }

/* ── Protocol ── */
.progress { height: 8px; border-radius: 6px; background: var(--chip); overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--terra)); }
.daygrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin: 8px 0; }
.daygrid span { aspect-ratio: 1; display: grid; place-items: center; border-radius: 9px; background: var(--chip); font-size: .8rem; font-weight: 600; color: var(--muted); }
.daygrid span.done { background: var(--gold); color: #fff; }
.daygrid span.today { box-shadow: 0 0 0 2px var(--ink) inset; color: var(--ink); }
.invoc { font-family: var(--serif); font-size: 1.22rem; line-height: 1.4; font-style: italic; }
.invoc-en { color: var(--muted); font-size: .92rem; }

/* ── Guides ── */
.portrait { width: 100%; aspect-ratio: 4 / 5; border-radius: var(--r); object-fit: cover; background: var(--chip); }
.portrait.ph { aspect-ratio: 16 / 9; display: grid; place-items: center; font-family: var(--serif); font-size: 3rem; color: #fff; }
.gthumb { width: 56px; height: 70px; border-radius: 10px; object-fit: cover; flex: none; display: grid; place-items: center; color: #fff; font-family: var(--serif); font-weight: 700; font-size: 1.3rem; }

/* ── Sheet / toast / lock ── */
.sheet-bg { position: fixed; inset: 0; z-index: 60; background: rgba(20, 14, 26, .5); display: flex; align-items: flex-end; justify-content: center; animation: fade .18s; }
.sheet { background: var(--bg); width: 100%; max-width: 680px; max-height: 92vh; overflow: auto; border-radius: 22px 22px 0 0; padding: 18px 16px calc(env(safe-area-inset-bottom) + 18px); animation: up .22s ease-out; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: -6px auto 12px; }
@keyframes up { from { transform: translateY(40px); opacity: .5 } to { transform: none; opacity: 1 } }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabh) + env(safe-area-inset-bottom) + 16px); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: .9rem; z-index: 80; box-shadow: var(--shadow); animation: fade .2s; max-width: 90vw; text-align: center; }
.lock { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 20px; }
.lock img { width: 84px; height: 84px; border-radius: 22px; }
.pinpad { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px; }
.pinpad button { height: 72px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 1.6rem; font-family: var(--serif); cursor: pointer; }
.pindots { display: flex; gap: 12px; height: 16px; }
.pindots i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--ink); }
.pindots i.on { background: var(--ink); }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px) } 75% { transform: translateX(8px) } }

/* ── Misc ── */
.mais { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mais a { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; color: var(--ink); display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.mais a .ic { font-size: 1.5rem; }
.mais a .t { font-weight: 600; }
.mais a .s { color: var(--muted); font-size: .8rem; line-height: 1.3; }
details { border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; margin: 8px 0; background: var(--card); }
details > summary { cursor: pointer; padding: 12px 0; font-weight: 500; list-style: none; display: flex; align-items: center; gap: 8px; }
details > summary::after { content: '+'; margin-left: auto; color: var(--muted); font-size: 1.2rem; }
details[open] > summary::after { content: '–'; }
details > :last-child { margin-bottom: 12px; }
ul.b { padding-left: 1.1em; margin: .3em 0 .7em; }
ul.b li { margin: .25em 0; }
ol.steps { padding-left: 1.3em; }
ol.steps li { margin: .45em 0; }
.empty { text-align: center; color: var(--muted); padding: 26px 10px; }
.pron { color: var(--gold); font-weight: 500; }
textarea.prompt { font-size: .86rem; min-height: 180px; font-family: ui-monospace, Menlo, monospace; }
.footer-note { text-align: center; color: var(--muted); font-size: .8rem; margin: 26px 0 6px; }
.stars { letter-spacing: 2px; color: var(--gold); }
@media (min-width: 560px) { .fgrid { grid-template-columns: repeat(3, 1fr); } .mais { grid-template-columns: repeat(3, 1fr); } }
@media print { .tabbar, .topbar { display: none; } }
