/*
 * Responsive panel composition layered over the established cartoon theme.
 * Motion follows the friendly line-icon language of the Unicons animated set
 * (IconScout reference: loading-animated-icon_6670513);
 * assets stay local so the control panel remains self-contained.
 */

:root {
  --panel-gap: clamp(12px, 1.55vw, 20px);
  --panel-line: rgba(216, 154, 232, .28);
  --panel-surface: rgba(18, 13, 22, .86);
  --panel-surface-soft: rgba(24, 17, 29, .66);
}

body { overflow-x: hidden; }

/* Animated loading icon and request feedback */
.ui-page-loader {
  position: fixed;
  z-index: 20000;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  color: var(--text-main);
  background:
    radial-gradient(circle at 50% 42%, rgba(196,122,216,.22), transparent 27%),
    rgba(8,5,10,.94);
  opacity: 1;
  visibility: visible;
  transition: opacity .28s ease, visibility .28s ease;
  animation: ui-loader-failsafe 0s 4s forwards;
}
.ui-page-loader.is-ready { opacity: 0; visibility: hidden; pointer-events: none; }
.ui-page-loader.is-leaving { opacity: 1; visibility: visible; pointer-events: auto; animation: none; }
.ui-page-loader > span:last-child strong,
.ui-page-loader > span:last-child small { display: block; }
.ui-page-loader > span:last-child strong { font-size: 13px; }
.ui-page-loader > span:last-child small { margin-top: 3px; color: var(--text-faint); font-size: 9px; }
.unicon-motion-loader {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 2px solid #e2a1f0;
  border-radius: 14px;
  color: #f1b4f7;
  background: #26172c;
  box-shadow: 5px 5px 0 var(--cartoon-ink), 0 0 28px rgba(196,122,216,.3);
  transform: rotate(-3deg);
}
.unicon-motion-loader svg {
  width: 28px;
  height: 28px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: unicon-loader-turn 1.25s cubic-bezier(.55,.15,.42,.88) infinite;
}
.unicon-motion-loader circle { fill: #f06bc8; stroke: none; transform-origin: center; animation: unicon-loader-dot .8s ease-in-out infinite alternate; }
[data-command-busy="1"] button[type="submit"]::before,
form.ui-form-submitting button[type="submit"]::before {
  content: "";
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  margin-right: 7px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: unicon-loader-turn .72s linear infinite;
}
@keyframes unicon-loader-turn { to { transform: rotate(360deg); } }
@keyframes unicon-loader-dot { to { transform: scale(1.45); opacity: .55; } }
@keyframes ui-loader-failsafe { to { opacity: 0; visibility: hidden; pointer-events: none; } }

/* Desktop frame inspired by the supplied panel concepts */
.sidebar { width: 224px; }
.main { width: calc(100% - 224px); margin-left: 224px; padding-inline: clamp(22px,3vw,48px); }
.topbar { min-height: 78px; padding-inline: 18px; }
.topbar > .topbar-copy { min-width: 0; margin-right: auto; }
.topbar-title-line { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-title-line h1 { flex: 0 1 auto; }
.topbar-title-line .badge { flex: 0 1 auto; max-width: min(360px,38vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .logout-form { flex: 0 0 auto; }
.section-heading { min-height: 52px; }
.section-heading h2 { font-size: clamp(21px,2vw,29px); }
.section-heading > div { position: relative; }
.control-intro { max-width: 780px; margin: -10px 0 18px; }

/* Irregular sticker cards keep the supplied panel hierarchy but make it Renn. */
.stats-grid { gap: clamp(10px,1.2vw,16px); }
.stat-card { position: relative; isolation: isolate; border-width: 2px; }
.stat-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -2px;
  right: 18px;
  width: 38px;
  height: 8px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(222,152,235,.22);
  box-shadow: 1px 2px 0 rgba(5,3,7,.45);
  transform: rotate(4deg);
}
.stat-card:nth-child(1) { border-radius: 17px 8px 14px 7px; }
.stat-card:nth-child(2) { border-radius: 8px 18px 7px 14px; }
.stat-card:nth-child(3) { border-radius: 14px 7px 18px 9px; }
.stat-card:nth-child(4) { border-radius: 7px 15px 9px 18px; }
.stat-card:nth-child(2)::before,.stat-card:nth-child(4)::before { right: auto; left: 19px; transform: rotate(-5deg); }

/* Dashboard overview */
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0,1.45fr) minmax(300px,.75fr);
  gap: var(--panel-gap);
  margin-top: var(--panel-gap);
}
.dashboard-panel {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 2px solid var(--panel-line);
  border-radius: 10px;
  background:
    radial-gradient(circle at 86% 4%, rgba(196,122,216,.12), transparent 33%),
    linear-gradient(145deg,rgba(255,255,255,.045),transparent),
    var(--panel-surface);
  box-shadow: 5px 5px 0 var(--cartoon-ink), 0 24px 70px rgba(0,0,0,.3);
}
.dashboard-device-overview { border-radius: 18px 8px 15px 8px; }
.dashboard-shortcuts-panel { border-radius: 8px 18px 8px 15px; }
.dashboard-panel::after {
  content: "";
  position: absolute;
  top: 11px;
  right: 12px;
  width: 30px;
  height: 9px;
  border-top: 2px solid rgba(229,168,241,.42);
  border-bottom: 2px solid rgba(111,213,232,.28);
  pointer-events: none;
  transform: rotate(3deg);
}
.panel-heading {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 17px;
  border-bottom: 1px solid rgba(196,122,216,.17);
}
.panel-heading h3 { margin: 0; font-size: 16px; }
.panel-heading .eyebrow { margin-bottom: 3px; }
.panel-heading > a { color: #efb5f6; font-size: 9px; font-weight: 800; text-decoration: none; }
.panel-heading > a:hover { color: #fff; }
.panel-live { display: inline-flex; align-items: center; gap: 6px; color: #73e3a4; font-size: 9px; font-weight: 800; }
.panel-live i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.dashboard-device-list { display: grid; padding: 6px 14px 13px; }
.dashboard-device-row {
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) auto 74px;
  gap: 11px;
  align-items: center;
  min-height: 66px;
  padding: 9px 5px;
  border-bottom: 1px solid rgba(196,122,216,.13);
  color: inherit;
  text-decoration: none;
  transition: padding .15s ease, background .15s ease;
}
.dashboard-device-row:last-child { border-bottom: 0; }
.dashboard-device-row:hover { margin-inline: -6px; padding-inline: 11px; border-radius: 8px; background: rgba(155,91,183,.09); }
.dashboard-device-avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 2px solid #d89ae8;
  border-radius: 11px;
  color: #180d1e;
  background: linear-gradient(145deg,#f1b0ef,#a859c3);
  box-shadow: 3px 3px 0 var(--cartoon-ink);
  font-size: 14px;
  font-weight: 900;
  transform: rotate(-2deg);
}
.dashboard-device-copy { min-width: 0; }
.dashboard-device-copy strong,
.dashboard-device-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-device-copy strong { font-size: 11px; }
.dashboard-device-copy small { margin-top: 3px; color: var(--text-faint); font-size: 8px; }
.dashboard-device-state { display: inline-flex; align-items: center; gap: 6px; font-size: 8px; font-weight: 800; }
.dashboard-device-state i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 9px currentColor; }
.dashboard-device-state.online { color: #5fe497; }
.dashboard-device-state.offline { color: #ff7c88; }
.dashboard-device-state.revoked { color: #a69da9; }
.dashboard-device-seen { color: var(--text-faint); font-size: 8px; text-align: right; }
.dashboard-empty { padding: 36px 18px; text-align: center; }
.dashboard-empty strong,.dashboard-empty span { display: block; }
.dashboard-empty span { margin-top: 5px; color: var(--text-faint); font-size: 9px; }
.dashboard-shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding: 14px; }
.dashboard-shortcuts a {
  min-height: 112px;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  padding: 13px;
  border: 2px solid rgba(196,122,216,.2);
  border-radius: 9px;
  color: inherit;
  background: rgba(255,255,255,.022);
  box-shadow: 3px 3px 0 rgba(7,5,8,.85);
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.dashboard-shortcuts a:hover { border-color: rgba(226,161,240,.72); background: rgba(155,91,183,.13); box-shadow: 5px 5px 0 var(--cartoon-ink); transform: translate(-1px,-1px) rotate(-.4deg); }
.shortcut-icon {
  min-width: 32px;
  height: 30px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  border: 1px solid rgba(226,161,240,.55);
  border-radius: 8px;
  color: #e9a9f3;
  background: #321d39;
  font: 900 12px 'JetBrains Mono',monospace;
}
.dashboard-shortcuts strong { font-size: 10px; }
.dashboard-shortcuts small { margin-top: 4px; color: var(--text-faint); font-size: 7.5px; line-height: 1.45; }

/* Key status overview */
.authorization-stats {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 12px;
  margin-bottom: 17px;
}
.authorization-stats article {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 98px;
  padding: 15px;
  border: 2px solid rgba(196,122,216,.22);
  border-radius: 9px;
  background: var(--panel-surface-soft);
  box-shadow: 4px 4px 0 var(--cartoon-ink);
}
.authorization-stat-icon { width: 38px; height: 38px; display: grid; flex: 0 0 38px; place-items: center; border: 2px solid currentColor; border-radius: 10px; box-shadow: 3px 3px 0 var(--cartoon-ink); font-weight: 900; transform: rotate(-3deg); }
.authorization-stat-icon.active { color: #68e49e; background: #153524; }
.authorization-stat-icon.processing { color: #df9ced; background: #38203f; animation: authorization-processing 2.1s ease-in-out infinite; }
.authorization-stat-icon.renewal { color: #ffc865; background: #3d2b13; }
.authorization-stat-icon.failed { color: #ff808c; background: #402027; }
.authorization-stats small,.authorization-stats strong,.authorization-stats p { display: block; }
.authorization-stats small { color: var(--text-faint); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.authorization-stats strong { margin-top: 2px; font-size: 22px; }
.authorization-stats p { margin: 1px 0 0; color: var(--text-faint); font-size: 7.5px; }
@keyframes authorization-processing { 50% { transform: rotate(10deg) scale(1.06); box-shadow: 4px 4px 0 var(--cartoon-ink),0 0 15px rgba(216,154,232,.32); } }

/* Dense operational surfaces */
.device-control-shell { grid-template-columns: 270px minmax(0,1fr); overflow: visible; border-radius: 12px; }
.device-browser { position: relative; z-index: 3; }
.device-browser-head { z-index: 95; }
.device-selector-list {
  position: relative;
  z-index: 1;
  max-height: clamp(430px,calc(100dvh - 300px),650px);
  margin: 0 10px 13px;
  padding: 9px;
  border: 1px solid rgba(196,122,216,.22);
  border-radius: 9px 6px 11px 7px;
  background: rgba(8,6,10,.28);
  box-shadow: inset 0 -14px 22px rgba(4,3,6,.38),0 3px 0 rgba(5,3,7,.52);
  scrollbar-gutter: stable;
}
.device-bulk-menu { max-height: min(640px,calc(100vh - 150px)); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.device-bulk-menu-head small { margin: 0; color: #8d8191; font-size: 7px; letter-spacing: .08em; text-transform: uppercase; }
.device-bulk-menu .bulk-menu-icon.danger { color: #ff8e9d; }
.device-select-all-button { display: grid !important; place-items: center; padding: 0 !important; line-height: 0; }
.device-select-all-button svg { width: 17px; height: 17px; display: block; margin: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transform: none; }
.device-select-all-button.is-all-selected { color: #170d1c; border-color: #efc2f7; background: #d88fe8; box-shadow: 3px 3px 0 var(--cartoon-ink); transform: translate(-1px,-1px) rotate(-2deg); }
.device-browser { padding: 15px 0; }
.device-stage { padding: clamp(12px,1.6vw,20px); }
.device-selector { min-height: 112px; }
.device-control-header { min-height: 92px; }
.device-kpi-grid { gap: 11px; }
.package-control-card { margin-top: 13px; }
.delta-key-card,.script-library-card { border-radius: 11px; }
.table-wrap { scrollbar-gutter: stable; }
th { white-space: nowrap; }

/* One compact operational rail replaces scattered device buttons. */
.device-operation-bar { display: grid; grid-template-columns: auto minmax(90px,1fr) repeat(4,auto); gap: 8px; align-items: center; }
.device-operation-bar > small { margin-right: 0; }
.device-operation-bar form { min-width: 0; margin: 0; }
.device-operation-bar .button { min-height: 34px; padding-inline: 10px; white-space: nowrap; }

/* Square line-icon package actions: setting, join, open, close, uninstall. */
.device-package-table .package-actions { min-width: 205px; flex-wrap: nowrap; gap: 7px; }
.package-action-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  flex: 0 0 34px;
  place-items: center;
  padding: 0;
  border: 2px solid rgba(196,122,216,.46);
  border-radius: 9px 6px 9px 6px;
  color: #e8b1f0;
  background: #211724;
  box-shadow: 3px 3px 0 var(--cartoon-ink);
  cursor: pointer;
  transition: color .14s ease,background .14s ease,border-color .14s ease,box-shadow .14s ease,transform .14s ease;
}
.package-action-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.package-action-icon.settings { color: #78d9e7; border-color: rgba(103,219,229,.5); background: rgba(19,68,76,.38); }
.package-action-icon.join { color: #1a0e20; border-color: #ecc0f4; background: #c47ad8; }
.package-action-icon.open { color: #75e1a6; border-color: rgba(109,227,164,.5); background: rgba(25,91,56,.34); }
.package-action-icon.close { color: #ff9aa4; border-color: rgba(239,92,111,.5); background: rgba(99,31,44,.42); }
.package-action-icon:hover:not(:disabled) { color: #fff; border-color: currentColor; box-shadow: 4px 4px 0 var(--cartoon-ink); transform: translate(-1px,-1px) rotate(2deg); }
.package-action-icon:active:not(:disabled) { box-shadow: 1px 1px 0 var(--cartoon-ink); transform: translate(2px,2px); }
.package-action-icon:disabled { opacity: .34; cursor: not-allowed; box-shadow: 1px 1px 0 var(--cartoon-ink); }
.package-server-popover { width: min(450px,calc(100% - 28px)); max-height: min(680px,calc(100dvh - 28px)); padding: 19px; }
.package-server-popover .dialog-header h2 { max-width: 320px; overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.package-server-popover .dialog-copy { margin-block: 9px 0; font-size: 9px; line-height: 1.5; }
.package-server-popover .form-grid { gap: 10px; margin-top: 14px; }
.package-server-popover .form-grid label > span { margin-bottom: 5px; font-size: 8px; }
.package-server-popover .form-grid input,.package-server-popover .form-grid select { min-height: 40px; }
.package-server-popover .form-grid > .button { min-height: 42px; }

/* Resource deck: reference-inspired system metrics with hand-cut card geometry. */
.device-kpi-grid.resource-overview {
  grid-template-columns: repeat(5,minmax(0,1fr));
  gap: 12px;
  margin-top: 14px;
}
.resource-overview .resource-kpi {
  --resource-accent: #79d7ec;
  position: relative;
  min-height: 142px;
  padding: 13px 14px 18px;
  overflow: hidden;
  border: 2px solid rgba(196,122,216,.3);
  border-color: color-mix(in srgb,var(--resource-accent) 34%,transparent);
  border-radius: 17px 7px 14px 8px;
  background:
    radial-gradient(circle at 95% -6%,color-mix(in srgb,var(--resource-accent) 18%,transparent),transparent 43%),
    linear-gradient(150deg,rgba(255,255,255,.04),transparent 53%),
    rgba(14,10,17,.84);
  box-shadow: 4px 4px 0 var(--cartoon-ink);
}
.resource-overview .resource-kpi:nth-child(even) { border-radius: 7px 17px 8px 14px; }
.resource-overview .resource-kpi::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 9px;
  width: 16px;
  height: 5px;
  border-top: 2px solid var(--resource-accent);
  border-bottom: 2px solid var(--resource-accent);
  opacity: .35;
  transform: rotate(7deg);
}
.resource-kpi.cpu { --resource-accent: #78b9ff; }
.resource-kpi.memory { --resource-accent: #d590ef; }
.resource-kpi.disk { --resource-accent: #67dbe5; }
.resource-kpi.packages { --resource-accent: #f18abb; }
.resource-kpi.auto-kill { --resource-accent: #6de3a4; }
.resource-kpi .resource-kpi-head {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--resource-accent);
  letter-spacing: 0;
  text-transform: none;
}
.resource-kpi .resource-kpi-head small {
  max-width: calc(100% - 53px);
  margin: 0;
  overflow: hidden;
  color: #d9cedd;
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: .07em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.resource-icon {
  width: 34px;
  height: 32px;
  display: grid;
  flex: 0 0 34px;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 9px 6px 9px 6px;
  background: #241629;
  background: color-mix(in srgb,var(--resource-accent) 14%,#17101b);
  box-shadow: 3px 3px 0 var(--cartoon-ink);
  transform: rotate(-3deg);
  transform-origin: center;
}
.resource-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.resource-kpi strong { margin-top: 11px; color: #fff; font-size: clamp(18px,1.6vw,24px); letter-spacing: -.035em; }
.resource-kpi .resource-note { margin-top: 2px; color: var(--text-faint); font-size: 7px; letter-spacing: .02em; text-transform: none; }
.resource-kpi progress,
.resource-track {
  position: absolute;
  right: 13px;
  bottom: 11px;
  left: 13px;
  width: auto;
  height: 5px;
  overflow: hidden;
  border: 0;
  border-radius: 99px 55px 99px 45px;
  background: rgba(255,255,255,.07);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.55);
  appearance: none;
}
.resource-kpi progress::-webkit-progress-bar { border-radius: inherit; background: transparent; }
.resource-kpi progress::-webkit-progress-value { border-radius: inherit; background: var(--resource-accent); background: linear-gradient(90deg,color-mix(in srgb,var(--resource-accent) 64%,#fff),var(--resource-accent)); }
.resource-kpi progress::-moz-progress-bar { border-radius: inherit; background: var(--resource-accent); background: linear-gradient(90deg,color-mix(in srgb,var(--resource-accent) 64%,#fff),var(--resource-accent)); }
.resource-track { display: block; }
.resource-track i { width: var(--resource-ratio,64%); height: 100%; display: block; border-radius: inherit; background: var(--resource-accent); background: linear-gradient(90deg,color-mix(in srgb,var(--resource-accent) 58%,#fff),var(--resource-accent)); }
.resource-track.disk-available i { width: 68%; }
.resource-track.feature-on i { width: 100%; }
.resource-track.feature-off i { width: 16%; background: #796f7d; }
.resource-kpi:hover .resource-icon { animation: resource-icon-pop .65s cubic-bezier(.2,.8,.3,1); }
@keyframes resource-icon-pop { 35% { transform: translateY(-3px) rotate(7deg) scale(1.06); } 70% { transform: translateY(1px) rotate(-5deg); } }

/* Account Loader becomes a visual route map instead of another generic two-card row. */
.account-loader-view { position: relative; }
.account-loader-heading { align-items: flex-end; }
.account-loader-heading p:not(.eyebrow) { margin: 7px 0 0; color: var(--text-faint); font-size: 9px; }
.account-device-count {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 11px;
  border: 2px solid rgba(111,213,232,.34);
  border-radius: 11px 6px 11px 6px;
  color: #a9dce7;
  background: rgba(10,25,29,.78);
  box-shadow: 3px 3px 0 var(--cartoon-ink);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
  transform: rotate(1deg);
}
.account-device-count strong { color: #fff; font-size: 15px; }
.account-loader-summary { margin: 16px 0; border-radius: 16px 7px 14px 8px; }
.account-loader-grid { display: grid; grid-template-columns: minmax(260px,.72fr) minmax(0,1.28fr); gap: var(--panel-gap); }
.account-loader-grid .card { margin: 0; }
.account-loader-intro,
.account-loader-command { position: relative; min-width: 0; overflow: hidden; border-width: 2px; }
.account-loader-intro { min-height: 284px; padding-right: clamp(20px,7vw,100px); border-radius: 19px 8px 15px 7px; }
.account-loader-intro h3,.account-loader-command h3 { margin: 5px 0 0; font-size: clamp(22px,2.5vw,34px); line-height: 1.1; letter-spacing: -.045em; }
.account-loader-intro .muted-text { max-width: 330px; }
.account-loader-intro .endpoint-note { position: relative; z-index: 2; margin-top: 28px; }
.loader-orbit {
  position: absolute;
  top: -54px;
  right: -58px;
  width: 184px;
  height: 184px;
  border: 2px dashed rgba(226,161,240,.27);
  border-radius: 50%;
  animation: loader-orbit-spin 17s linear infinite;
}
.loader-orbit::before,.loader-orbit::after,.loader-orbit i { content: ""; position: absolute; border-radius: 50%; }
.loader-orbit::before { inset: 28px; border: 2px solid rgba(111,213,232,.18); }
.loader-orbit::after { width: 15px; height: 15px; top: 20px; left: 22px; border: 2px solid #e8a9f1; background: #47224d; box-shadow: 3px 3px 0 var(--cartoon-ink); }
.loader-orbit i { width: 8px; height: 8px; right: 10px; bottom: 51px; background: #6fd5e8; box-shadow: 0 0 12px #6fd5e8; }
@keyframes loader-orbit-spin { to { transform: rotate(360deg); } }
.account-loader-command { align-self: stretch; padding-top: 56px; border-radius: 8px 19px 7px 15px; }
.command-ticket { position: absolute; top: 13px; right: 16px; left: 16px; display: flex; align-items: center; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px dashed rgba(226,161,240,.3); color: #dca3e7; font: 800 7px 'JetBrains Mono',monospace; letter-spacing: .13em; }
.command-ticket i { width: 45px; height: 7px; border-top: 2px solid #6fd5e8; border-bottom: 2px solid #cb72de; opacity: .55; transform: rotate(-2deg); }
.account-loader-command .code-block { margin-top: 24px; }
.registered-device-card { margin-top: var(--panel-gap); padding: 0; overflow: hidden; border-width: 2px; border-radius: 8px 18px 9px 15px; }
.registered-device-head { min-height: 75px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 18px; border-bottom: 1px dashed rgba(226,161,240,.24); }
.registered-device-head h3 { margin: 3px 0 0; font-size: 17px; }
.registered-device-head a { color: #e6a7ef; font-size: 8px; font-weight: 800; text-decoration: none; }
.registered-device-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; background: rgba(196,122,216,.12); }
.registered-device-row {
  min-width: 0;
  min-height: 84px;
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) auto 74px 18px;
  gap: 10px;
  align-items: center;
  padding: 13px 15px;
  color: inherit;
  background: rgba(15,11,18,.96);
  text-decoration: none;
  transition: background .16s ease,box-shadow .16s ease,transform .16s ease;
}
.registered-device-row:hover { z-index: 1; background: #211526; box-shadow: inset 4px 0 0 #ca73dc; transform: translateX(2px); }
.registered-device-icon { position: relative; width: 39px; height: 42px; display: grid; place-items: center; border: 2px solid rgba(226,161,240,.45); border-radius: 11px 7px 10px 7px; color: #e6a7ef; background: #2b1931; box-shadow: 3px 3px 0 var(--cartoon-ink); transform: rotate(-2deg); }
.registered-device-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.registered-device-icon i { position: absolute; right: -4px; bottom: -3px; width: 10px; height: 10px; border: 2px solid #171019; border-radius: 50%; }
.registered-device-icon i.online { background: #61e39a; box-shadow: 0 0 9px #61e39a; }
.registered-device-icon i.offline { background: #ff7b88; }
.registered-device-icon i.revoked { background: #8f8492; }
.registered-device-copy { min-width: 0; }
.registered-device-copy strong,.registered-device-copy small,.registered-device-copy em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.registered-device-copy strong { font-size: 10px; }
.registered-device-copy small { margin-top: 3px; color: var(--text-faint); font-size: 7.5px; }
.registered-device-copy em { margin-top: 3px; color: #7c7180; font: normal 6.5px 'JetBrains Mono',monospace; }
.registered-device-state { display: inline-flex; align-items: center; justify-content: center; min-width: 55px; padding: 5px 7px; border: 1px solid currentColor; border-radius: 99px; font-size: 7px; font-weight: 800; }
.registered-device-state.online { color: #66dfa0; background: rgba(24,91,55,.2); }
.registered-device-state.offline { color: #ff858f; background: rgba(110,34,44,.2); }
.registered-device-state.revoked { color: #a99eac; background: rgba(90,82,93,.18); }
.registered-device-seen { color: var(--text-faint); font-size: 7px; text-align: right; }
.registered-device-arrow { color: #d991e8; font-size: 19px; }
.registered-device-empty { grid-column: 1/-1; padding: 34px 18px; background: rgba(15,11,18,.96); text-align: center; }
.registered-device-empty strong,.registered-device-empty span { display: block; }
.registered-device-empty span { margin-top: 5px; color: var(--text-faint); font-size: 8px; }

/* The setup flow reads like a guided cartoon route, while retaining every command. */
#setup { position: relative; overflow: hidden; border-radius: 19px 8px 16px 7px; }
#setup .steps { position: relative; gap: 11px; padding-left: 6px; }
#setup .steps::before { content: ""; position: absolute; top: 22px; bottom: 22px; left: 19px; width: 3px; border-radius: 99px; background: repeating-linear-gradient(to bottom,#b868ca 0 8px,transparent 8px 14px); opacity: .4; }
#setup .steps article { position: relative; z-index: 1; padding: 15px; border-radius: 15px 7px 13px 7px; }
#setup .steps article:nth-child(even) { margin-left: 26px; border-radius: 7px 15px 7px 13px; }
#setup .steps article > span { width: 31px; height: 31px; flex-basis: 31px; transform: rotate(-5deg); }
#setup .steps article:nth-child(even) > span { transform: rotate(5deg); }

/* Fixed, predictable mobile navigation */
.mobile-dock,.mobile-more-sheet { display: none; }

/* Login split-screen composition */
.login-body { display: block; padding: 0; }
.login-layout {
  width: min(1320px,calc(100% - 46px));
  min-height: calc(100dvh - 46px);
  display: grid;
  grid-template-columns: minmax(0,1.25fr) minmax(360px,.75fr);
  gap: 22px;
  margin: 23px auto;
}
.login-story,
.login-card {
  border: 2px solid rgba(196,122,216,.34);
  border-radius: 16px;
  background:
    radial-gradient(circle at 84% 7%,rgba(196,122,216,.12),transparent 34%),
    rgba(12,9,15,.82);
  box-shadow: 7px 7px 0 var(--cartoon-ink),0 30px 100px rgba(0,0,0,.35);
  backdrop-filter: blur(16px);
}
.login-story { display: flex; flex-direction: column; min-width: 0; padding: clamp(28px,4.2vw,60px); overflow: hidden; }
.login-brand { display: inline-flex; align-items: center; gap: 13px; width: max-content; color: inherit; text-decoration: none; }
.login-brand strong,.login-brand small { display: block; }
.login-brand strong { font-size: 18px; }
.login-brand small { margin-top: 2px; color: #d99be7; font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
.login-story-copy { max-width: 620px; margin-block: auto; padding-block: 60px; }
.login-story-copy h2 { margin: 0; font-size: clamp(38px,5.2vw,70px); line-height: 1.04; letter-spacing: -.065em; }
.login-story-copy h2 span { color: #cf79e5; text-shadow: 3px 3px 0 #1d0e22; }
.login-story-copy > p:not(.eyebrow) { max-width: 570px; margin: 22px 0 0; color: var(--text-muted); font-size: clamp(13px,1.4vw,17px); line-height: 1.7; }
.login-benefits { display: grid; gap: 15px; margin-top: 32px; }
.login-benefits > div { display: grid; grid-template-columns: 43px minmax(0,1fr); gap: 13px; align-items: center; }
.login-benefits > div > span { width: 40px; height: 40px; display: grid; place-items: center; border: 2px solid rgba(226,161,240,.65); border-radius: 10px; color: #ebaaf4; background: #2b1931; box-shadow: 3px 3px 0 var(--cartoon-ink); font-weight: 900; transform: rotate(-2deg); }
.login-benefits p { margin: 0; }
.login-benefits strong,.login-benefits small { display: block; }
.login-benefits strong { font-size: 12px; }
.login-benefits small { margin-top: 3px; color: var(--text-faint); font-size: 9px; line-height: 1.5; }
.login-story-foot { color: var(--text-faint); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.login-layout .login-card { align-self: center; width: calc(100% - 34px); max-width: 500px; margin: 17px; padding: clamp(28px,4vw,48px); }
.login-layout .login-card::after { opacity: .7; }
.login-layout .login-form input { min-height: 52px; }
.login-layout .login-form .button { min-height: 50px; }

@media (max-width: 1260px) {
  .sidebar { width: 216px; }
  .main { width: calc(100% - 216px); margin-left: 216px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-shortcuts { grid-template-columns: repeat(5,minmax(0,1fr)); }
  .dashboard-shortcuts a { min-height: 105px; }
  .device-control-shell { grid-template-columns: 238px minmax(0,1fr); }
  .device-kpi-grid.resource-overview { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .device-operation-bar { grid-template-columns: auto minmax(70px,1fr) repeat(2,auto); }
  .device-operation-bar form:nth-of-type(3),.device-operation-bar form:nth-of-type(4) { grid-row: 2; }
  .device-operation-bar form:nth-of-type(3) { grid-column: 3; }
  .device-operation-bar form:nth-of-type(4) { grid-column: 4; }
  .resource-kpi.auto-kill { grid-column: auto; }
}

@media (max-width: 1020px) {
  .dashboard-shortcuts { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .authorization-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .device-control-shell { grid-template-columns: 1fr; }
  .device-browser { border-right: 0; border-bottom: 2px solid var(--panel-line); }
  .device-selector-list { padding-inline: 12px; }
  .account-loader-grid { grid-template-columns: 1fr; }
  .account-loader-intro { min-height: 245px; }
  .registered-device-list { grid-template-columns: 1fr; }
  .device-operation-bar { grid-template-columns: auto minmax(70px,1fr) repeat(4,auto); }
  .device-operation-bar form:nth-of-type(3),.device-operation-bar form:nth-of-type(4) { grid-row: auto; grid-column: auto; }
  .login-layout { grid-template-columns: minmax(0,1fr) minmax(350px,.85fr); }
  .login-story-copy h2 { font-size: clamp(38px,5.8vw,58px); }
}

@media (max-width: 760px) {
  body:not(.login-body) { padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
  body.mobile-more-open { overflow: hidden; }
  body::before { background-position: 64% center; opacity: .3; }
  .sidebar { width: min(310px,86vw); }
  .main { width: 100%; margin-left: 0; padding: 12px 12px 36px; }
  .topbar {
    top: 8px;
    display: grid;
    grid-template-columns: 42px minmax(0,1fr) auto;
    gap: 10px;
    min-height: 66px;
    margin: 0 0 18px;
    padding: 10px;
  }
  .topbar h1 { overflow: hidden; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-title-line { align-items: flex-start; flex-direction: column; gap: 5px; }
  .topbar-title-line .badge { max-width: min(100%,220px); padding-inline: 7px; font-size: 7px; }
  .topbar .view-description { display: none; }
  .topbar .logout-form { display: none; }
  .section-heading { align-items: flex-start; min-height: 0; }
  .section-heading h2 { font-size: 23px; }
  .section-heading .heading-actions { align-items: flex-end; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { min-height: 112px; padding: 14px; }
  .stat-card strong { font-size: 25px; }
  .dashboard-grid { margin-top: 12px; }
  .dashboard-shortcuts { grid-template-columns: 1fr 1fr; }
  .dashboard-device-row { grid-template-columns: 42px minmax(0,1fr) auto; }
  .dashboard-device-seen { display: none; }
  .authorization-stats { grid-template-columns: 1fr 1fr; gap: 9px; }
  .authorization-stats article { min-height: 88px; padding: 11px; }
  .authorization-stat-icon { width: 34px; height: 34px; flex-basis: 34px; }
  .authorization-stats p { display: none; }

  .device-control-shell { margin-inline: 0; overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .device-browser { padding: 13px 0; border: 2px solid var(--panel-line); border-radius: 11px; background: var(--panel-surface); box-shadow: 4px 4px 0 var(--cartoon-ink); }
  .device-selector-list { display: grid; max-height: min(360px,48dvh); margin: 0 10px 11px; overflow-x: hidden; overflow-y: auto; padding: 9px; }
  .device-selector-wrap { width: 100%; max-width: none; flex: none; }
  .device-selector-wrap .device-selector { width: 100%; min-width: 0; max-width: none; min-height: 94px; }
  .device-stage { padding: 14px 0 0; }
  .device-control-header { min-height: 0; }
  .device-control-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .device-control-actions form,.device-control-actions .button { width: 100%; }
  .device-kpi-grid { grid-template-columns: 1fr 1fr; }
  .device-kpi-grid > div { min-height: 92px; }
  .device-kpi-grid.resource-overview { grid-template-columns: 1fr 1fr; gap: 9px; }
  .resource-overview .resource-kpi { min-height: 130px; padding: 11px 12px 17px; }
  .resource-kpi progress,.resource-track { right: 11px; bottom: 9px; left: 11px; }
  .package-control-card { overflow: hidden; }
  .bulk-rejoin-bar { position: sticky; z-index: 5; bottom: calc(78px + env(safe-area-inset-bottom)); }
  .device-operation-bar { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
  .device-operation-bar > label,.device-operation-bar > small { grid-column: span 1; }
  .device-operation-bar form,.device-operation-bar form:nth-of-type(3),.device-operation-bar form:nth-of-type(4) { width: 100%; grid-row: auto; grid-column: auto; }
  .device-operation-bar .button { width: 100%; min-height: 38px; padding-inline: 7px; font-size: 7.5px; }

  .mobile-dock {
    position: fixed;
    z-index: 72;
    right: 10px;
    bottom: calc(9px + env(safe-area-inset-bottom));
    left: 10px;
    min-height: 68px;
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 5px;
    padding: 7px;
    border: 2px solid rgba(216,154,232,.42);
    border-radius: 18px 10px 17px 10px;
    background: rgba(17,12,21,.95);
    box-shadow: 5px 5px 0 rgba(5,3,7,.92),0 18px 50px rgba(0,0,0,.48);
    backdrop-filter: blur(18px);
  }
  .customer-service-widget { right:16px; bottom:calc(96px + env(safe-area-inset-bottom)); z-index:74; }
  .mobile-dock { isolation:isolate; }
  .mobile-dock.mobile-dock-compact { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .mobile-dock-link { position:relative; z-index:1; pointer-events:auto; touch-action:manipulation; }
  .mobile-dock-link {
    min-width: 0;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 3px;
    padding: 5px 3px;
    border: 2px solid transparent;
    border-radius: 9px;
    color: var(--text-faint);
    background: transparent;
    box-shadow: none;
    font-size: 7px;
    font-weight: 800;
    text-decoration: none;
  }
  .mobile-dock-link .nav-icon { width: 21px; height: 21px; flex-basis: 21px; }
  .mobile-dock-link > span:last-child { width: auto; }
  .mobile-dock-link.active { color: #190d20; border-color: #e9b4f2; background: #bc6bd0; box-shadow: 3px 3px 0 var(--cartoon-ink); transform: translate(-1px,-1px); }
  button.mobile-dock-link { width: 100%; font: inherit; cursor: pointer; }
  .mobile-more-dots { height: 21px; display: flex; align-items: center; gap: 3px; }
  .mobile-more-dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
  .mobile-more-toggle.more-active { color: #190d20; border-color: #e9b4f2; background: #bc6bd0; box-shadow: 3px 3px 0 var(--cartoon-ink); }

  .account-loader-heading { align-items: flex-start; }
  .account-loader-heading .account-device-count { margin-top: 5px; }
  .account-loader-grid { gap: 12px; }
  .account-loader-intro { min-height: 250px; padding: 20px; }
  .account-loader-intro h3,.account-loader-command h3 { font-size: 25px; }
  .account-loader-command { padding-top: 54px; }
  .registered-device-head { min-height: 68px; padding: 13px 14px; }
  .registered-device-row { grid-template-columns: 42px minmax(0,1fr) auto 17px; padding: 12px; }
  .registered-device-seen { display: none; }
  #setup .steps { padding-left: 0; }
  #setup .steps::before { left: 15px; }
  #setup .steps article,#setup .steps article:nth-child(even) { margin-left: 0; padding: 13px; }
  .mobile-more-sheet:not([hidden]) { position: fixed; z-index: 110; inset: 0; display: block; }
  .mobile-more-scrim { position: absolute; inset: 0; width: 100%; border: 0; border-radius: 0; background: rgba(5,3,7,.72); box-shadow: none; }
  .mobile-more-panel {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    max-height: min(620px,88dvh);
    padding: 10px 15px calc(18px + env(safe-area-inset-bottom));
    overflow-y: auto;
    border: 2px solid #c47ad8;
    border-bottom: 0;
    border-radius: 20px 20px 0 0;
    background: rgba(23,17,28,.985);
    box-shadow: 0 -24px 70px rgba(0,0,0,.55);
    animation: mobile-sheet-in .24s cubic-bezier(.2,.8,.25,1) both;
  }
  .mobile-sheet-handle { width: 46px; height: 5px; display: block; margin: 0 auto 13px; border-radius: 99px; background: rgba(226,161,240,.4); }
  .mobile-more-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 4px 2px 13px; }
  .mobile-more-heading p { margin-bottom: 2px; }
  .mobile-more-heading strong { font-size: 17px; }
  .mobile-more-heading button { width: 36px; height: 36px; border: 2px solid rgba(196,122,216,.35); border-radius: 9px; color: white; background: #211724; box-shadow: 3px 3px 0 var(--cartoon-ink); font-size: 20px; }
  .mobile-more-links { display: grid; gap: 8px; }
  .mobile-more-links .nav-link { min-height: 64px; display: grid; grid-template-columns: 32px minmax(0,1fr); padding: 11px; border-color: rgba(196,122,216,.22); background: rgba(255,255,255,.025); }
  .mobile-more-links .nav-link > span { width: auto; min-width: 0; text-align: left; }
  .mobile-more-links strong,.mobile-more-links small { display: block; }
  .mobile-more-links strong { color: var(--text-main); font-size: 11px; }
  .mobile-more-links small { margin-top: 3px; color: var(--text-faint); font-size: 8px; }
  .mobile-logout-form { margin-top: 12px; }
  .mobile-logout-form .button { width: 100%; min-height: 46px; }
  @keyframes mobile-sheet-in { from { opacity: 0; transform: translateY(34px); } to { opacity: 1; transform: translateY(0); } }

  /* Mobile table-to-card conversion, preserving every real action. */
  .device-package-table,
  .delta-key-table,
  .script-library-table { margin: 10px 0 0; overflow: visible; }
  .device-package-table table,
  .delta-key-table table,
  .script-library-table table,
  .device-package-table tbody,
  .delta-key-table tbody,
  .script-library-table tbody { display: block; min-width: 0; }
  .device-package-table thead,
  .delta-key-table thead,
  .script-library-table thead { display: none; }
  .device-package-table tr,
  .delta-key-table tr,
  .script-library-table tr { position: relative; display: block; margin: 10px; padding: 10px; border: 2px solid rgba(196,122,216,.2); border-radius: 10px; background: rgba(15,11,18,.75); box-shadow: 3px 3px 0 rgba(7,5,8,.82); }
  .device-package-table td,
  .delta-key-table td,
  .script-library-table td { min-height: 42px; display: grid; grid-template-columns: 90px minmax(0,1fr); gap: 10px; align-items: center; padding: 9px 4px; border-top: 1px solid rgba(196,122,216,.12); font-size: 10px; }
  .device-package-table td::before,
  .delta-key-table td::before,
  .script-library-table td::before { color: var(--text-faint); font-size: 7px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
  .device-package-table td:first-child { position: absolute; z-index: 2; top: 17px; right: 15px; display: block; min-height: 0; padding: 0; border: 0; }
  .device-package-table td:nth-child(2) { min-height: 54px; padding-right: 34px; border-top: 0; }
  .device-package-table td:nth-child(2)::before { content: "Package"; }
  .device-package-table td:nth-child(3)::before { content: "Account"; }
  .device-package-table td:nth-child(4)::before { content: "Status"; }
  .device-package-table td:nth-child(5)::before { content: "Key status"; }
  .device-package-table td:nth-child(6)::before { content: "Auto rejoin"; }
  .device-package-table td:nth-child(7) { display: block; }
  .device-package-table td:nth-child(7)::before { content: "Actions"; display: block; margin-bottom: 9px; }
  .device-package-table .package-actions { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; }
  .device-package-table .package-actions form { width: auto; }
  .device-package-table .package-actions .package-action-icon,.device-package-table .package-actions .package-trash-button { width: 36px; height: 36px; }
  .device-package-table .account-identity { min-width: 0; }

  .delta-key-table td:nth-child(1) { border-top: 0; }
  .delta-key-table td:nth-child(1)::before { content: "Device"; }
  .delta-key-table td:nth-child(2)::before { content: "Status"; }
  .delta-key-table td:nth-child(3)::before { content: "Authorization"; }
  .delta-key-table td:nth-child(4)::before { content: "Helper package"; }
  .delta-key-table td:nth-child(5)::before { content: "Completed"; }
  .delta-key-table td:nth-child(6)::before { content: "Expires"; }
  .delta-key-table td:nth-child(7)::before { content: "Action"; }
  .delta-key-table td form,.delta-key-table td .button { width: 100%; }

  .script-library-table td:nth-child(1) { border-top: 0; }
  .script-library-table td:nth-child(1)::before { content: "Script"; }
  .script-library-table td:nth-child(2)::before { content: "File"; }
  .script-library-table td:nth-child(3)::before { content: "Devices"; }
  .script-library-table td:nth-child(4)::before { content: "Modified"; }
  .script-library-table td:nth-child(5) { display: block; }
  .script-library-table td:nth-child(5)::before { content: "Actions"; display: block; margin-bottom: 9px; }
  .script-library-table .script-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .script-library-table .script-actions form,.script-library-table .script-actions .button { width: 100%; }
  .device-package-table td[colspan],
  .delta-key-table td[colspan],
  .script-library-table td[colspan] { position: static; display: block; padding: 0; border: 0; }
  .device-package-table td[colspan]::before,
  .delta-key-table td[colspan]::before,
  .script-library-table td[colspan]::before { display: none; }

  .login-layout { width: min(560px,calc(100% - 24px)); min-height: calc(100dvh - 24px); display: block; margin: 12px auto; }
  .login-story { display: none; }
  .login-layout .login-card { width: 100%; max-width: none; margin: 0; padding: 34px 22px; }
}

/* Desktop readability: 100% browser zoom should feel close to the former 125% view. */
@media (min-width:1200px) {
  .sidebar { width:264px; padding:28px 22px; }
  .main { width:calc(100% - 264px); margin-left:264px; padding:36px clamp(30px,3.4vw,62px) 84px; }
  .brand { gap:14px; margin-bottom:28px; padding-bottom:24px; }
  .brand-mark { width:45px; height:45px; flex-basis:45px; }
  .brand strong { font-size:16px; }.brand small { font-size:10.5px; }
  .nav { gap:11px; }.nav-link { min-height:51px; padding:12px 13px; font-size:13px; }.nav-icon { width:26px; height:26px; flex-basis:26px; }
  .sidebar-footer { padding:15px; }.sidebar-footer strong,.profile-copy strong { font-size:12px; }.sidebar-footer small { font-size:9px; }.profile-license { font-size:9px; }
  .profile-avatar { width:42px; height:42px; flex-basis:42px; font-size:16px; }
  .topbar { min-height:94px; margin-bottom:35px; padding:18px 20px; }.topbar h1 { font-size:clamp(29px,2.5vw,39px); }.view-description { font-size:15px; }
  .eyebrow { font-size:10.5px; }.section-heading { min-height:64px; margin-bottom:23px; }.section-heading h2 { font-size:clamp(25px,2.1vw,33px); }
  .section-heading>div>p:last-child,.control-intro,.muted-text { font-size:12px; line-height:1.65; }
  .button { min-height:42px; padding:10px 16px; font-size:12.5px; }.button.compact { min-height:36px; }
  input,select,textarea { min-height:48px; font-size:12px; }.badge { min-height:27px; padding:5px 9px; font-size:10px; }
  .card { padding:clamp(22px,2.5vw,32px); }.stat-card { min-height:145px; padding:22px; }.stat-card small,.stat-card p { font-size:11px; }
}

@media (max-width: 480px) {
  .main { padding-inline: 10px; }
  .topbar-title-line .badge { font-size: 6.5px; }
  .stats-grid { gap: 9px; }
  .stat-card { min-height: 104px; gap: 9px; }
  .stat-icon { width: 32px; height: 32px; }
  .stat-card small { font-size: 7px; }
  .stat-card p { font-size: 7.5px; }
  .dashboard-device-copy small { max-width: 165px; }
  .dashboard-shortcuts { grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; }
  .dashboard-shortcuts a { min-height: 108px; padding: 11px; }
  .authorization-stats article { gap: 8px; }
  .authorization-stats strong { font-size: 19px; }
  .device-kpi-grid { grid-template-columns: 1fr 1fr; }
  .device-kpi-grid strong { font-size: 16px; }
  .resource-overview .resource-kpi { min-height: 126px; }
  .resource-kpi .resource-kpi-head { gap: 6px; }
  .resource-icon { width: 29px; height: 28px; flex-basis: 29px; }
  .resource-icon svg { width: 17px; height: 17px; }
  .resource-kpi .resource-kpi-head small { max-width: calc(100% - 35px); font-size: 6.5px; }
  .resource-kpi .resource-note { font-size: 6.5px; }
  .account-device-count { padding: 7px 9px; }
  .account-loader-intro { min-height: 265px; }
  .loader-orbit { right: -90px; }
  .registered-device-row { grid-template-columns: 39px minmax(0,1fr) auto 13px; gap: 7px; padding-inline: 10px; }
  .registered-device-icon { width: 36px; height: 39px; }
  .registered-device-copy em { max-width: 130px; }
  .registered-device-state { min-width: 48px; padding-inline: 5px; font-size: 6.5px; }
  .device-package-table td,
  .delta-key-table td,
  .script-library-table td { grid-template-columns: 78px minmax(0,1fr); }
  .device-package-table .package-actions { display: flex; }
  .cartoon-confirm-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .ui-page-loader,.unicon-motion-loader svg,.unicon-motion-loader circle,
  .authorization-stat-icon.processing,[data-command-busy="1"] button[type="submit"]::before,
  form.ui-form-submitting button[type="submit"]::before,.loader-orbit,
  .resource-kpi:hover .resource-icon { animation: none !important; }
}
