/* Apunte v5 — Diseño: app móvil con barra inferior (riel lateral en PC).
   Degradado de marca "aurora" (turquesa → azul → violeta); el coral-fucsia es solo para grabar. */
:root {
  --bg: #F3F5FB;
  --surface: #FFFFFF;
  --surface-2: #EDF0F8;
  --ink: #0F1535;
  --muted: #646C8A;
  --line: #E2E6F0;
  --navy: #141B4D;
  --on-navy: #FFFFFF;
  --brand-a: #11BFB0;
  --brand-b: #3A66FF;
  --brand-c: #7C4DFF;
  --brand-ink: #2F55E8;
  --rec-a: #FF6A4D;
  --rec-b: #FF2D78;
  --ok: #17946A;
  --warn: #B87800;
  --err: #E0444B;
  --s0: #3A66FF; --s1: #E2508A; --s2: #11A396; --s3: #E07A1F; --s4: #7C4DFF; --s5: #2E9BD6;
  --shadow: 0 1px 2px rgba(15,21,53,.05), 0 8px 24px -12px rgba(15,21,53,.18);
  --shadow-lg: 0 24px 60px -20px rgba(20,27,77,.45);
  --g-brand: linear-gradient(120deg, var(--brand-a) 0%, var(--brand-b) 52%, var(--brand-c) 100%);
  --g-rec: linear-gradient(120deg, var(--rec-a), var(--rec-b));
  --g-banner: radial-gradient(120% 140% at 100% 0%, rgba(124,77,255,.55) 0%, transparent 55%), radial-gradient(90% 120% at 0% 100%, rgba(17,191,176,.45) 0%, transparent 60%), linear-gradient(135deg, #0F1650 0%, #1B2580 100%);
  --g-soft: linear-gradient(135deg, rgba(17,191,176,.12), rgba(58,102,255,.10) 50%, rgba(124,77,255,.14));
  --font: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --nav-h: 68px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A0E22; --surface: #131937; --surface-2: #1A2145; --ink: #EEF1FF; --muted: #9AA3C7; --line: #252D55;
    --navy: #3A66FF; --on-navy: #FFFFFF; --brand-ink: #8FA8FF;
    --ok: #4CC79A; --warn: #E7B04A; --err: #FF6B70;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px -14px rgba(0,0,0,.6);
    --g-soft: linear-gradient(135deg, rgba(17,191,176,.16), rgba(58,102,255,.14) 50%, rgba(124,77,255,.20));
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A0E22; --surface: #131937; --surface-2: #1A2145; --ink: #EEF1FF; --muted: #9AA3C7; --line: #252D55;
  --navy: #3A66FF; --on-navy: #FFFFFF; --brand-ink: #8FA8FF;
  --ok: #4CC79A; --warn: #E7B04A; --err: #FF6B70;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px -14px rgba(0,0,0,.6);
  --g-soft: linear-gradient(135deg, rgba(17,191,176,.16), rgba(58,102,255,.14) 50%, rgba(124,77,255,.20));
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font: 500 15px/1.55 var(--font); -webkit-text-size-adjust: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; text-wrap: balance; letter-spacing: -.02em; }
p { margin: 0 0 .7em; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--brand-b); outline-offset: 2px; }
svg { display: block; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- estructura ---------- */
#main { min-width: 0; padding-bottom: calc(var(--nav-h) + 96px + env(safe-area-inset-bottom, 0px)); }
body.nonav #main { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
.page { max-width: 760px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top, 0px)) 16px 24px; display: flex; flex-direction: column; gap: 18px; animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* barra inferior (celular) / riel (PC) */
#nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); }
body.nonav #nav { display: none; }
#nav .nav-brand, #nav .nav-new { display: none; }
.nav-item { display: grid; place-items: center; align-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 600; position: relative; }
.nav-item svg { width: 24px; height: 24px; }
.nav-item[aria-current="page"] { color: var(--brand-ink); }
.nav-item[aria-current="page"] .nav-ico { background: var(--g-soft); }
.nav-ico { display: grid; place-items: center; width: 52px; height: 30px; border-radius: 999px; transition: background .2s; }
.nav-badge { position: absolute; top: 8px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--g-rec); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }

