/* ==========================================================================
   ALFONSO · FASE 7 — sistema de diseño web, PWA y móvil
   Se carga después de pro-v5.css y alfonso-theme.css. Sólo presentación:
   ningún dato, permiso ni estado se inventa aquí.
   Paleta: blanco #FFFFFF, negro #000000, dorado #C9A84C, amarillo #FFD700.
   ========================================================================== */

:root {
  --a-white: #FFFFFF;
  --a-black: #000000;
  --a-gold: #C9A84C;
  --a-yellow: #FFD700;
  --a-gold-soft: #F6EBC8;
  --a-gold-line: #E4D3A2;

  --bg: #F7F6F2;
  --surface: #FFFFFF;
  --surface2: #FAF8F3;
  --surface3: #F1EEE7;
  --ink: #0A0A0A;
  --ink-soft: #2B2A27;
  --muted: #6F6B62;
  --line: #E6E1D6;
  --line-strong: #D6CFBE;
  --gold: var(--a-gold);
  --gold2: var(--a-yellow);
  --ok: #1F7A4D;
  --warn: #8A5A00;
  --bad: #B42318;
  --shadow: 0 18px 44px rgba(10, 10, 10, .07);
  --shadow-sm: 0 6px 18px rgba(10, 10, 10, .05);
  --radius: 20px;
  --radius-sm: 14px;
  --ring: 0 0 0 3px rgba(201, 168, 76, .38);

  color: var(--ink);
  background: var(--bg);
  font-family: Montserrat, Inter, "Segoe UI Variable", "Segoe UI", ui-sans-serif, system-ui, -apple-system, sans-serif;
}

:root[data-theme="dark"] {
  --bg: #080808;
  --surface: #111111;
  --surface2: #171614;
  --surface3: #201E19;
  --ink: #F7F4EC;
  --ink-soft: #E6E1D5;
  --muted: #A9A397;
  --line: #2A2823;
  --line-strong: #3B382F;
  --gold: #D9BA63;
  --gold2: var(--a-yellow);
  --gold-soft: #2A2416;
  --gold-line: #4A3F22;
  --ok: #63C58C;
  --warn: #F0C268;
  --bad: #FF8A80;
  --shadow: 0 22px 54px rgba(0, 0, 0, .55);
  --shadow-sm: 0 8px 20px rgba(0, 0, 0, .45);
}

html { scroll-behavior: smooth; }
body {
  color: var(--ink);
  background:
    radial-gradient(1100px 420px at 88% -8%, rgba(255, 215, 0, .11), transparent 70%),
    radial-gradient(900px 380px at -6% 6%, rgba(201, 168, 76, .08), transparent 70%),
    var(--bg);
  min-height: 100vh;
}
[data-theme="dark"] body {
  background:
    radial-gradient(1000px 420px at 88% -8%, rgba(201, 168, 76, .13), transparent 72%),
    radial-gradient(800px 340px at -6% 4%, rgba(255, 215, 0, .05), transparent 70%),
    var(--bg);
}

