/* ═══ Portal Operativo PILAY · sistema visual (pilay-design) ═══ */

:root {
  --bg: #F1F2F4;
  --surface: #FFFFFF;
  --surface-2: #EAECEF;
  --surface-3: #F7F8F9;
  --border: #E2E5E9;
  --border-input: #D6DAE0;
  --border-strong: #CDD2D9;
  --row-sep: #EDEFF2;
  --text: #1F2733;
  --text-2: #5F6978;
  --text-3: #3D4756;
  --navy: #13233F;
  --primary: #1F56E0;
  --primary-hover: #163F9F;
  --blue-50: #E7EEFC;
  --blue-200: #C9D7F7;
  --blue-ink: #1A3E9E;
  --focus: #DCE6FC;
  --success: #1E8A5A;
  --green-50: #E6F4EC;
  --green-ink: #17603F;
  --danger: #B42318;
  --edit-bg: #E9EBEE;
  --edit-border: #DADEE3;
  --neutral-soft: #E6E8EC;
  --neutral-ink: #3D4756;
  --hero-shape: #E2E5EA;
  --hero-shape-2: #E9EBEE;
  --overlay: rgba(19, 35, 63, .32);

  --shadow-rest: 0 1px 2px rgba(19, 35, 63, .04);
  --shadow-hover: 0 4px 14px rgba(19, 35, 63, .07);
  --shadow-modal: 0 24px 60px rgba(19, 35, 63, .14);
  --shadow-search: 0 1px 2px rgba(19, 35, 63, .04), 0 10px 30px rgba(19, 35, 63, .07);

  --page-max: 1680px;
  --gutter: clamp(16px, 3vw, 48px);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;

  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #14181F;
  --surface: #1B2029;
  --surface-2: #232934;
  --surface-3: #181D25;
  --border: #2A313C;
  --border-input: #343C49;
  --border-strong: #3A4250;
  --row-sep: #242A34;
  --text: #E8ECF2;
  --text-2: #9AA4B2;
  --text-3: #C3CAD5;
  --navy: #F1F4F9;
  --primary: #5B8CFF;
  --primary-hover: #84A8FF;
  --blue-50: #1E2A44;
  --blue-200: #2E4170;
  --blue-ink: #A9C1FF;
  --focus: #26365C;
  --success: #3FB57F;
  --green-50: #17322A;
  --green-ink: #8FDAB5;
  --danger: #F2877E;
  --edit-bg: #1E242E;
  --edit-border: #2A313C;
  --neutral-soft: #262C36;
  --neutral-ink: #C3CAD5;
  --hero-shape: #222833;
  --hero-shape-2: #1D222B;
  --overlay: rgba(5, 8, 14, .6);

  --shadow-rest: 0 1px 2px rgba(0, 0, 0, .25);
  --shadow-hover: 0 6px 18px rgba(0, 0, 0, .35);
  --shadow-modal: 0 24px 60px rgba(0, 0, 0, .5);
  --shadow-search: 0 1px 2px rgba(0, 0, 0, .25), 0 10px 30px rgba(0, 0, 0, .3);

  color-scheme: dark;
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 22px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }
img { display: block; max-width: 100%; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
kbd {
  font-family: var(--mono); font-size: 11px; line-height: 18px;
  padding: 0 6px; border-radius: 6px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
  white-space: nowrap;
}
code { font-family: var(--mono); font-size: 12px; }
[hidden] { display: none !important; }

:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); border-radius: 10px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 200;
  background: var(--surface); padding: 8px 14px; border-radius: 10px; box-shadow: var(--shadow-hover);
}
.skip-link:focus { top: 12px; }

.logo-on-dark { display: none; }
[data-theme="dark"] .logo-on-light { display: none; }
[data-theme="dark"] .logo-on-dark { display: block; }

/* ── Botones ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px;
  font-size: 14px; font-weight: 500; line-height: 1; text-decoration: none; white-space: nowrap;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn svg { width: 16px; height: 16px; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 48px; padding: 0 20px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); color: #fff; }
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .bento .app-card:first-child .app-open { color: #0B1530; }
.btn-secondary { background: var(--surface); border-color: var(--border-input); color: var(--text-3); }
.btn-secondary:hover { background: var(--bg); border-color: var(--border-strong); }
.btn-ghost { color: var(--text-3); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { color: var(--danger); padding-left: 8px; padding-right: 8px; }
.btn-danger:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: default; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px; color: var(--text-2);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ── Header ── */
.app-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.app-header-inner {
  max-width: var(--page-max); margin: 0 auto; height: 64px; padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy); }