@media (min-width: 900px) {
  #nav { top: 0; right: auto; width: 248px; height: auto; grid-template-columns: none; grid-auto-rows: min-content; align-content: start; gap: 4px; padding: 22px 14px; border-top: 0; border-right: 1px solid var(--line); }
  body.nonav #nav { display: grid; }
  #nav .nav-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-size: 22px; font-weight: 800; letter-spacing: -.03em; text-decoration: none; }
  .nav-brand svg { width: 34px; height: 34px; }
  #nav .nav-new { display: flex; margin: 0 0 14px; }
  .nav-item { grid-template-columns: 30px 1fr; justify-items: start; gap: 10px; padding: 10px 12px; border-radius: 12px; font-size: 14.5px; }
  .nav-item:hover { background: var(--surface-2); }
  .nav-item[aria-current="page"] { background: var(--g-soft); }
  .nav-item[aria-current="page"] .nav-ico { background: none; }
  .nav-ico { width: 30px; height: 30px; }
  .nav-badge { position: static; justify-self: end; grid-column: 3; }
  .nav-item { grid-template-columns: 30px 1fr auto; }
  #main, body.nonav #main { margin-left: 248px; padding-bottom: 48px; }
  .fab { display: none !important; }
}

/* ---------- encabezados ---------- */
.top { display: flex; align-items: center; gap: 10px; }
.top h1 { font-size: clamp(30px, 8vw, 38px); font-weight: 800; flex: 1; min-width: 0; }
.top .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.icon-btn { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; border: 0; background: var(--surface); box-shadow: var(--shadow); cursor: pointer; color: var(--ink); text-decoration: none; flex: none; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.plain { background: transparent; box-shadow: none; }
.search { position: relative; }
.search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); }
.search input { width: 100%; height: 50px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); padding: 0 16px 0 48px; font-size: 15px; box-shadow: var(--shadow); }
.search input::placeholder { color: var(--muted); }

