/* ============================================================
   ObraAcuática — tema agua profunda · v5.0 diseño UI/UX
   Glassmorphism + animaciones suaves + bordes redondeados
   Paleta: profundo #05121C · aqua #1FB6CD · arena #E8DCC4
   ============================================================ */

:root {
  --bg: #05121C;
  --bg2: #071B29;
  --card: rgba(10, 36, 54, 0.55);
  --card2: rgba(13, 44, 66, 0.45);
  --glass-line: rgba(150, 210, 230, 0.14);
  --line: #143952;
  --aqua: #1FB6CD;
  --aqua-bright: #4FD8EC;
  --aqua-soft: rgba(31, 182, 205, 0.14);
  --aqua-line: rgba(31, 182, 205, 0.35);
  --gold: #D8B36A;
  --sand: #E8DCC4;
  --txt: #E2EFF6;
  --muted: #84A9BB;
  --ok: #3DDC97;
  --warn: #FFC857;
  --bad: #FF6B6B;
  --radius-l: 22px;
  --radius-m: 16px;
  --radius-s: 12px;
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.45), 0 4px 14px rgba(0, 0, 0, 0.3);
  --shadow-aqua: 0 12px 34px rgba(31, 182, 205, 0.22);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  font-size: 15px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background:
    radial-gradient(1100px 520px at 82% -12%, rgba(31, 182, 205, 0.12), transparent 62%),
    radial-gradient(900px 460px at -12% 108%, rgba(79, 216, 236, 0.07), transparent 58%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  background-attachment: fixed;
  color: var(--txt);
  min-height: 100vh;
  padding-bottom: 2rem;
  -webkit-font-smoothing: antialiased;
}

/* ---------- scrollbar ---------- */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: #06151f; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #12455f, #0d3348);
  border-radius: 8px;
  border: 2px solid #06151f;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--aqua), #0E7A96); }

::selection { background: rgba(31, 182, 205, 0.35); color: #fff; }

/* ---------- header glass ---------- */
.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.6rem;
  background: rgba(6, 24, 38, 0.72);
  backdrop-filter: blur(14px) saturate(1.25);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  border-bottom: 1px solid var(--glass-line);
  position: sticky;
  top: 0;
  z-index: 20;
}

/* línea de agua animada bajo el header */
.topbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%, rgba(31, 182, 205, 0) 20%,
    rgba(79, 216, 236, 0.9) 38%,
    rgba(31, 182, 205, 0.9) 55%,
    rgba(31, 182, 205, 0) 78%, transparent 100%);
  background-size: 220% 100%;
  animation: waterline 7s linear infinite;
  opacity: 0.85;
}

@keyframes waterline {
  0% { background-position: 130% 0; }
  100% { background-position: -130% 0; }
}

.brand { display: flex; align-items: center; gap: 0.9rem; }

.logo {
  width: 48px; height: 48px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--aqua-bright) 0%, var(--aqua) 45%, #0B6E88 100%);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.15rem; color: #041820;
  letter-spacing: 0.5px;
  box-shadow: 0 6px 18px rgba(31, 182, 205, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.brand:hover .logo {
  transform: rotate(-6deg) scale(1.06);
  box-shadow: 0 8px 24px rgba(31, 182, 205, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.brand-txt h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: 0.2px;
}
.brand-txt p { color: var(--muted); font-size: 0.8rem; }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: flex-end;
}

.tab-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.tg-label {
  font-size: 0.58rem;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 800;
  padding-left: 0.3rem;
}

.tg-btns { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.tabs button {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  color: var(--muted);
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.83rem;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.25s var(--ease);
  position: relative;
  overflow: hidden;
}

.tabs button:hover {
  color: var(--txt);
  background: rgba(31, 182, 205, 0.1);
  transform: translateY(-1px);
}

.tabs button.active {
  background: linear-gradient(135deg, rgba(31, 182, 205, 0.22), rgba(31, 182, 205, 0.08));
  border-color: var(--aqua-line);
  color: var(--aqua-bright);
  box-shadow: 0 4px 16px rgba(31, 182, 205, 0.22);
}

/* ---------- layout ---------- */
main { max-width: 1220px; margin: 1.4rem auto; padding: 0 1.2rem; }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: panelIn 0.45s var(--ease); }

@keyframes panelIn {
  from { opacity: 0; transform: translateY(14px) scale(0.995); }
  to { opacity: 1; transform: none; }
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.1rem;
  margin-bottom: 1.1rem;
}

/* ---------- cards glass ---------- */
.card {
  background: linear-gradient(165deg, var(--card) 0%, var(--card2) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-l);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow-lg);
  margin-bottom: 1.1rem;
  position: relative;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  animation: cardIn 0.5s var(--ease) backwards;
}

.card:nth-child(1) { animation-delay: 0.03s; }
.card:nth-child(2) { animation-delay: 0.09s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.21s; }
.card:nth-child(5) { animation-delay: 0.27s; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.card:hover {
  border-color: rgba(31, 182, 205, 0.28);
  transform: translateY(-2px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 6px 22px rgba(31, 182, 205, 0.1);
}

/* brillo superior sutil */
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 8%; right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(180, 230, 245, 0.35), transparent);
  pointer-events: none;
}

.card h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--aqua-bright);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  letter-spacing: 0.2px;
}

.card h2::before {
  content: "";
  width: 5px; height: 20px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--aqua-bright), #0B6E88);
  box-shadow: 0 0 10px rgba(31, 182, 205, 0.55);
}

.hint { color: var(--muted); font-size: 0.82rem; line-height: 1.55; margin-bottom: 0.95rem; }
.disclaimer { border-left: 3px solid var(--warn); padding-left: 0.7rem; border-radius: 2px; }

/* ---------- forms ---------- */
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 0.95rem;
}