.brand-logo { height: 24px; width: auto; }
.brand-divider { width: 1px; height: 24px; background: var(--border-strong); }
.brand-name { font-size: 15px; font-weight: 600; white-space: nowrap; }

.header-search {
  margin-left: auto;
  display: flex; align-items: center; gap: 10px;
  width: 300px; height: 38px; padding: 0 8px 0 12px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text-2); font-size: 13px; text-align: left;
  transition: border-color .15s, background .15s;
}
.header-search:hover { border-color: var(--border-strong); }
.header-search-label { flex: 1; }
.header-search svg { width: 16px; height: 16px; }

.header-actions { display: flex; align-items: center; gap: 6px; }
#theme-toggle .icon-sun { display: none; }
[data-theme="dark"] #theme-toggle .icon-sun { display: block; }
[data-theme="dark"] #theme-toggle .icon-moon { display: none; }

.user-menu { position: relative; }
.avatar-btn { border-radius: 999px; padding: 2px; }
.avatar-btn:hover .avatar { box-shadow: 0 0 0 3px var(--focus); }
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 999px;
  background: var(--neutral-soft); color: var(--neutral-ink);
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
  transition: box-shadow .15s;
}
.avatar-lg { width: 40px; height: 40px; font-size: 13px; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50;
  width: 260px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-modal);
  animation: pop .14s ease-out;
}
.menu-head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-head-text { display: flex; flex-direction: column; min-width: 0; }
.menu-head-text strong { font-size: 14px; font-weight: 600; color: var(--navy); }
.menu-head-text span { font-size: 12px; line-height: 18px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  height: 40px; padding: 0 10px; border-radius: 8px;
  font-size: 14px; color: var(--text-3); text-decoration: none; text-align: left;
}
.menu-item:hover { background: var(--bg); color: var(--text); }
.menu-item[aria-pressed="true"], .menu-item[aria-current="page"] { background: var(--surface-2); color: var(--text); font-weight: 500; }

/* ── Barra de modo edición ── */
.edit-bar { background: var(--edit-bg); border-bottom: 1px solid var(--edit-border); }
.edit-bar-inner {
  max-width: var(--page-max); margin: 0 auto; padding: 10px var(--gutter);
  display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap;
}
.edit-bar-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--navy); }
.edit-bar-hint { font-size: 13px; color: var(--text-2); flex: 1 1 240px; }
.edit-bar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Página ── */
.page { width: 100%; max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter) 56px; flex: 1; }