/* ---------- banner con degradado ---------- */
.banner { position: relative; overflow: hidden; border-radius: 24px; padding: 22px 20px; color: #fff; background: var(--g-banner); box-shadow: var(--shadow-lg); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; isolation: isolate; }
.banner::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(rgba(255,255,255,.55) 1px, transparent 1.5px); background-size: 34px 34px; mask-image: linear-gradient(90deg, transparent 30%, #000 100%); opacity: .5; }
.banner h2 { font-size: 21px; font-weight: 800; margin-bottom: 6px; }
.banner p { margin: 0; color: rgba(255,255,255,.82); font-size: 14px; max-width: 34ch; }
.banner .bcta { margin-top: 14px; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; background: #fff; color: #141B4D; font-weight: 700; font-size: 14px; text-decoration: none; border: 0; cursor: pointer; }
.banner .bcta svg { width: 16px; height: 16px; }
.banner .bx { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; cursor: pointer; }
.banner .bx svg { width: 16px; height: 16px; }
.bubbles { position: relative; width: 104px; height: 92px; }
.bub { position: absolute; display: grid; place-items: center; border-radius: 22px; box-shadow: 0 10px 24px -8px rgba(0,0,0,.45); color: #fff; animation: float 5s ease-in-out infinite; }
.bub svg { width: 55%; height: 55%; }
.bub.b1 { width: 58px; height: 58px; right: 0; top: 0; background: var(--g-rec); transform: rotate(8deg); }
.bub.b2 { width: 50px; height: 50px; left: 0; top: 10px; background: linear-gradient(135deg, var(--brand-a), var(--brand-b)); transform: rotate(-10deg); animation-delay: -1.6s; }
.bub.b3 { width: 46px; height: 46px; left: 30px; bottom: 0; background: linear-gradient(135deg, var(--brand-b), var(--brand-c)); animation-delay: -3s; }
@keyframes float { 50% { translate: 0 -6px; } }
@media (max-width: 420px) { .bubbles { width: 76px; height: 76px; } .bub.b1 { width: 46px; height: 46px; } .bub.b2 { width: 40px; height: 40px; } .bub.b3 { width: 36px; height: 36px; left: 22px; } }

/* ---------- estadísticas ---------- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--surface); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); display: grid; gap: 2px; min-width: 0; }
.stat b { font-size: 24px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; background: var(--g-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* ---------- lista de notas ---------- */
.group h2 { font-size: 20px; font-weight: 800; margin: 6px 2px 12px; }
.cards { display: grid; gap: 12px; }
.ncard { display: grid; gap: 6px; padding: 18px 18px 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); text-decoration: none; animation: rise .4s ease both; animation-delay: calc(var(--i, 0) * 40ms); transition: transform .15s, box-shadow .15s; }
.ncard:hover { transform: translateY(-2px); box-shadow: 0 14px 34px -16px rgba(20,27,77,.35); }
.ncard h3 { font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.nmeta { color: var(--muted); font-size: 14px; font-weight: 500; }
.snip { color: var(--muted); font-size: 14px; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.chip svg { width: 16px; height: 16px; color: var(--muted); }
.chip.ok { color: var(--ok); } .chip.ok svg { color: var(--ok); }
.chip.err { color: var(--err); border-color: color-mix(in srgb, var(--err) 35%, var(--line)); } .chip.err svg { color: var(--err); }
.chip.brand { border: 0; background: var(--g-soft); color: var(--brand-ink); }
.spin { width: 15px; height: 15px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, var(--brand-b) 25%, transparent); border-top-color: var(--brand-b); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 34px 20px; display: grid; justify-items: center; gap: 8px; color: var(--muted); }
.empty-state .orb { width: 84px; height: 84px; border-radius: 28px; display: grid; place-items: center; background: var(--g-brand); color: #fff; box-shadow: var(--shadow-lg); margin-bottom: 8px; }
.empty-state .orb svg { width: 40px; height: 40px; }
.empty-state h3 { color: var(--ink); font-size: 19px; }
.notice { border-radius: 16px; padding: 14px 16px; font-size: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; gap: 12px; align-items: flex-start; }
.notice svg { width: 20px; height: 20px; flex: none; margin-top: 1px; color: var(--warn); }
.notice.err svg { color: var(--err); } .notice.ok svg { color: var(--ok); } .notice.work svg { color: var(--brand-b); }
.notice > div { min-width: 0; overflow-wrap: anywhere; }

/* botón flotante "Nueva nota" */
.fab { position: fixed; z-index: 25; left: 16px; right: 16px; bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom, 0px)); max-width: 560px; margin: 0 auto; height: 62px; border-radius: 999px; border: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; color: #fff; font-size: 19px; font-weight: 700; background: var(--g-brand); background-size: 160% 100%; box-shadow: 0 16px 34px -12px rgba(58,102,255,.65); animation: shimmer 6s ease-in-out infinite; }
.fab svg { width: 24px; height: 24px; }
@keyframes shimmer { 50% { background-position: 100% 0; } }

/* ---------- botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-decoration: none; font-weight: 700; white-space: nowrap; }
.btn svg { width: 18px; height: 18px; }
.btn:hover { background: var(--surface-2); }
.btn.grad { border: 0; color: #fff; background: var(--g-brand); box-shadow: 0 10px 24px -12px rgba(58,102,255,.7); }
.btn.navy { border: 0; color: var(--on-navy); background: var(--navy); }
.btn.rec { border: 0; color: #fff; background: var(--g-rec); box-shadow: 0 12px 26px -12px rgba(255,45,120,.7); }
.btn.danger { color: var(--err); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.scroller { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 6px; }
.scroller::-webkit-scrollbar { display: none; }
.scroller .chip { cursor: pointer; flex: none; }
.scroller .chip:hover { background: var(--surface-2); }

/* ---------- hoja "Agregar nueva nota" ---------- */
#sheet { position: fixed; inset: 0; z-index: 50; display: none; }
#sheet.open { display: block; }
.backdrop { position: absolute; inset: 0; background: rgba(10,14,40,.45); backdrop-filter: blur(3px); animation: fade .2s ease both; }
@keyframes fade { from { opacity: 0; } }
.panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow-y: auto; background: var(--bg); border-radius: 28px 28px 0 0; padding: 10px 16px calc(20px + env(safe-area-inset-bottom, 0px)); animation: up .32s cubic-bezier(.2,.8,.2,1) both; }
@keyframes up { from { transform: translateY(100%); } }
@media (min-width: 900px) { .panel { left: 50%; right: auto; bottom: auto; top: 50%; width: 520px; transform: translate(-50%, -50%); border-radius: 28px; animation: pop .25s ease both; } @keyframes pop { from { opacity: 0; transform: translate(-50%, -46%); } } }
.grabber { width: 48px; height: 5px; border-radius: 99px; background: var(--line); margin: 4px auto 12px; }
.panel h2 { text-align: center; font-size: 20px; font-weight: 800; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin: 0 -16px 16px; }
.opts { display: grid; gap: 12px; }
.opt { display: grid; grid-template-columns: 48px minmax(0, 1fr) 20px; gap: 14px; align-items: center; padding: 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; cursor: pointer; text-align: left; width: 100%; transition: transform .12s; }
.opt:active { transform: scale(.98); }
.opt .oi { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; color: #fff; }
.opt .oi svg { width: 24px; height: 24px; }
.opt b { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; }
.opt small { display: block; color: var(--muted); font-size: 14px; font-weight: 500; margin-top: 2px; }
.opt > svg { width: 20px; height: 20px; color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .03em; }
.tag svg { width: 14px; height: 14px; }
.tag.live { background: color-mix(in srgb, var(--brand-b) 14%, transparent); color: var(--brand-ink); }
.tag.new { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.tag.pc { background: color-mix(in srgb, var(--brand-c) 14%, transparent); color: var(--brand-c); }
.oi.g1 { background: var(--g-rec); } .oi.g2 { background: linear-gradient(135deg, #11BFB0, #15A4D8); } .oi.g3 { background: linear-gradient(135deg, #7C4DFF, #C14DFF); }
.oi.g4 { background: linear-gradient(135deg, #FFB020, #FF7A1A); } .oi.g5 { background: linear-gradient(135deg, #3A66FF, #7C4DFF); } .oi.g6 { background: linear-gradient(135deg, #2E9BD6, #11BFB0); }

/* ---------- grabación ---------- */
.recpage { min-height: 100vh; display: flex; flex-direction: column; max-width: 760px; margin: 0 auto; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px calc(18px + env(safe-area-inset-bottom, 0px)); gap: 14px; }
@media (min-width: 900px) { .recpage { min-height: calc(100vh - 0px); } }
.toggle-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--surface); border-radius: 20px; padding: 14px 16px; box-shadow: var(--shadow); }
.cc { width: 30px; height: 24px; border-radius: 7px; background: var(--g-brand); color: #fff; display: grid; place-items: center; font: 800 11px/1 var(--font); letter-spacing: .02em; }
.toggle-row b { font-size: 16px; font-weight: 700; }
.toggle-row small { display: block; color: var(--muted); font-size: 13px; font-weight: 500; line-height: 1.4; margin-top: 2px; }
.switch { position: relative; width: 76px; height: 40px; border-radius: 999px; border: 0; cursor: pointer; background: var(--surface-2); color: var(--muted); font: 800 13px var(--font); padding: 0; box-shadow: inset 0 0 0 1px var(--line); }
.switch::before { content: ""; position: absolute; top: 4px; left: 4px; width: 32px; height: 32px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .2s; }
.switch span { position: absolute; top: 50%; transform: translateY(-50%); right: 12px; }
.switch[aria-checked="true"] { background: var(--g-brand); color: #fff; box-shadow: none; }
.switch[aria-checked="true"]::before { transform: translateX(36px); }
.switch[aria-checked="true"] span { right: auto; left: 12px; }
.switch[disabled] { opacity: .55; cursor: not-allowed; }
.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pill-select { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 38px 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14.5px; max-width: 100%; }
.pill-select svg.lead { width: 20px; height: 20px; color: var(--brand-b); }
.pill-select select { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.pill-select::after { content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); }
.rec-body { flex: 1; min-height: 220px; display: flex; flex-direction: column; }
.tips { margin: auto; text-align: center; display: grid; justify-items: center; gap: 6px; color: var(--muted); padding: 20px 0; }
.tips .bulb { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; background: var(--g-soft); color: var(--brand-ink); }
.tips .bulb svg { width: 28px; height: 28px; }
.tips h3 { color: var(--ink); font-size: 19px; margin: 6px 0 4px; }
.tips ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; text-align: left; font-size: 15px; }
.tips li { display: flex; gap: 8px; } .tips li::before { content: "•"; color: var(--brand-b); font-weight: 800; }
.live { flex: 1; overflow-y: auto; max-height: 46vh; padding: 4px 2px; }
.live .lrow { margin-bottom: 14px; animation: rise .3s ease both; }
.live .lts { font: 500 13px var(--mono); color: var(--muted); margin-bottom: 2px; }
.live .ltx { font-size: 19px; line-height: 1.5; font-weight: 500; }
.live .interim .ltx { color: var(--muted); }
.listen { margin: auto; display: grid; justify-items: center; gap: 14px; text-align: center; color: var(--muted); max-width: 32ch; }
.orb-rec { width: 120px; height: 120px; border-radius: 50%; background: var(--g-rec); display: grid; place-items: center; color: #fff; position: relative; box-shadow: 0 20px 44px -16px rgba(255,45,120,.7); }
.orb-rec svg { width: 48px; height: 48px; }
.orb-rec::before, .orb-rec::after { content: ""; position: absolute; inset: -14px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--rec-b) 45%, transparent); animation: ring 2s ease-out infinite; }
.orb-rec::after { animation-delay: 1s; }
.orb-rec.paused { filter: grayscale(.8); } .orb-rec.paused::before, .orb-rec.paused::after { animation: none; opacity: 0; }
@keyframes ring { from { transform: scale(.85); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.rec-foot { display: grid; gap: 14px; justify-items: center; border-top: 1px solid var(--line); margin: 0 -16px; padding: 14px 16px 0; }
canvas.wave { width: 100%; height: 76px; }
.timer-row { display: flex; align-items: center; gap: 10px; font: 500 34px/1 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.timer-row .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--rec-b); animation: blink 1.2s ease-in-out infinite; }
.timer-row .dot.off { background: var(--muted); animation: none; }
@keyframes blink { 50% { opacity: .25; } }
.rec-actions { display: flex; gap: 12px; justify-content: center; width: 100%; }
.mic-big { width: 100%; max-width: 300px; height: 72px; border-radius: 999px; border: 0; cursor: pointer; background: var(--g-rec); color: #fff; display: grid; place-items: center; box-shadow: 0 18px 36px -14px rgba(255,45,120,.75); transition: transform .12s; }
.mic-big:active { transform: scale(.97); }
.mic-big svg { width: 32px; height: 32px; }
.rec-actions .btn { height: 64px; min-width: 150px; font-size: 18px; }
.rec-actions .btn.stop { min-width: 64px; width: 64px; padding: 0; }
.rec-actions .btn.stop svg { width: 22px; height: 22px; }
.rec-hint { color: var(--muted); font-size: 13px; text-align: center; margin: 0; }

/* ---------- vista de nota ---------- */
.hero { border-radius: 24px; padding: 18px; background: var(--surface); box-shadow: var(--shadow); display: grid; gap: 12px; position: relative; overflow: hidden; isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--g-soft); }
.title-input { width: 100%; min-width: 0; border: 0; background: transparent; font: 800 clamp(22px, 6vw, 28px)/1.2 var(--font); letter-spacing: -.02em; padding: 2px 0; border-bottom: 2px solid transparent; }
.title-input:focus { outline: none; border-bottom-color: var(--brand-b); }
.hmeta { display: flex; flex-wrap: wrap; gap: 8px; }
audio { width: 100%; height: 44px; border-radius: 999px; }
.seg { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; background: var(--surface); padding: 5px; border-radius: 999px; box-shadow: var(--shadow); }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1 0 auto; height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; cursor: pointer; font-weight: 700; font-size: 14px; color: var(--muted); }
.seg button[aria-selected="true"] { background: var(--g-brand); color: #fff; box-shadow: 0 6px 16px -8px rgba(58,102,255,.8); }
.card { background: var(--surface); border-radius: 22px; padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.prose { font-size: 16px; line-height: 1.7; overflow-wrap: anywhere; }
.prose h4 { font-size: 17px; font-weight: 800; margin: 1.3em 0 .5em; display: flex; align-items: center; gap: 8px; }
.prose h4::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--g-brand); flex: none; }
.prose h4:first-child { margin-top: 0; }
.prose ul { margin: 0 0 .9em; padding-left: 1.2em; } .prose li { margin-bottom: .35em; } .prose li::marker { color: var(--brand-b); }
.prose p:last-child { margin-bottom: 0; }
.tline { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tline:last-child { border-bottom: 0; }
.tline.nosp { grid-template-columns: minmax(0, 1fr); }
.av { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px; }
.av.s0 { background: var(--s0); } .av.s1 { background: var(--s1); } .av.s2 { background: var(--s2); } .av.s3 { background: var(--s3); } .av.s4 { background: var(--s4); } .av.s5 { background: var(--s5); } .av.sx { background: var(--surface-2); color: var(--muted); }
.thead { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 13px; }
.thead b { font-weight: 800; font-size: 14px; }
.thead .ts { font-family: var(--mono); color: var(--muted); }
.ttext { font-size: 15.5px; line-height: 1.6; overflow-wrap: anywhere; }
.tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.task { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.task input { appearance: none; width: 26px; height: 26px; margin: 0; border-radius: 9px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; display: grid; place-items: center; }
.task input:checked { border: 0; background: var(--g-brand); }
.task input:checked::after { content: ""; width: 7px; height: 12px; border: solid #fff; border-width: 0 3px 3px 0; transform: translate(0, -1px) rotate(45deg); }
.task.done .t { text-decoration: line-through; color: var(--muted); }
.task .t { font-weight: 700; overflow-wrap: anywhere; }
.task .who { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.task .who .chip { height: 28px; font-size: 12.5px; padding: 0 10px; }
.task .from { display: block; font-size: 13px; color: var(--brand-ink); text-decoration: none; margin-top: 6px; font-weight: 600; }

/* chat */
.chat { display: grid; gap: 12px; }
.msg { max-width: 86%; padding: 12px 16px; border-radius: 20px 20px 20px 6px; background: var(--surface); box-shadow: var(--shadow); overflow-wrap: anywhere; font-size: 15px; }
.msg.me { justify-self: end; border-radius: 20px 20px 6px 20px; background: var(--g-brand); color: #fff; }
.msg p:last-child { margin-bottom: 0; }
.typing { display: inline-flex; gap: 5px; } .typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; } .typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
.chat-form { display: flex; gap: 8px; position: sticky; bottom: calc(var(--nav-h) + 8px + env(safe-area-inset-bottom, 0px)); padding: 8px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-lg); }
body.nonav .chat-form { bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 900px) { .chat-form { bottom: 16px; } }
.chat-form input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0 12px; font-size: 15px; }
.chat-form input:focus { outline: none; }
.chat-form .btn { min-height: 44px; width: 44px; padding: 0; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; }
.suggest button { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 14px; font-weight: 600; text-align: left; }
.suggest button:hover { background: var(--surface-2); }
.chat-hero { text-align: center; display: grid; justify-items: center; gap: 8px; padding: 10px 0; }
.chat-hero .orb { width: 72px; height: 72px; border-radius: 24px; background: var(--g-brand); display: grid; place-items: center; color: #fff; box-shadow: var(--shadow-lg); }
.chat-hero .orb svg { width: 34px; height: 34px; }
.chat-hero p { color: var(--muted); margin: 0; max-width: 40ch; }

/* formularios / ajustes */
.section-title { font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 6px 4px -6px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13.5px; font-weight: 700; }
.field input[type="text"], .field input[type="email"], .field input[type="password"], .field select, .field textarea { width: 100%; min-height: 48px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); padding: 10px 14px; font-size: 15px; }
.field textarea { min-height: 220px; resize: vertical; line-height: 1.6; }
.field small { color: var(--muted); font-size: 13px; font-weight: 500; line-height: 1.45; }
.stack { display: grid; gap: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.check { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; font-size: 15px; font-weight: 600; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--brand-b); }
details.card summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.card summary::after { content: "+"; font-size: 22px; color: var(--muted); }
details[open].card summary::after { content: "–"; }

/* marca */
.ia-pill { display: inline-block; margin-left: 4px; padding: 0 8px 2px; border-radius: 10px; background: linear-gradient(120deg, #6A4DFF, #B23DFF 55%, #FF4FA3); color: #fff; font-weight: 800; font-size: .85em; vertical-align: 2px; }
/* cuenta y planes */
.field input.otp { font: 700 28px/1 var(--mono); letter-spacing: .35em; text-align: center; min-height: 64px; }
.acct-head { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.acct-head small { display: block; color: var(--muted); font-size: 13.5px; }
.avatar { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: var(--g-brand); color: #fff; font-weight: 800; font-size: 20px; }
.avatar svg { width: 24px; height: 24px; }
.plan-badge { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 12px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .05em; }
.plan-badge svg { width: 14px; height: 14px; }
.plan-badge.pro { background: linear-gradient(120deg, #FFB020, #FF6A4D); color: #fff; }
.meters { display: grid; gap: 12px; }
.meter-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.meter-top b { font-variant-numeric: tabular-nums; }
.bar { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--g-brand); }
.bar i.hot { background: var(--g-rec); }
.login-hero { text-align: center; display: grid; justify-items: center; gap: 10px; padding: 10px 0 4px; }
.login-hero .orb { width: 84px; height: 84px; border-radius: 26px; overflow: hidden; box-shadow: var(--shadow-lg); }
.login-hero .orb svg { width: 100%; height: 100%; }
.login-hero h1 { font-size: 30px; font-weight: 800; }
.login-hero p { color: var(--muted); max-width: 34ch; margin: 0; }
.btn.google { background: var(--surface); }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; font-weight: 600; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.plan { position: relative; background: var(--surface); border-radius: 24px; padding: 22px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.plan.pro { border: 2px solid transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--g-brand) border-box; }
.plan h3 { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 800; }
.plan h3 svg { width: 22px; height: 22px; color: #FF8A1A; }
.plan .price { font-size: 34px; font-weight: 800; letter-spacing: -.03em; margin: 8px 0 14px; }
.plan.pro .price { background: var(--g-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.plan .price small { font-size: 14px; font-weight: 600; color: var(--muted); -webkit-text-fill-color: var(--muted); }
.plan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: 15px; }
.plan li { display: flex; gap: 10px; align-items: flex-start; }
.plan li svg { width: 18px; height: 18px; margin-top: 2px; color: var(--ok); }
.ribbon { position: absolute; top: -12px; right: 18px; height: 26px; padding: 0 12px; border-radius: 999px; background: var(--g-brand); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.paysteps { margin: 0; padding-left: 1.3em; display: grid; gap: 10px; font-size: 15.5px; }
.paysteps li::marker { color: var(--brand-b); font-weight: 800; }
.sel { user-select: all; overflow-wrap: anywhere; }
.urow { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.urow small { display: block; color: var(--muted); font-size: 13px; }

#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 92px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); background: var(--navy); color: var(--on-navy); padding: 12px 18px; border-radius: 16px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; width: max-content; max-width: calc(100% - 32px); z-index: 60; box-shadow: var(--shadow-lg); }
body.nonav #toast { bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 900px) { #toast, body.nonav #toast { bottom: 28px; left: calc(50% + 124px); } }

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

#printSheet { display: none; }
@media print {
  body > *:not(#printSheet) { display: none !important; }
  #printSheet { display: block !important; color: #000; background: #fff; font: 12pt/1.5 var(--font); }
  #printSheet h1 { font-size: 22pt; margin-bottom: 4pt; }
  #printSheet h2 { font-size: 14pt; margin: 16pt 0 6pt; border-bottom: 1px solid #999; padding-bottom: 3pt; }
  #printSheet .pmeta { color: #444; font-size: 10pt; }
  #printSheet pre { white-space: pre-wrap; font: 10.5pt/1.5 var(--font); }
}

/* v9: entrar con correo y contraseña */
.auth-seg { background: var(--bg); box-shadow: none; }
.auth-seg button { flex: 1 1 0; }
.pass-wrap { position: relative; }
.pass-wrap input { width: 100%; padding-right: 52px; }
.pass-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.pass-eye svg { width: 20px; height: 20px; }
.pass-eye.on { color: var(--brand-ink); }
.linkish { border: 0; background: none; padding: 4px 0; color: var(--brand-ink); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; justify-self: center; align-self: center; }
.pw-box { display: grid; gap: 10px; padding: 14px; border-radius: 16px; background: var(--bg); }
