/* =====================================================================
   Controle de Proxy — estilos
   ===================================================================== */

:root {
  --bg: #f4f5f9;
  --bg-grad: radial-gradient(1200px 600px at 100% -10%, #e9e7ff 0%, transparent 60%), radial-gradient(900px 500px at -10% 110%, #e0f2fe 0%, transparent 55%);
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #f1f3f8;
  --border: #e5e7ef;
  --border-strong: #d4d8e3;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --accent-soft: #eef0ff;
  --accent-text: #4338ca;
  --ok: #059669;
  --ok-soft: #e7f8f1;
  --warn: #c2680a;
  --warn-soft: #fff6e6;
  --danger: #dc2626;
  --danger-soft: #fdeeee;
  --mark: #fde68a;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 20px -6px rgba(15, 23, 42, .10);
  --shadow-lg: 0 30px 80px -20px rgba(15, 23, 42, .40);
  --overlay: rgba(15, 23, 42, .45);
  --radius: 14px;
  --radius-sm: 10px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
  --sidebar: 248px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0a0d16;
  --bg-grad: radial-gradient(1200px 600px at 100% -10%, rgba(99, 102, 241, .14) 0%, transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(14, 165, 233, .08) 0%, transparent 55%);
  --surface: #111522;
  --surface-2: #151a29;
  --surface-3: #1a2032;
  --border: #232a3d;
  --border-strong: #2f3850;
  --text: #e8ebf3;
  --text-2: #c3c9d8;
  --muted: #8b94ab;
  --faint: #5d6782;
  --accent: #818cf8;
  --accent-2: #a78bfa;
  --accent-soft: rgba(129, 140, 248, .14);
  --accent-text: #a5b4fc;
  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, .12);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, .12);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, .12);
  --mark: rgba(250, 204, 21, .35);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -8px rgba(0, 0, 0, .5);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, .8);
  --overlay: rgba(3, 6, 14, .65);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0d16;
    --bg-grad: radial-gradient(1200px 600px at 100% -10%, rgba(99, 102, 241, .14) 0%, transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(14, 165, 233, .08) 0%, transparent 55%);
    --surface: #111522;
    --surface-2: #151a29;
    --surface-3: #1a2032;
    --border: #232a3d;
    --border-strong: #2f3850;
    --text: #e8ebf3;
    --text-2: #c3c9d8;
    --muted: #8b94ab;
    --faint: #5d6782;
    --accent: #818cf8;
    --accent-2: #a78bfa;
    --accent-soft: rgba(129, 140, 248, .14);
    --accent-text: #a5b4fc;
    --ok: #34d399;
    --ok-soft: rgba(52, 211, 153, .12);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, .12);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, .12);
    --mark: rgba(250, 204, 21, .35);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -8px rgba(0, 0, 0, .5);
    --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, .8);
    --overlay: rgba(3, 6, 14, .65);
    color-scheme: dark;
  }
}