.form-row label {
  flex: 1 1 150px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.unit { color: var(--aqua); font-size: 0.72rem; font-weight: 700; }

input[type="number"], select {
  background: rgba(4, 20, 31, 0.65);
  border: 1px solid var(--line);
  color: var(--txt);
  border-radius: var(--radius-s);
  padding: 0.58rem 0.75rem;
  font-size: 0.95rem;
  font-family: inherit;
  width: 100%;
  transition: border-color 0.22s var(--ease), box-shadow 0.22s var(--ease), background 0.22s var(--ease);
}

input[type="number"]:hover, select:hover { border-color: #1e5474; }

input[type="number"]:focus, select:focus {
  outline: none;
  border-color: var(--aqua);
  background: rgba(4, 22, 34, 0.9);
  box-shadow: 0 0 0 4px rgba(31, 182, 205, 0.16), 0 4px 14px rgba(31, 182, 205, 0.12);
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--aqua) 50%), linear-gradient(135deg, var(--aqua) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2rem;
  cursor: pointer;
}

input[readonly] { opacity: 0.75; background: rgba(3, 14, 22, 0.8); }

.form-row .chk { flex-direction: row; align-items: center; flex-wrap: wrap; }
.form-row .chk input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--aqua); cursor: pointer; transition: transform 0.18s var(--ease); }
.form-row .chk input[type="checkbox"]:hover { transform: scale(1.18); }
.form-row .chk.big { font-size: 0.92rem; color: var(--txt); }

/* ---------- type cards ---------- */
.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.75rem;
}

.type-card {
  background: rgba(7, 32, 47, 0.6);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-m);
  padding: 0.95rem;
  cursor: pointer;
  transition: all 0.28s var(--ease);
  position: relative;
  overflow: hidden;
}

.type-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(220px 120px at 85% -10%, rgba(31, 182, 205, 0.14), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}

.type-card:hover {
  transform: translateY(-4px);
  border-color: var(--aqua-line);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4), 0 6px 18px rgba(31, 182, 205, 0.14);
}

.type-card:hover::after { opacity: 1; }
.type-card:hover .tc-icon { transform: scale(1.18) rotate(-5deg); }

.type-card .tc-icon { font-size: 1.6rem; margin-bottom: 0.4rem; transition: transform 0.3s var(--ease); display: inline-block; }
.type-card .tc-name { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.3rem; color: var(--txt); }
.type-card .tc-desc { color: var(--muted); font-size: 0.75rem; line-height: 1.5; }
.type-card .tc-time { margin-top: 0.5rem; font-size: 0.72rem; color: var(--aqua); font-weight: 700; }

.type-card.selected {
  border-color: var(--aqua);
  background: linear-gradient(165deg, rgba(31, 182, 205, 0.16), rgba(7, 32, 47, 0.7));
  box-shadow: 0 0 0 3px rgba(31, 182, 205, 0.18), 0 12px 28px rgba(31, 182, 205, 0.16);
  transform: translateY(-2px);
}

.type-card.selected .tc-icon { animation: popIn 0.45s var(--ease); }

@keyframes popIn {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.28); }
  100% { transform: scale(1); }
}

/* ---------- KPIs ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.95rem;
}

.tab-panel.active .kpi {
  animation: kpiIn 0.5s var(--ease) backwards;
}
.tab-panel.active .kpi:nth-child(1) { animation-delay: 0.05s; }
.tab-panel.active .kpi:nth-child(2) { animation-delay: 0.1s; }
.tab-panel.active .kpi:nth-child(3) { animation-delay: 0.15s; }
.tab-panel.active .kpi:nth-child(4) { animation-delay: 0.2s; }
.tab-panel.active .kpi:nth-child(5) { animation-delay: 0.25s; }
.tab-panel.active .kpi:nth-child(6) { animation-delay: 0.3s; }
.tab-panel.active .kpi:nth-child(7) { animation-delay: 0.35s; }
.tab-panel.active .kpi:nth-child(8) { animation-delay: 0.4s; }

@keyframes kpiIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.kpi {
  background: linear-gradient(165deg, rgba(7, 32, 47, 0.75), rgba(6, 26, 40, 0.55));
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 0.8rem 0.9rem;
  transition: all 0.25s var(--ease);
}

.kpi:hover {
  transform: translateY(-3px);
  border-color: var(--aqua-line);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35), 0 4px 14px rgba(31, 182, 205, 0.12);
}

.kpi .k-label { font-size: 0.71rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.kpi .k-value { font-size: 1.38rem; font-weight: 800; color: var(--txt); margin: 0.18rem 0; letter-spacing: 0.3px; }
.kpi .k-sub { font-size: 0.7rem; color: var(--muted); line-height: 1.45; }
.kpi.hl {
  border-color: var(--aqua-line);
  background: linear-gradient(165deg, rgba(31, 182, 205, 0.15), rgba(7, 32, 47, 0.7));
}
.kpi.hl .k-value { color: var(--aqua-bright); text-shadow: 0 0 18px rgba(31, 182, 205, 0.45); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-s); }

table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }

th {
  text-align: left;
  padding: 0.6rem 0.65rem;
  color: var(--aqua-bright);
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1.5px solid var(--aqua-line);
  white-space: nowrap;
  background: rgba(31, 182, 205, 0.05);
}

td {
  padding: 0.58rem 0.65rem;
  border-bottom: 1px solid rgba(20, 57, 82, 0.6);
  vertical-align: top;
  line-height: 1.5;
  transition: background 0.18s ease;
}

tbody tr { transition: background 0.2s var(--ease); }
tbody tr:hover td { background: rgba(31, 182, 205, 0.055); }

td input[type="number"] {
  padding: 0.32rem 0.5rem;
  font-size: 0.84rem;
  min-width: 90px;
  border-radius: 9px;
}

.tag {
  display: inline-block;
  padding: 0.14rem 0.58rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}
.tag.ok { background: rgba(61, 220, 151, 0.13); color: var(--ok); }
.tag.warn { background: rgba(255, 200, 87, 0.13); color: var(--warn); }
.tag.bad { background: rgba(255, 107, 107, 0.13); color: var(--bad); }
.tag.aqua { background: var(--aqua-soft); color: var(--aqua-bright); }

/* ---------- protocol steps ---------- */
.step-list { list-style: none; counter-reset: step; }