/* ── Hero ── */
.hero {
  position: relative; isolation: isolate;
  padding: 56px 0 40px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.hero-art {
  position: absolute; z-index: -1; inset: 24px 0 0;
  display: flex; align-items: flex-end; justify-content: space-between;
  pointer-events: none;
}
.hero-art span {
  display: block; width: 46px; border-radius: 999px; background: var(--hero-shape);
  animation: rise .9s cubic-bezier(.2, .8, .2, 1) both;
}
.hero-art span:nth-child(1) { height: 190px; margin-left: 2%; }
.hero-art span:nth-child(2) { height: 110px; margin-right: auto; margin-left: 18px; background: var(--hero-shape-2); animation-delay: .08s; }
.hero-art span:nth-child(3) { height: 140px; background: var(--hero-shape-2); animation-delay: .16s; }
.hero-art span:nth-child(4) { height: 230px; margin-left: 18px; margin-right: 2%; animation-delay: .24s; }
@keyframes rise { from { transform: scaleY(.2); transform-origin: bottom; opacity: 0; } to { transform: scaleY(1); transform-origin: bottom; opacity: 1; } }

.hero-greeting { font-size: 15px; font-weight: 500; color: var(--text-2); margin-bottom: 8px; }
.hero-title {
  font-size: 44px; line-height: 52px; font-weight: 600; letter-spacing: -.025em; color: var(--navy);
  margin-bottom: 28px; max-width: 760px;
}
.hero-search {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  width: 100%; max-width: 640px; height: 56px; padding: 0 12px 0 20px;
  background: var(--surface); border: 1px solid var(--border-input); border-radius: 16px;
  box-shadow: var(--shadow-search);
  transition: border-color .15s, box-shadow .15s;
}
.hero-search:focus-within { border-color: var(--primary); box-shadow: var(--shadow-search), 0 0 0 3px var(--focus); }
.hero-search > svg { width: 20px; height: 20px; color: var(--text-2); }
.hero-search input {
  flex: 1; min-width: 0; height: 100%; border: none; outline: none; background: transparent;
  font-size: 16px;
}
.hero-search input:focus-visible, .palette-input:focus-visible { box-shadow: none; }
.hero-search input::placeholder { color: var(--text-2); opacity: 1; }
.hero-search input::-webkit-search-cancel-button { cursor: pointer; }
.hero-search kbd { background: var(--bg); }
.hero-try { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.hero-try-label { font-size: 13px; color: var(--text-2); }

/* ── Chips ── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 13px; font-weight: 500; color: var(--text-3); white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: var(--border-strong); background: var(--surface-3); }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--surface); }
.chip-count { font-size: 12px; color: var(--text-2); }
.chip[aria-pressed="true"] .chip-count { color: inherit; opacity: .7; }
.chip-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--cat, var(--text-2)); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.chip[aria-pressed="true"] .chip-dot { box-shadow: 0 0 0 2px var(--surface); }

/* Punto de color por categoría (único uso de colores propios de área) */
.cat-1 { --cat: #1F56E0; }
.cat-2 { --cat: #1E8A5A; }
.cat-3 { --cat: #6B7FA8; }
.cat-4 { --cat: #2F8FB3; }
.cat-5 { --cat: #13233F; }
.cat-6 { --cat: #8A94A6; }
[data-theme="dark"] .cat-5 { --cat: #C3CAD5; }

/* ── Secciones ── */
.section { margin-top: 40px; scroll-margin-top: 80px; }
.section:focus { outline: none; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.section-head h2 { font-size: 18px; line-height: 24px; font-weight: 600; color: var(--navy); display: flex; align-items: center; gap: 8px; }
.section-sub { font-size: 13px; line-height: 18px; color: var(--text-2); margin-top: 2px; }
.count-pill {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 500;
}

/* ── Segmentado ── */
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: 10px; }
.segmented button {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--text-2);
}
.segmented button svg { width: 16px; height: 16px; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(19, 35, 63, .08); }

/* ── Tarjeta de app ── */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.app-card {
  position: relative;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-rest);
  transition: transform .18s, box-shadow .18s, border-color .18s;
  animation: cardIn .35s ease-out both;
  animation-delay: calc(var(--i, 0) * 30ms);
}
.app-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: var(--border-strong); }
.app-card:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); }
@keyframes cardIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

.app-card-link {
  display: flex; flex-direction: column; gap: 14px; height: 100%;
  padding: 20px; color: inherit; text-decoration: none; border-radius: 16px;
}
.app-card-link:focus-visible { box-shadow: none; }
.app-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-right: 36px; }
.app-logo {
  flex-shrink: 0; width: 48px; height: 48px; border-radius: 12px; padding: 7px;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.app-logo img { width: 100%; height: 100%; object-fit: contain; }
[data-theme="dark"] .app-logo { background: #F4F6F9; border-color: transparent; }
.app-monogram {
  background: var(--neutral-soft); border-color: transparent; color: var(--neutral-ink);
  font-size: 16px; font-weight: 600; letter-spacing: .02em;
}
[data-theme="dark"] .app-monogram { background: var(--neutral-soft); }
.app-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.app-title { font-size: 16px; line-height: 22px; font-weight: 600; color: var(--navy); display: flex; align-items: center; gap: 6px; }
.app-title .app-ext { width: 15px; height: 15px; color: var(--text-2); opacity: 0; transform: translate(-3px, 3px); transition: opacity .15s, transform .15s; }
.app-card:hover .app-ext, .app-card-link:focus-visible .app-ext { opacity: 1; transform: none; color: var(--primary); }
.app-desc {
  font-size: 13px; line-height: 20px; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.app-meta { display: flex; align-items: center; gap: 8px; margin-top: auto; min-width: 0; }
.app-host {
  font-family: var(--mono); font-size: 12px; line-height: 18px; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.app-cat {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; line-height: 18px; color: var(--text-2); white-space: nowrap;
}
.app-cat::before { content: ''; width: 6px; height: 6px; border-radius: 999px; background: var(--cat, var(--text-2)); }
.app-meta .sep { width: 3px; height: 3px; border-radius: 999px; background: var(--border-strong); }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap;
}
.pill-neutral { background: var(--surface-2); color: var(--text-2); }
.pill-blue { background: var(--blue-50); color: var(--blue-ink); }
.pill-green { background: var(--green-50); color: var(--green-ink); }

.card-actions { position: absolute; top: 14px; right: 14px; display: flex; gap: 4px; z-index: 2; }
.card-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 9px; color: var(--text-2);
  background: var(--surface); transition: background .15s, color .15s, opacity .15s;
}
.card-btn svg { width: 16px; height: 16px; }
.card-btn:hover { background: var(--surface-2); color: var(--text); }
.pin-btn { opacity: 0; }
.app-card:hover .pin-btn, .pin-btn:focus-visible, .pin-btn[aria-pressed="true"] { opacity: 1; }
/* "Conocé la app": siempre a la vista */
.know-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px 0 10px; border-radius: 999px;
  background: var(--blue-50); color: var(--blue-ink); border: 1px solid var(--blue-200);
  font-size: 13px; font-weight: 500; white-space: nowrap; transition: background .15s, border-color .15s;
}
.know-btn svg { width: 16px; height: 16px; }
.know-btn:hover { background: var(--surface); border-color: var(--primary); color: var(--primary); }
.app-host.is-links { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font); }
.app-host.is-links svg { width: 13px; height: 13px; flex-shrink: 0; }
.pin-btn[aria-pressed="true"] { color: var(--primary); }
.pin-btn[aria-pressed="true"] svg { fill: var(--blue-50); }
@media (hover: none) { .pin-btn { opacity: 1; } }

/* Apps internas sin acceso: se conocen, no se abren */
.app-lock { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; line-height: 18px; color: var(--text-2); white-space: nowrap; }
.app-lock svg { width: 13px; height: 13px; flex-shrink: 0; }
.app-card.is-locked .app-title .app-ext { opacity: 1; transform: none; color: var(--text-2); }
.app-card.is-locked:hover .app-ext { color: var(--text-2); }

/* Grupos de "Todas las apps" */
.apps-group + .apps-group { margin-top: 32px; }
.apps-group-head { margin-bottom: 14px; }
.apps-group-head h3 {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; line-height: 22px; font-weight: 600; color: var(--navy);
}
.apps-group-head h3 svg { width: 16px; height: 16px; color: var(--text-2); }
.apps-group-head p { font-size: 13px; line-height: 18px; color: var(--text-2); margin-top: 2px; }
.apps-group-interna {
  padding: 20px; border-radius: 20px; background: var(--surface-3); border: 1px solid var(--border);
}
@media (max-width: 760px) { .apps-group-interna { padding: 12px; border-radius: 16px; } }

/* Inactiva (solo visible en edición) */
.app-card.is-inactive { background: var(--surface-3); }
.app-card.is-inactive .app-logo, .app-card.is-inactive .app-body { opacity: .6; }

/* Edición: arrastrar */
.is-editing .app-card { cursor: grab; }
.is-editing .app-card-link { cursor: inherit; }
.app-card.is-dragging { opacity: .4; }
.app-card.drop-before { box-shadow: -4px 0 0 0 var(--primary), var(--shadow-hover); }
.app-card.drop-after { box-shadow: 4px 0 0 0 var(--primary), var(--shadow-hover); }
.drag-handle { color: var(--text-2); cursor: grab; }

/* ── Bento de fijadas ── */
.bento { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); grid-auto-flow: dense; gap: 16px; }
.bento .app-card:first-child { grid-column: span 2; }
.bento .app-card:first-child .app-card-link { padding: 22px; gap: 14px; justify-content: space-between; }
.bento .app-card:first-child .app-logo { width: 56px; height: 56px; padding: 8px; border-radius: 14px; }
.bento .app-card:first-child .app-title { font-size: 20px; line-height: 28px; letter-spacing: -.01em; }
.bento .app-card:first-child .app-desc { font-size: 14px; line-height: 21px; -webkit-line-clamp: 3; max-width: 52ch; }
.bento .app-card:first-child .app-open {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  height: 40px; padding: 0 16px; border-radius: 10px; background: var(--primary); color: #fff; font-weight: 500;
}
.app-open { display: none; }
.bento .app-card:first-child .app-open svg { width: 16px; height: 16px; }
.bento .app-card:first-child:hover .app-open { background: var(--primary-hover); }

/* ── Vista lista ── */
.app-list {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-rest); overflow: hidden;
}
.app-list .app-card {
  border: none; border-radius: 0; box-shadow: none; animation: none; background: transparent;
  border-bottom: 1px solid var(--row-sep);
}
.app-list .app-card:last-child { border-bottom: none; }
.app-list .app-card:hover { transform: none; background: var(--bg); box-shadow: none; }
.app-list .app-card:focus-within { box-shadow: inset 0 0 0 2px var(--focus); }
.app-list .app-card-link { flex-direction: row; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 0; }
.app-list .app-card-top { padding-right: 0; }
.app-list .app-logo { width: 40px; height: 40px; padding: 6px; border-radius: 10px; }
.app-list .app-body { flex-direction: row; align-items: center; gap: 16px; }
.app-list .app-title { font-size: 14px; font-weight: 500; flex: 0 0 220px; min-width: 0; }
.app-list .app-desc { -webkit-line-clamp: 1; flex: 1; }
.app-list .app-meta { margin: 0; flex: 0 0 auto; padding-right: 196px; }
.app-list .app-lock { display: none; }
.app-list .app-cat { display: none; }
.app-list .app-meta .sep { display: none; }
.app-list .card-actions { top: 50%; transform: translateY(-50%); right: 12px; }
.app-list .card-btn { background: transparent; }

/* ── Estados vacíos ── */
.empty {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 24px; border: 1px dashed var(--border-strong); border-radius: 16px;
  color: var(--text-2); background: transparent;
}
.empty-icon {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--text-2);
}
.empty strong { display: block; color: var(--text); font-weight: 600; }
.empty-center { flex-direction: column; text-align: center; padding: 40px 24px; }