/* ------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
[hidden] { display: none !important; }
a { color: var(--accent-text); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }

.ic {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px;
  font: inherit; font-weight: 600; font-size: 13.5px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--surface-2); border-color: var(--faint); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .icon-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn .ic { width: 16px; height: 16px; }
.btn.primary {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 70%, transparent);
}
:root[data-theme="dark"] .btn.primary { color: #0b0d17; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #0b0d17; } }
.btn.primary:hover { filter: brightness(1.06); color: #fff; }
:root[data-theme="dark"] .btn.primary:hover { color: #0b0d17; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary:hover { color: #0b0d17; } }
.btn.danger { color: #fff; background: var(--danger); border-color: transparent; }
.btn.danger:hover { filter: brightness(1.08); color: #fff; background: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn.lg { height: 46px; font-size: 15px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .6; pointer-events: none; }
.btn .spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; padding: 0;
  color: var(--muted); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: all .15s;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--border-strong); }
.icon-btn.ghost { background: transparent; border-color: transparent; }
.icon-btn.ghost:hover { background: var(--surface-3); }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.xs { width: 28px; height: 28px; border-radius: 8px; }
.icon-btn.xs .ic { width: 15px; height: 15px; }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); }
.icon-btn.ok:hover { color: var(--ok); background: var(--ok-soft); }

kbd {
  font: 500 11px var(--mono); color: var(--faint);
  border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 6px; background: var(--surface-2);
}

/* ------------------------------------------------------------- forms */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .req { color: var(--danger); }
.field .hint { color: var(--faint); font-size: 12px; }
input, select, textarea {
  width: 100%;
  font: inherit; font-size: 14px; color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  transition: border-color .15s, box-shadow .15s;
  min-width: 0;
}
input, select { height: 40px; }
textarea { resize: vertical; min-height: 64px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
input.mono, textarea.mono { font-family: var(--mono); font-size: 13px; }
select {
  appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
input[type="date"], input[type="datetime-local"] { font-variant-numeric: tabular-nums; }
input[type="color"] { padding: 3px; height: 40px; width: 56px; cursor: pointer; }
.input-ico { position: relative; }
.input-ico > .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; width: 17px; height: 17px; }
.input-ico > input { padding-left: 38px; }
.input-ico > .reveal { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.input-ico > input[type="password"], .input-ico > input.has-reveal { padding-right: 40px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.form-error, .form-ok, .banner {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
}
.form-error { color: var(--danger); background: var(--danger-soft); border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent); }
.form-ok { color: var(--ok); background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 25%, transparent); }
.banner.warn { color: var(--warn); background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); }
.banner .ic { margin-top: 1px; }

/* ------------------------------------------------------------- boot / login */
.boot { position: fixed; inset: 0; display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; position: relative; overflow: hidden; }
.login-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(600px 400px at 20% 20%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    radial-gradient(500px 400px at 85% 80%, color-mix(in srgb, var(--accent-2) 20%, transparent), transparent 70%);
}
.login-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, #000 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 10%, transparent 70%);
  opacity: .55;
}
.login-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 400px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px 28px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: rise .5s cubic-bezier(.2, .8, .2, 1);
}
.login-card .form { text-align: left; margin-top: 24px; }
.login-card h1 { font-size: 22px; margin-top: 16px; }
.login-card > .muted { margin: 4px 0 0; }
.login-card.install .form { margin-top: 16px; }
.login-card.install .form-error, .login-card.install .form-ok { margin-top: 16px; text-align: left; }
.login-card.install .btn.block { margin-top: 16px; }
.login-foot { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--faint); font-size: 12px; margin: 20px 0 0; }
.login-foot .ic { width: 13px; height: 13px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }

.brand-mark {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent) 80%, transparent);
}
.brand-mark .ic { width: 20px; height: 20px; stroke-width: 2.2; }
.brand-mark.lg { width: 60px; height: 60px; border-radius: 17px; }
.brand-mark.lg .ic { width: 30px; height: 30px; }
.brand-mark.sm { width: 32px; height: 32px; border-radius: 9px; }
.brand-mark.sm .ic { width: 17px; height: 17px; }

/* ------------------------------------------------------------- layout */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 18px 14px;
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 20px; }
.brand-text { display: grid; line-height: 1.25; min-width: 0; }
.brand-text strong { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: var(--muted); font-size: 12px; }
.nav { display: grid; gap: 3px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 10px;
  color: var(--text-2); font-weight: 500;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-3); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.nav a .ic { width: 18px; height: 18px; }
