/* Fuentes locales (mismas que usaba la app original vía fontsource) */
@font-face { font-family: "Bebas Neue"; font-style: normal; font-display: swap; font-weight: 400; src: url(/fonts/bebas-neue-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Montserrat Variable"; font-style: normal; font-display: swap; font-weight: 100 900; src: url(/fonts/montserrat-latin-wght-normal.woff2) format("woff2-variations"); }
/* Mesa 5T4D10 · basado en el Sistema de Diseño App 2.0
   Oscuro, sobrio, un solo acento (pink). Bordes de 1 px, sin sombras. */
:root {
  color-scheme: dark;
  --bg: #0a0a0b; --surface: #141416; --surface-raised: #1c1c1f; --surface-sunken: #1f1f23;
  --avatar: #26262b; --line: #26262b; --line-strong: #3a3a41; --track: #2a2a2f;
  --text: #f5f5f7; --text-2: #b4b4bc; --text-muted: #8f8f98; --nav-inactive: #7e7e87;
  --pink: #fd0154; --pink-hover: #ff4d85; --pink-soft: rgba(253,1,84,.10); --pink-line: #5a1a30; --on-pink: #fff;
  --nav-bg: rgba(12,12,14,.96); --scrim: rgba(10,10,11,.96); --ghost: rgba(255,255,255,.06);
  --chart-1: #f5f5f7; --chart-2: #d9d9de; --chart-3: #a6a6ae; --chart-4: #8f8f98; --chart-5: #5a5a62; --chart-6: #4a4a52;
  --r-xs: 6px; --r-sm: 12px; --r-md: 16px; --r-lg: 20px; --r-xl: 24px; --r-2xl: 28px; --r-pill: 999px;
  --display: "Bebas Neue", "Oswald", Impact, sans-serif;
  --sans: "Montserrat Variable", Montserrat, system-ui, sans-serif;
  --side: 248px;
  --ease: cubic-bezier(.2,.7,.2,1);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: var(--sans); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100dvh; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--pink); color: #fff; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Tipografía ---------- */
.d { font-family: var(--display); font-weight: 400; letter-spacing: .02em; line-height: 1; text-transform: uppercase; }
.h-xl { font-size: clamp(34px, 4vw, 44px); }
.h-l { font-size: 32px; }
.h-m { font-size: 24px; }
.h-s { font-size: 20px; }
.sec { font-family: var(--display); font-size: 22px; letter-spacing: .02em; line-height: 1.05; text-transform: uppercase; margin: 0; }
.over { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.muted { color: var(--text-muted); }
.t2 { color: var(--text-2); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.pink { color: var(--pink); }
p { margin: 0; }

/* ---------- Estructura ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; border-right: 1px solid var(--line); padding: 24px 16px; display: flex; flex-direction: column; gap: 22px; background: var(--bg); }
.brand { display: flex; flex-direction: column; gap: 2px; padding: 0 8px; }
.brand b { font-family: var(--display); font-size: 30px; letter-spacing: .03em; line-height: .9; }
.brand span { font-size: 12px; color: var(--text-muted); }
.navlist { display: flex; flex-direction: column; gap: 2px; }
.navlink { display: flex; align-items: center; gap: 12px; padding: 0 12px; height: 44px; border-radius: var(--r-sm); color: var(--text-2); font-weight: 600; font-size: 14px; transition: background .15s, color .15s; }
.navlink:hover { background: var(--ghost); color: var(--text); }
.navlink[aria-current="page"] { background: var(--surface-raised); color: var(--text); }
.navlink[aria-current="page"] svg { color: var(--pink); }
.navlink .count { margin-left: auto; font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.navlink .count.hot { color: var(--pink); }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.side-foot .who { display: flex; flex-direction: column; min-width: 0; }
.side-foot .who b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main { min-width: 0; padding: 32px clamp(20px, 3.5vw, 48px) 80px; max-width: 1440px; width: 100%; }
.topbar { display: none; }
.tabbar { display: none; }

@media (max-width: 1023px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { padding: 16px 20px 132px; }
  .topbar { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20; padding: 12px 20px; padding-top: max(12px, env(safe-area-inset-top)); background: var(--nav-bg); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
  .topbar b { font-family: var(--display); font-size: 24px; letter-spacing: .03em; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(84px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--nav-bg); border-top: 1px solid var(--line); backdrop-filter: blur(12px); }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--nav-inactive); font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
  .tab[aria-current="page"] { color: var(--text); }
  .tab.core { position: relative; }
  .tab.core .dot { width: 60px; height: 60px; border-radius: 50%; background: var(--pink); color: #fff; display: grid; place-items: center; margin-top: -30px; box-shadow: 0 0 0 5px var(--bg); }
  .tab.core span { color: var(--pink); font-weight: 800; }
}

/* ---------- Encabezados de página ---------- */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.ph h1 { margin: 6px 0 0; }
.ph p { color: var(--text-2); margin-top: 8px; max-width: 64ch; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.section { margin-top: 36px; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-h a { font-size: 13px; color: var(--text-2); font-weight: 600; }
.section-h a:hover { color: var(--text); }

/* ---------- Superficies ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 20px; }
.card.tight { padding: 16px; border-radius: var(--r-lg); }
.card.link { transition: border-color .15s; display: block; }
.card.link:hover { border-color: var(--line-strong); }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 680px) { .g2, .g3 { grid-template-columns: 1fr; } }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface-raised); color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer; transition: background .15s, border-color .15s, opacity .15s; white-space: nowrap; }
.btn:hover { border-color: var(--line-strong); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--pink); border-color: var(--pink); color: var(--on-pink); font-family: var(--display); font-size: 19px; letter-spacing: .04em; font-weight: 400; padding: 0 22px; }
.btn.primary:hover { background: var(--pink-hover); border-color: var(--pink-hover); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { color: var(--text); background: var(--ghost); }
.btn.sm { height: 36px; padding: 0 14px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.danger:hover { border-color: var(--pink); color: var(--pink); }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-raised); border: 1px solid var(--line); cursor: pointer; color: var(--text); }
.icon-btn:hover { border-color: var(--line-strong); }
.icon-btn.sm { width: 36px; height: 36px; }

/* ---------- Píldoras y estados ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--r-pill); background: var(--surface-raised); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.pill.now { border-color: var(--pink-line); color: var(--pink); background: var(--pink-soft); }
.pill.done { background: var(--text); color: var(--bg); border-color: var(--text); }
.pill.warn { border-color: var(--line-strong); color: var(--text); }
.flag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--text-2); }
.flag.bad { color: var(--pink); }
.flag svg { flex: none; }

/* Barra de avance de 3 momentos */
.prog { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.prog i { display: block; height: 4px; border-radius: 2px; background: var(--track); overflow: hidden; }
.prog i b { display: block; height: 100%; background: var(--text); border-radius: 2px; }
.prog i.cur b { background: var(--pink); }
.bar { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.bar b { display: block; height: 100%; background: var(--text); border-radius: 3px; }
.bar.pinkfill b { background: var(--pink); }

/* Avatares */
.av { width: 26px; height: 26px; border-radius: 50%; background: var(--avatar); border: 1px solid var(--line-strong); display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--text-2); flex: none; }
.av.lg { width: 36px; height: 36px; font-size: 12px; }
.av.vac { border-style: dashed; color: var(--text-muted); background: transparent; }
.avs { display: flex; }
.avs .av + .av { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }

/* ---------- Tarjeta de pieza ---------- */
.pc { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; transition: border-color .15s; min-width: 0; }
.pc:hover { border-color: var(--line-strong); }
.pc.late { border-color: var(--pink-line); }
.pc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-muted); }
.pc-title { font-weight: 700; font-size: 14px; line-height: 1.3; color: var(--text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pc-next { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-2); border-top: 1px solid var(--line); padding-top: 10px; }
.pc-next.bad { color: var(--pink); }
.pc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field small { color: var(--text-muted); font-size: 11px; }
.in, .sel, .ta { width: 100%; min-height: 44px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--surface-sunken); border: 1px solid var(--line); color: var(--text); font-size: 14px; transition: border-color .15s; }
.in:hover, .sel:hover, .ta:hover { border-color: var(--line-strong); }
.in:focus, .sel:focus, .ta:focus { outline: none; border-color: var(--text-muted); }
.ta { min-height: 96px; resize: vertical; line-height: 1.5; }
.ta.big { min-height: 180px; }
.in:disabled, .sel:disabled, .ta:disabled { opacity: .7; }
.sel { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238f8f98' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.title-in { font-family: var(--display); font-size: clamp(30px, 3.4vw, 40px); letter-spacing: .02em; line-height: 1.05; text-transform: uppercase; background: transparent; border: 1px solid transparent; border-radius: var(--r-sm); padding: 4px 8px; margin-left: -9px; width: 100%; color: var(--text); }
.title-in:hover { border-color: var(--line); }
.title-in:focus { outline: none; border-color: var(--line-strong); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; user-select: none; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); }
.seg a, .seg button { height: 34px; padding: 0 14px; border-radius: var(--r-pill); display: inline-flex; align-items: center; font-size: 13px; font-weight: 600; color: var(--text-2); background: none; border: 0; cursor: pointer; }
.seg [aria-current="true"], .seg [aria-pressed="true"] { background: var(--surface-raised); color: var(--text); }

/* Checklist de tareas */
.task { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.check { width: 24px; height: 24px; border-radius: 8px; border: 1.5px solid var(--line-strong); background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--bg); padding: 0; transition: background .15s, border-color .15s; }
.check[aria-checked="true"] { background: var(--text); border-color: var(--text); }
.check:disabled { cursor: not-allowed; opacity: .6; }
.task .meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.task .meta .bad { color: var(--pink); font-weight: 700; }
.task.done .tname { color: var(--text-muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.tname { font-weight: 600; font-size: 14px; }

/* Tablas */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }

/* Toast */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 28px; z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
@media (max-width: 1023px) { .toasts { bottom: 104px; } }
.toast { background: var(--text); color: var(--bg); font-weight: 600; font-size: 13px; padding: 12px 18px; border-radius: var(--r-pill); max-width: min(560px, 90vw); animation: tin .2s var(--ease); pointer-events: auto; }
.toast.err { background: var(--pink); color: #fff; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* Vacíos */
.empty { border: 1px dashed var(--line-strong); border-radius: var(--r-xl); padding: 36px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--text-2); }
.empty h3 { margin: 0; }

/* Utilidades */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hide-sm { }
@media (max-width: 680px) { .hide-sm { display: none !important; } }
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }

/* ---------- Hoy ---------- */
.countdown { display: flex; align-items: center; gap: 12px; padding: 12px 18px 12px 14px; border: 1px solid var(--pink-line); border-radius: var(--r-xl); background: var(--pink-soft); }
.countdown .d { font-size: 52px; color: var(--pink); line-height: .9; }
.countdown b { font-weight: 600; color: var(--text-2); }
.countdown span:last-child { font-size: 13px; line-height: 1.35; max-width: 18ch; }
.hero { display: grid; grid-template-columns: 180px 1fr; gap: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2xl); padding: 24px; }
.hero-time { display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--line); padding-right: 20px; }
.hero-time .d { font-size: 64px; line-height: .9; }
@media (max-width: 680px) { .hero { grid-template-columns: 1fr; gap: 12px; padding: 20px; } .hero-time { border-right: 0; padding-right: 0; flex-direction: row; align-items: baseline; gap: 12px; } .hero-time .d { font-size: 44px; } }
.att { display: grid; grid-template-columns: 36px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.att:last-child { border-bottom: 0; }
.att-i { width: 36px; height: 36px; border-radius: 12px; background: var(--surface-sunken); display: grid; place-items: center; color: var(--text-2); }
.att-i.hot { color: var(--pink); }
.att-t { display: flex; flex-direction: column; min-width: 0; }
.att-t b { font-size: 14px; font-weight: 700; }
.att-t span { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-c { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.att:hover .att-c { color: var(--text); }
@media (max-width: 680px) { .att { grid-template-columns: 36px 1fr; } .att-c { display: none; } }
.week7 { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x mandatory; }
.day7 { display: flex; flex-direction: column; gap: 8px; min-height: 160px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); scroll-snap-align: start; }
.day7.now { border-color: var(--pink-line); }
.day7-h { display: flex; align-items: baseline; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.day7-h b { font-size: 28px; color: var(--text); }
.day7.now .day7-h span { color: var(--pink); }
.mini { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 14px; background: var(--surface-raised); border: 1px solid var(--line); }
.mini:hover { border-color: var(--line-strong); }
.mini-t { font-size: 13px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.toplist { margin: 10px 0 0; padding: 0; list-style: none; counter-reset: t; }
.toplist li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 13px; font-weight: 600; counter-increment: t; }
.toplist li::before { content: counter(t); font-family: var(--display); font-size: 20px; color: var(--text-muted); width: 20px; }
.toplist li a { flex: 1; }

/* ---------- Editor ---------- */
.ed-top { display: flex; justify-content: space-between; align-items: center; margin: -8px 0 12px -10px; }
.ed-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.ed-side { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100dvh - 48px); overflow-y: auto; scrollbar-width: thin; }
@media (max-width: 1200px) { .ed-grid { grid-template-columns: 1fr; } .ed-side { position: static; max-height: none; overflow: visible; } }
.blk { scroll-margin-top: 80px; }
.blk.cur { border-color: var(--line-strong); }
.blk.cur .sec::after { content: "Ahora"; font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--pink); margin-left: 10px; vertical-align: middle; }
.who-sel { appearance: none; max-width: 120px; height: 32px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface-raised); color: var(--text-2); font-size: 12px; font-weight: 600; padding: 0 12px; cursor: pointer; text-overflow: ellipsis; }
.who-sel:hover { border-color: var(--line-strong); }
.ready { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; }
.ready li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.ready li svg { color: var(--pink); }
.drop { margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 88px; border: 1px dashed var(--line-strong); border-radius: var(--r-lg); color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer; text-align: center; padding: 16px; }
.drop:hover { border-color: var(--text-muted); color: var(--text); }
.media-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 10px; }
.media-item { position: relative; display: flex; flex-direction: column; gap: 6px; }
.media-item video, .media-item img { width: 100%; aspect-ratio: 9/16; object-fit: cover; border-radius: var(--r-md); background: var(--surface-sunken); border: 1px solid var(--line); }
.media-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.media-item .icon-btn { position: absolute; top: 6px; right: 6px; }

/* ---------- Calendario ---------- */
.wk-strip { display: flex; gap: 10px; flex-wrap: wrap; }
.wk-strip > div { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); min-width: 120px; }
.wk-strip > div.wide { flex: 1; min-width: 240px; font-size: 14px; font-weight: 600; }
.wk-strip b.d { font-size: 30px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(180px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.cal-day { display: flex; flex-direction: column; gap: 8px; min-height: 280px; }
.cal-h { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 6px 6px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.cal-h b { font-size: 28px; color: var(--text); }
.cal-day.now .cal-h { border-bottom-color: var(--pink); }
.cal-day.now .cal-h span { color: var(--pink); }
.cal-day.past .cal-h b { color: var(--text-muted); }
.cal-add { width: 100%; height: 40px; border-radius: var(--r-md); border: 1px dashed var(--line); background: transparent; color: var(--text-muted); display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 600; cursor: pointer; opacity: .7; }
.cal-add:hover { opacity: 1; border-color: var(--line-strong); color: var(--text); }
@media (max-width: 900px) { .cal { grid-template-columns: 1fr; overflow: visible; } .cal-day { min-height: 0; } .cal-day.past:not(:has(.pc)) { display: none; } }

/* ---------- Flujo ---------- */
.kanban { display: flex; flex-direction: column; gap: 28px; }
.kb-mh { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; scroll-margin-top: 80px; }
.kb-cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.kb-col { display: flex; flex-direction: column; gap: 8px; background: var(--ghost); border-radius: var(--r-xl); padding: 10px; min-height: 120px; }
.kb-ch { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; padding: 4px 6px 6px; }
.dl { margin: 14px 0 0; display: grid; gap: 4px; font-size: 13px; }
.dl dt { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-top: 6px; }
.dl dd { margin: 0; color: var(--text-2); }
.cell-in { width: 100%; background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 6px 8px; color: var(--text); font-size: 13px; }
.cell-in:hover { border-color: var(--line); }
.cell-in:focus { outline: none; border-color: var(--line-strong); background: var(--surface-sunken); }

/* ---------- PWA ---------- */
html { -webkit-tap-highlight-color: transparent; }
body { overscroll-behavior-y: none; }
.install { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; margin-bottom: 20px; border: 1px solid var(--line-strong); border-radius: var(--r-xl); background: var(--surface); }
.install img { border-radius: 12px; flex: none; }
.install-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.install-t b { font-size: 14px; }
.install-t span { font-size: 12px; color: var(--text-2); }
.install-t svg { vertical-align: -2px; }
@media (display-mode: standalone) {
  .main { padding-top: 12px; }
  .ed-top .btn.ghost { padding-left: 0; }
}

/* =================== Rediseño v2: más orientación, rosa con propósito =================== */
.over { color: var(--pink); }
.muted .over, .card .over, .wk-strip .over, .dl dt { color: var(--text-muted); }
.navlink[aria-current="page"] { background: var(--pink); color: #fff; }
.navlink[aria-current="page"] svg { color: #fff; }
.navlink .count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; display: inline-grid; place-items: center; background: var(--surface-raised); color: var(--text-2); font-size: 11px; font-weight: 700; }
.navlink .count.hot { background: var(--pink); color: #fff; }
.navlink[aria-current="page"] .count { background: rgba(255,255,255,.22); color: #fff; }
@media (max-width: 1023px) {
  .tab[aria-current="page"]:not(.core) { color: var(--pink); }
  .tab[aria-current="page"]:not(.core)::after { content: ""; width: 18px; height: 3px; border-radius: 2px; background: var(--pink); margin-top: 2px; }
}
.ph h1 { position: relative; }
.sec-bar { display: inline-block; width: 18px; height: 4px; border-radius: 2px; background: var(--pink); margin-right: 10px; vertical-align: middle; transform: translateY(-3px); }

/* Accesos grandes de Hoy */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
@media (max-width: 860px) { .tiles { grid-template-columns: 1fr; } }
.tile { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); transition: border-color .15s, background .15s; }
.tile:hover { border-color: var(--pink-line); }
.tile .n { font-family: var(--display); font-size: 52px; line-height: .9; color: var(--text); min-width: 48px; }
.tile.hot { background: var(--pink); border-color: var(--pink); }
.tile.hot .n, .tile.hot b, .tile.hot span { color: #fff; }
.tile b { display: block; font-size: 15px; font-weight: 700; }
.tile span { font-size: 12px; color: var(--text-2); }
.tile .go { margin-left: auto; color: var(--text-muted); }
.tile.hot .go { color: #fff; }

/* Ponerse al día */
.catchup { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 20px; margin-bottom: 28px; border-radius: var(--r-xl); border: 1px solid var(--pink-line); background: var(--pink-soft); }
.catchup p { flex: 1; min-width: 260px; color: var(--text); font-size: 14px; }
.catchup p span { color: var(--text-2); display: block; font-size: 12px; margin-top: 2px; }

/* Grupos de atención */
.groups { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.gchip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: 13px; cursor: pointer; }
.gchip b { font-family: var(--display); font-size: 18px; font-weight: 400; color: var(--text); }
.gchip.hot b { color: var(--pink); }
.gchip[aria-pressed="true"] { background: var(--pink); border-color: var(--pink); color: #fff; }
.gchip[aria-pressed="true"] b { color: #fff; }

/* Tarjeta de pieza v2 */
.pc { gap: 8px; padding: 14px 14px 12px; }
.pc-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-muted); font-weight: 600; }
.pc-meta .hr { color: var(--text); font-variant-numeric: tabular-nums; }
.pc-title { font-size: 14.5px; -webkit-line-clamp: 3; }
.pc-state { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mdot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text-2); }
.mdot i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.mdot.m-produccion i { background: var(--text); }
.mdot.m-publicacion i { background: var(--pink); }
.pc-next { border-top: 1px solid var(--line); padding-top: 8px; font-size: 12px; color: var(--text-2); display: flex; justify-content: space-between; gap: 8px; }
.pc-next b { color: var(--text); font-weight: 600; }
.pc-alert { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; height: 22px; padding: 0 9px; border-radius: 11px; background: var(--pink); color: #fff; font-size: 11px; font-weight: 700; }
.cal-day.now .cal-h { background: var(--pink); border-radius: var(--r-md); border-bottom-color: transparent; padding: 8px 10px; }
.cal-day.now .cal-h span, .cal-day.now .cal-h b { color: #fff; }

/* Pieza v2: siguiente paso y pestañas */
.nextbar { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px; margin: 0 0 16px; border-radius: var(--r-xl); background: #16090e; border: 1px solid var(--pink-line); }
@media (max-width: 1023px) { .nextbar { top: 64px; } }
.nextbar .lbl { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--pink); }
.nextbar .what { flex: 1; min-width: 200px; }
.nextbar .what b { display: block; font-size: 16px; }
.nextbar .what span { font-size: 12px; color: var(--text-2); }
.mtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.mtab { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 16px; background: none; border: 0; border-bottom: 3px solid transparent; color: var(--text-2); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.mtab .k { font-size: 11px; font-weight: 700; color: var(--text-muted); background: var(--surface-raised); border-radius: 10px; padding: 2px 7px; }
.mtab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--pink); }
.mtab[aria-selected="true"] .k { background: var(--pink); color: #fff; }
.mtab .now { width: 7px; height: 7px; border-radius: 50%; background: var(--pink); }
.ed-grid { grid-template-columns: minmax(0, 1fr) 340px; }

/* =================== Gráficas =================== */
.viz-row .card { display: flex; flex-direction: column; justify-content: center; }
.chart-ring { display: flex; align-items: center; gap: 18px; }
.chart-ring > div { min-width: 0; }
.chart-ring b { display: block; font-family: var(--display); font-size: 22px; font-weight: 400; letter-spacing: .02em; text-transform: uppercase; }
.chart-ring > div > span { font-size: 12px; color: var(--text-2); }
.ring-num { font-family: var(--display); font-size: 30px; fill: var(--text); letter-spacing: .02em; }
.legend { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 5px; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.legend li i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend li em { font-style: normal; margin-left: auto; padding-left: 10px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.row-legend { flex-direction: row; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; }
.row-legend li em { margin-left: 2px; padding-left: 0; }
.today-key { width: 10px; height: 10px; border-radius: 3px; border: 2px solid var(--pink); background: transparent !important; }
.segbar { display: flex; gap: 3px; height: 28px; border-radius: 8px; overflow: hidden; }
.segbar span { display: grid; place-items: center; min-width: 4px; font-family: var(--display); font-size: 15px; letter-spacing: .02em; }
.mom-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.mom-nums a { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: var(--r-md); background: var(--surface-raised); border: 1px solid var(--line); min-width: 0; }
.mom-nums a:hover { border-color: var(--line-strong); }
.mom-nums .d { font-size: 32px; line-height: .9; }
.mom-nums b { font-size: 13px; }
.mom-nums em { font-style: normal; font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wbars { display: flex; align-items: flex-end; gap: 8px; height: 180px; }
.wbar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; min-width: 0; }
.wbar .stack { width: 100%; max-width: 38px; display: flex; flex-direction: column-reverse; gap: 2px; border-radius: 6px; overflow: hidden; min-height: 4px; }
.wbar .stack i { display: block; min-height: 2px; }
.wbar em { font-style: normal; font-family: var(--display); font-size: 16px; color: var(--text-2); }
.wbar span { font-size: 11px; font-weight: 700; color: var(--text-muted); }
.wbar.cur span { color: #fff; background: var(--pink); border-radius: 8px; padding: 1px 7px; }
.wbar.cur em { color: var(--text); }
.wbar:hover .stack { outline: 1px solid var(--line-strong); outline-offset: 2px; }
.heat-wrap { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.heat-dows { display: grid; grid-template-rows: 16px repeat(7, 26px); gap: 5px; font-size: 10px; align-items: center; color: var(--text-muted); font-weight: 600; }
.heat { display: flex; gap: 5px; }
.heat-col { display: grid; grid-template-rows: 16px repeat(7, 26px); gap: 5px; }
.heat-m { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; width: 26px; overflow: visible; }
.heat-cell { display: block; width: 26px; height: 26px; border-radius: 7px; }
.heat-cell.none { border: 1px dashed var(--line); }
.heat-cell.empty { visibility: hidden; }
.heat-cell.today { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--pink); }
.heat a:hover .heat-cell, .heat-col > a:hover .heat-cell { transform: scale(1.15); }
.heat-cell { transition: transform .12s; }
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hb { display: block; }
.hb-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 6px; }
.hb-top span { font-weight: 600; }
.hb-top em { font-style: normal; color: var(--text-muted); font-weight: 400; font-size: 12px; }
.hb-track { display: flex; gap: 2px; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.hb-track i { display: block; height: 100%; }
a.hb:hover .hb-top span { color: var(--pink); }
.linearea { width: 100%; height: auto; display: block; margin-top: 6px; }
.linearea .ax { font-size: 11px; fill: var(--text-muted); font-family: var(--sans); }
.empty-chart svg { width: 100%; height: auto; display: block; margin: 8px 0 12px; }
@media (max-width: 680px) { .mom-nums { grid-template-columns: 1fr; } .chart-ring svg { width: 108px; height: 108px; } }
.cal .pc-next { flex-direction: column; gap: 2px; }
.cal .pc-next > span:last-child { font-size: 11px; }

/* =================== Equipo: formularios responsivos =================== */
html, body { overflow-x: clip; }
.main { min-width: 0; }
.section-h { flex-wrap: wrap; }
.invite-form { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 160px auto; gap: 12px; align-items: end; }
.member-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.new-member { display: flex; gap: 8px; margin-top: 12px; }
.new-member .in { flex: 1; min-width: 0; }
@media (max-width: 760px) {
  .invite-form { grid-template-columns: 1fr; gap: 14px; }
  .invite-form .in, .invite-form .sel { min-height: 52px; font-size: 16px; } /* 16px evita el zoom automático de iPhone */
  .invite-form .f-btn { width: 100%; height: 52px; }
  .member-row { grid-template-columns: 1fr; gap: 2px; padding: 10px 0; }
  .new-member { flex-direction: column; }
  .new-member .btn { width: 100%; height: 48px; }
  .in, .sel, .ta { font-size: 16px; }
}

/* =================== Logo y margen superior en celular =================== */
.brand img { display: block; width: 136px; height: auto; margin-bottom: 6px; }
.topbar img { display: block; height: 24px; width: auto; }
@media (max-width: 1023px) {
  .topbar { background: var(--bg); padding-top: calc(env(safe-area-inset-top, 0px) + 14px); padding-bottom: 14px; }
  .main { padding-top: 24px; }
  .ph { margin-top: 4px; }
}

/* El atributo hidden debe ganarle a cualquier display (en React estos bloques ni se renderizan) */
[hidden] { display: none !important; }

/* =================== Ajuste óptico de Bebas Neue ===================
   Las mayúsculas de Bebas Neue quedan ~0.11em por encima del centro de su caja de línea, así que dentro de
   botones y chips se veían subidas. Se compensa bajando el texto; el icono se contrapesa para que siga centrado. */
.btn.primary { padding-top: .19em; }
/* El texto es lo que se centra; el icono cuelga a su izquierda sin ocupar espacio. */
.btn.primary .lbl { position: relative; display: inline-block; }
.btn.primary .lbl > svg { position: absolute; right: 100%; top: calc(50% - .095em); margin-right: 8px; transform: translateY(-50%); }
.gchip b { position: relative; top: .08em; }
.segbar span { padding-top: .12em; }