/* ── Conocé la app ── */
.info-video { margin: 0 0 20px; }
.info-video video {
  display: block; width: 100%; aspect-ratio: 16 / 10; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.info-video figcaption { font-size: 12px; line-height: 18px; color: var(--text-2); margin-top: 6px; }
.info-head { display: flex; gap: 16px; align-items: flex-start; }
.info-head .app-logo { width: 56px; height: 56px; padding: 8px; border-radius: 14px; flex-shrink: 0; }
.info-desc { color: var(--text); font-size: 15px; line-height: 22px; margin-bottom: 10px; }
.info-cta {
  display: flex; gap: 14px; align-items: flex-start; margin-top: 20px;
  padding: 16px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border);
}
.info-cta-icon {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--blue-50); color: var(--blue-ink);
}
.info-cta-icon svg { width: 18px; height: 18px; }
.info-cta strong { display: block; color: var(--text); font-weight: 600; }
.info-cta p { font-size: 13px; line-height: 18px; color: var(--text-2); margin: 2px 0 10px; }

.apps-hint {
  display: flex; align-items: flex-start; gap: 8px; margin: -4px 0 16px;
  font-size: 13px; line-height: 20px; color: var(--text-2);
}
.apps-hint svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; color: var(--primary); }
.apps-hint strong { color: var(--text); font-weight: 500; }
.info-cta a { color: var(--primary); }

