/* Calculadora rápida: regla, perillas y "tu semana". Usa los tokens de styles.css (claro por defecto). */

body:not(.detailed) #calc, body:not(.detailed) #diagnostico { display: none; }

.theme-t { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line-2); background: none; color: var(--ink-2); cursor: pointer; display: grid; place-items: center; }
.theme-t:hover { color: var(--ink); }
.theme-t .i { width: 18px; height: 18px; }
:root[data-theme="dark"] .theme-t .moon, :root:not([data-theme="dark"]) .theme-t .sun { display: none; }

.quick { position: relative; padding: 8px 0 56px; scroll-margin-top: 70px; }
.q-grid { display: grid; gap: 16px; }
.q-in { display: grid; gap: 16px; min-width: 0; }
.q-card, .q-out { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.q-hd { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.q-hd .k { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; font-family: Lexend, sans-serif; font-weight: 600; font-size: .85rem; color: #fff; background: linear-gradient(135deg, var(--v1), var(--v2)); }
.q-hd h2 { font-family: Lexend, sans-serif; font-weight: 600; font-size: 1.12rem; letter-spacing: -.02em; line-height: 1.25; }
.q-hint { font-size: .8rem; color: var(--ink-3); margin: -8px 0 12px 42px; }

/* Personas */
.q-people { display: grid; grid-template-columns: 52px 1fr 52px; gap: 12px; align-items: center; }
.st { width: 52px; height: 52px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--field); color: var(--v3); cursor: pointer; display: grid; place-items: center; transition: transform .15s var(--ease), background-color .2s; }
.st:active { transform: scale(.92); }
.st:hover { background: rgba(142,116,238,.12); }
.st svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.q-pn { text-align: center; }
.q-pn b { display: block; font-family: Lexend, sans-serif; font-size: 2.2rem; font-weight: 600; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.q-pn span { font-size: .8rem; color: var(--ink-3); }
.q-avatars { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; min-height: 30px; margin: 12px 0 4px; }
.av { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(142,116,238,.14); color: var(--v3); animation: pop .4s var(--ease) both; animation-delay: var(--d); font-size: .7rem; font-weight: 600; }
.av svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@keyframes pop { from { transform: scale(0); opacity: 0; } }

/* Regla del sueldo */
.q-sal { position: relative; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.q-sal-hd { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: .85rem; color: var(--ink-2); font-weight: 500; margin-bottom: 8px; }
.q-sal-hd b { font-family: Lexend, sans-serif; font-size: 1.35rem; font-weight: 600; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.q-sal-hd b small { font-family: Inter, sans-serif; font-size: .74rem; font-weight: 400; color: var(--ink-3); letter-spacing: 0; }
.q-sal-hd b small.pick { font-size: .85rem; color: var(--v3); font-weight: 600; animation: nudge 1.6s ease-in-out infinite; display: inline-block; }
@keyframes nudge { 50% { transform: translateX(-6px); } }
.ruler { position: relative; height: 64px; overflow: hidden; border-radius: 14px; background: var(--field); border: 1px solid var(--line); cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); }
.ruler.grab { cursor: grabbing; }
.ruler:focus-visible { outline: 2px solid var(--v2); outline-offset: 2px; }
.ruler-t { display: flex; align-items: flex-start; height: 100%; width: max-content; will-change: transform; pointer-events: none; }
.ruler-t .tk { flex: none; width: 12px; height: 100%; position: relative; }
.ruler-t .tk::before { content: ""; position: absolute; left: 50%; top: 0; width: 1.5px; height: 14px; background: rgba(var(--fg),.28); transform: translateX(-50%); }
.ruler-t .tk.mj::before { height: 24px; width: 2px; background: rgba(var(--fg),.55); }
.ruler-t .tk em { all: unset; position: absolute; left: 50%; top: 32px; transform: translateX(-50%); font-style: normal; font-size: .7rem; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.needle { position: absolute; left: 50%; bottom: 0; height: 64px; width: 3px; border-radius: 3px; background: linear-gradient(180deg, var(--v1), var(--v2)); transform: translateX(-50%); pointer-events: none; opacity: .35; transition: opacity .3s; }
.needle::before { content: ""; position: absolute; left: 50%; top: -4px; width: 11px; height: 11px; border-radius: 50%; background: var(--v2); transform: translateX(-50%); box-shadow: 0 0 0 4px rgba(142,116,238,.25); }
.ruler.live + .needle { opacity: 1; }

/* Perillas */
.dials { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dial { display: grid; grid-template-rows: auto 1fr auto; align-items: start; justify-items: center; text-align: center; gap: 4px; padding: 10px 6px 12px; border-radius: 18px; border: 1px solid transparent; transition: border-color .2s, background-color .2s; }
.dial.act { border-color: rgba(142,116,238,.35); background: rgba(142,116,238,.06); }
.dial-k { position: relative; width: 100%; max-width: 150px; aspect-ratio: 1; cursor: grab; touch-action: pan-y; border-radius: 50%; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.dial-k:active { cursor: grabbing; }
.dial-k:focus-visible { outline: 2px solid var(--v2); outline-offset: 2px; }
.dial-k svg { width: 100%; height: 100%; overflow: visible; }
.dial-k circle { fill: none; stroke-linecap: round; }
.dial-k .ticks line { stroke: rgba(var(--fg),.22); stroke-width: 1.5; stroke-linecap: round; }
.dial-k .tr { stroke: rgba(var(--fg),.08); stroke-width: 12; }
.dial-k .val { stroke: url(#qGrad); stroke-width: 12; transition: stroke-dasharray .12s; }
.dial-k .tr2 { stroke: rgba(var(--fg),.05); stroke-width: 6; }
.dial-k .fx { stroke: var(--ok); stroke-width: 6; transition: stroke-dasharray .12s; }
.dial-k .hnd { fill: #fff; stroke: var(--v2); stroke-width: 3; filter: drop-shadow(0 2px 4px rgba(40,20,90,.35)); transition: r .2s var(--ease); }
.dial:not(.on) .hnd { stroke: rgba(var(--fg),.3); }
.dial.act .hnd { r: 11; }
.dial-c { position: absolute; inset: 0; display: grid; place-content: center; pointer-events: none; }
.dial-c b { font-family: Lexend, sans-serif; font-weight: 600; font-size: 1.35rem; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.dial:not(.on) .dial-c b { color: var(--ink-3); }
.dial-c span { font-size: .62rem; color: var(--ink-3); margin-top: 3px; }
.dial-n { font-size: .82rem; font-weight: 600; line-height: 1.25; color: var(--ink); min-height: 2.5em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.dial-p { font-size: .7rem; color: var(--ink-3); }
.dial-p b { color: var(--ok); font-family: Lexend, sans-serif; }
.q-how { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(142,116,238,.08); border: 1px solid rgba(142,116,238,.18); font-size: .84rem; line-height: 1.45; color: var(--ink-2); display: grid; gap: 2px; }
.q-how b { color: var(--ink); font-size: .86rem; }
.q-empty { grid-column: 1 / -1; padding: 22px; text-align: center; color: var(--ink-3); font-size: .9rem; border: 1px dashed var(--line-2); border-radius: 14px; }

/* Tu semana */
.q-out { display: grid; gap: 14px; align-content: start; scroll-margin-top: 80px; }
.q-out-hd { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.q-mode { width: auto; }
.q-mode button { padding: 7px 12px; font-size: .8rem; }
.week { display: flex; flex-wrap: wrap; gap: 8px 10px; justify-content: center; padding: 14px 8px; border-radius: 16px; background: var(--field); border: 1px solid var(--line); min-height: 104px; }
.pw { display: grid; justify-items: center; gap: 4px; }
.pw .cells { display: grid; grid-template-columns: repeat(5, 9px); grid-auto-rows: 9px; gap: 2px; grid-auto-flow: column; grid-template-rows: repeat(8, 9px); }
.pw i { border-radius: 2.5px; background: rgba(var(--fg),.07); transition: background-color .35s var(--ease), transform .35s var(--ease), box-shadow .35s; transition-delay: var(--d); }
.pw i.w { background: linear-gradient(135deg, var(--v1), var(--v2)); }
.pw i.f { background: var(--ok); transform: scale(.82); box-shadow: 0 0 6px rgba(14,148,103,.45); }
.pw span { font-size: .6rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pw.extra .cells { outline: 1.5px dashed var(--bad); outline-offset: 3px; border-radius: 3px; }
.pw.extra span { color: var(--bad); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; font-size: .72rem; color: var(--ink-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: rgba(var(--fg),.1); }
.legend i.w { background: linear-gradient(135deg, var(--v1), var(--v2)); }
.legend i.f { background: var(--ok); }
.q-wnote { font-size: .84rem; color: var(--ink-2); text-align: center; line-height: 1.45; min-height: 2.9em; }
.q-big { display: grid; justify-items: center; text-align: center; padding-top: 12px; border-top: 1px solid var(--line); }
.q-big small { font-size: .78rem; color: var(--ink-3); }
.q-big b { font-family: Lexend, sans-serif; font-weight: 600; font-size: clamp(2.2rem, 9vw, 2.9rem); letter-spacing: -.04em; line-height: 1.05; font-variant-numeric: tabular-nums;
  background: linear-gradient(100deg, var(--v1), var(--v2) 60%, var(--ok)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.q-sub { text-align: center; font-size: .86rem; color: var(--ink-2); margin-top: -6px; }
.q-sub:empty { display: none; }
.q-bars { display: grid; gap: 5px; }
.q-row { display: flex; justify-content: space-between; font-size: .78rem; color: var(--ink-3); }
.q-row b { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.q-bar { height: 10px; border-radius: 99px; background: rgba(var(--fg),.06); overflow: hidden; }
.q-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: rgba(var(--fg),.3); transition: width .5s var(--ease); }
.q-bar.after i { background: linear-gradient(90deg, var(--v1), var(--v2)); }
.q-out .btn-main { width: 100%; justify-content: center; }
.q-more { background: none; border: 1px solid var(--line-2); border-radius: 12px; min-height: 46px; padding: 10px 14px; color: var(--v3); font-weight: 600; font-size: .86rem; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
.q-more .i { width: 14px; height: 14px; transform: rotate(-90deg); }
.detailed .q-more { display: none; }
.q-fine { font-size: .72rem; color: var(--ink-3); text-align: center; line-height: 1.4; }

@media (min-width: 560px) {
  .dials { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 980px) {
  .q-grid { grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; }
  .q-out { position: sticky; top: 84px; }
  .q-card { padding: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .pw i, .av, .q-bar i { transition: none; animation: none; }
  .q-sal-hd b small.pick { animation: none; }
}
@media print { .quick { display: none; } }

/* ¿Qué te quita tiempo?: casillas en forma de píldora */
#sectors.sectors { display: flex; flex-wrap: wrap; gap: 8px; max-width: 900px; }
#sectors .chip { min-height: 44px; padding: 7px 16px 7px 7px; border-radius: 999px; font-size: .86rem; line-height: 1.25; }
#sectors .chip .ic { width: 28px; height: 28px; border-radius: 50%; }

/* Áreas de la empresa: pestañas encima de las tareas */
.depts { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 12px; padding: 2px 16px; max-width: calc(900px + 32px); }
.depts::-webkit-scrollbar { display: none; }
.dept { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(var(--bgc),.85); color: var(--ink-2); font: 600 .84rem/1 Inter, sans-serif; cursor: pointer; white-space: nowrap; transition: background-color .2s, color .2s, border-color .2s; }
.dept:hover { color: var(--ink); border-color: rgba(142,116,238,.45); }
.dept[aria-selected="true"] { background: linear-gradient(135deg, var(--v1), var(--v2)); border-color: transparent; color: #fff; }
.dept i { font-style: normal; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center; font-size: .7rem; background: rgba(142,116,238,.18); color: var(--v3); }
.dept[aria-selected="true"] i { background: rgba(255,255,255,.25); color: #fff; }
#sectors .chip { animation: pop .3s var(--ease) both; }

/* Cifras que se escriben a mano */
.quick .q-pn input, .quick .sal-in input, .quick .dial-i input { width: auto; min-height: 0; box-shadow: none; font-size: inherit; -moz-appearance: textfield; appearance: textfield; background: none; border: 0; border-bottom: 2px dashed rgba(142,116,238,.25); color: var(--ink); font-family: Lexend, sans-serif; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; text-align: center; padding: 0; margin: 0; border-radius: 0; transition: border-color .2s, background-color .2s; }
.q-pn input::-webkit-inner-spin-button, .q-pn input::-webkit-outer-spin-button, .dial-i input::-webkit-inner-spin-button, .dial-i input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.quick .q-pn input:hover, .quick .sal-in input:hover, .quick .dial-i input:hover { border-bottom-color: rgba(142,116,238,.4); }
.quick .q-pn input:focus, .quick .sal-in input:focus, .quick .dial-i input:focus { outline: none; box-shadow: none; border-bottom-color: var(--v2); background: rgba(142,116,238,.08); }
.q-pn input::placeholder, .sal-in input::placeholder, .dial-i input::placeholder { color: var(--ink-3); opacity: .7; }
.quick .q-pn input { display: block; width: 2.4ch; margin: 0 auto 2px; font-size: 2.2rem; line-height: 1.1; }
.sal-in { display: inline-flex; align-items: baseline; gap: 4px; flex-wrap: wrap; justify-content: flex-end; cursor: text; }
.sal-in i.u { font-style: normal; font-family: Lexend, sans-serif; font-size: 1.35rem; font-weight: 600; color: var(--ink); }
.quick .sal-in input { width: 6ch; font-size: 1.35rem; text-align: left; }
.sal-in small { font-size: .74rem; color: var(--ink-3); }
.sal-in small.pick { font-size: .8rem; color: var(--v3); font-weight: 600; }
.dial-c .dial-i { display: inline-flex; align-items: baseline; justify-content: center; gap: 2px; pointer-events: auto; cursor: text; }
.quick .dial-i input { width: 1.4ch; font-size: 1.35rem; line-height: 1.1; }
.dial-i i.u { font-style: normal; font-family: Lexend, sans-serif; font-weight: 600; font-size: 1.1rem; color: var(--ink); }
.dial:not(.on) .dial-i input, .dial:not(.on) .dial-i i.u { color: var(--ink-3); }