.tab-panel.active .step-list li { animation: kpiIn 0.45s var(--ease) backwards; }
.tab-panel.active .step-list li:nth-child(1) { animation-delay: 0.04s; }
.tab-panel.active .step-list li:nth-child(2) { animation-delay: 0.08s; }
.tab-panel.active .step-list li:nth-child(3) { animation-delay: 0.12s; }
.tab-panel.active .step-list li:nth-child(4) { animation-delay: 0.16s; }
.tab-panel.active .step-list li:nth-child(5) { animation-delay: 0.2s; }
.tab-panel.active .step-list li:nth-child(6) { animation-delay: 0.24s; }
.tab-panel.active .step-list li:nth-child(7) { animation-delay: 0.28s; }
.tab-panel.active .step-list li:nth-child(8) { animation-delay: 0.32s; }

.step-list li {
  counter-increment: step;
  position: relative;
  padding: 0.7rem 0.7rem 0.7rem 3.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  margin-bottom: 0.6rem;
  background: rgba(7, 32, 47, 0.6);
  font-size: 0.87rem;
  line-height: 1.55;
  transition: all 0.25s var(--ease);
}

.step-list li:hover {
  border-color: var(--aqua-line);
  transform: translateX(4px);
  background: rgba(10, 40, 58, 0.75);
}

.step-list li::before {
  content: counter(step);
  position: absolute;
  left: 0.72rem; top: 0.66rem;
  width: 1.9rem; height: 1.9rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--aqua-bright), #0B6E88);
  color: #041820;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(31, 182, 205, 0.35);
  transition: transform 0.25s var(--ease);
}

.step-list li:hover::before { transform: scale(1.12) rotate(-6deg); }

.step-list .cn {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.76rem;
  color: var(--warn);
  border-left: 2px solid var(--warn);
  padding-left: 0.6rem;
  border-radius: 2px;
}

.step-list .cn b { color: var(--warn); }

/* ---------- misc ---------- */
.warn {
  background: rgba(255, 200, 87, 0.08);
  border: 1px solid rgba(255, 200, 87, 0.4);
  color: var(--warn);
  border-radius: var(--radius-s);
  padding: 0.7rem 0.85rem;
  font-size: 0.82rem;
  line-height: 1.55;
  animation: kpiIn 0.4s var(--ease);
}

.sub-box {
  border: 1px dashed var(--aqua-line);
  border-radius: var(--radius-m);
  padding: 0.9rem;
  background: rgba(31, 182, 205, 0.045);
}

.schema {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.8rem;
  line-height: 1.75;
  color: var(--muted);
  white-space: pre;
  overflow-x: auto;
  background: rgba(3, 14, 22, 0.85);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 1.05rem;
  transition: border-color 0.25s var(--ease);
}

.schema:hover { border-color: var(--aqua-line); }
.schema .hl { color: var(--aqua-bright); font-weight: 700; }

.breakdown { font-size: 0.84rem; color: var(--muted); line-height: 1.65; }
.breakdown b { color: var(--txt); }
.breakdown .row {
  display: flex; justify-content: space-between; gap: 1rem;
  border-bottom: 1px dashed rgba(20, 57, 82, 0.8);
  padding: 0.34rem 0.2rem;
  border-radius: 6px;
  transition: background 0.2s var(--ease), padding-left 0.2s var(--ease);
}
.breakdown .row:hover { background: rgba(31, 182, 205, 0.05); padding-left: 0.55rem; }

/* ---------- botones ---------- */
.btn {
  background: rgba(7, 32, 47, 0.8);
  border: 1.5px solid var(--aqua-line);
  color: var(--aqua-bright);
  font-weight: 700;
  font-size: 0.88rem;
  font-family: inherit;
  padding: 0.68rem 1.35rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  position: relative;
  overflow: hidden;
}

.btn:hover {
  background: rgba(31, 182, 205, 0.14);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(31, 182, 205, 0.25);
  border-color: var(--aqua);
}

.btn:active { transform: translateY(0) scale(0.97); }

.btn.primary {
  background: linear-gradient(135deg, var(--aqua-bright), var(--aqua) 55%, #0B6E88);
  color: #041820;
  border: none;
  font-size: 0.95rem;
  box-shadow: 0 8px 24px rgba(31, 182, 205, 0.35);
}

.btn.primary::after {
  content: "";
  position: absolute;
  top: 0; left: -80%;
  width: 55%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: skewX(-22deg);
  transition: left 0.55s var(--ease);
}

.btn.primary:hover::after { left: 130%; }
.btn.primary:hover { box-shadow: 0 12px 32px rgba(31, 182, 205, 0.5); }

.next-step {
  display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 0.5rem;
  flex-wrap: wrap;
}

/* ---------- total bar ---------- */
.total-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(31, 182, 205, 0.16), rgba(31, 182, 205, 0.03));
  border: 1.5px solid var(--aqua-line);
  border-radius: var(--radius-l);
  padding: 1rem 1.3rem;
  margin-top: 1.1rem;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-aqua);
}

.total-bar .t-label { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; }
.total-bar .t-value {
  font-size: 1.6rem; font-weight: 800; color: var(--aqua-bright);
  text-shadow: 0 0 22px rgba(31, 182, 205, 0.4);
}

/* ---------- química ---------- */
.chem-action {
  border: 1px solid var(--line);
  border-left: 3px solid var(--aqua);
  border-radius: var(--radius-m);
  background: rgba(7, 32, 47, 0.65);
  padding: 0.8rem 0.95rem;
  margin-bottom: 0.6rem;
  font-size: 0.86rem;
  line-height: 1.6;
  animation: kpiIn 0.4s var(--ease) backwards;
}

.chem-action:nth-child(2) { animation-delay: 0.06s; }
.chem-action:nth-child(3) { animation-delay: 0.12s; }
.chem-action:nth-child(4) { animation-delay: 0.18s; }
.chem-action:nth-child(5) { animation-delay: 0.24s; }

.chem-action:hover { border-color: var(--aqua-line); border-left-width: 3px; }
.chem-action .ca-title { font-weight: 700; color: var(--aqua-bright); margin-bottom: 0.25rem; }
.chem-action.ok { border-left-color: var(--ok); }
.chem-action.warn { border-left-color: var(--warn); }
.chem-action.bad { border-left-color: var(--bad); }