/* ── Personas con acceso (admin) ── */
.field-btn { align-self: flex-start; margin-top: 4px; }
.acc-loading, .acc-empty { color: var(--text-2); font-size: 14px; padding: 8px 0; }
.acc-status {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px;
  background: var(--bg); border: 1px solid var(--border);
}
.acc-status.is-closed { background: var(--blue-50); border-color: var(--blue-200); }
.acc-status > svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; color: var(--text-2); }
.acc-status.is-closed > svg { color: var(--blue-ink); }
.acc-status strong { display: block; color: var(--text); font-weight: 600; }
.acc-status p { font-size: 13px; line-height: 18px; color: var(--text-2); margin: 2px 0 0; }
.acc-status .btn { margin-top: 10px; }
.acc-add { margin-top: 20px; display: flex; flex-direction: column; gap: 6px; }
.acc-add-row { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.acc-add-row .textarea { flex: 1 1 280px; min-height: 44px; }
.acc-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.acc-list-head strong { color: var(--text); font-weight: 600; font-size: 14px; }
.acc-filter { max-width: 240px; height: 34px; }
.acc-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; }
.acc-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--row-sep); flex-wrap: wrap; }
.acc-row:last-child { border-bottom: none; }
.acc-email { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; font-size: 14px; color: var(--text); }
.acc-note { font-size: 12px; color: var(--text-2); }
.acc-token { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.acc-token strong { display: block; color: var(--text); font-weight: 600; font-size: 14px; }
.acc-token p { font-size: 13px; line-height: 18px; color: var(--text-2); margin: 2px 0 10px; }
.acc-token-box { display: flex; gap: 8px; }
.acc-token-box .input { flex: 1; font-family: var(--mono); font-size: 12px; }
.acc-warn { color: var(--text) !important; margin-top: 6px !important; }

/* ── Elegir sede (apps con varias direcciones) ── */
.link-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.link-choice {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--border); color: inherit; text-decoration: none; transition: background .15s, border-color .15s;
}
.link-choice:hover { background: var(--bg); border-color: var(--border-strong); }
.link-choice-icon {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; background: var(--blue-50); color: var(--blue-ink);
}
.link-choice-icon svg { width: 18px; height: 18px; }
.link-choice-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.link-choice-text strong { font-weight: 500; color: var(--text); }
.link-choice-text span { font-family: var(--mono); font-size: 12px; line-height: 18px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-choice .chev { width: 16px; height: 16px; color: var(--text-2); }

/* ── Papelera ── */
.trash-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.trash-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.trash-row:last-child { border-bottom: none; }
.trash-row .app-logo { width: 40px; height: 40px; padding: 6px; border-radius: 10px; flex-shrink: 0; }
.trash-row .app-monogram { font-size: 14px; }
.trash-info { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; }
.trash-info strong { color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
.trash-info span { font-size: 13px; line-height: 18px; color: var(--text-2); }
.trash-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Footer ── */
.page-footer {
  text-align: center; font-size: 12px; line-height: 18px; color: var(--text-2);
  padding: 24px 16px 32px;
}

/* ── Formularios ── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field-label { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--text-3); }
.field-hint { font-size: 12px; line-height: 18px; color: var(--text-2); }
.field-error { font-size: 12px; line-height: 18px; color: var(--danger); }
.input, .textarea {
  width: 100%; height: 40px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--border-input); border-radius: 10px;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 20px; }
.input:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1; min-width: 0; }
/* Editor: una o varias direcciones (una por plaza/sede) */
.links-edit { display: flex; flex-direction: column; gap: 8px; }
.link-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto auto; gap: 6px; align-items: center; }
.links-edit.is-single .link-row { grid-template-columns: minmax(0, 1fr) auto; }
.links-edit.is-single .link-name, .links-edit.is-single [data-link-del] { display: none; }
.links-add { align-self: flex-start; margin-top: 4px; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--text-3); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--border-strong);
  transition: background .15s; flex-shrink: 0;
}
.switch-track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 999px;
  background: #fff; box-shadow: 0 1px 2px rgba(19, 35, 63, .2); transition: transform .15s;
}
.switch input:checked + .switch-track { background: var(--success); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px var(--focus); }