.nav-count {
  margin-left: auto; font-style: normal; font-size: 11.5px; font-weight: 600;
  color: var(--muted); background: var(--surface-3); border-radius: 99px; padding: 1px 8px;
}
.nav a.active .nav-count { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-text); }
.sidebar-foot { margin-top: auto; display: grid; gap: 10px; }
.online-box { padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.online-title { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.online-title em { margin-left: auto; font-style: normal; color: var(--ok); }
.online-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.online-list:empty { display: none; }
.pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent);
  animation: pulse 2s infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.user-card {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px; border-radius: 12px;
  background: transparent; border: 1px solid transparent;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.user-card:hover { background: var(--surface-3); }
.user-card .who { display: grid; line-height: 1.25; min-width: 0; flex: 1; }
.user-card .who strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card .who small { color: var(--muted); font-size: 12px; }
.user-card > .ic { color: var(--faint); width: 16px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-title h2 { font-size: 19px; white-space: nowrap; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.live-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; color: var(--ok);
  background: var(--ok-soft); border-radius: 99px; padding: 3px 10px 3px 9px;
}
.live-badge.off { color: var(--warn); background: var(--warn-soft); }
.live-badge.off .pulse { background: var(--warn); animation: none; }
.content { padding: 24px 28px 48px; display: grid; gap: 18px; max-width: 1500px; width: 100%; }
.view { display: grid; gap: 18px; min-width: 0; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

.mobile-only { display: none !important; }
.bottom-nav { display: none; }
.fab { display: none; }

/* ------------------------------------------------------------- cards / kpis */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; }
.card-head h3, .roles-card h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.card-head h3 .ic, .roles-card h3 .ic { color: var(--accent); }
.card-head p { margin: 3px 0 0; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi {
  position: relative; overflow: hidden;
  padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  text-align: left; font: inherit; color: inherit;
}
button.kpi { cursor: pointer; transition: border-color .15s, transform .15s; }
button.kpi:hover { border-color: color-mix(in srgb, var(--kc, var(--accent)) 45%, var(--border)); transform: translateY(-1px); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kpi-ico { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: var(--kc, var(--accent)); background: color-mix(in srgb, var(--kc, var(--accent)) 13%, transparent); }
.kpi-ico .ic { width: 17px; height: 17px; }
.kpi-val { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.kpi-spark { position: absolute; right: 14px; bottom: 14px; display: flex; align-items: flex-end; gap: 3px; height: 34px; }
.kpi-spark i { display: block; width: 5px; border-radius: 2px; background: color-mix(in srgb, var(--kc, var(--accent)) 45%, transparent); min-height: 2px; }
.kpi-spark i:last-child { background: var(--kc, var(--accent)); }

.type-card { padding: 16px 20px; }
.type-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.type-card-head h4 { font-size: 13px; color: var(--muted); font-weight: 600; }
.stack-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--surface-3); gap: 2px; }
.stack-bar span { background: var(--c); min-width: 4px; transition: flex-grow .4s ease; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.legend button {
  display: inline-flex; align-items: center; gap: 7px;
  font: inherit; font-size: 12.5px; font-weight: 500; color: var(--text-2);
  padding: 4px 10px; border-radius: 99px;
  background: transparent; border: 1px solid var(--border); cursor: pointer;
  transition: all .15s;
}
.legend button:hover { border-color: var(--c); }
.legend button.on { background: color-mix(in srgb, var(--c) 14%, transparent); border-color: color-mix(in srgb, var(--c) 50%, transparent); color: var(--text); }
.legend b { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- chips */
.chip {
  --c: var(--faint);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 99px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  color: color-mix(in srgb, var(--c) 70%, var(--text));
  background: color-mix(in srgb, var(--c) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 28%, transparent);
  max-width: 100%;
}
.chip > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.legend .chip-dot { width: 8px; height: 8px; }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 6px;
  color: var(--muted); background: var(--surface-3);
}
.badge.danger { color: var(--danger); background: var(--danger-soft); }
.badge.ok { color: var(--ok); background: var(--ok-soft); }
.badge.warn { color: var(--warn); background: var(--warn-soft); }
.badge.accent { color: var(--accent-text); background: var(--accent-soft); }
.list-tag { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 500; max-width: 100%; }
.list-tag .ic { width: 14px; height: 14px; color: var(--faint); }
.list-tag span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket { display: inline-block; font-weight: 500; color: var(--text); background: var(--surface-3); border: 1px solid var(--border); border-radius: 6px; padding: 1px 7px; font-size: 12.5px; white-space: nowrap; }
.role-badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.role-badge.admin { color: var(--accent-text); background: var(--accent-soft); }
.role-badge.operador { color: var(--ok); background: var(--ok-soft); }
.role-badge.leitor { color: var(--muted); background: var(--surface-3); }

.avatar {
  --h: 230;
  display: inline-grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: 50%;
  font-size: 12.5px; font-weight: 700; letter-spacing: .02em;
  color: hsl(var(--h) 55% 35%);
  background: hsl(var(--h) 75% 90%);
}
:root[data-theme="dark"] .avatar { color: hsl(var(--h) 80% 80%); background: hsl(var(--h) 35% 22%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar { color: hsl(var(--h) 80% 80%); background: hsl(var(--h) 35% 22%); } }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.md { width: 30px; height: 30px; font-size: 11.5px; }
.online-list .avatar { width: 28px; height: 28px; font-size: 10.5px; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--ok); }

/* ------------------------------------------------------------- filters */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 16px; border-bottom: 1px solid var(--border); }
.filters select { width: auto; max-width: 220px; height: 38px; font-size: 13.5px; }
.search { position: relative; flex: 1 1 280px; min-width: 200px; }
.search > .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 17px; height: 17px; pointer-events: none; }
.search input { height: 38px; padding-left: 38px; padding-right: 40px; }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.search input:focus + kbd, .search input:not(:placeholder-shown) + kbd { display: none; }
.date-range { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 4px 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }
.date-range > .ic { color: var(--faint); width: 16px; }
.date-range input { border: 0; height: 34px; padding: 0 4px; width: 128px; box-shadow: none !important; background: transparent; font-size: 13px; }
.date-range span { color: var(--faint); font-size: 12px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: 10px; border: 1px solid var(--border); }
.seg button { font: inherit; font-size: 13px; font-weight: 500; color: var(--muted); border: 0; background: transparent; padding: 0 12px; height: 30px; border-radius: 7px; cursor: pointer; transition: all .15s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }
.filters-actions { display: flex; gap: 8px; margin-left: auto; }

/* ------------------------------------------------------------- table */
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: separate; border-spacing: 0; }
.grid th {
  position: sticky; top: 0;
  text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); background: var(--surface-2);
  padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
  user-select: none;
}
.grid th[data-sort] { cursor: pointer; }
.grid th[data-sort]:hover { color: var(--text); }
.grid th .ic { width: 13px; height: 13px; vertical-align: -2px; margin-left: 3px; }
.grid th.sorted { color: var(--accent-text); }
.grid td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.grid tbody tr { transition: background .12s; }
.grid tbody tr:hover { background: var(--surface-2); }
#tbody tr { cursor: pointer; }
.grid tbody tr:last-child td { border-bottom: 0; }
.grid.compact td { padding: 9px 14px; }
.th-actions { width: 1%; }
.td-actions { white-space: nowrap; text-align: right; }
.row-actions { display: inline-flex; gap: 2px; opacity: .55; transition: opacity .15s; }
tr:hover .row-actions, .row-actions:focus-within { opacity: 1; }
.cell-date { display: grid; line-height: 1.3; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cell-date small { color: var(--muted); font-size: 12px; }
.url-cell { display: flex; align-items: center; gap: 4px; min-width: 0; max-width: 460px; }
.url { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.url .wc { color: var(--accent-text); font-weight: 700; }
.url-cell .copy { opacity: 0; flex: none; }
tr:hover .url-cell .copy { opacity: 1; }
.exec { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
tr.is-removed .url, tr.is-removed .ticket { text-decoration: line-through; color: var(--muted); }
tr.is-removed td { background: color-mix(in srgb, var(--danger) 3%, transparent); }
tr.flash td { animation: flash 2.4s ease-out both; }
@keyframes flash {
  0%, 25% { background: color-mix(in srgb, var(--accent) 16%, transparent); }
  100% { background: transparent; }
}
.empty { padding: 56px 24px; text-align: center; color: var(--muted); }
.empty .empty-ico { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--surface-3); color: var(--faint); margin-bottom: 14px; }
.empty .empty-ico .ic { width: 26px; height: 26px; }
.empty h4 { color: var(--text); font-size: 15px; margin-bottom: 4px; }
.empty p { margin: 0 0 16px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.pager:empty { display: none; }
.pager-nav { display: flex; align-items: center; gap: 6px; }
.pager select { width: auto; height: 32px; font-size: 13px; padding-top: 0; padding-bottom: 0; }
.pager-num { font-variant-numeric: tabular-nums; padding: 0 6px; color: var(--text-2); font-weight: 500; }

.skeleton-row td { padding: 16px 14px; }
.sk { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* ------------------------------------------------------------- modal */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 20px;
  background: var(--overlay);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .2s;
}
.overlay.open { opacity: 1; }
.modal {
  width: 100%; max-width: 560px; max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; box-shadow: var(--shadow-lg);
  transform: translateY(12px) scale(.98); transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
.overlay.open .modal { transform: none; }
.modal.lg { max-width: 760px; }
.modal.sm { max-width: 440px; }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 14px; }
.modal-head h3 { font-size: 17px; }
.modal-head p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.modal-head .icon-btn { margin-left: auto; margin-top: -4px; margin-right: -6px; }
.modal-body { padding: 6px 22px 20px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 18px 18px; }
.modal-foot .hint-keys { margin-right: auto; color: var(--faint); font-size: 12px; display: flex; align-items: center; gap: 4px; }
.confirm-msg { margin: 0; color: var(--text-2); }
.confirm-msg .url { white-space: normal; word-break: break-all; }

.type-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.type-opt { --c: var(--accent); position: relative; cursor: pointer; }
.type-opt input { position: absolute; opacity: 0; pointer-events: none; }
.type-opt-box {
  display: flex; gap: 10px; align-items: flex-start; height: 100%;
  padding: 10px 12px; border-radius: 11px;
  border: 1.5px solid var(--border); background: var(--surface);
  transition: all .15s;
}
.type-opt-box .chip-dot { margin-top: 6px; width: 9px; height: 9px; }
.type-opt-box strong { display: block; font-size: 13px; font-weight: 600; line-height: 1.35; }
.type-opt-box small { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.35; margin-top: 2px; }
.type-opt:hover .type-opt-box { border-color: color-mix(in srgb, var(--c) 50%, var(--border)); }
.type-opt input:checked + .type-opt-box {
  border-color: var(--c);
  background: color-mix(in srgb, var(--c) 9%, var(--surface));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 16%, transparent);
}
.type-opt input:focus-visible + .type-opt-box { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }

.url-analysis { display: grid; gap: 6px; }
.url-analysis:empty { display: none; }
.ua-summary { font-size: 12px; color: var(--muted); font-weight: 500; }
.ua-list { display: flex; flex-wrap: wrap; gap: 6px; }
.ua-item {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  font-family: var(--mono); font-size: 12px;
  padding: 3px 9px; border-radius: 7px;
  background: var(--surface-3); border: 1px solid var(--border);
}
.ua-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ua-item .ic { width: 13px; height: 13px; }
.ua-item.ok .ic { color: var(--ok); }
.ua-item.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.ua-item.warn .ic { color: var(--warn); }
.ua-item.bad { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: var(--danger); }
.ua-notes { display: grid; gap: 4px; }
.ua-note { display: flex; align-items: flex-start; gap: 6px; font-size: 12.5px; color: var(--warn); }
.ua-note .ic { width: 14px; height: 14px; margin-top: 2px; }
.ua-note.info { color: var(--accent-text); }

.swatches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.swatches button { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); cursor: pointer; background: var(--c); }
.swatches button.on { box-shadow: 0 0 0 2px var(--text); }

/* ------------------------------------------------------------- drawer */
.drawer-overlay { place-items: stretch end; padding: 0; }
.drawer {
  width: min(520px, 100vw); height: 100%;
  display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform: translateX(30px); transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}
.overlay.open .drawer { transform: none; }
.drawer-head { display: flex; align-items: center; gap: 8px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.drawer-head h3 { font-size: 15px; margin-right: auto; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; display: grid; gap: 20px; align-content: start; }
.drawer-url {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 14px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.drawer-url .url { white-space: normal; word-break: break-all; font-size: 14.5px; flex: 1; }
.drawer-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.kv > div { min-width: 0; }
.kv dt { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 3px; }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.kv .full { grid-column: 1 / -1; }
.notes-box { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-weight: 400; }
.section-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.drawer-foot { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }
.drawer-foot .btn { flex: 1; }
.removed-banner { display: grid; gap: 4px; }

/* ------------------------------------------------------------- timeline */
.timeline { padding: 8px 20px 12px; }
.tl-day { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 14px 0 6px; position: sticky; top: 0; }
.tl-item { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 10px 0; }
.tl-item + .tl-item::before { content: ""; position: absolute; left: 16.5px; top: -10px; height: 20px; width: 1px; background: var(--border); }
.tl-ico { --t: var(--accent); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--t); background: color-mix(in srgb, var(--t) 13%, transparent); }
.tl-ico .ic { width: 16px; height: 16px; }
.tl-ico.ok { --t: var(--ok); } .tl-ico.danger { --t: var(--danger); } .tl-ico.warn { --t: var(--warn); } .tl-ico.muted { --t: var(--muted); }
.tl-main { min-width: 0; }
.tl-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.tl-line strong { font-weight: 600; }
.tl-time { color: var(--faint); font-size: 12px; margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl-summary { color: var(--text-2); overflow-wrap: anywhere; }
.tl-summary.link { cursor: pointer; }
.tl-summary.link:hover { color: var(--accent-text); }
.tl-details { margin-top: 8px; display: grid; gap: 4px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; font-size: 12.5px; }
.diff-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.diff-k { font-weight: 600; color: var(--muted); min-width: 90px; }
.diff-old { color: var(--danger); text-decoration: line-through; overflow-wrap: anywhere; }
.diff-new { color: var(--ok); font-weight: 500; overflow-wrap: anywhere; }
.diff-row .ic { width: 13px; height: 13px; color: var(--faint); align-self: center; }
.tl-ip { color: var(--faint); font-size: 11.5px; font-family: var(--mono); }
.load-more { display: flex; justify-content: center; padding: 0 0 16px; }

/* ------------------------------------------------------------- admin */
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell strong { font-weight: 600; white-space: nowrap; }
.dot-online { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; margin-left: 6px; }
.types-list { display: grid; grid-template-columns: minmax(0, 1fr); padding: 0 8px 8px; }
.type-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; }
.type-row:hover { background: var(--surface-2); }
.type-row .sw { width: 14px; height: 14px; border-radius: 5px; background: var(--c); flex: none; }
.type-row .tinfo { flex: 1; min-width: 0; }
.type-row .tinfo strong { display: block; font-weight: 600; }
.type-row .tinfo small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.type-row.inactive { opacity: .55; }
.type-row .count { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.roles-card { padding: 18px 20px; }
.roles { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; color: var(--text-2); }
.roles li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.roles .role-badge { min-width: 110px; text-align: center; }

/* ------------------------------------------------------------- menu / toasts */
.menu {
  position: fixed; z-index: 120; min-width: 230px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px;
  animation: pop .15s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(4px) scale(.98); } }
.menu-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu-head div { display: grid; line-height: 1.3; }
.menu-head small { color: var(--muted); }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: transparent; font: inherit; color: var(--text-2); border-radius: 8px; cursor: pointer; text-align: left; }
.menu button:hover { background: var(--surface-3); color: var(--text); }
.menu button.danger { color: var(--danger); }
.menu button.danger:hover { background: var(--danger-soft); }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: toastIn .3s cubic-bezier(.2, .8, .2, 1);
  border-left: 3px solid var(--t, var(--accent));
}
.toast.out { animation: toastOut .25s ease forwards; }
.toast .t-ico { color: var(--t, var(--accent)); margin-top: 1px; }
.toast .t-body { flex: 1; min-width: 0; font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.toast .t-body strong { display: block; color: var(--text); font-size: 13.5px; margin-bottom: 1px; }
.toast .t-close { margin: -4px -6px 0 0; }
.toast.ok { --t: var(--ok); } .toast.danger { --t: var(--danger); } .toast.warn { --t: var(--warn); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1360px) {
  .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters-actions { margin-left: 0; }
}

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-only { display: inline-grid !important; }
  .topbar { padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); }
  .topbar-title h2 { font-size: 17px; }
  #newBtn { display: none; }
  .content { padding: 16px 16px 96px; gap: 14px; }
  .view { gap: 14px; }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 6px 8px; padding-bottom: max(6px, env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
  }
  .bottom-nav a { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 6px 0; font-size: 11px; font-weight: 600; color: var(--muted); border-radius: 10px; }
  .bottom-nav a.active { color: var(--accent-text); }
  .bottom-nav a .ic { width: 20px; height: 20px; }
  .fab {
    display: grid !important; place-items: center;
    position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 31;
    width: 54px; height: 54px; border-radius: 17px; border: 0; cursor: pointer;
    color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 12px 28px -8px color-mix(in srgb, var(--accent) 80%, transparent);
  }
  .fab .ic { width: 24px; height: 24px; stroke-width: 2.4; }
  .toasts { bottom: calc(140px + env(safe-area-inset-bottom)); right: 16px; }
}