.formula-detail { font-size: 0.86rem; }
.formula-detail .fd-head { color: var(--txt); font-weight: 700; margin-bottom: 0.4rem; }
.formula-detail .fd-note { color: var(--muted); font-size: 0.79rem; line-height: 1.55; margin-top: 0.55rem; }

/* ---------- chips ---------- */
.chip-grid { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(7, 32, 47, 0.7);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  color: var(--txt);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.48rem 0.9rem;
  cursor: pointer;
  transition: all 0.22s var(--ease);
  font-family: inherit;
}

.chip:hover {
  border-color: var(--aqua-line);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
}

.chip.on {
  background: linear-gradient(135deg, rgba(31, 182, 205, 0.25), rgba(7, 32, 47, 0.8));
  border-color: var(--aqua);
  box-shadow: 0 0 0 3px rgba(31, 182, 205, 0.16), 0 8px 20px rgba(31, 182, 205, 0.18);
  animation: chipPop 0.35s var(--ease);
}

@keyframes chipPop {
  0% { transform: scale(0.94); }
  55% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.chip.on::after { content: "✓"; color: var(--aqua-bright); font-weight: 800; }
.chip .ch-ic { font-size: 1.05rem; }
.chip .ch-tx { max-width: 300px; }

/* ---------- plano (estilos en bloque blueprint más abajo) ---------- */

.hidden { display: none !important; }

/* ---------- footer ---------- */
footer {
  max-width: 1220px;
  margin: 1.6rem auto 0;
  padding: 1rem 1.2rem;
  border-top: 1px solid var(--glass-line);
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.65;
}

/* ---------- accesibilidad: menos movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .topbar { padding: 0.7rem 0.9rem; }
  .tabs { justify-content: flex-start; }
  .tabs button { font-size: 0.76rem; padding: 0.42rem 0.7rem; }
  .card { padding: 1rem; border-radius: var(--radius-m); }
  .type-grid { grid-template-columns: 1fr; }
}

/* ---------- hero illustration ---------- */
.hero-card {
  display: flex;
  gap: 1.4rem;
  align-items: stretch;
  padding: 1.1rem;
  overflow: hidden;
  background:
    radial-gradient(600px 200px at 85% -20%, rgba(31, 182, 205, 0.1), transparent 65%),
    linear-gradient(165deg, var(--card) 0%, var(--card2) 100%);
}

.hero-art {
  flex: 0 0 46%;
  min-width: 280px;
  border-radius: var(--radius-m);
  overflow: hidden;
  border: 1px solid var(--glass-line);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
  background: #fff;
}

.hero-card:hover .hero-art {
  transform: scale(1.015) rotate(-0.3deg);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42), 0 6px 18px rgba(31, 182, 205, 0.18);
}

.hero-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
  min-width: 220px;
}

.hero-kicker {
  font-size: 0.72rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--aqua);
  font-weight: 800;
}

.hero-info h2 { font-size: 1.7rem; margin-bottom: 0.15rem; }
.hero-desc { color: var(--muted); font-size: 0.92rem; line-height: 1.6; max-width: 480px; }
.hero-meta { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.35rem; }

/* ---------- thumbnails en tarjetas de tipo ---------- */
.tc-art {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(20, 57, 82, 0.7);
  margin-bottom: 0.55rem;
  background: #fff;
  transition: transform 0.3s var(--ease);
}

.type-card:hover .tc-art { transform: scale(1.03); }
.type-card.selected .tc-art {
  border-color: var(--aqua-line);
  box-shadow: 0 6px 16px rgba(31, 182, 205, 0.22);
}

.tc-head { display: flex; align-items: center; gap: 0.45rem; margin-bottom: 0.3rem; flex-wrap: wrap; }
.tc-head .tc-icon { font-size: 1.25rem; }

/* ---------- papel blueprint en planos ---------- */
.plano-wrap {
  background-color: #fdfcf7;
  background-image:
    linear-gradient(rgba(31, 120, 180, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 120, 180, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(31, 120, 180, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 120, 180, 0.05) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
  padding: 14px;
  overflow-x: auto;
  margin-bottom: 0.7rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6), 0 10px 26px rgba(0, 0, 0, 0.3);
}

@media (max-width: 720px) {
  .hero-card { flex-direction: column; }
  .hero-art { min-width: 0; }
}

/* ---------- obra: progreso, gantt, checklist ---------- */
.progress-track {
  position: relative;
  background: rgba(7, 32, 47, 0.8);
  border: 1px solid var(--line);
  border-radius: 999px;
  height: 30px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--aqua), #0d7c93);
  border-radius: 999px;
  box-shadow: 0 0 18px rgba(31, 182, 205, 0.5);
  transition: width 0.6s var(--ease);
  position: relative;
}

.progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: waterline 3.5s linear infinite;
}

.progress-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--txt);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.gantt { margin: 0.5rem 0 0.9rem; overflow-x: auto; }