.logo-field { display: flex; align-items: center; gap: 14px; }
.logo-field .app-logo { width: 64px; height: 64px; padding: 9px; border-radius: 16px; }
.logo-field-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: var(--overlay);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: fade .15s ease-out;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 480px; max-height: calc(100vh - 32px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-modal);
  animation: pop .18s ease-out;
}
.modal-sm { max-width: 420px; }
.modal-lg { max-width: 720px; }
.modal-head { display: flex; align-items: flex-start; gap: 14px; padding: 20px 20px 4px 24px; }
.modal-icon {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--text-3);
}
.modal-icon.is-danger { background: var(--surface-2); color: var(--danger); }
.modal-icon.is-success { background: var(--green-50); color: var(--green-ink); }
.modal-titles { flex: 1; min-width: 0; padding-top: 2px; }
.modal-title { font-size: 18px; line-height: 24px; font-weight: 600; color: var(--navy); }
.modal-subtitle { font-size: 13px; line-height: 18px; color: var(--text-2); margin-top: 2px; }
.modal-body { padding: 18px 24px 22px; overflow-y: auto; color: var(--text-3); }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
  padding: 14px 24px; background: var(--surface-3); border-top: 1px solid var(--border);
}
.modal-success { text-align: center; }
.modal-success .modal-body { padding-top: 28px; }
.success-check {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  background: var(--success); color: #fff;
}
.success-check svg { width: 26px; height: 26px; stroke-width: 2.25; }
.modal-success .modal-title { margin-bottom: 6px; }

/* ── Paleta de comandos (Ctrl K) ── */
.palette-overlay { align-items: flex-start; padding-top: 12vh; }
.palette { max-width: 620px; }
.palette-input-wrap { display: flex; align-items: center; gap: 12px; padding: 0 18px; height: 60px; border-bottom: 1px solid var(--border); }
.palette-input-wrap svg { width: 20px; height: 20px; color: var(--text-2); }
.palette-input { flex: 1; min-width: 0; height: 100%; border: none; outline: none; background: transparent; font-size: 16px; }
.palette-list { list-style: none; max-height: 380px; overflow-y: auto; padding: 8px; }
.palette-item a {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px;
  color: var(--text); text-decoration: none;
}
.palette-item .app-logo { width: 36px; height: 36px; padding: 5px; border-radius: 10px; }
.palette-item .app-monogram { font-size: 13px; }
.palette-item-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.palette-item-text strong { font-weight: 500; }
.palette-item-text span { font-size: 12px; line-height: 18px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-item .chev { color: var(--text-2); opacity: 0; }
.palette-item[aria-selected="true"] a { background: var(--surface-2); }
.palette-item[aria-selected="true"] .chev { opacity: 1; color: var(--text); }
.palette-empty { padding: 28px 16px; text-align: center; color: var(--text-2); }
.palette-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--border); background: var(--surface-3); font-size: 12px; color: var(--text-2); }
.palette-foot span { display: inline-flex; align-items: center; gap: 6px; }