:focus-visible { outline: 3px solid var(--a-gold); outline-offset: 3px; }
::selection { background: var(--a-gold-soft); color: var(--a-black); }
[data-theme="dark"] ::selection { background: #4A3F22; color: #FFF8DC; }

/* ---------- Shell ---------- */
.app { grid-template-columns: 268px minmax(0, 1fr); background: transparent; }
.side {
  background: linear-gradient(178deg, #111111 0%, #0B0B0B 58%, #080808 100%);
  border-right: 1px solid rgba(201, 168, 76, .18);
  color: #F7F4EC;
  padding: 24px 16px 18px;
  gap: 16px;
}
[data-theme="light"] .side { background: linear-gradient(178deg, #101010 0%, #050505 100%); }
.side .brand { border-bottom: 1px solid rgba(201, 168, 76, .22); padding-bottom: 18px; }
.side .brand b { color: #FFFFFF; letter-spacing: .16em; font-weight: 800; }
.side .brand small { color: var(--a-gold); letter-spacing: .32em; font-size: 10px; text-transform: uppercase; }
.brand-symbol img { filter: drop-shadow(0 2px 10px rgba(255, 215, 0, .22)); }
.nav-heading {
  color: #8C8678;
  font-size: 10px;
  letter-spacing: .26em;
  text-transform: uppercase;
  padding: 2px 12px 0;
}
.nav-group {
  color: #8C8678;
  font-size: 10px;
  letter-spacing: .24em;
  text-transform: uppercase;
  padding: 16px 12px 6px;
}
.nav { gap: 2px; }
.nav button {
  color: #CFC9BC;
  border-radius: 12px;
  padding: 10px 12px;
  gap: 11px;
  font-size: 14px;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.nav button:hover { background: rgba(255, 255, 255, .06); color: #FFFFFF; }
.nav button.active {
  background: linear-gradient(100deg, rgba(201, 168, 76, .24), rgba(255, 215, 0, .08));
  color: #FFFFFF;
  box-shadow: inset 3px 0 0 var(--a-gold);
}
.nav button.active .ui-icon { color: var(--a-gold); }
.side-foot { border-top: 1px solid rgba(255, 255, 255, .09); padding-top: 14px; }
.side-foot-label { color: #8C8678; letter-spacing: .22em; }
#sideStatus { color: #F7F4EC; font-weight: 650; }
.side-foot-detail { color: #A9A397; }
.side .btn {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .14);
  color: #F7F4EC;
}
.side .btn:hover { background: rgba(201, 168, 76, .2); border-color: var(--a-gold); }

/* ---------- Topbar ---------- */
.main { background: transparent; }
.top.phase7-top {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 76px;
  padding: 12px 26px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.top-heading { display: flex; align-items: center; gap: 12px; }
.phase7-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 680px);
}
.phase7-search form,
#topSearch {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--surface2);
  border-radius: 999px;
  padding: 4px 8px 4px 16px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.phase7-search form:focus-within,
#topSearch:focus-within { border-color: var(--a-gold); box-shadow: var(--ring); }
#searchCommand { padding: 10px 0; font-size: 14px; }
#topSearch .btn,
.topbar-kbd {
  border-radius: 999px;
  min-width: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}
.topbar-kbd { font-size: 11px; letter-spacing: .04em; }

.top-actions { display: flex; align-items: center; gap: 9px; margin-left: auto; }
.top-actions .health { margin-right: 4px; }
.top-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.top-icon-btn:hover { border-color: var(--a-gold); background: var(--surface2); }
.top-icon-btn .ui-icon { width: 21px; height: 21px; }
.notification-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--a-gold);
  color: var(--a-black);
  font-size: 10px;
  font-weight: 800;
  border: 2px solid var(--surface);
}
.notification-dot[hidden] { display: none; }
.top-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--surface);
  min-width: 0;
  max-width: 220px;
}
.top-chip .chip-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--a-gold), var(--a-yellow));
  color: var(--a-black);
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}
.top-chip b { display: block; font-size: 12px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-chip small { display: block; font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions .top-cta { white-space: nowrap; }
.top-actions .profile-chip { max-width: 190px; }
.top-actions .company-chip { max-width: 200px; }

/* ---------- Botones y tarjetas ---------- */
.btn {
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 10px 14px;
  font-weight: 600;
  transition: background .16s ease, border-color .16s ease, transform .12s ease, box-shadow .16s ease;
}
.btn:hover { border-color: var(--a-gold); background: var(--surface2); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(135deg, var(--a-gold) 0%, #B8963E 100%);
  border-color: #B8963E;
  color: var(--a-black);
  box-shadow: 0 8px 20px rgba(201, 168, 76, .28);
}
.btn.primary:hover { background: linear-gradient(135deg, #D8B75B 0%, var(--a-gold) 100%); }
.btn.primary .ui-icon { color: var(--a-black); }
.btn.ghost { background: transparent; }
.btn.link-button { border: 0; background: transparent; color: var(--gold); padding: 4px 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}
.card h3 { font-size: 15px; letter-spacing: -.01em; }
.card h4 { font-size: 13px; letter-spacing: .01em; }
.muted { color: var(--muted); }
.data-note { color: var(--muted); font-size: 12px; }
.tag { border-radius: 999px; padding: 4px 10px; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.tag.ok { background: rgba(31, 122, 77, .12); color: var(--ok); }
.tag.warn { background: rgba(138, 90, 0, .12); color: var(--warn); }
.tag.bad { background: rgba(180, 35, 24, .12); color: var(--bad); }
[data-theme="dark"] .tag.ok { background: rgba(99, 197, 140, .16); }
[data-theme="dark"] .tag.warn { background: rgba(240, 194, 104, .16); }
[data-theme="dark"] .tag.bad { background: rgba(255, 138, 128, .16); }

.workspace { max-width: 1560px; padding: 26px 26px 56px; }
.section-title h2 { font-size: 26px; letter-spacing: -.02em; }

/* ---------- Inicio web ---------- */
.reference-dashboard { grid-template-columns: minmax(0, 1fr) 330px; gap: 26px; }
.reference-hero {
  border-radius: 28px;
  background:
    radial-gradient(700px 340px at 8% 20%, rgba(255, 215, 0, .5), transparent 68%),
    radial-gradient(600px 300px at 92% 10%, rgba(201, 168, 76, .26), transparent 70%),
    linear-gradient(150deg, #FFFDF6 0%, #FFF8DD 62%, #FBEFC4 100%);
  border: 1px solid var(--a-gold-line);
  box-shadow: 0 24px 60px rgba(201, 168, 76, .16);
}
[data-theme="dark"] .reference-hero {
  background:
    radial-gradient(700px 340px at 8% 20%, rgba(201, 168, 76, .22), transparent 68%),
    radial-gradient(600px 300px at 92% 10%, rgba(255, 215, 0, .12), transparent 70%),
    linear-gradient(150deg, #191712 0%, #121110 60%, #0C0C0B 100%);
  border-color: #3B382F;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
.reference-copy h2 { color: var(--a-black); letter-spacing: -.03em; }
.reference-copy h2 em { color: #8A6A17; font-style: normal; }
.reference-copy p { color: #5B5445; }
[data-theme="dark"] .reference-copy h2 { color: #FFF8E2; }
[data-theme="dark"] .reference-copy h2 em { color: var(--a-gold); }
[data-theme="dark"] .reference-copy p { color: #C9C2B2; }
.reference-copy .eyebrow { color: #8A6A17; letter-spacing: .3em; }
[data-theme="dark"] .reference-copy .eyebrow { color: var(--a-gold); }

.reference-composer {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: -26px 18px 0;
  position: relative;
  z-index: 2;
  padding: 10px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.reference-composer .composer { flex: 1; display: flex; align-items: center; gap: 10px; }
.reference-composer textarea {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 12px 6px;
  resize: none;
  min-height: 44px;
  outline: none;
}
.reference-composer .composer > .btn { border-radius: 14px; }

/* Centro de Alfonso: voz */
.voice-assistant { display: flex; align-items: center; gap: 12px; }
.voice-orb {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  flex-shrink: 0;
}
.voice-orb .voice-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(201, 168, 76, .55);
  opacity: .8;
  transform: scale(.86);
  transition: transform .3s ease, opacity .3s ease, border-color .3s ease;
}
.voice-orb .voice-ring:nth-child(2) { inset: -7px; opacity: .45; border-color: rgba(255, 215, 0, .45); }
.voice-orb .voice-ring:nth-child(3) { inset: -14px; opacity: .22; border-color: rgba(201, 168, 76, .5); }
.reference-composer .mic,
.mic {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid var(--a-gold);
  background: linear-gradient(150deg, #FFF8DD, #F2D98A);
  color: #3A2C05;
  box-shadow: 0 8px 22px rgba(201, 168, 76, .32);
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.mic:hover { transform: translateY(-1px) scale(1.03); }
.mic .ui-icon { width: 24px; height: 24px; }
[data-theme="dark"] .mic { background: linear-gradient(150deg, #2A2416, #4A3B12); color: #FFE58A; }
.mic.listening {
  background: linear-gradient(150deg, var(--a-yellow), var(--a-gold));
  box-shadow: 0 0 0 6px rgba(255, 215, 0, .22), 0 10px 26px rgba(201, 168, 76, .45);
  animation: voice-pulse 1.6s ease-in-out infinite;
}
.mic.speaking {
  background: linear-gradient(150deg, #2B2A27, #121110);
  border-color: var(--a-gold);
  color: var(--a-yellow);
  animation: voice-pulse 1.1s ease-in-out infinite;
}
.mic.requesting { border-style: dashed; animation: voice-pulse 2.4s ease-in-out infinite; }
.mic.error { border-color: var(--bad); color: var(--bad); background: var(--surface); }
.voice-orb[data-voice-state="listening"] .voice-ring,
.voice-orb[data-voice-state="speaking"] .voice-ring { animation: voice-ring 1.8s ease-out infinite; }
.voice-orb[data-voice-state="listening"] .voice-ring:nth-child(2) { animation-delay: .35s; }
.voice-orb[data-voice-state="listening"] .voice-ring:nth-child(3) { animation-delay: .7s; }
.voice-orb[data-voice-state="speaking"] .voice-ring { animation: voice-ring 1.2s ease-out infinite; border-color: rgba(255, 215, 0, .7); }
.voice-orb[data-voice-state="off"] .voice-ring { opacity: .35; transform: scale(.82); }
.voice-orb[data-voice-state="offline"] .voice-ring { border-color: var(--warn); opacity: .35; transform: scale(.82); }
.voice-orb[data-voice-state="error"] .voice-ring { border-color: var(--bad); }
.voice-wave {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 22px;
}
.voice-wave i {
  display: block;
  width: 3px;
  height: 6px;
  border-radius: 3px;
  background: var(--a-gold);
  opacity: .45;
}
.voice-orb[data-voice-state="listening"] .voice-wave i,
.voice-orb[data-voice-state="speaking"] .voice-wave i { animation: voice-bar 1s ease-in-out infinite; opacity: 1; }
.voice-wave i:nth-child(2) { animation-delay: .12s; }
.voice-wave i:nth-child(3) { animation-delay: .24s; }
.voice-wave i:nth-child(4) { animation-delay: .36s; }
.voice-wave i:nth-child(5) { animation-delay: .48s; }
#voiceState {
  display: block;
  font-size: 12px;
  font-weight: 650;
  color: var(--ink-soft);
  line-height: 1.25;
}
#voiceState[data-voice-state="off"],
#voiceState[data-voice-state="error"] { color: var(--muted); }
#voiceState[data-voice-state="listening"] { color: #8A6A17; }
[data-theme="dark"] #voiceState[data-voice-state="listening"] { color: var(--a-yellow); }
.voice-hint { display: block; font-size: 10px; color: var(--muted); }
#voiceText { display: block; font-size: 11px; color: var(--muted); min-height: 14px; }

@keyframes voice-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes voice-ring { 0% { transform: scale(.84); opacity: .75; } 100% { transform: scale(1.28); opacity: 0; } }
@keyframes voice-bar { 0%, 100% { height: 6px; } 50% { height: 20px; } }

/* Centro de voz dedicado (móvil) */
.voice-center { display: grid; place-items: center; gap: 22px; padding: 34px 20px 30px; text-align: center; }
.voice-center .voice-orb { width: 132px; height: 132px; }
.voice-center .mic { width: 96px; height: 96px; }
.voice-center .mic .ui-icon { width: 42px; height: 42px; }
.voice-center h3 { margin: 0; font-size: 19px; }
.voice-center p { margin: 0; color: var(--muted); max-width: 42ch; font-size: 13px; }
.voice-states { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; }
.voice-states span { border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; font-size: 10px; color: var(--muted); }
.voice-states span[aria-current="true"] { border-color: var(--a-gold); color: var(--ink); background: var(--gold-soft); }

/* Mosaicos de acción y modo */
.reference-actions { gap: 14px; }
.action-tile {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.action-tile:hover { transform: translateY(-2px); border-color: var(--a-gold); box-shadow: var(--shadow); }
.action-tile .ui-icon { color: var(--gold); }
.mode-tile { border-radius: var(--radius-sm); border: 1px solid var(--line); }
.mode-tile.active { border-color: var(--a-gold); background: var(--gold-soft); }
.mode-tile .ui-icon { color: var(--gold); }
.system-row { border-bottom: 1px solid var(--line); }
.system-row:last-child { border-bottom: 0; }
.system-state.online { color: var(--ok); }
.clock-panel { background: linear-gradient(140deg, var(--surface), var(--surface2)); }

/* ---------- Módulos Fase 7 ---------- */
.p7-shell { display: grid; gap: 20px; }
.p7-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 26px 28px;
  border-radius: 26px;
  border: 1px solid var(--line);
  background:
    radial-gradient(600px 260px at 100% 0%, rgba(255, 215, 0, .14), transparent 70%),
    linear-gradient(135deg, var(--surface) 0%, var(--surface2) 100%);
  box-shadow: var(--shadow-sm);
}
.p7-hero .eyebrow { color: var(--gold); letter-spacing: .28em; font-size: 10px; text-transform: uppercase; }
.p7-hero h2 { margin: 8px 0 6px; font-size: 30px; letter-spacing: -.03em; }
.p7-hero h2 em { font-style: normal; color: #8A6A17; }
[data-theme="dark"] .p7-hero h2 em { color: var(--a-gold); }
.p7-hero p { margin: 0; color: var(--muted); font-size: 13px; max-width: 62ch; }
.p7-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.p7-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
.p7-grid > * { min-width: 0; }
.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }
.p7-kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.p7-kpi b { font-size: 30px; letter-spacing: -.04em; line-height: 1; }
.p7-kpi span { color: var(--muted); font-size: 12px; }
.p7-kpi .p7-kpi-note { color: var(--muted); font-size: 10px; }
.p7-kpi.gold { background: linear-gradient(150deg, var(--surface), var(--gold-soft)); border-color: var(--a-gold-line); }
.p7-kpi.gold b { color: #7A5C12; }
[data-theme="dark"] .p7-kpi.gold b { color: var(--a-yellow); }
.p7-list { display: grid; gap: 0; }
.p7-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.p7-row:last-child { border-bottom: 0; }
.p7-row .p7-row-main { min-width: 0; }
.p7-row b { display: block; font-size: 13px; }
.p7-row p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.p7-row time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.p7-empty {
  display: grid;
  gap: 4px;
  padding: 18px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line-strong);
  background: var(--surface2);
  color: var(--muted);
}
.p7-empty b { color: var(--ink); font-size: 13px; }
.p7-empty p { margin: 0; font-size: 12px; }
.p7-note { color: var(--muted); font-size: 11px; }
.p7-badge-row { display: flex; flex-wrap: wrap; gap: 6px; }
.p7-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  color: var(--muted);
}
.p7-badge.ok { border-color: rgba(31, 122, 77, .35); color: var(--ok); }
.p7-badge.warn { border-color: rgba(138, 90, 0, .35); color: var(--warn); }
.p7-badge.off { border-style: dashed; }
.p7-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.p7-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: left;
  color: var(--ink);
}
.p7-tile:hover { border-color: var(--a-gold); box-shadow: var(--shadow); }
.p7-tile .ui-icon { color: var(--gold); margin-bottom: 4px; }
.p7-tile b { font-size: 14px; }
.p7-tile span { color: var(--muted); font-size: 11px; }
.p7-progress { height: 6px; border-radius: 999px; background: var(--surface3); overflow: hidden; }
.p7-progress i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--a-gold), var(--a-yellow)); }

/* ---------- Móvil ---------- */
.reference-mobile-nav {
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(16px);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -10px 30px rgba(10, 10, 10, .08);
  padding: 9px 8px max(12px, env(safe-area-inset-bottom));
}
.reference-mobile-nav button {
  position: relative;
  gap: 4px;
  padding: 5px 2px;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  border-radius: 14px;
}
.reference-mobile-nav button[aria-current="page"] { color: var(--ink); }
.reference-mobile-nav button[aria-current="page"] .ui-icon {
  background: var(--gold-soft);
  box-shadow: 0 0 0 8px var(--gold-soft);
  border-radius: 16px;
  color: #7A5C12;
}
[data-theme="dark"] .reference-mobile-nav button[aria-current="page"] .ui-icon { color: var(--a-yellow); }
.reference-mobile-nav button.voice-tab .ui-icon {
  width: 44px;
  height: 44px;
  margin-top: -18px;
  padding: 10px;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--a-yellow), var(--a-gold));
  color: var(--a-black);
  border: 3px solid var(--surface);
  box-shadow: 0 8px 20px rgba(201, 168, 76, .4);
}
.reference-mobile-nav button.voice-tab span { margin-top: 1px; }

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
  .reference-dashboard { grid-template-columns: minmax(0, 1fr) 290px; }
  .top-actions .company-chip { display: none; }
}

@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 280px; transform: translateX(-102%); transition: transform .22s ease; height: 100vh; z-index: 30; }
  .side.open { transform: translateX(0); }
  .top.phase7-top { padding: 10px 16px; gap: 10px; }
  .top-actions .profile-chip, .top-actions .health { display: none; }
  .reference-dashboard { grid-template-columns: 1fr; }
  .reference-rail { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .p7-grid .span-8, .p7-grid .span-6, .p7-grid .span-4, .p7-grid .span-3 { grid-column: span 6; }
}

@media (max-width: 760px) {
  body { padding-bottom: 84px; }
  .workspace { padding: 14px 14px 34px; }
  .top.phase7-top { min-height: 62px; padding: 8px 12px; }
  .top-heading .menu { display: inline-flex; }
  .phase7-search { flex: 1; }
  .top-actions .top-cta { display: none; }
  .top-actions .company-chip { display: none; }
  .top-chip { padding: 6px 9px; max-width: 150px; }
  .top-chip small { display: none; }
  .top-actions .top-icon-btn { width: 38px; height: 38px; }
  .reference-hero { min-height: 300px; grid-template-columns: 54% 46%; border-radius: 24px; }
  .reference-dog { height: 310px; }
  .reference-composer {
    margin: -18px 10px 0;
    padding: 8px;
    gap: 8px;
    flex-wrap: wrap;
    border-radius: 18px;
  }
  .reference-composer .voice-assistant { width: 100%; justify-content: flex-end; }
  .reference-composer .voice-assistant .voice-copy { display: none; }
  .voice-center .voice-orb { width: 116px; height: 116px; }
  .voice-center .mic { width: 86px; height: 86px; }
  .p7-hero { padding: 20px; border-radius: 22px; flex-direction: column; align-items: flex-start; }
  .p7-hero h2 { font-size: 24px; }
  .p7-grid { gap: 12px; }
  .p7-grid .span-8, .p7-grid .span-6, .p7-grid .span-4, .p7-grid .span-3 { grid-column: span 12; }
  .p7-tiles { grid-template-columns: 1fr; }
  .card { padding: 16px; border-radius: 18px; }
  .footer { padding-bottom: 100px; }
}

@media (max-width: 430px) {
  .top-actions .top-icon-btn { width: 36px; height: 36px; }
  .top-chip .chip-avatar { width: 26px; height: 26px; }
  .reference-copy h2 { font-size: 30px; }
  .p7-kpi b { font-size: 26px; }
}

/* ---------- Accesibilidad y movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .mic.listening { animation: none; box-shadow: 0 0 0 6px rgba(255, 215, 0, .28); }
  .voice-orb[data-voice-state] .voice-ring { animation: none !important; }
}

@media (prefers-contrast: more) {
  :root { --line: #9A9282; --muted: #4A473F; }
  .card, .p7-kpi, .p7-tile { border-width: 2px; }
  .btn { border-width: 2px; }
}

@media (forced-colors: active) {
  .card, .p7-kpi, .p7-tile, .top-chip, .top-icon-btn { border: 1px solid CanvasText; }
  .mic { border: 2px solid CanvasText; }
}

/* Final references: live components only, no screenshot/data baked into UI. */
.voice-settings { display: grid; gap: 12px; }
.voice-settings label { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.voice-settings select { width: min(100%, 620px); }
.voice-settings input[type="range"] { width: min(100%, 300px); accent-color: #C9A84C; }
.admin-user[hidden] { display: none !important; }
.admin-permission-matrix { margin-block: 12px; }
.admin-permission-matrix summary { cursor: pointer; min-height: 44px; padding: 10px; }
.table-scroll { max-width: 100%; overflow: auto; }
.table-scroll th, .table-scroll td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; }
.voice-orb[data-voice-state="processing"] .voice-ring { animation: voice-ring 3s ease-in-out infinite; border-color: #C9A84C; }
.voice-orb[data-voice-state="processing"] .mic { box-shadow: 0 0 32px #FFD70088; }
:root[data-audio-meter="measured"] .voice-orb[data-voice-state="listening"] .voice-wave i {
  animation: none; transform: scaleY(calc(.25 + var(--voice-level, 0) * 2)); opacity: 1;
}
:root[data-audio-meter="measured"] .voice-orb[data-voice-state="listening"] .mic {
  box-shadow: 0 0 calc(18px + var(--voice-level, 0) * 45px) #FFD70099;
}
@media (prefers-reduced-motion: reduce) {
  .voice-orb[data-voice-state] *, :root[data-audio-meter="measured"] .voice-wave i { animation: none !important; transform: none !important; transition: none !important; }
}

/* FASE 7.1 · referencias verificadas. SVG/CSS propios, nunca capturas de fondo. */
:root { --radius: 16px; --gold-soft: #FBF4DC; --gold-line: #E4D3A2; }
:root[data-theme="dark"] { --gold-soft: #2A2416; --gold-line: #4A3F22; }
.app { grid-template-columns: 218px minmax(0, 1fr); }
:root[data-theme] .side { width: auto; padding: 20px 12px; gap: 10px; border-right: 1px solid var(--line); }
:root[data-theme="light"] .side { background: linear-gradient(165deg, #FFFFFF 65%, #FFF9E6); color: var(--ink); }
:root[data-theme="light"] .side .brand b, :root[data-theme="light"] #sideStatus { color: #000000; }
:root[data-theme="light"] .nav button { color: #292929; }
:root[data-theme="light"] .nav button:hover { background: #FBF4DC; color: #000000; }
:root[data-theme="light"] .nav button.active { color: #000000; background: linear-gradient(100deg, #FFE778, #FFF9E6); border: 1px solid #C9A84C; box-shadow: 0 0 12px #FFD70033; }
:root[data-theme="light"] .side .btn { background: #FFFFFF; border-color: var(--line); color: #242424; }
:root[data-theme="light"] .brand, :root[data-theme="light"] .side-foot { border-color: var(--line); }
.side .brand { gap: 8px; padding: 0 0 14px; }
.side .brand b { font-size: 18px; letter-spacing: .06em; }
.side .brand small { font-size: 9px; }
.nav-heading { font-size: 9px; padding: 0 8px; }
.nav .nav-group { padding: 10px 8px 3px; font-size: 9px; letter-spacing: .12em; }
.nav button { min-height: 38px; padding: 8px 10px; font-size: 13px; }
.nav button .ui-icon { width: 19px; height: 19px; }
.side-foot { padding: 12px 6px 0; font-size: 11px; }
:root[data-theme="light"] .side-foot-detail { color: #686868; }
.workspace { max-width: 1700px; padding: 16px 20px 32px; }
.top.phase7-top { height: auto; min-height: 76px; padding: 10px 20px; gap: 12px; }
.phase7-search { width: 100%; }
#topSearch { display: flex; border-color: var(--a-gold); background: var(--surface); }
#searchCommand { min-width: 0; width: 100%; border: 0; color: var(--ink); background: transparent; box-shadow: none; }
.topbar-kbd { flex-shrink: 0; }
.top-actions .health, .top-actions .top-cta { display: none; }
.top-chip.profile-chip { border: 0; background: transparent; padding: 4px; }
.top-chip .chip-avatar { border-radius: 50%; }
.company-chip { max-width: 150px; }
.top-heading { min-width: 0; }
.p71-dashboard { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px 16px; align-items: start; }
.p71-primary, .p71-rail { display: contents; }
.p71-primary > * { grid-column: 1; min-width: 0; margin: 0; }
.p71-welcome { grid-row: 1; display: flex; align-items: center; justify-content: space-between; min-height: 72px; }
.p71-welcome h2 { margin: 0; font-size: clamp(26px, 2.6vw, 38px); letter-spacing: -.045em; line-height: 1.15; }
.p71-welcome p { margin: 3px 0; font-size: 20px; color: var(--ink-soft); }
.p71-welcome small { font-size: 11px; color: var(--muted); }
.p71-welcome .p71-mascot { width: 56px; height: 64px; flex-shrink: 0; opacity: .85; }
.p71-welcome .p71-mascot img { width: 100%; height: 100%; object-fit: contain; }
.p71-voice-stage { grid-row: 2; position: relative; min-height: 258px; isolation: isolate; border-radius: 24px; overflow: hidden; background: radial-gradient(ellipse at 50% 44%, #FFD70026, transparent 64%); }
.p71-ribbons { position: absolute; width: 100%; height: 210px; top: 8px; left: 0; z-index: -1; }
.p71-horizon { position: absolute; inset: auto -10% -145px; height: 220px; border-radius: 50%; border-top: 1px solid var(--a-gold); background: repeating-radial-gradient(ellipse at 50% 0%, transparent 0 25px, #C9A84C18 26px 27px, transparent 28px 40px); z-index: -1; opacity: .6; }
.p71-voice { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; width: 210px; margin: 20px auto 8px; text-align: center; }
.p71-voice .voice-orb { width: 144px; height: 144px; margin-bottom: 20px; }
/* !important acotado: neutraliza .mic !important del tema heredado. */
.p71-voice .mic { width: 116px; height: 116px; border: 3px double var(--a-gold) !important; color: #694A0B !important; background: radial-gradient(circle at 38% 28%, #FFFCEB, #FFE773 65%, #C9A84C) !important; box-shadow: 0 0 0 5px #FFFFFF55, 0 0 0 7px #C9A84C55, 0 0 35px #FFD70055; }
.p71-voice .mic .ui-icon { width: 48px; height: 48px; }
.p71-voice .voice-ring:nth-child(2) { inset: -15px; }
.p71-voice .voice-ring:nth-child(3) { inset: -30px; }
.p71-voice .voice-wave { position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); }
.p71-voice .voice-copy { max-width: 210px; }
.p71-voice .voice-hint { font-size: 11px; line-height: 1.35; margin-top: 4px; }
.p71-voice .link-button { font-size: 11px; min-height: 28px; padding: 0 6px; color: var(--ink-soft); }
.p71-orbit-actions { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 210px 1fr; grid-template-rows: repeat(3, 64px); align-items: center; padding: 12px 8%; gap: 6px; }
.p71-orbit-action { display: flex; align-items: center; gap: 10px; min-height: 48px; max-width: 180px; padding: 9px 14px; background: var(--surface); border: 1px solid var(--gold-line); border-radius: 32px; box-shadow: 0 4px 14px #C9A84C1A; text-align: left; font-size: 12px; color: var(--ink); cursor: pointer; }
.p71-orbit-action:hover, .p71-role:hover { border-color: var(--a-gold); box-shadow: 0 4px 18px #C9A84C33; }
.p71-orbit-action .ui-icon { flex-shrink: 0; color: var(--gold); }
.orbit-0, .orbit-2, .orbit-4 { grid-column: 1; justify-self: end; }
.orbit-1, .orbit-3, .orbit-5 { grid-column: 3; justify-self: start; }
.orbit-0, .orbit-1 { grid-row: 1; }
.orbit-2, .orbit-3 { grid-row: 2; }
.orbit-4, .orbit-5 { grid-row: 3; }
.p71-roles { grid-row: 3; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.p71-role { display: flex; align-items: center; gap: 12px; padding: 16px; min-height: 100px; color: var(--ink); background: var(--surface); border: 1px solid var(--gold-line); border-radius: 16px; box-shadow: 0 5px 15px #C9A84C1A; text-align: left; cursor: pointer; }
.p71-role-icon { color: var(--gold); background: var(--gold-soft); padding: 12px; border-radius: 14px; }
.p71-role-icon .ui-icon { width: 30px; height: 30px; }
.p71-role b { font-size: 16px; display: block; }
.p71-role small { color: var(--muted); font-size: 12px; display: block; line-height: 1.4; margin-top: 4px; }
.p71-role-arrow { margin-left: auto; padding: 3px; border: 1px solid var(--gold-line); border-radius: 50%; color: var(--gold); flex-shrink: 0; }
.p71-role-arrow .ui-icon { width: 18px; height: 18px; }
.p71-summary { grid-row: 4; }
.p71-mobile-summary { display: none; }
.p71-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.p71-kpi { display: grid; gap: 8px; padding: 16px; min-width: 0; background: linear-gradient(150deg, var(--surface) 65%, var(--gold-soft)); }
.p71-kpi > .ui-icon { color: var(--gold); }
.p71-kpi > span { font-size: 12px; color: var(--ink-soft); }
.p71-kpi > b { font-size: 24px; line-height: 1; }
.p71-kpi > small { font-size: 10px; color: var(--muted); }
.p71-bottom { grid-row: 5; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr); gap: 12px; }
.p71-dashboard .card { margin: 0; padding: 16px; border-radius: 16px; }
.p71-dashboard h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; }
.p71-dashboard h3 .ui-icon { width: 19px; height: 19px; flex-shrink: 0; }
.p71-dashboard .row-head { gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.p71-dashboard .link-button { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--ink-soft); }
.p71-dashboard .link-button .ui-icon { width: 14px; height: 14px; }
.p71-tasks .row { padding: 9px 0; border: 0; background: transparent; box-shadow: none; }
.p71-tasks .row h4 { font-size: 12px; }
.p71-tasks .row p { margin: 3px 0; font-size: 11px; color: var(--muted); }
.p71-tasks .row .btn { font-size: 11px; padding: 6px 8px; }
.p71-bars { display: flex; align-items: end; gap: 14px; min-height: 146px; padding: 10px 0; overflow-x: auto; }
.p71-bar { flex: 1; min-width: 50px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; }
.p71-bar i { display: block; width: 80%; min-height: 2px; background: linear-gradient(var(--a-yellow), var(--a-gold)); border-radius: 5px 5px 0 0; }
.p71-bar small { color: var(--muted); font-size: 9px; white-space: nowrap; }
.p71-agenda { grid-row: 6; }
.p71-compose { grid-row: 7; border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: var(--surface); }
.p71-compose summary, .p71-recent summary { cursor: pointer; font-size: 13px; color: var(--ink-soft); }
.p71-compose .composer { display: flex; flex-direction: row; margin-top: 12px; }
.p71-compose textarea { flex: 1; min-width: 0; width: 100%; background: var(--surface2); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 12px; resize: vertical; }
.p71-primary > .data-note { grid-row: 8; }
.p71-primary > .p71-services { grid-column: 2; grid-row: 1 / 3; }
.p71-legacy-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; }
.p71-service { display: flex; align-items: center; gap: 10px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.p71-service > .ui-icon { color: var(--muted); width: 18px; height: 18px; }
.p71-service b, .p71-service small { display: block; font-size: 12px; }
.p71-service small { color: var(--muted); font-size: 11px; margin-top: 3px; }
.p71-service small.measured { color: var(--ok); }
.p71-messages { grid-column: 2; grid-row: 3 / 5; }
.p71-message { display: flex; gap: 9px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.p71-message > div { min-width: 0; }
.p71-message-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; background: var(--surface3); color: var(--muted); }
.p71-message b { font-size: 12px; }
.p71-message p { margin: 3px 0; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p71-message time { font-size: 10px; color: var(--muted); }
.p71-quick { grid-column: 2; grid-row: 5; }
.p71-quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 14px; }
.p71-quick-grid button { display: flex; align-items: center; flex-direction: column; gap: 6px; min-height: 72px; padding: 9px 5px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 10px; cursor: pointer; }
.p71-quick-grid .ui-icon { color: var(--gold); }
.p71-recent { grid-column: 2; grid-row: 6 / 9; }
:root[data-theme="dark"] .p71-voice .mic { background: radial-gradient(circle at 38% 28%, #5D4B19, #16130C 75%) !important; color: #FFD700 !important; }
.p71-voice .mic[data-voice-state="error"] { border-color: var(--bad) !important; color: var(--bad) !important; }
.p71-message-search { display: grid; gap: 7px; margin-bottom: 12px; font-size: 12px; color: var(--ink-soft); }
.p71-message-search input { padding: 12px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface2); color: var(--ink); width: 100%; }
.p71-thread { align-items: center; }
.p71-thread[hidden] { display: none; }
.p71-thread .p7-row-main { flex: 1; }
.p71-thread p { overflow-wrap: anywhere; }
.p71-crm-overview { display: grid; gap: 16px; margin-bottom: 20px; }
.p71-crm-overview h2 { margin: 0; font-size: 28px; letter-spacing: -.03em; }
/* Fase 8: filas empresariales legibles en ambos temas, sin fondo blanco legacy. */
.enterprise-task-center .row, .enterprise-admin .row, .enterprise-crm .row { background: var(--surface2); color: var(--ink); border-color: var(--line); }
.crm-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 12px; align-items: end; margin: 14px 0; }
.enterprise-crm input, .enterprise-crm select, .enterprise-crm textarea, .enterprise-reports input { box-sizing: border-box; width: 100%; color: var(--ink); background: var(--surface2); border: 1px solid var(--line); padding: 9px; border-radius: 8px; }
.crm-pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.crm-card { padding: 12px; margin: 10px 0; border: 1px solid var(--line); border-radius: 10px; overflow-wrap: anywhere; }
.enterprise-values { margin: 8px 0; overflow-wrap: anywhere; }
.enterprise-values > div { padding: 7px 0; border-bottom: 1px solid var(--line); }
.enterprise-values dt { font-weight: 600; }
.enterprise-values dd { margin-inline-start: 12px; }
.enterprise-task-center form input { max-width: 150px; margin: 8px; }
.enterprise-task-center .enterprise-voice input { max-width: 100%; }
.p71-kpis > .card, .p71-bottom > .card { grid-column: auto !important; }
:root[data-theme="dark"] .p71-dashboard h3, :root[data-theme="dark"] .p71-dashboard .row h4 { color: var(--ink); }
.p71-dashboard .empty { background: var(--surface2); color: var(--muted); }
@media (min-width: 761px) {
  .p71-voice-stage .p71-voice { margin: 6px auto 0; gap: 6px; }
  .p71-voice-stage { min-height: 240px; }
  .p71-voice .voice-orb { margin-bottom: 14px; }
}
@media (max-width: 1400px) {
  .p71-dashboard { grid-template-columns: minmax(0, 1fr) 260px; }
  .p71-orbit-actions { padding-inline: 0; grid-template-columns: 1fr 180px 1fr; }
  .p71-role { padding: 12px; gap: 8px; }
  .p71-role-icon { padding: 6px; }
  .p71-role-arrow { display: none; }
  .p71-role b { font-size: 14px; }
}
@media (max-width: 1100px) {
  .top-actions .company-chip { display: none; }
  .topbar-kbd { display: none; }
  .p71-dashboard { grid-template-columns: minmax(0, 1fr) 230px; }
  .p71-bottom { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  :root[data-theme] .side { width: min(300px, 88vw); }
  .top.phase7-top .menu { display: inline-flex; }
  .top-actions .profile-chip { display: flex; }
}
@media (min-width: 761px) and (max-width: 1000px) {
  /* Anula el .card { grid-column:1!important } responsive heredado. */
  .p71-primary > .p71-services, .p71-rail > .card { grid-column: 2 !important; }
}
@media (max-width: 760px) {
  html[data-collapsed="true"] .app { display: block; }
  body { padding-bottom: 0; }
  .workspace { padding: 14px 12px 100px; }
  .top.phase7-top { flex-wrap: wrap; padding: 8px 12px; min-height: 68px; gap: 8px; }
  .top-heading { display: contents; }
  .top-heading .menu { display: inline-flex; order: 0; min-width: 40px; min-height: 40px; }
  .mobile-wordmark { display: flex; align-items: center; gap: 6px; order: 1; margin-right: auto; }
  .mobile-wordmark img { width: 30px; height: 30px; }
  .mobile-wordmark b { font-size: 13px; }
  .mobile-wordmark small { display: none; }
  .top-actions { order: 2; gap: 5px; margin-left: 0; }
  .top-actions .profile-chip { display: flex; max-width: 125px; gap: 5px; }
  .top-chip small { display: block; font-size: 9px; }
  .top-chip b { font-size: 11px; }
  .top-chip .chip-avatar { width: 25px; height: 25px; }
  #topSession { display: none; }
  .phase7-search { order: 3; width: 100%; flex: 0 0 100%; }
  #topSearch { display: flex; width: 100%; }
  #searchCommand { font-size: 13px; padding: 8px 0; }
  #topSearch .btn { min-height: 36px; padding: 6px; }
  .top-actions .top-icon-btn { width: 36px; height: 40px; border: 0; background: transparent; }
  .p71-dashboard { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
  .p71-primary, .p71-rail { display: contents; }
  .p71-dashboard > *, .p71-primary > *, .p71-rail > * { width: 100%; }
  .p71-welcome { order: 0; min-height: 64px; }
  .p71-welcome h2 { font-size: 28px; }
  .p71-welcome p { font-size: 17px; }
  .p71-welcome .p71-mascot { width: 42px; height: 48px; }
  .p71-voice-stage { order: 1; min-height: 280px; }
  .p71-voice { width: 160px; margin-top: 55px; }
  .p71-voice .voice-orb { width: 118px; height: 118px; }
  .p71-voice .mic { width: 96px; height: 96px; }
  .p71-voice .mic .ui-icon { width: 40px; height: 40px; }
  .p71-orbit-actions { grid-template-columns: 1fr 100px 1fr; grid-template-rows: 48px 100px 48px; padding: 6px 0; gap: 4px; }
  .p71-orbit-action { width: 100%; min-width: 0; min-height: 44px; padding: 7px 9px; gap: 5px; font-size: 11px; }
  .p71-orbit-action span { min-width: 0; overflow-wrap: anywhere; }
  .p71-orbit-action .ui-icon { width: 18px; height: 18px; }
  .orbit-0 { grid-column: 1 / 3; width: 44%; justify-self: start; }
  .orbit-1 { grid-column: 2 / 4; width: 44%; justify-self: end; }
  .orbit-2, .orbit-3 { grid-row: 3; }
  .orbit-4, .orbit-5 { display: none; }
  .p71-ribbons { top: 40px; height: 190px; }
  .p71-roles { order: 2; gap: 7px; }
  .p71-role { position: relative; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 14px 7px 32px; min-height: 146px; }
  .p71-role-icon { background: transparent; padding: 0; }
  .p71-role-icon .ui-icon { width: 30px; height: 30px; }
  .p71-role b { font-size: 13px; overflow-wrap: anywhere; }
  .p71-role small { font-size: 11px; }
  .p71-role-arrow { display: block; position: absolute; right: 8px; bottom: 8px; }
  .p71-summary { order: 3; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
  .p71-mobile-summary { display: flex; justify-content: space-between; gap: 6px; margin-bottom: 12px; }
  .p71-mobile-summary h3 { font-size: 14px; }
  .p71-mobile-summary span { font-size: 10px; color: var(--muted); }
  .p71-kpis { gap: 5px; }
  .p71-dashboard .p71-kpi { padding: 9px 4px; gap: 7px; border-radius: 10px; box-shadow: none; }
  .p71-kpi > span { font-size: 10px; min-height: 26px; }
  .p71-kpi > b { font-size: 22px; }
  .p71-kpi > small { font-size: 9px; }
  .p71-bottom { order: 4; display: contents; }
  .p71-tasks { order: 4; }
  .p71-services { order: 5; }
  .p71-service-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .p71-service { display: flex; flex-direction: column; align-items: flex-start; padding: 9px 5px; border: 1px solid var(--line); border-radius: 10px; }
  .p71-service b { font-size: 10px; min-height: 28px; }
  .p71-service small { font-size: 9px; overflow-wrap: anywhere; }
  .p71-messages { order: 6; }
  .p71-chart { order: 7; }
  .p71-quick { order: 8; }
  .p71-agenda { order: 9; }
  .p71-compose { order: 10; }
  .p71-recent { order: 11; }
  .p71-primary > .data-note { order: 12; }
  .reference-mobile-nav { display: grid; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: minmax(0, 1fr); position: fixed; inset: auto 0 0; z-index: 25; padding: 8px 8px max(12px, env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; }
  .reference-mobile-nav button { display: flex; align-items: center; flex-direction: column; justify-content: center; min-height: 48px; border: 0; background: transparent; }
  .reference-mobile-nav button.voice-tab .ui-icon { width: 58px; height: 58px; margin-top: -24px; color: #000000; box-shadow: 0 0 16px #FFD70066; }
  .reference-mobile-nav button.voice-tab > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .reference-mobile-nav .notification-dot { right: 15%; top: 0; }
}
@media (max-width: 360px) {
  .mobile-wordmark span { display: none; }
  .top-actions .profile-chip .chip-avatar { display: none; }
  .p71-role b { font-size: 11px; }
  .p71-role small { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { .p71-dashboard *, .p71-dashboard *::before { animation: none !important; transition: none !important; } }
@media (forced-colors: active) {
  .p71-role, .p71-orbit-action, .p71-service { border: 1px solid CanvasText; }
  .p71-bar i { background: CanvasText; }
  .p71-ribbons, .p71-horizon { display: none; }
}