.gantt-head {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.gantt-head .g-week {
  font-size: 0.68rem;
  color: var(--muted);
  text-align: center;
  border-left: 1px dashed var(--line);
}

.gantt-row {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
  align-items: center;
}

.g-label { font-size: 0.8rem; color: var(--txt); font-weight: 600; }
.g-label small { color: var(--muted); font-weight: 500; }

.g-track {
  position: relative;
  height: 30px;
  background:
    repeating-linear-gradient(90deg, rgba(20, 57, 82, 0.35) 0 1px, transparent 1px 12.5%),
    rgba(7, 32, 47, 0.55);
  border-radius: 8px;
  border: 1px solid var(--line);
}

.g-bar {
  position: absolute;
  top: 4px; bottom: 4px;
  border-radius: 7px;
  overflow: hidden;
  min-width: 14px;
  transition: all 0.4s var(--ease);
}

.g-done {
  height: 100%;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(1px);
}

.phase-pre      { background: linear-gradient(90deg, #35586e, #27455a); }
.phase-struct   { background: linear-gradient(90deg, #0f7d95, #0a5c73); }
.phase-water    { background: linear-gradient(90deg, #18a8c4, #1187a3); }
.phase-install  { background: linear-gradient(90deg, #e8a13c, #c77f1f); }
.phase-startup  { background: linear-gradient(90deg, #3ecf8e, #2aa672); }

.phase-title {
  color: var(--aqua-bright);
  font-size: 0.9rem;
  margin: 1.1rem 0 0.6rem;
  letter-spacing: 0.3px;
}

.obra-list { list-style: none; }

.obra-list li {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  margin-bottom: 0.5rem;
  background: rgba(7, 32, 47, 0.55);
  transition: all 0.25s var(--ease);
}

.obra-list li:hover { border-color: var(--aqua-line); }

.obra-list li.done {
  background: linear-gradient(165deg, rgba(61, 220, 151, 0.09), rgba(7, 32, 47, 0.6));
  border-color: rgba(61, 220, 151, 0.35);
}

.obra-list li.done .ob-step { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(61, 220, 151, 0.6); }

.ob-check { display: flex; gap: 0.6rem; align-items: flex-start; cursor: pointer; flex: 1; }
.ob-check input[type="checkbox"] { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ok); cursor: pointer; flex-shrink: 0; }

.ob-step { font-size: 0.85rem; line-height: 1.5; }
.ob-step .cn {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.74rem;
  color: var(--warn);
  border-left: 2px solid var(--warn);
  padding-left: 0.5rem;
}

.ob-date { font-size: 0.72rem; color: var(--ok); white-space: nowrap; font-weight: 700; }

/* ---------- modo cliente: oculta costos ---------- */
.client-mode .price-col { display: none; }
.client-mode #paymentPlan .kpi .k-sub { color: var(--aqua-bright); }

/* ---------- proveedores: botón celda + modal ---------- */
.prov-btn {
  background: rgba(31, 182, 205, 0.08);
  border: 1px solid var(--aqua-line);
  color: var(--aqua-bright);
  font-size: 0.76rem;
  font-weight: 700;
  font-family: inherit;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s var(--ease);
}

.prov-btn:hover {
  background: rgba(31, 182, 205, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(31, 182, 205, 0.2);
}

.prov-modal {
  position: fixed;
  inset: 0;
  background: rgba(3, 12, 20, 0.72);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  animation: panelIn 0.3s var(--ease);
}

.prov-box {
  background: linear-gradient(165deg, rgba(10, 36, 54, 0.97), rgba(7, 27, 41, 0.97));
  border: 1px solid var(--aqua-line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-aqua), var(--shadow-lg);
  max-width: 640px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  padding: 1.4rem 1.5rem;
  position: relative;
}

.prov-box h3 { color: var(--txt); font-size: 1.05rem; margin-bottom: 0.3rem; padding-right: 2rem; }
.prov-box h3 .aqua { color: var(--aqua-bright); }
.prov-zone { color: var(--muted); font-size: 0.8rem; margin-bottom: 1rem; }

.prov-close {
  position: absolute;
  top: 0.9rem; right: 0.9rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--muted);
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.prov-close:hover { color: var(--bad); border-color: var(--bad); transform: rotate(90deg); }

.prov-sec {
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 0.9rem;
  margin-bottom: 0.9rem;
  background: rgba(7, 32, 47, 0.5);
}

.prov-sec h4 {
  color: var(--aqua-bright);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 0.6rem;
}

.prov-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  padding: 0.5rem 0.2rem;
  border-bottom: 1px dashed rgba(20, 57, 82, 0.8);
  font-size: 0.84rem;
  line-height: 1.5;
}

.prov-row:last-of-type { border-bottom: none; }
.prov-empty { color: var(--muted); font-size: 0.8rem; margin-bottom: 0.7rem; line-height: 1.5; }

.btn.mini {
  padding: 0.28rem 0.7rem;
  font-size: 0.74rem;
  border-radius: 999px;
  display: inline-block;
  text-decoration: none;
  margin-left: 0.3rem;
}

.btn.mini.danger { border-color: rgba(255, 107, 107, 0.4); color: var(--bad); }
.btn.mini.danger:hover { background: rgba(255, 107, 107, 0.12); }

/* ---------- asistente IA ---------- */
.ia-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.9rem; }

.ia-status {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.ia-status.on { color: var(--ok); border-color: rgba(61, 220, 151, 0.4); background: rgba(61, 220, 151, 0.08); animation: pulseGlow 2.4s ease infinite; }

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.25); }
  50% { box-shadow: 0 0 0 6px rgba(61, 220, 151, 0.05); }
}

.chat-box {
  background: rgba(4, 18, 28, 0.6);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 1rem;
  min-height: 260px;
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.msg { max-width: 86%; padding: 0.7rem 0.95rem; border-radius: 16px; font-size: 0.87rem; line-height: 1.6; animation: kpiIn 0.3s var(--ease); }

.msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--aqua-bright), var(--aqua));
  color: #041820;
  font-weight: 600;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 14px rgba(31, 182, 205, 0.3);
}

.msg.bot {
  align-self: flex-start;
  background: rgba(7, 32, 47, 0.9);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}

.msg.bot table { font-size: 0.78rem; margin: 0.5rem 0; }
.msg.bot th, .msg.bot td { padding: 0.3rem 0.45rem; }
.msg .src { display: block; margin-top: 0.4rem; font-size: 0.68rem; color: var(--muted); }

.msg.typing { align-self: flex-start; background: rgba(7, 32, 47, 0.9); border: 1px solid var(--line); }

.typing-dots { display: inline-flex; gap: 5px; padding: 0.2rem 0; }
.typing-dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--aqua);
  animation: bounce 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* ---------- cuenta / seguridad ---------- */
.user-chip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-left: 0.6rem;
  padding: 0.3rem 0.6rem 0.3rem 0.35rem;
  border: 1px solid var(--aqua-line);
  border-radius: 999px;
  background: rgba(31, 182, 205, 0.08);
}

.uc-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--aqua-bright), #0B6E88);
  color: #041820;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
}

.uc-info { display: flex; flex-direction: column; line-height: 1.15; }
.uc-info b { font-size: 0.78rem; }
.uc-info small { font-size: 0.62rem; color: var(--muted); }

.secret-box {
  background: rgba(3, 14, 22, 0.9);
  border: 1px dashed var(--aqua-line);
  border-radius: var(--radius-s);
  color: var(--aqua-bright);
  font-family: Consolas, monospace;
  font-size: 1.05rem;
  letter-spacing: 2px;
  padding: 0.7rem 0.9rem;
  text-align: center;
  user-select: all;
  margin: 0.3rem 0;
  word-break: break-all;
}

/* ---------- tira horizontal de tipos (compacta) ---------- */
.type-strip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.ts-scroll {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 4px 2px 8px;
  scrollbar-width: thin;
}

.ts-scroll::-webkit-scrollbar { height: 6px; }
.ts-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }

.ts-card {
  position: relative;
  flex: 0 0 128px;
  height: 86px;
  border-radius: 13px;
  overflow: hidden;
  border: 2px solid var(--line);
  cursor: pointer;
  padding: 0;
  background: #07202F;
  scroll-snap-align: start;
  transition: all 0.22s var(--ease);
  font-family: inherit;
}

.ts-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s var(--ease);
}

.ts-card:hover img { transform: scale(1.1); }

.ts-card .ts-emoji {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

.ts-name {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0.75rem 0.35rem 0.28rem;
  font-size: 0.68rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(180deg, transparent, rgba(3, 12, 20, 0.9));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.ts-exotic {
  position: absolute;
  top: 5px; right: 7px;
  color: var(--gold);
  font-size: 0.7rem;
  text-shadow: 0 1px 3px #000;
}

.ts-card.selected {
  border-color: var(--aqua);
  box-shadow: 0 0 0 3px rgba(31, 182, 205, 0.25), 0 6px 16px rgba(31, 182, 205, 0.25);
}

.ts-card.selected::after {
  content: "✓";
  position: absolute;
  top: 4px; left: 6px;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--aqua-bright), var(--aqua));
  color: #041820;
  font-size: 0.68rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ts-arrow {
  flex: 0 0 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--aqua-line);
  background: rgba(31, 182, 205, 0.08);
  color: var(--aqua-bright);
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.ts-arrow:hover { background: rgba(31, 182, 205, 0.22); transform: scale(1.08); }

/* ---------- LANDING HERO premium ---------- */
.landing {
  position: relative;
  min-height: 56vh;
  display: flex;
  align-items: center;
  border-radius: var(--radius-l);
  overflow: hidden;
  margin-bottom: 1.1rem;
  border: 1px solid var(--glass-line);
  box-shadow: var(--shadow-lg);
}

.landing-bg {
  position: absolute;
  inset: 0;
  background-image: url("img/hero.jpg");
  background-size: cover;
  background-position: center;
  transform: scale(1.05);
  animation: heroZoom 22s var(--ease) infinite alternate;
  transition: background-image 0.6s ease;
}

@keyframes heroZoom {
  from { transform: scale(1.04); }
  to { transform: scale(1.13) translate(-1.5%, -1%); }
}

.landing-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg, rgba(3, 12, 20, 0.92) 0%, rgba(4, 18, 30, 0.68) 42%, rgba(6, 26, 40, 0.18) 100%),
    linear-gradient(0deg, rgba(3, 12, 20, 0.55) 0%, transparent 45%);
}

.landing-content {
  position: relative;
  z-index: 2;
  padding: 2.2rem 2.4rem;
  max-width: 680px;
}

.landing-kicker {
  font-size: 0.72rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 1rem;
}

.landing-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.1rem, 4.6vw, 3.6rem);
  line-height: 1.06;
  color: #fff;
  margin-bottom: 1.1rem;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.landing-title em {
  color: var(--aqua-bright);
  font-style: italic;
}

.landing-sub {
  color: rgba(226, 239, 246, 0.88);
  font-size: 0.98rem;
  line-height: 1.65;
  max-width: 540px;
  margin-bottom: 1.6rem;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.landing-cta { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 1.8rem; }

.btn.big { padding: 0.9rem 1.7rem; font-size: 1rem; }

.btn.ghost {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  backdrop-filter: blur(6px);
}

.btn.ghost:hover { background: rgba(255, 255, 255, 0.16); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4); }

.landing-stats { display: flex; gap: 2.2rem; flex-wrap: wrap; }

.landing-stats div { display: flex; flex-direction: column; }

.landing-stats b {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
}

.landing-stats span {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: rgba(226, 239, 246, 0.65);
  margin-top: 0.3rem;
}

@media (max-width: 720px) {
  .landing { min-height: 66vh; }
  .landing-content { padding: 2rem 1.4rem; }
  .landing-stats { gap: 1.4rem; }
}

/* ---------- tarjetas de tipo con FOTO ---------- */
.type-card {
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tc-photo {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #07202F;
}

.tc-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease), filter 0.4s ease;
  display: block;
}

.type-card:hover .tc-photo img { transform: scale(1.08); }

.tc-photo-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4, 18, 30, 0.05) 30%, rgba(4, 18, 30, 0.88) 100%);
  pointer-events: none;
}

.type-card.selected .tc-photo::after {
  content: "✓ tu elección";
  position: absolute;
  top: 10px; left: 10px;
  background: linear-gradient(135deg, var(--aqua-bright), var(--aqua));
  color: #041820;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(31, 182, 205, 0.5);
  z-index: 2;
}

.type-card .tc-head,
.type-card .tc-desc,
.type-card .tc-time { margin-left: 0.9rem; margin-right: 0.9rem; }

.type-card .tc-head { margin-top: -1.9rem; position: relative; z-index: 2; }
.type-card .tc-desc { margin-top: 0.35rem; margin-bottom: 0.45rem; }
.type-card .tc-time { margin-bottom: 0.9rem; }

/* ---------- hero card con foto ---------- */
.hero-art { position: relative; }

.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  min-height: 200px;
}

.hero-photo-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(200deg, transparent 40%, rgba(5, 18, 28, 0.75) 100%);
  pointer-events: none;
}

.hero-info h2 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.9rem;
  letter-spacing: 0;
}