/* ── Panel lateral de edición ── */
.side-overlay { position: fixed; inset: 0; z-index: 90; background: var(--overlay); animation: fade .15s ease-out; }
.side-panel {
  position: fixed; z-index: 95; top: 0; right: 0; bottom: 0;
  width: 420px; max-width: 100%;
  display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-modal);
  animation: slideIn .2s cubic-bezier(.2, .8, .2, 1);
}
@keyframes slideIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.side-head { display: flex; align-items: center; gap: 12px; padding: 18px 16px 14px 24px; border-bottom: 1px solid var(--border); }
.side-head h2 { flex: 1; font-size: 18px; line-height: 24px; font-weight: 600; color: var(--navy); }
.side-body { flex: 1; overflow-y: auto; padding: 22px 24px; }
.side-foot { display: flex; align-items: center; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--border); background: var(--surface-3); }
.side-foot .spacer { flex: 1; }
.sheet-handle { display: none; }

/* ── Tabla ── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 12px; line-height: 18px; font-weight: 500; color: var(--text-2);
  background: var(--surface-3); padding: 10px 16px; border-bottom: 1px solid var(--border);
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--row-sep); vertical-align: middle; color: var(--text); }
.table tr:last-child td { border-bottom: none; }
.table .muted { color: var(--text-2); font-size: 13px; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell .avatar { width: 30px; height: 30px; font-size: 11px; }
.segmented-sm button { height: 26px; padding: 0 10px; font-size: 12px; }
.save-status { font-size: 12px; color: var(--text-2); min-height: 18px; }

/* ── Pestañas "Todas las apps | Próximamente" ── */
.section-head.has-tabs { align-items: flex-end; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.section-head.has-tabs .segmented { margin-bottom: 7px; }
.tabs { display: flex; gap: 24px; margin-bottom: -1px; overflow-x: auto; scrollbar-width: none; }
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 2px; border-bottom: 2px solid transparent;
  font-size: 15px; font-weight: 500; color: var(--text-2); white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--navy); font-weight: 600; border-bottom-color: var(--primary); }
.tab:focus-visible { border-radius: 8px 8px 0 0; }
.soon-intro { font-size: 13px; line-height: 18px; color: var(--text-2); margin-bottom: 16px; }

/* ── Próximamente: proyectos en curso ── */
.soon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.soon-card {
  display: flex; flex-direction: column; gap: 16px; padding: 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-rest);
  animation: cardIn .35s ease-out both;
}
.soon-top { display: flex; align-items: flex-start; gap: 14px; }
.soon-top .card-btn { margin: -6px -6px 0 auto; }
.soon-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.soon-title { font-size: 16px; line-height: 22px; font-weight: 600; color: var(--navy); }
.soon-desc {
  font-size: 13px; line-height: 20px; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.soon-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.soon-meta .pill svg { width: 13px; height: 13px; }
.soon-warn { font-size: 12px; line-height: 18px; color: var(--text-2); }

/* Barra de avance: solo lectura (todos) o deslizable (admin) */
.progress { display: flex; flex-direction: column; gap: 8px; --pct: 0%; --fill: var(--primary); }
.progress.is-done { --fill: var(--success); }
.progress-head { display: flex; align-items: baseline; justify-content: space-between; font-size: 13px; line-height: 18px; color: var(--text-2); }
.progress-value { font-size: 22px; line-height: 28px; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.progress-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: var(--pct); border-radius: 999px; background: var(--fill); transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.progress-status { min-height: 18px; font-size: 12px; line-height: 18px; color: var(--text-2); }

.progress-range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 24px; margin: 0; background: transparent; cursor: pointer;
}
.progress-range:focus-visible { box-shadow: none; }
.progress-range::-webkit-slider-runnable-track {
  height: 8px; border-radius: 999px;
  background: linear-gradient(to right, var(--fill) var(--pct), var(--surface-2) var(--pct));
}
.progress-range::-moz-range-track { height: 8px; border-radius: 999px; background: var(--surface-2); }
.progress-range::-moz-range-progress { height: 8px; border-radius: 999px; background: var(--fill); }
.progress-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; margin-top: -6px; border-radius: 999px;
  background: var(--surface); border: 2px solid var(--fill); box-shadow: var(--shadow-hover);
  transition: box-shadow .15s;
}
.progress-range::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 999px;
  background: var(--surface); border: 2px solid var(--fill); box-shadow: var(--shadow-hover);
}
.progress-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--focus); }
.progress-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--focus); }

/* App recién pasada desde Próximamente */
.app-card.is-new { border-color: var(--success); box-shadow: 0 0 0 3px var(--green-50), var(--shadow-hover); }

/* ═══ Responsive ═══ */
@media (min-width: 1440px) {
  .app-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
  .soon-grid { gap: 20px; }
}

@media (max-width: 960px) {
  .header-search { width: auto; }
  .header-search-label, .header-search kbd { display: none; }
  .hero-title { font-size: 36px; line-height: 44px; }
  .app-list .app-title { flex-basis: 160px; }
  .app-list .app-host { display: none; }
}

