@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 200 800; font-display: swap; src: url('/fonts/plus-jakarta-sans-latin-wght-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 200 800; font-display: swap; src: url('/fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #08080A; --panel: #111114; --panel2: #17171B; --panel3: #1E1E23; --ink: #F2EFE9; --muted: #9A98A1;
  --gold: #C9A24B; --goldtx: #D4AE5B; --line: rgba(201,162,75,.2); --btnink: #08080A; --chip: rgba(201,162,75,.14);
  --danger: #E5604D; --radius: 16px; --nav-h: 64px;
  --font: 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #F5F1E8; --panel: #FFFFFF; --panel2: #FBF8F2; --panel3: #F0EBDF; --ink: #17140E; --muted: #6A655A;
  --gold: #C9A24B; --goldtx: #7A5F26; --line: rgba(23,20,14,.14); --btnink: #17140E; --chip: rgba(201,162,75,.22);
  --danger: #B93B2A; color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
h1, h2 { text-wrap: balance; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 12px 18px; border-radius: 12px; background: var(--gold); color: var(--btnink); font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }
a { color: var(--goldtx); }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg { flex: none; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- botones y campos ---------- */
.btn { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border: 0; border-radius: 14px; background: var(--gold); color: var(--btnink); font-weight: 700; transition: filter .15s, transform .1s; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .6; cursor: wait; }
.btn.small { min-height: 40px; padding: 0 16px; font-size: .92rem; }
.btn.big { min-height: 56px; font-size: 1.05rem; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.ghost.danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.linkbtn { background: none; border: 0; color: var(--goldtx); font-weight: 600; padding: 8px 0; text-align: left; }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 12px; background: transparent; color: var(--muted); transition: background .15s, color .15s; position: relative; }
.icon-btn:hover { background: var(--chip); color: var(--ink); }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--panel2); color: var(--ink); font-size: .88rem; font-weight: 600; transition: background .15s; }
.chip:hover { background: var(--panel3); }
.chip .ico { width: 16px; height: 16px; }
.chip.layer { color: var(--muted); }
.chip.layer.on { background: color-mix(in srgb, var(--c) 28%, var(--panel2)); color: var(--ink); }
.field { display: flex; flex-direction: column; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field label, .field legend { font-size: .85rem; font-weight: 600; padding: 0; }
.field input, .field select, .field textarea { width: 100%; min-height: 50px; padding: 12px 14px; background: var(--panel2); border: 1px solid transparent; border-radius: 14px; outline: 0; transition: border-color .15s; }
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); }
.field input[readonly] { color: var(--muted); }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; font-weight: 600; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--gold); flex: none; }
.error { color: var(--danger); font-size: .9rem; min-height: 1.3em; }
.note { color: var(--muted); font-size: .9rem; }
.form { display: flex; flex-direction: column; gap: 16px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.actions .btn { flex: 1 1 auto; }
.actions.row .btn { flex: 0 1 auto; }
.avatar { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--c, var(--gold)); color: #0B0B0D; font-weight: 800; font-size: .85rem; }
.avatar.sm { width: 28px; height: 28px; font-size: .68rem; }
a.inline { font-weight: 600; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.sw { width: 40px; height: 40px; border-radius: 50%; border: 3px solid transparent; background: var(--c, var(--panel2)); font-size: .7rem; font-weight: 700; color: var(--ink); padding: 0; }
.sw.on { border-color: var(--ink); }
.sw:not([data-c]) { width: auto; padding: 0 14px; border-radius: 999px; background: var(--panel2); border-color: transparent; }
.sw:not([data-c]).on { border-color: var(--ink); }

/* ---------- acceso ---------- */
.brand { display: flex; align-items: center; gap: 11px; font-size: 1.15rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.brand em { font-style: normal; color: var(--goldtx); }
.brand span { font-weight: 500; color: var(--muted); letter-spacing: 0; }
.login { height: 100dvh; display: flex; flex-wrap: wrap; overflow: auto; }
.login-main { flex: 1 1 480px; min-width: 0; padding: 40px clamp(20px, 6vw, 88px); display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.login-form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 18px; }
.login-form h1 { margin-bottom: 8px; font-size: clamp(2rem, 5vw, 2.6rem); line-height: 1.05; letter-spacing: -.035em; font-weight: 800; }
.login-form p { color: var(--muted); }
.login-form .error { color: var(--danger); }
.login-foot { font-size: .82rem; color: var(--muted); }
.login-side { flex: 1 1 420px; min-width: 0; margin: 16px; border-radius: 32px; background: var(--panel); padding: clamp(28px, 5vw, 64px); display: flex; flex-direction: column; justify-content: center; gap: 36px; min-height: 360px; }
.login-side h2 { font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.02; letter-spacing: -.04em; font-weight: 800; max-width: 12ch; }
.points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.points li { display: flex; flex-direction: column; gap: 4px; max-width: 38ch; }
.points strong { font-size: 1.08rem; }
.points span { color: var(--muted); }

/* ---------- hojas ---------- */
.sheet-bg { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: min(640px, 100%); max-height: 92dvh; display: flex; flex-direction: column; background: var(--panel); border-radius: 26px 26px 0 0; overflow: hidden; animation: up .24s cubic-bezier(.2,.8,.2,1); }
.sheet.small { width: min(480px, 100%); }
.sheet header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 10px 8px 22px; flex: none; }
.sheet header h2 { font-size: 1.15rem; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbody { overscroll-behavior: contain; overflow: auto; padding: 8px 22px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 4px; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 92px + env(safe-area-inset-bottom)); z-index: 40; display: flex; align-items: center; gap: 14px; padding: 13px 20px; border-radius: 14px; background: var(--ink); color: var(--bg); font-weight: 600; max-width: calc(100vw - 32px); box-shadow: 0 12px 34px rgba(0,0,0,.4); animation: up .2s ease-out; }
.toast button { background: none; border: 0; font-weight: 800; color: inherit; text-decoration: underline; }


/* ---------- panel ---------- */
body { overflow: auto; }
.hub { min-height: 100dvh; display: flex; flex-direction: column; }
.hubtop { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(14px, env(safe-area-inset-top)) clamp(16px, 4vw, 40px) 14px; }
.top-r { display: flex; align-items: center; gap: 8px; }
.hubmain { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: clamp(12px, 3vw, 32px) clamp(16px, 4vw, 40px) 56px; display: flex; flex-direction: column; gap: 24px; }
.hello h1 { font-size: clamp(2rem, 6vw, 3.2rem); line-height: 1.05; letter-spacing: -.04em; font-weight: 800; }
.hello p { color: var(--muted); margin-top: 8px; max-width: 52ch; }
.appgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.appcard { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 96px; padding: 18px; border: 0; border-radius: 22px; background: var(--panel); text-align: left; transition: background .15s, transform .12s; }
.appcard:hover { background: var(--panel2); }
.appcard:active { transform: scale(.985); }
.appcard.busy { opacity: .6; cursor: wait; }
.tile { flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--chip); color: var(--goldtx); }
.tile .ico { width: 28px; height: 28px; }
.tile.sm { width: 40px; height: 40px; border-radius: 12px; }
.tile.sm .ico { width: 20px; height: 20px; }
.atxt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.atxt strong { font-size: 1.12rem; letter-spacing: -.02em; }
.atxt small { color: var(--muted); }
.go { color: var(--muted); }
.appcard:hover .go { color: var(--goldtx); }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab { min-height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--panel2); font-weight: 600; }
.tab.on { background: var(--gold); color: var(--btnink); }
.paneh { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.rows { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 16px; border: 0; border-radius: 16px; background: var(--panel); text-align: left; }
button.row:hover { background: var(--panel2); }
.row.static { cursor: default; }
.rtxt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.rtxt strong, .rtxt small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rtxt small { color: var(--muted); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.st { font-style: normal; font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--chip); color: var(--goldtx); }
.st.no { background: var(--panel3); color: var(--muted); }
.appgrant { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; }
.appgrant + .appgrant { border-top: 1px solid var(--line); }
.gurl { min-height: 40px; font-size: .88rem; }
.cred { display: grid; gap: 4px; padding: 16px; border-radius: 16px; background: var(--panel2); overflow-wrap: anywhere; }
.cred span { color: var(--muted); font-size: .85rem; }
.cred strong { font-size: 1.05rem; margin-bottom: 8px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; user-select: all; }
@media (prefers-reduced-motion: reduce) { .appcard { transition: none; } }
.empty { color: var(--muted); padding: 12px 2px; }