/* ---------- planes ---------- */
.planes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.plan-card {
  position: relative;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-l);
  background: linear-gradient(165deg, rgba(7, 32, 47, 0.75), rgba(6, 26, 40, 0.5));
  padding: 1.5rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  transition: all 0.3s var(--ease);
}

.plan-card:hover { transform: translateY(-4px); border-color: var(--aqua-line); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4); }

.plan-card.featured {
  border-color: var(--aqua);
  background: linear-gradient(165deg, rgba(31, 182, 205, 0.14), rgba(7, 32, 47, 0.8));
  box-shadow: var(--shadow-aqua);
}

.plan-badge {
  position: absolute;
  top: -11px; left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--aqua-bright), var(--aqua));
  color: #041820;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 2px;
  padding: 0.28rem 0.9rem;
  border-radius: 999px;
  white-space: nowrap;
}

.plan-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  text-align: center;
  line-height: 1.1;
}

.plan-name small { font-size: 0.75rem; font-family: var(--font-body); color: var(--muted); font-weight: 600; }

.plan-price {
  text-align: center;
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--aqua-bright);
}

.plan-price span { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.plan-price small { display: block; font-size: 0.66rem; color: var(--muted); font-weight: 500; margin-top: 0.2rem; }

.plan-card ul { list-style: none; flex: 1; }

.plan-card li {
  font-size: 0.82rem;
  padding: 0.32rem 0;
  border-bottom: 1px dashed rgba(20, 57, 82, 0.7);
  line-height: 1.45;
}

.plan-card .btn { justify-self: center; text-align: center; text-decoration: none; }

details {
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 0.8rem 1rem;
  margin-bottom: 0.6rem;
  background: rgba(7, 32, 47, 0.5);
}

details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--aqua-bright);
  font-size: 0.88rem;
}

details[open] summary { margin-bottom: 0.5rem; }

/* ---------- selector de roles ---------- */
.roles { margin-bottom: 1.4rem; }

.roles-title { text-align: center; margin-bottom: 1.1rem; }

.roles-title h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--txt);
}

.roles-title p { color: var(--muted); font-size: 0.88rem; margin-top: 0.25rem; }

.roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.role-card {
  position: relative;
  background: linear-gradient(165deg, rgba(7, 32, 47, 0.8), rgba(6, 26, 40, 0.55));
  border: 1.5px solid var(--line);
  border-radius: var(--radius-l);
  padding: 1.1rem 1rem;
  cursor: pointer;
  font-family: inherit;
  color: var(--txt);
  text-align: center;
  transition: all 0.3s var(--ease);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  align-items: center;
}

.role-card:hover { transform: translateY(-5px); border-color: var(--aqua-line); box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45); }

.role-card.featured {
  border-color: var(--aqua);
  background: linear-gradient(165deg, rgba(31, 182, 205, 0.15), rgba(7, 32, 47, 0.85));
  box-shadow: var(--shadow-aqua);
}

.rc-badge {
  position: absolute;
  top: -11px; left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--aqua-bright), var(--aqua));
  color: #041820;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 1.8px;
  padding: 0.26rem 0.8rem;
  border-radius: 999px;
  white-space: nowrap;
}

.rc-icon { font-size: 1.7rem; }
.rc-name { font-family: var(--font-display); font-size: 1.1rem; font-weight: 900; }
.rc-desc { color: var(--muted); font-size: 0.74rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rc-cta { color: var(--aqua-bright); font-weight: 700; font-size: 0.8rem; margin-top: 0.2rem; }

/* área cliente */
.cl-questions li {
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  margin-bottom: 0.5rem;
  font-size: 0.87rem;
  line-height: 1.5;
  background: rgba(7, 32, 47, 0.55);
  transition: all 0.25s var(--ease);
}

.cl-questions li:hover { border-color: var(--aqua-line); transform: translateX(4px); }

input[type="range"] {
  width: 100%;
  accent-color: var(--aqua);
  height: 28px;
  cursor: pointer;
}

/* área proveedor */
.offer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 0.2rem;
  border-bottom: 1px dashed rgba(20, 57, 82, 0.8);
  font-size: 0.85rem;
  line-height: 1.5;
}

.offer-row:last-of-type { border-bottom: none; }

/* ---------- paleta de color de agua ---------- */
.color-grid {
  display: grid;
  grid-template-columns: minmax(260px, 380px) 1fr;
  gap: 1.2rem;
  align-items: start;
}

.agua-mock { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }

.swatch-row { display: flex; gap: 0.7rem; flex-wrap: wrap; }

.swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  width: 92px;
}

.sw-chip {
  width: 54px; height: 54px;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.22s var(--ease);
}

.swatch:hover .sw-chip { transform: scale(1.12) rotate(-3deg); }

.sw-name { font-size: 0.66rem; color: var(--muted); text-align: center; line-height: 1.3; }

.color-tips { list-style: none; margin-top: 0.8rem; }

.color-tips li {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
  padding: 0.3rem 0 0.3rem 1.3rem;
  position: relative;
}

.color-tips li::before { content: "💧"; position: absolute; left: 0; }

@media (max-width: 720px) { .color-grid { grid-template-columns: 1fr; } }

/* ---------- ENTERPRISE: command palette ---------- */
.cmd-palette {
  position: fixed;
  inset: 0;
  background: rgba(3, 12, 20, 0.7);
  backdrop-filter: blur(8px);
  z-index: 300;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  animation: panelIn 0.2s var(--ease);
}

.cmd-box {
  background: linear-gradient(165deg, rgba(10, 36, 54, 0.98), rgba(7, 27, 41, 0.98));
  border: 1px solid var(--aqua-line);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(31, 182, 205, 0.2);
  max-width: 580px;
  width: 92%;
  overflow: hidden;
}

.cmd-input {
  width: 100%;
  padding: 1rem 1.3rem;
  font-size: 1.05rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  color: var(--txt);
  outline: none;
  font-family: inherit;
}

.cmd-input::placeholder { color: var(--muted); }

.cmd-list { max-height: 320px; overflow-y: auto; padding: 0.4rem; }

.cmd-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--txt);
  transition: background 0.15s ease;
}

.cmd-item:hover, .cmd-item.sel {
  background: rgba(31, 182, 205, 0.12);
  color: var(--aqua-bright);
}

