:root {
  --bg: #eceeed;
  --bg-strong: #dde1df;
  --surface: rgba(249, 250, 249, 0.96);
  --surface-strong: #f8f9f8;
  --ink: #242a2c;
  --ink-soft: #626b6e;
  --line: rgba(36, 42, 44, 0.13);
  --accent: #59666b;
  --accent-strong: #3f4b50;
  --accent-soft: rgba(89, 102, 107, 0.12);
  --mint: #0e8a75;
  --mint-soft: rgba(14, 138, 117, 0.14);
  --gold: #c48d1f;
  --danger: #c74343;
  --danger-soft: rgba(199, 67, 67, 0.12);
  --shadow: 0 14px 34px rgba(32, 38, 40, 0.09);
  --radius-xl: 18px;
  --radius-lg: 15px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --page-background: linear-gradient(180deg, #f2f3f2, #e7eae8);
  --sidebar-background: linear-gradient(180deg, #343b3e, #272e31);
  --brand-background: rgba(255, 255, 255, 0.045);
  --hero-background: var(--surface-strong);
  --hero-accent-background: linear-gradient(160deg, #3b4447, #2c3437);
  --primary-background: linear-gradient(135deg, #59666b, #737f83);
  --primary-shadow: 0 8px 18px rgba(41, 50, 53, 0.18);
  --focus-border: rgba(89, 102, 107, 0.62);
  --focus-ring: rgba(89, 102, 107, 0.13);
  --panel-glow: rgba(255, 255, 255, 0.07);
}

html[data-theme="fun"] {
  --bg: #f4efe6;
  --bg-strong: #ebe1d2;
  --surface: rgba(255, 251, 244, 0.9);
  --surface-strong: #fffaf1;
  --ink: #1d2a2e;
  --ink-soft: #526265;
  --line: rgba(29, 42, 46, 0.12);
  --accent: #c95b2b;
  --accent-strong: #a7481e;
  --accent-soft: rgba(201, 91, 43, 0.12);
  --shadow: 0 24px 60px rgba(38, 31, 22, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --page-background:
    radial-gradient(circle at top left, rgba(201, 91, 43, 0.18), transparent 26%),
    radial-gradient(circle at right 20%, rgba(14, 138, 117, 0.18), transparent 20%),
    linear-gradient(180deg, #f6f1e7, #eee4d3 52%, #e7dac5);
  --sidebar-background: linear-gradient(180deg, rgba(23, 40, 44, 0.92), rgba(29, 42, 46, 0.98));
  --brand-background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    linear-gradient(135deg, rgba(201, 91, 43, 0.18), rgba(14, 138, 117, 0.16));
  --hero-background:
    linear-gradient(160deg, rgba(255, 250, 241, 0.9), rgba(247, 238, 223, 0.92)),
    var(--surface-strong);
  --hero-accent-background:
    linear-gradient(160deg, rgba(29, 42, 46, 0.96), rgba(38, 63, 69, 0.96)),
    #22393d;
  --primary-background: linear-gradient(135deg, var(--accent), #e1813f);
  --primary-shadow: 0 12px 24px rgba(201, 91, 43, 0.22);
  --focus-border: rgba(201, 91, 43, 0.55);
  --focus-ring: rgba(201, 91, 43, 0.12);
  --panel-glow: rgba(201, 91, 43, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page-background);
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  transition: color 260ms ease, background 360ms ease;
}

html[data-theme="fun"] body::before {
  content: "";
  position: fixed;
  z-index: 0;
  inset: 0;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(29, 42, 46, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 42, 46, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 24px;
  background: var(--sidebar-background);
  color: #f6f1e7;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-card,
.panel {
  backdrop-filter: blur(18px);
}

.brand-card {
  position: relative;
  padding: 22px;
  border-radius: var(--radius-xl);
  background: var(--brand-background);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  margin-bottom: 18px;
}

.theme-screw {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 25px;
  height: 25px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #9ba2a2, #4d5658 48%, #20282a 76%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.4),
    0 2px 4px rgba(4, 12, 14, 0.34);
  cursor: pointer;
  opacity: 0.58;
  transform: rotate(0deg);
  transition: opacity 180ms ease, transform 520ms cubic-bezier(0.2, 0.9, 0.25, 1.18), box-shadow 180ms ease;
}

.theme-screw span {
  position: absolute;
  top: 10px;
  left: 4px;
  width: 15px;
  height: 3px;
  border-radius: 999px;
  background: #202729;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.28);
}

.theme-screw:hover,
.theme-screw:focus-visible {
  opacity: 1;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.5),
    0 0 0 4px rgba(255, 255, 255, 0.08),
    0 3px 5px rgba(4, 12, 14, 0.38);
}

.theme-screw:focus-visible {
  outline: 2px solid rgba(255, 237, 183, 0.92);
  outline-offset: 3px;
}

html[data-theme="fun"] .theme-screw {
  opacity: 0.92;
  background: radial-gradient(circle at 36% 30%, #f0c46c, #9a6520 48%, #493014 76%);
  transform: rotate(135deg);
}

.brand-card h1 {
  margin: 8px 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  letter-spacing: 0.02em;
}

.brand-copy {
  margin: 0;
  color: rgba(246, 241, 231, 0.74);
  line-height: 1.5;
}

.eyebrow {
  margin: 0;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: inherit;
  opacity: 0.72;
}

.panel {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow);
}

.sidebar .panel {
  margin-top: 18px;
}

.panel-glow {
  position: relative;
  overflow: hidden;
}

.panel-glow::after {
  content: "";
  position: absolute;
  inset: auto -30% -70% auto;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--panel-glow), transparent 70%);
  pointer-events: none;
}

.main-stage {
  padding: 26px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.hero-card {
  border-radius: 30px;
  padding: 28px;
  background: var(--hero-background);
  border: 1px solid rgba(29, 42, 46, 0.09);
  box-shadow: var(--shadow);
  animation: float-in 420ms ease;
}

.hero-card-accent {
  background: var(--hero-accent-background);
  color: #f7efe2;
}

.hero-card h2 {
  margin: 8px 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 2vw, 2.8rem);
}

.hero-copy,
.helper-copy {
  line-height: 1.55;
  color: var(--ink-soft);
}

.hero-card-accent .helper-copy,
.hero-card-accent .hero-copy,
.hero-card-accent .eyebrow {
  color: rgba(247, 239, 226, 0.78);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.hero-metrics article {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.55);
}

.hero-card-accent .hero-metrics article {
  background: rgba(255, 255, 255, 0.08);
}

.metric-label {
  display: block;
  font-size: 0.85rem;
  color: inherit;
  opacity: 0.72;
}

.hero-metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 1.8rem;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.panel-large,
.panel-wide {
  grid-column: span 2;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-heading h2 {
  margin: 3px 0 0;
  font-size: 1.25rem;
}

.stack-form {
  display: grid;
  gap: 14px;
}

.stack-form label,
.device-targets {
  display: grid;
  gap: 8px;
}

label span,
legend {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
}

input,
select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid rgba(29, 42, 46, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  outline: none;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

input:focus,
select:focus {
  border-color: var(--focus-border);
  box-shadow: 0 0 0 4px var(--focus-ring);
  transform: translateY(-1px);
}

.form-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(1px);
}

.button:disabled,
.quick-action:disabled {
  cursor: wait;
  opacity: 0.62;
}

.button-primary {
  color: #fff8ef;
  background: var(--primary-background);
  box-shadow: var(--primary-shadow);
}

.button-warning {
  color: #fff9ef;
  background: linear-gradient(135deg, #bd4b3f, #d46d39);
}

.button-ghost {
  color: var(--ink);
  background: rgba(29, 42, 46, 0.06);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.device-badges {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.device-badges .status-badge {
  min-width: 0;
  padding: 5px 9px;
}

.status-idle {
  background: rgba(29, 42, 46, 0.08);
  color: var(--ink-soft);
}

.status-ok {
  background: var(--mint-soft);
  color: var(--mint);
}

.status-problem,
.status-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-warn {
  background: rgba(196, 141, 31, 0.14);
  color: var(--gold);
}

.inline-toggle,
.pill-choice {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.device-filters {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.device-filters .inline-toggle {
  justify-content: flex-start;
  white-space: nowrap;
}

.device-filters .inline-toggle span {
  font-size: 0.78rem;
}

.inline-toggle input,
.pill-choice input {
  width: auto;
}

.device-list {
  display: grid;
  gap: 10px;
}

.device-item {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(29, 42, 46, 0.08);
  border-radius: var(--radius-lg);
  padding: 14px;
  background: rgba(29, 42, 46, 0.03);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.device-item:hover {
  transform: translateX(4px);
  background: rgba(29, 42, 46, 0.06);
}

.device-item.active {
  border-color: rgba(201, 91, 43, 0.7);
  background: linear-gradient(135deg, rgba(201, 91, 43, 0.14), rgba(255, 250, 241, 0.96));
  box-shadow: 0 12px 24px rgba(201, 91, 43, 0.10);
}

.device-topline,
.device-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.device-name {
  font-weight: 700;
  color: var(--ink);
}

.device-meta {
  margin-top: 10px;
  font-size: 0.84rem;
  color: var(--ink-soft);
}

.device-item .device-topline,
.device-item .device-name,
.device-item .device-meta,
.device-item .device-meta span {
  color: inherit;
}

.device-item .device-topline,
.device-item .device-name {
  color: var(--ink);
}

.device-item .device-meta,
.device-item .device-meta span {
  color: var(--ink-soft);
}

.device-detail {
  display: grid;
  gap: 18px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.detail-card {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: rgba(29, 42, 46, 0.05);
}

.detail-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.3rem;
}

.issue-list,
.note-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-soft);
}

.upload-progress {
  display: grid;
  gap: 16px;
}

.progress-hero {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(14, 138, 117, 0.12), rgba(201, 91, 43, 0.14));
}

.progress-bar {
  position: relative;
  height: 16px;
  border-radius: 999px;
  background: rgba(29, 42, 46, 0.08);
  overflow: hidden;
  margin-top: 14px;
}

.progress-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), #67c8b4, var(--accent));
  transition: width 260ms ease;
}

.progress-caption {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.meta-grid,
.target-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.meta-chip,
.target-chip {
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(29, 42, 46, 0.05);
}

.target-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.target-chip input {
  width: auto;
}

.table-shell {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--ink-soft);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  isolation: isolate;
  margin: 16px 0;
}

.quick-action {
  --quick-action-edge: #203236;
  --quick-action-tilt: 0deg;
  --quick-action-control-top: #ed7a3a;
  --quick-action-control-bottom: #a4381e;
  --quick-action-control-border: #732512;
  position: relative;
  min-height: 112px;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-bottom: 6px solid var(--quick-action-edge);
  border-radius: 16px;
  padding: 20px 16px 15px;
  color: #fffaf1;
  cursor: pointer;
  isolation: isolate;
  text-align: left;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    inset 0 -16px 22px rgba(4, 18, 21, 0.16),
    0 8px 0 rgba(5, 15, 18, 0.3),
    0 16px 24px rgba(7, 17, 20, 0.24);
  transform: rotateZ(var(--quick-action-tilt));
  transform-style: preserve-3d;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.quick-action:hover:not(:disabled) {
  transform: translateY(-3px) rotateX(1deg) rotateY(-0.5deg) rotateZ(var(--quick-action-tilt));
  filter: saturate(1.08);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.28),
    inset 0 -18px 18px rgba(4, 18, 21, 0.12),
    0 11px 0 rgba(5, 15, 18, 0.28),
    0 22px 30px rgba(7, 17, 20, 0.3);
}

.quick-action:active:not(:disabled) {
  transform: translateY(5px) rotateZ(var(--quick-action-tilt));
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.2),
    inset 0 -13px 18px rgba(4, 18, 21, 0.2),
    0 3px 0 rgba(5, 15, 18, 0.32),
    0 10px 18px rgba(7, 17, 20, 0.22);
}

.quick-action.is-armed {
  z-index: 10;
}

.quick-action:focus-visible {
  outline: 3px solid rgba(255, 230, 159, 0.96);
  outline-offset: 3px;
}

.quick-action-program {
  --quick-action-edge: #853a1a;
  --quick-action-tilt: -0.55deg;
  --quick-action-control-top: #f39449;
  --quick-action-control-bottom: #bb4d24;
  --quick-action-control-border: #783017;
  background: linear-gradient(135deg, #bd5a2b, #e1843d);
}

.quick-action-agent {
  --quick-action-edge: #04514d;
  --quick-action-tilt: 0.45deg;
  --quick-action-control-top: #38c5ae;
  --quick-action-control-bottom: #08756f;
  --quick-action-control-border: #034b48;
  background: linear-gradient(135deg, #08756f, #1a9f8a);
}

.quick-action-reboot {
  --quick-action-edge: #762029;
  --quick-action-tilt: 0.55deg;
  --quick-action-control-top: #f45f63;
  --quick-action-control-bottom: #a51f31;
  --quick-action-control-border: #6e1420;
  background: linear-gradient(135deg, #a7343d, #d05a42);
}

.quick-action-git {
  --quick-action-edge: #183c4c;
  --quick-action-tilt: -0.45deg;
  --quick-action-control-top: #58a9bd;
  --quick-action-control-bottom: #24556a;
  --quick-action-control-border: #153b4b;
  background: linear-gradient(135deg, #24556a, #287c78);
}

.quick-action-content {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 7px;
  padding-left: 76px;
}

.quick-action-content strong {
  font-size: 0.96rem;
  line-height: 1.2;
}

.quick-action-content small {
  color: rgba(255, 250, 241, 0.74);
  font-size: 0.73rem;
}

.quick-action-guard {
  position: absolute;
  z-index: 3;
  top: 17px;
  left: 12px;
  width: 64px;
  height: 72px;
  perspective: 360px;
  transform: rotateY(-3deg) rotateX(2deg);
  transform-style: preserve-3d;
}

.quick-action-guard::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 10px 2px 1px;
  border: 1px solid rgba(2, 12, 14, 0.7);
  border-radius: 12px;
  background:
    radial-gradient(circle at 9px 9px, #5f6664 0 2px, #1b2425 2.5px 4px, transparent 4.5px),
    radial-gradient(circle at calc(100% - 9px) 9px, #5f6664 0 2px, #1b2425 2.5px 4px, transparent 4.5px),
    radial-gradient(circle at 9px calc(100% - 9px), #5f6664 0 2px, #1b2425 2.5px 4px, transparent 4.5px),
    radial-gradient(circle at calc(100% - 9px) calc(100% - 9px), #5f6664 0 2px, #1b2425 2.5px 4px, transparent 4.5px),
    linear-gradient(145deg, #334346, #142124);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 4px 0 rgba(3, 12, 14, 0.55),
    0 7px 10px rgba(3, 14, 17, 0.32);
}

.quick-action-guard::after {
  content: "";
  position: absolute;
  z-index: 5;
  top: 7px;
  left: 13px;
  width: 38px;
  height: 9px;
  border: 1px solid rgba(2, 12, 14, 0.78);
  border-radius: 999px;
  background: linear-gradient(180deg, #718083, #1a282b 48%, #0b1517 52%, #4a595c);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 2px 3px rgba(1, 9, 11, 0.48);
}

.quick-action-control {
  position: absolute;
  z-index: 2;
  top: 23px;
  left: 11px;
  width: 42px;
  height: 42px;
  border: 4px solid #e4b61f;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffdf62, #a86a03);
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.72),
    0 3px 0 rgba(68, 39, 3, 0.72),
    0 6px 8px rgba(3, 14, 17, 0.34);
}

.quick-action-control span {
  position: absolute;
  inset: 4px;
  border: 1px solid var(--quick-action-control-border);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 27%, rgba(255, 255, 255, 0.72) 0 8%, transparent 10%),
    linear-gradient(145deg, var(--quick-action-control-top), var(--quick-action-control-bottom));
  box-shadow:
    inset 0 3px 4px rgba(255, 255, 255, 0.36),
    inset 0 -5px 6px rgba(30, 5, 8, 0.38),
    0 2px 0 var(--quick-action-control-border);
}

.quick-action::after {
  content: "";
  position: absolute;
  z-index: 1;
  right: 13px;
  bottom: 5px;
  left: 13px;
  height: 9px;
  border-radius: 0 0 10px 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(4, 15, 18, 0.3));
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.16);
  pointer-events: none;
}

.quick-action-lid {
  position: absolute;
  z-index: 4;
  top: 10px;
  left: 4px;
  width: 56px;
  height: 58px;
  border: 2px solid rgba(222, 246, 246, 0.78);
  border-radius: 9px 9px 12px 12px;
  background:
    linear-gradient(112deg, rgba(255, 255, 255, 0.68) 0 9%, rgba(255, 255, 255, 0.11) 24% 64%, rgba(183, 226, 225, 0.2) 66% 82%, rgba(7, 20, 24, 0.14)),
    rgba(218, 242, 241, 0.16);
  box-shadow:
    inset 2px 0 0 rgba(255, 255, 255, 0.22),
    inset -3px -4px 7px rgba(20, 72, 74, 0.12),
    0 0 0 1px rgba(3, 17, 20, 0.22),
    0 5px 8px rgba(3, 14, 17, 0.2);
  backdrop-filter: blur(0.7px);
  pointer-events: none;
  transform: translate3d(0, 0, 13px) rotateX(0deg);
  transform-origin: 50% 2px;
  transform-style: preserve-3d;
  transition: transform 500ms cubic-bezier(0.18, 0.92, 0.3, 1.16), box-shadow 420ms ease;
}

.quick-action-lid span {
  position: absolute;
  bottom: 6px;
  left: 50%;
  width: 24px;
  height: 6px;
  border: 1px solid rgba(229, 250, 248, 0.72);
  border-radius: 2px 2px 6px 6px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(20, 56, 60, 0.34));
  box-shadow: 0 1px 2px rgba(2, 14, 16, 0.28);
  transform: translateX(-50%);
}

.quick-action-lid::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 30px;
  height: 8px;
  border: 1px solid rgba(203, 234, 234, 0.68);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(237, 252, 250, 0.78), rgba(26, 56, 59, 0.46));
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.48),
    0 1px 2px rgba(3, 15, 17, 0.4);
  transform: translateX(-50%);
}

.quick-action-lid::after {
  content: "";
  position: absolute;
  top: 7px;
  right: 7px;
  width: 9px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
  transform: rotate(-7deg);
}

.quick-action.is-armed .quick-action-lid {
  box-shadow:
    inset 2px 0 0 rgba(255, 255, 255, 0.28),
    inset -3px -4px 7px rgba(20, 72, 74, 0.12),
    0 0 0 1px rgba(3, 17, 20, 0.2),
    0 12px 13px rgba(3, 14, 17, 0.28);
  transform: translate3d(2px, -30px, 34px) rotateX(64deg) rotateZ(-3deg);
}

.quick-action.is-armed .quick-action-control span {
  filter: brightness(1.08) saturate(1.1);
}

html[data-theme="standard"] .quick-action {
  min-height: 72px;
  padding: 16px 17px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom-width: 1px;
  border-radius: 10px;
  color: #273034;
  background: linear-gradient(180deg, #f3f5f4, #e3e7e5);
  box-shadow: 0 4px 10px rgba(5, 15, 18, 0.16);
  transform: none;
}

html[data-theme="standard"] .quick-action::before {
  content: "";
  position: absolute;
  top: 13px;
  bottom: 13px;
  left: 0;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--quick-action-control-top);
  opacity: 0.76;
}

html[data-theme="standard"] .quick-action::after,
html[data-theme="standard"] .quick-action-guard {
  display: none;
}

html[data-theme="standard"] .quick-action-content {
  gap: 4px;
  padding-left: 0;
}

html[data-theme="standard"] .quick-action-content small {
  color: #6b7477;
}

html[data-theme="standard"] .quick-action:hover:not(:disabled) {
  filter: none;
  box-shadow: 0 7px 15px rgba(5, 15, 18, 0.2);
  transform: translateY(-1px);
}

html[data-theme="standard"] .quick-action:active:not(:disabled) {
  box-shadow: 0 2px 6px rgba(5, 15, 18, 0.14);
  transform: translateY(1px);
}

html[data-theme="standard"] .quick-action.is-armed {
  outline: 2px solid rgba(255, 255, 255, 0.72);
  outline-offset: -5px;
  background: #d9dedc;
}

@media (prefers-reduced-motion: reduce) {
  body,
  .theme-screw,
  .quick-action,
  .quick-action-control span,
  .quick-action-lid,
  .quick-action-content {
    transition: none;
  }
}

.commands-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.commands-pagination span {
  color: var(--ink-soft);
  font-size: 0.85rem;
  text-align: center;
}

.command-status {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 0.76rem;
  font-weight: 700;
}

.command-status-pending {
  color: #8c6111;
  background: rgba(196, 141, 31, 0.16);
}

.command-status-dispatched {
  color: #236783;
  background: rgba(35, 103, 131, 0.12);
}

.command-status-completed {
  color: var(--mint);
  background: var(--mint-soft);
}

.command-status-failed {
  color: var(--danger);
  background: var(--danger-soft);
}

.command-details {
  min-width: 190px;
}

.command-details summary {
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.command-details-failed summary,
.command-failure-reason {
  color: var(--danger);
}

.command-details-body {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.command-details-body span {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.command-details-body pre {
  max-width: 420px;
  max-height: 220px;
  margin: 0;
  overflow: auto;
  padding: 10px;
  border-radius: 10px;
  background: rgba(29, 42, 46, 0.06);
  color: var(--ink);
  font-size: 0.76rem;
  white-space: pre-wrap;
}

.command-failure-reason {
  margin: 0;
  line-height: 1.4;
}

.empty-state {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(29, 42, 46, 0.04);
  color: var(--ink-soft);
}

.toast-host {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  z-index: 30;
}

.toast {
  min-width: 260px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  color: #fff9ef;
  background: rgba(29, 42, 46, 0.92);
  box-shadow: 0 18px 36px rgba(29, 42, 46, 0.22);
  animation: toast-in 220ms ease;
}

.toast.error {
  background: rgba(199, 67, 67, 0.96);
}

.toast.success {
  background: rgba(14, 138, 117, 0.96);
}

.settings-dialog {
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 28px;
  color: var(--ink);
  background: var(--surface-strong);
  box-shadow: 0 30px 90px rgba(15, 30, 34, 0.34);
}

.settings-dialog::backdrop {
  background: rgba(17, 31, 35, 0.62);
  backdrop-filter: blur(5px);
}

.settings-sheet {
  display: grid;
  gap: 22px;
  padding: 28px;
}

.settings-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.config-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-strong) 82%, var(--accent-soft));
}

.config-field > input[type="checkbox"] {
  margin-top: 5px;
}

.config-field-control {
  display: grid;
  gap: 7px;
}

.config-field-control small {
  color: var(--ink-soft);
  line-height: 1.45;
}

.config-field textarea {
  min-height: 88px;
  resize: vertical;
}

.config-field:not(.enabled) .config-value {
  opacity: 0.52;
  pointer-events: none;
}

.settings-warning {
  padding: 14px 16px;
  border-left: 4px solid var(--gold);
  border-radius: 12px;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--gold) 10%, transparent);
}

.settings-actions {
  justify-content: flex-end;
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .hero-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .panel-large,
  .panel-wide {
    grid-column: span 1;
  }

  .detail-grid,
  .hero-metrics,
  .meta-grid,
  .target-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .main-stage,
  .sidebar {
    padding: 16px;
  }

  .panel,
  .brand-card,
  .hero-card {
    padding: 18px;
    border-radius: 22px;
  }

  .form-row {
    flex-direction: column;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .settings-fields {
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }
}