@media (max-width: 760px) {
  .kpis { gap: 10px; }
  .kpi { padding: 13px 14px; }
  .kpi-val { font-size: 23px; }
  .kpi-spark { display: none; }
  .live-badge b { display: none; }
  .live-badge { padding: 5px; }
  .filters { padding: 12px; gap: 8px; }
  .search { flex-basis: 100%; }
  .search kbd { display: none; }
  .filters select { flex: 1 1 calc(50% - 4px); max-width: none; }
  .date-range { flex: 1 1 100%; min-width: 0; }
  .date-range > .ic { display: none; }
  .date-range input { flex: 1 1 0; width: 0; min-width: 0; }
  .seg { flex: 1 1 100%; }
  .seg button { flex: 1; }
  .filters-actions { flex: 1 1 100%; }
  .filters-actions .btn { flex: 1; }
  .grid-2 { grid-template-columns: 1fr; }
  .type-picker { grid-template-columns: 1fr 1fr; }
  .kv { grid-template-columns: 1fr 1fr; }

  /* tabela de liberações vira cartões */
  #releasesTable thead, .releases-grid thead { display: none; }
  .releases-grid, .releases-grid tbody { display: block; }
  .releases-grid tr {
    display: grid; grid-template-columns: 1fr auto; gap: 6px 10px;
    padding: 12px 14px; border-bottom: 1px solid var(--border);
  }
  .releases-grid td { display: block; padding: 0; border: 0; min-width: 0; }
  .releases-grid td.td-url { grid-column: 1 / -1; order: -2; }
  .releases-grid td.td-date { order: -1; grid-column: 1 / -1; }
  .releases-grid .cell-date { display: flex; gap: 6px; font-size: 12px; color: var(--muted); }
  .releases-grid .cell-date small::before { content: "· "; }
  .releases-grid td.td-type, .releases-grid td.td-list, .releases-grid td.td-ticket, .releases-grid td.td-exec { grid-column: auto; }
  .releases-grid .td-cells { grid-column: 1 / -1; }
  .releases-grid td.td-actions { grid-column: 1 / -1; text-align: left; border-top: 1px dashed var(--border); padding-top: 6px; margin-top: 2px; }
  .releases-grid .row-actions { opacity: 1; }
  .releases-grid .url-cell { max-width: none; }
  .releases-grid .url { white-space: normal; word-break: break-all; font-size: 13.5px; }
  .releases-grid .url-cell .copy { opacity: 1; }
  .releases-grid tr.is-removed td { background: none; }
  .releases-grid td[data-label]:not(.td-url):not(.td-date)::before {
    content: attr(data-label); display: block;
    font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); margin-bottom: 2px;
  }

  .overlay { padding: 0; place-items: end stretch; }
  .modal { max-width: none !important; max-height: 94vh; border-radius: 20px 20px 0 0; transform: translateY(40px); }
  .modal-foot { border-radius: 0; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .modal-foot .hint-keys { display: none; }
  .modal-foot .btn { flex: 1; }
  .drawer-overlay { place-items: stretch; }
  .drawer { width: 100vw; transform: translateY(30px); }
  .timeline { padding: 4px 14px 10px; }
  .tl-time { margin-left: 0; width: 100%; }
}

@media (max-width: 420px) {
  .type-picker { grid-template-columns: 1fr; }
  .topbar-title h2 { font-size: 16px; }
}

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