.cmd-hint { font-size: 0.72rem; color: var(--muted); }

.cmd-empty { padding: 1.2rem; text-align: center; color: var(--muted); font-size: 0.85rem; }

.cmd-footer {
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
}

/* ---------- theme light overrides ---------- */
body.theme-light { --bg: #f5f3ee; --bg2: #ecebe4; }

body.theme-light .landing-overlay {
  background: linear-gradient(100deg, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0.5) 50%, rgba(255,255,255,0.1) 100%) !important;
}

body.theme-light .plano-wrap { background-color: #fff; }

/* ---------- skip link (WCAG) ---------- */
#skipLink:focus { left: 0 !important; }

/* ---------- kbd shortcut display ---------- */
kbd {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
  font-family: Consolas, monospace;
  font-size: 0.8rem;
  color: var(--txt);
}

/* ---------- FÁBRICA: publicidad rústica ---------- */
.fabrica-landing {
  margin-bottom: 1.2rem;
  border: 2px dashed rgba(216, 179, 106, 0.35);
  border-radius: var(--radius-l);
  padding: 1.4rem 1.2rem;
  background:
    radial-gradient(600px 200px at 70% -10%, rgba(216, 179, 106, 0.06), transparent 70%),
    linear-gradient(165deg, rgba(10, 36, 54, 0.5), rgba(6, 26, 40, 0.4));
}

.fabrica-header { text-align: center; margin-bottom: 1rem; }

.fabrica-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--txt);
}

.fabrica-header h2 span { color: var(--gold); }

.fabrica-header p { color: var(--muted); font-size: 0.85rem; margin-top: 0.3rem; }

.fabrica-strip {
  display: flex;
  gap: 0.8rem;
  overflow-x: auto;
  padding-bottom: 0.6rem;
  scrollbar-width: thin;
}

.fabrica-card {
  flex: 0 0 220px;
  border: 1.5px solid rgba(216, 179, 106, 0.25);
  border-radius: var(--radius-m);
  padding: 1rem 0.9rem;
  background: linear-gradient(165deg, rgba(10, 36, 54, 0.7), rgba(6, 26, 40, 0.6));
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: all 0.25s var(--ease);
}

.fabrica-card:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(216, 179, 106, 0.15);
}

.fc-tag {
  font-size: 0.58rem;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 800;
}

.fc-icon { font-size: 1.6rem; }
.fc-name { font-weight: 800; font-size: 0.88rem; color: var(--txt); line-height: 1.3; }
.fc-desc { font-size: 0.72rem; color: var(--muted); line-height: 1.45; flex: 1; }
.fc-price { font-size: 0.82rem; font-weight: 700; color: var(--aqua-bright); }
.fc-cta {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold);
  text-decoration: none;
  text-align: center;
  border: 1px solid rgba(216, 179, 106, 0.3);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  transition: all 0.2s;
}

.fc-cta:hover { background: rgba(216, 179, 106, 0.12); }

/* grid version dentro de tab */
.fabrica-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.8rem;
}

/* ---------- GUÍA PASO A PASO ---------- */
.guia-progress {
  display: flex;
  gap: 0;
  margin: 1rem 0;
  overflow-x: auto;
  padding-bottom: 0.3rem;
}

.guia-phase-btn {
  flex: 1;
  min-width: 110px;
  padding: 0.6rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 0;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  background: rgba(7, 32, 47, 0.5);
  transition: all 0.2s;
  font-family: inherit;
}

.guia-phase-btn:first-child { border-radius: 10px 0 0 10px; }
.guia-phase-btn:last-child { border-radius: 0 10px 10px 0; }

.guia-phase-btn.active {
  background: linear-gradient(135deg, rgba(31, 182, 205, 0.2), rgba(31, 182, 205, 0.05));
  border-color: var(--aqua);
  color: var(--aqua-bright);
}

.guia-phase-btn.done { color: var(--ok); border-color: rgba(61, 220, 151, 0.3); }
.guia-phase-btn.done::after { content: " ✓"; color: var(--ok); }

.guia-step {
  border: 1.5px solid var(--aqua-line);
  border-radius: var(--radius-l);
  padding: 1.5rem 1.4rem;
  background: linear-gradient(165deg, rgba(10, 36, 54, 0.6), rgba(6, 26, 40, 0.5));
  animation: panelIn 0.35s var(--ease);
}

.guia-step-num {
  position: absolute;
  top: -14px; left: 20px;
  background: linear-gradient(135deg, var(--aqua-bright), var(--aqua));
  color: #041820;
  font-weight: 900;
  font-size: 0.85rem;
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(31, 182, 205, 0.4);
}

.guia-step h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--txt);
  margin-bottom: 0.6rem;
  position: relative;
  padding-top: 0.3rem;
}

.guia-step .step-txt {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--txt);
}

.guia-step .step-txt.cliente {
  font-size: 0.95rem;
  color: var(--aqua-bright);
  font-style: italic;
  border-left: 3px solid var(--aqua);
  padding-left: 0.8rem;
  margin-top: 0.6rem;
}

.guia-step .guia-cn {
  display: block;
  margin-top: 0.8rem;
  font-size: 0.8rem;
  color: var(--warn);
  border-left: 2px solid var(--warn);
  padding-left: 0.7rem;
  line-height: 1.5;
}

.guia-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  gap: 0.6rem;
}

.guia-count { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.guia-progress-bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(7, 32, 47, 0.8);
  overflow: hidden;
  margin: 0.6rem 0;
}

.guia-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--aqua), var(--ok));
  border-radius: 3px;
  transition: width 0.4s var(--ease);
}

/* ---------- print ---------- */
@media print {
  body { background: #fff; color: #000; }
  .topbar, .next-step, footer, .tabs { display: none; }
  .card { box-shadow: none; border: 1px solid #999; background: #fff; backdrop-filter: none; animation: none; }
  .card h2, .kpi .k-value { color: #111; text-shadow: none; }
  .tab-panel { display: none; }
  .tab-panel.active { display: block; }
  .step-list li, .kpi, .chem-action { animation: none; }
}