@media (max-width: 760px) {
  .app-header-inner, .edit-bar-inner { padding-left: 16px; padding-right: 16px; }
  .page { padding: 0 16px 40px; }
  .brand-divider, .brand-name { display: none; }
  .header-search { width: 44px; height: 44px; justify-content: center; padding: 0; background: transparent; border: none; }
  .header-search svg { width: 20px; height: 20px; }
  .icon-btn { width: 44px; height: 44px; }

  .hero { padding: 36px 0 24px; }
  .hero-art { display: none; }
  .hero-title { font-size: 30px; line-height: 38px; margin-bottom: 20px; }
  .hero-search kbd { display: none; }
  .hero-try { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; width: 100%; padding-bottom: 4px; }

  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 16px; padding: 0 16px 4px; scrollbar-width: none; }
  .chip { height: 36px; }

  .section { margin-top: 32px; }
  .segmented span { display: none; }
  .segmented button { height: 36px; padding: 0 12px; }

  .app-grid { grid-template-columns: 1fr; gap: 12px; }
  .app-card-link { flex-direction: row; align-items: center; padding: 14px 16px; }
  .app-card-top { padding-right: 0; }
  .app-logo { width: 44px; height: 44px; }
  .app-card .app-desc { -webkit-line-clamp: 2; }
  .app-meta { display: none; }
  .app-body { padding-right: 92px; }
  .card-actions { top: 50%; right: 10px; transform: translateY(-50%); }
  .card-btn { width: 44px; height: 44px; }
  .know-btn { width: 44px; height: 44px; padding: 0; justify-content: center; }
  .know-btn span { display: none; }
  .link-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .link-row .link-name { grid-column: 1 / -1; }
  .know-btn svg { width: 20px; height: 20px; }
  .is-editing .card-actions .pin-btn { display: none; }

  .bento { grid-template-columns: 1fr 1fr; gap: 12px; }
  .bento .app-card:first-child { grid-column: 1 / -1; grid-row: auto; }
  .bento .app-card:first-child .app-card-link { flex-direction: column; align-items: flex-start; padding: 20px; gap: 14px; }
  .bento .app-card:first-child .app-logo { width: 56px; height: 56px; }
  .bento .app-card:first-child .app-title { font-size: 20px; line-height: 28px; }
  .bento .app-card:first-child .app-body { padding-right: 0; }
  .bento .app-card:first-child .card-actions { top: 12px; transform: none; }
  .bento .app-card:not(:first-child) .app-card-link { flex-direction: column; align-items: flex-start; }
  .bento .app-card:not(:first-child) .app-desc { display: none; }
  .bento .app-card:not(:first-child) .card-actions { top: 8px; transform: none; }
  .bento .app-card:not(:first-child) .app-body { padding-right: 0; }

  .soon-grid { grid-template-columns: 1fr; gap: 12px; }
  .soon-card { padding: 16px; gap: 14px; }
  .soon-card .app-logo { width: 44px; height: 44px; }
  .soon-top .card-btn { width: 44px; height: 44px; }
  .progress-range { height: 44px; }
  .progress-range::-webkit-slider-thumb { width: 28px; height: 28px; margin-top: -10px; }
  .progress-range::-moz-range-thumb { width: 24px; height: 24px; }
  .edit-bar-actions { width: 100%; }
  .edit-bar-actions .btn { flex: 1 1 auto; height: 40px; }
  .trash-actions { width: 100%; }
  .trash-actions .btn { flex: 1 1 auto; height: 44px; }

  .app-list .app-body { flex-direction: column; align-items: flex-start; gap: 0; }
  .app-list .app-title { flex-basis: auto; }
  .app-list .app-meta { display: none; }

  .side-panel {
    top: auto; left: 0; right: 0; width: 100%; max-height: 92vh;
    border-left: none; border-radius: 24px 24px 0 0;
    animation: sheetUp .22s cubic-bezier(.2, .8, .2, 1);
  }
  @keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
  .sheet-handle { display: block; width: 40px; height: 4px; border-radius: 999px; background: var(--border-strong); margin: 10px auto 0; }
  .side-body { padding: 18px 16px; }
  .side-head, .side-foot { padding-left: 16px; padding-right: 16px; }
  .side-foot .btn { height: 48px; }

  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal { max-width: none; border-radius: 24px 24px 0 0; max-height: 92vh; }
  .modal-foot .btn { height: 48px; flex: 1; }
  .palette-overlay { align-items: flex-start; padding: 0; }
  .palette { border-radius: 0 0 24px 24px; }
  .palette-foot { display: none; }
}

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