:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #020610;
  color: #f5faff;
  --cyan: #38c8ff;
  --blue: #1688ff;
  --emerald: #48e1a0;
  --danger: #ff5e70;
  --warning: #ffbd59;
  --line: rgba(105, 180, 255, 0.24);
  --line-strong: rgba(116, 201, 255, 0.56);
  --glass: rgba(8, 20, 37, 0.76);
  --glass-deep: rgba(4, 12, 25, 0.9);
  --text-muted: #93a8c2;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-width: 0; background: #020610; }

body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% -8%, rgba(18, 126, 232, 0.24), transparent 34rem),
    radial-gradient(circle at 100% 22%, rgba(0, 206, 255, 0.12), transparent 30rem),
    linear-gradient(180deg, #030916 0%, #01050d 58%, #030712 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  position: relative;
  isolation: isolate;
  width: min(100%, 720px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  background:
    linear-gradient(180deg, rgba(8, 20, 37, 0.91), rgba(3, 9, 19, 0.97)),
    radial-gradient(circle at 50% 0, rgba(33, 137, 255, 0.12), transparent 31rem);
}

main::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  border: 1px solid rgba(107, 185, 255, 0.08);
  pointer-events: none;
  content: "";
}

.top-status {
  --tone: var(--cyan);
  --tone-rgb: 56, 200, 255;
  position: relative;
  min-height: 118px;
  overflow: hidden;
  padding: 14px 16px 15px;
  border: 1px solid rgba(var(--tone-rgb), 0.62);
  border-radius: 17px;
  background:
    linear-gradient(145deg, rgba(var(--tone-rgb), 0.11), transparent 48%),
    linear-gradient(180deg, rgba(15, 34, 58, 0.9), rgba(5, 15, 29, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -18px 34px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(var(--tone-rgb), 0.08),
    0 14px 34px rgba(0, 0, 0, 0.4),
    0 0 26px rgba(var(--tone-rgb), 0.1);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
  backdrop-filter: blur(18px) saturate(125%);
}

.top-status::before {
  position: absolute;
  inset: 0 13% auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--tone-rgb), 0.95), transparent);
  box-shadow: 0 0 13px rgba(var(--tone-rgb), 0.75);
  content: "";
}

.top-status::after {
  position: absolute;
  right: -52px;
  bottom: -68px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--tone-rgb), 0.16), transparent 68%);
  pointer-events: none;
  content: "";
}

.top-status > * { position: relative; z-index: 1; }
.top-status[data-tone="ready"] { --tone: var(--emerald); --tone-rgb: 72, 225, 160; }
.top-status[data-tone="running"] { --tone: var(--cyan); --tone-rgb: 56, 200, 255; }
.top-status[data-tone="warning"] { --tone: var(--warning); --tone-rgb: 255, 189, 89; }
.top-status[data-tone="error"] { --tone: var(--danger); --tone-rgb: 255, 94, 112; }
.top-status-label { margin: 0 0 7px; color: var(--tone); font-size: 0.68rem; font-weight: 850; letter-spacing: 0.1em; text-shadow: 0 0 12px rgba(var(--tone-rgb), 0.42); }
.top-status h1 { margin: 0; color: #f8fbff; font-size: clamp(1.35rem, 6.2vw, 2.05rem); line-height: 1.24; letter-spacing: -0.02em; overflow-wrap: anywhere; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.42); }
.top-status-detail { margin: 8px 0 0; color: #c4d4e7; font-size: 0.84rem; font-weight: 560; line-height: 1.42; }

.start-countdown { text-align: center; }
.start-countdown p { margin: 0; }
.countdown-lead { color: #dff5ff; font-size: 0.95rem; font-weight: 850; letter-spacing: 0.08em; }
.countdown-number-row {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: center;
  width: 112px;
  height: 112px;
  margin: 7px auto;
  padding-top: 20px;
  border: 1px solid rgba(94, 207, 255, 0.72);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 42%, rgba(44, 151, 255, 0.22), rgba(4, 18, 35, 0.88) 62%),
    #061326;
  box-shadow:
    inset 0 0 20px rgba(43, 158, 255, 0.18),
    0 0 0 5px rgba(33, 145, 255, 0.08),
    0 0 26px rgba(34, 170, 255, 0.28);
}
.countdown-number-row::before {
  position: absolute;
  inset: 5px;
  border: 1px dashed rgba(115, 211, 255, 0.34);
  border-radius: inherit;
  content: "";
}
.countdown-number-row strong { color: #bcecff; font-size: 4rem; line-height: 0.98; font-variant-numeric: tabular-nums; letter-spacing: -0.07em; text-shadow: 0 0 10px #1688ff, 0 0 28px rgba(56, 200, 255, 0.68); }
.countdown-number-row span { color: #d8f2ff; font-size: 0.8rem; font-weight: 850; }

.app-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 13px; padding: 0 2px; }
.eyebrow { margin: 0 0 3px; color: #70baff; font-size: 0.62rem; font-weight: 850; letter-spacing: 0.17em; text-shadow: 0 0 10px rgba(56, 200, 255, 0.34); }
.app-title { margin: 0; font-size: 1.17rem; font-weight: 850; letter-spacing: -0.02em; }
h2 { margin: 17px 0 8px; color: #f1f8ff; font-size: 1rem; letter-spacing: -0.01em; }

button {
  position: relative;
  min-height: 48px;
  border: 1px solid rgba(108, 193, 255, 0.74);
  border-radius: 14px;
  padding: 10px 14px;
  color: #f8fcff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 42%),
    linear-gradient(180deg, #1289ed 0%, #0870d3 48%, #0753a4 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    inset 0 -5px 12px rgba(0, 26, 67, 0.34),
    0 0 0 1px rgba(28, 151, 255, 0.12),
    0 7px 18px rgba(0, 55, 122, 0.28),
    0 0 18px rgba(24, 149, 255, 0.12);
  font: inherit;
  font-weight: 790;
  line-height: 1.25;
  overflow-wrap: anywhere;
  white-space: normal;
  text-shadow: 0 1px 3px rgba(0, 21, 55, 0.78);
  touch-action: manipulation;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, color 140ms ease, transform 100ms ease;
}

button[data-button-state="enabled"]:not(:disabled) {
  border-color: #8bd8ff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 -6px 14px rgba(0, 33, 89, 0.4),
    0 0 0 1px rgba(49, 175, 255, 0.3),
    0 8px 20px rgba(0, 65, 148, 0.34),
    0 0 24px rgba(31, 178, 255, 0.22);
}

button:disabled,
button[data-button-state="disabled"] {
  border-color: rgba(95, 121, 153, 0.34);
  color: #708097;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 42%),
    linear-gradient(180deg, #172230, #101824);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), inset 0 -4px 10px rgba(0, 0, 0, 0.22);
  opacity: 1;
  text-shadow: none;
}

button[data-button-state="disabled"]::after,
button[data-button-state="running"]::after,
button[data-button-state="current"]::after {
  display: block;
  width: max-content;
  margin: 4px auto 0;
  padding: 2px 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: 0.04em;
  text-shadow: none;
}

button[data-button-state="disabled"]::after { content: "利用不可"; color: #8795a7; background: rgba(2, 8, 16, 0.72); }
button[data-button-state="running"] {
  border-color: #a6e4ff;
  color: #fff;
  background: repeating-linear-gradient(115deg, #0a61ad 0, #0a61ad 14px, #1186d7 14px, #1186d7 28px);
  background-size: 42px 42px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    0 0 0 2px rgba(69, 186, 255, 0.2),
    0 8px 22px rgba(0, 89, 171, 0.38),
    0 0 26px rgba(56, 200, 255, 0.28);
  animation: running-flow 1.5s linear infinite;
}
button[data-button-state="running"]::after { content: "実行中"; color: #05213a; background: #bfeeff; }
button[data-button-state="current"] {
  border-color: #82edba;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 40%),
    linear-gradient(180deg, #1b8859, #126342);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 0 0 2px rgba(72, 225, 160, 0.15), 0 8px 20px rgba(9, 111, 68, 0.3), 0 0 22px rgba(72, 225, 160, 0.2);
}
button[data-button-state="current"]::after { content: "有効"; color: #06301d; background: #b9f5d6; }
button:not(:disabled):active { transform: translateY(1px) scale(0.995); box-shadow: inset 0 3px 10px rgba(0, 24, 62, 0.34), 0 2px 8px rgba(0, 61, 136, 0.24); }
button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #9be3ff; outline-offset: 2px; }
.login { min-height: 44px; max-width: 47%; padding: 8px 12px; font-size: 0.78rem; }

@keyframes running-flow { to { background-position: 42px 0; } }

.tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin-top: 14px;
  padding: 4px;
  border: 1px solid rgba(88, 164, 237, 0.14);
  border-radius: 15px;
  background: rgba(2, 9, 19, 0.78);
  box-shadow: inset 0 1px 8px rgba(0, 0, 0, 0.52), 0 6px 20px rgba(0, 0, 0, 0.2);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.tab { min-height: 44px; border-color: transparent; border-radius: 11px; color: #8294aa; background: transparent; box-shadow: none; text-shadow: none; }
.tab.active { border-color: rgba(110, 198, 255, 0.28); color: #eaf7ff; background: linear-gradient(180deg, rgba(38, 104, 172, 0.56), rgba(16, 48, 84, 0.72)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.11), 0 0 15px rgba(36, 154, 255, 0.1); }
.emergency-tab.active { border-color: rgba(255, 99, 112, 0.45); color: #ffecef; background: linear-gradient(180deg, rgba(132, 36, 47, 0.72), rgba(72, 15, 25, 0.82)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 15px rgba(255, 71, 91, 0.12); }
.session-status { margin: 8px 2px 10px; font-size: 0.74rem; }

.freshness {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0;
  padding: 11px 12px;
  border: 1px solid;
  border-radius: 13px;
  background: var(--glass);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}
.freshness strong { letter-spacing: 0.05em; }
.freshness span { font-size: 0.76rem; text-align: right; }
.freshness.fresh { border-color: rgba(72, 225, 160, 0.55); color: #93f3bd; background: linear-gradient(135deg, rgba(16, 70, 49, 0.7), var(--glass-deep)); }
.freshness.stale { border-color: rgba(255, 189, 89, 0.56); color: #ffd38c; background: linear-gradient(135deg, rgba(83, 57, 18, 0.68), var(--glass-deep)); }
.freshness.offline { border-color: rgba(255, 94, 112, 0.5); color: #ffadb7; background: linear-gradient(135deg, rgba(86, 24, 35, 0.66), var(--glass-deep)); }
.snapshot-note { margin: 7px 2px 10px; color: var(--text-muted); font-size: 0.75rem; line-height: 1.42; }
.snapshot-note.warning { color: #ffd38c; font-weight: 750; }

.status-blockers {
  margin: 0 0 9px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 94, 112, 0.48);
  border-left: 3px solid var(--danger);
  border-radius: 12px;
  color: #ffe1e5;
  background: linear-gradient(145deg, rgba(91, 25, 36, 0.7), rgba(25, 8, 16, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055), 0 7px 18px rgba(0, 0, 0, 0.16);
}
.status-blockers[hidden] { display: none; }
.status-blockers strong { font-size: 0.8rem; letter-spacing: 0.02em; }
.status-blockers ul { display: grid; gap: 4px; margin: 7px 0 0; padding-left: 18px; }
.status-blockers li { color: #ffc2ca; font-size: 0.77rem; font-weight: 680; line-height: 1.4; }

.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 0; }
.status-grid > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(93, 164, 232, 0.2);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(15, 33, 54, 0.78), rgba(5, 15, 28, 0.86));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 6px 18px rgba(0, 0, 0, 0.15);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.status-grid .wide { grid-column: 1 / -1; }
dt { margin-bottom: 5px; color: #79a3ca; font-size: 0.65rem; font-weight: 790; letter-spacing: 0.035em; }
dd { margin: 0; color: #eff8ff; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.8rem; font-weight: 650; line-height: 1.35; white-space: pre-wrap; }
.status-important dd { font-family: inherit; font-size: 0.82rem; font-weight: 780; }

.snapshot-details { margin-top: 9px; color: var(--text-muted); font-size: 0.73rem; }
.snapshot-details summary { min-height: 44px; padding: 11px 4px; cursor: pointer; font-weight: 780; }
.help-mark { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 4px; border: 1px solid rgba(91, 204, 255, 0.46); border-radius: 50%; color: #c8f0ff; background: rgba(14, 95, 154, 0.35); }
.status-detail-intro { margin: 0 0 8px; color: #9bb0c7; line-height: 1.45; }
.status-detail-list { display: grid; gap: 7px; }
.status-detail-row { padding: 10px; border: 1px solid rgba(93, 164, 232, 0.16); border-radius: 11px; background: rgba(2, 10, 20, 0.78); }
.status-detail-row h4 { margin: 0 0 4px; color: #cde3f6; font-size: 0.76rem; }
.status-detail-row p { margin: 5px 0 0; color: #8fa6bd; font-size: 0.7rem; line-height: 1.42; }
.status-detail-row .status-detail-impact { color: #b5c8dc; }
.status-detail-value { display: block; color: #eff8ff; overflow-wrap: anywhere; font-size: 0.77rem; }
.status-detail-row code { display: block; margin-top: 7px; padding: 6px 7px; border-radius: 7px; color: #7f9ab5; background: rgba(0, 4, 10, 0.72); overflow-wrap: anywhere; white-space: pre-wrap; font: 0.66rem/1.35 ui-monospace, SFMono-Regular, Consolas, monospace; }
.status-details h3 { margin: 12px 0 6px; color: #cde3f6; font-size: 0.78rem; }
.snapshot-meta { padding: 11px; border: 1px solid rgba(93, 164, 232, 0.16); border-radius: 11px; background: rgba(2, 10, 20, 0.78); }
.snapshot-meta div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 0.71rem; }
.snapshot-meta span { color: #7890aa; }
.snapshot-meta strong { text-align: right; overflow-wrap: anywhere; }

.operator-panel-header { margin-top: 6px; }
.operator-panel-header h2 { margin: 2px 0 0; font-size: 1.13rem; }
.action-grid { display: grid; gap: 8px; margin-top: 10px; }
.action-grid.two { grid-template-columns: 1fr 1fr; }
.action-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.operator-action { min-height: 58px; }
.operator-action.caution:not(:disabled):not([data-button-state="running"]):not([data-button-state="current"]) { border-color: #ffcb78; background: linear-gradient(180deg, #c77b23, #975314); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 7px 18px rgba(136, 70, 8, 0.28), 0 0 18px rgba(255, 174, 61, 0.12); }
.operator-action.trade:not(:disabled):not([data-button-state="running"]):not([data-button-state="current"]) { border-color: #83e8b8; background: linear-gradient(180deg, #1d8e5f, #146143); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 7px 18px rgba(8, 100, 62, 0.26), 0 0 18px rgba(72, 225, 160, 0.12); }
.danger-zone { margin-top: 16px; padding: 12px; border: 1px solid rgba(255, 94, 112, 0.42); border-radius: 13px; background: linear-gradient(145deg, rgba(74, 18, 30, 0.54), rgba(24, 7, 14, 0.82)); }
.danger-zone h2 { margin: 0; color: #ffd9df; font-size: 0.9rem; }
.danger-zone p { margin: 6px 0 10px; color: #d7aeb5; font-size: 0.72rem; line-height: 1.4; }
.operator-action.dangerous { width: 100%; }
.operator-action.dangerous:not(:disabled):not([data-button-state="running"]):not([data-button-state="current"]) { border-color: #ff8795; background: linear-gradient(180deg, #c92e45, #8f1528); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 7px 18px rgba(123, 12, 30, 0.34), 0 0 18px rgba(255, 61, 87, 0.12); }
.command-monitor {
  position: relative;
  display: grid;
  gap: 4px;
  margin-top: 14px;
  overflow: hidden;
  padding: 11px 12px;
  border: 1px solid rgba(75, 171, 255, 0.26);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(13, 35, 61, 0.76), rgba(4, 13, 26, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.command-monitor::before { position: absolute; inset: 0 auto 0 0; width: 2px; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); content: ""; }
.command-monitor span { color: #79a3ca; font-size: 0.66rem; }
.command-monitor strong { color: #eef8ff; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.77rem; }

.operator-form {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(93, 164, 232, 0.2);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(12, 29, 49, 0.78), rgba(4, 13, 25, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 7px 22px rgba(0, 0, 0, 0.15);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.operator-form.compact { margin-top: 10px; }
.operator-form label { display: grid; gap: 5px; color: #9fb2c8; font-size: 0.73rem; font-weight: 730; }
.operator-form input, .operator-form select { width: 100%; min-height: 44px; border: 1px solid rgba(101, 176, 241, 0.34); border-radius: 10px; padding: 9px 10px; color: #f5faff; background: rgba(5, 17, 32, 0.92); box-shadow: inset 0 2px 7px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 126, 255, 0.04); font: inherit; }
.operator-form .checkbox-label { grid-template-columns: auto 1fr; align-items: center; min-height: 44px; padding: 5px 3px; cursor: pointer; }
.operator-form .checkbox-label input { width: 22px; min-height: 22px; accent-color: var(--blue); }
.form-grid { display: grid; gap: 8px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.manual-orders { display: grid; gap: 10px; margin-top: 14px; }
.manual-order-group { min-width: 0; padding: 11px; border: 1px solid rgba(93, 164, 232, 0.2); border-radius: 12px; background: linear-gradient(145deg, rgba(12, 29, 49, 0.74), rgba(4, 13, 25, 0.88)); }
.manual-order-group h3 { margin: 0 0 8px; color: #d9e8f7; font-size: 0.84rem; }
.manual-order-list { display: grid; gap: 8px; }
.manual-order-card { display: grid; gap: 8px; padding: 9px; border: 1px solid rgba(104, 174, 240, 0.25); border-radius: 10px; background: rgba(8, 24, 42, 0.84); }
.manual-order-empty { margin: 0; color: var(--text-muted); font-size: 0.75rem; }
.manual-order-cancel { width: 100%; background: linear-gradient(180deg, #c77b23, #975314); }
.manual-human-trigger { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 8px 9px; }
.manual-trigger-summary { display: grid; min-width: 0; gap: 3px; }
.manual-trigger-sentence { min-width: 0; color: #eef8ff; overflow-wrap: anywhere; font-size: 0.8rem; font-weight: 780; line-height: 1.42; }
.manual-trigger-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.manual-trigger-meta span { padding: 2px 6px; border: 1px solid rgba(91, 204, 255, 0.32); border-radius: 999px; color: #a9ddf3; background: rgba(14, 95, 154, 0.28); font-size: 0.64rem; font-weight: 720; }
.manual-human-trigger .manual-order-cancel { width: auto; min-width: 84px; min-height: 44px; padding: 7px 10px; font-size: 0.72rem; }

.danger-banner { margin: 8px 0 12px; padding: 12px; border: 1px solid rgba(255, 94, 112, 0.64); border-radius: 13px; color: #ffdfe4; background: linear-gradient(145deg, rgba(93, 25, 37, 0.72), rgba(31, 8, 17, 0.9)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07); font-weight: 820; text-align: center; letter-spacing: 0.025em; }
.danger-banner.armed { border-color: #ff5268; background: linear-gradient(145deg, rgba(153, 20, 38, 0.88), rgba(59, 7, 19, 0.94)); box-shadow: 0 0 24px rgba(255, 47, 73, 0.25); }
.notice { padding: 11px 12px; border: 1px solid rgba(255, 189, 89, 0.32); border-left: 3px solid var(--warning); border-radius: 10px; color: #f1d8ad; background: linear-gradient(135deg, rgba(69, 46, 16, 0.62), rgba(22, 14, 6, 0.78)); font-size: 0.8rem; line-height: 1.45; }
.actions { display: grid; gap: 8px; margin-top: 12px; }
button.shutdown:not(:disabled):not([data-button-state="running"]) { border-color: #ff8795; background: linear-gradient(180deg, #c92e45, #8f1528); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 7px 18px rgba(123, 12, 30, 0.34), 0 0 18px rgba(255, 61, 87, 0.12); }
.table-wrap { overflow-x: auto; border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 0.72rem; }
th, td { padding: 8px; border: 1px solid rgba(93, 164, 232, 0.22); text-align: left; }
th { background: rgba(20, 47, 77, 0.88); }
.status { margin-top: 11px; padding: 11px; border: 1px solid rgba(93, 164, 232, 0.18); border-radius: 10px; background: rgba(5, 17, 31, 0.86); overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.ok { color: #86f0b8; }
.error { color: #ff9ca9; }
.muted { color: var(--text-muted); }

.confirmation-overlay {
  position: fixed;
  z-index: 1100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  background: rgba(2, 7, 15, 0.82);
  -webkit-backdrop-filter: blur(9px) saturate(75%);
  backdrop-filter: blur(9px) saturate(75%);
}
.confirmation-dialog {
  width: min(100%, 380px);
  max-height: calc(100dvh - 28px);
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(255, 94, 112, 0.58);
  border-radius: 16px;
  background: linear-gradient(155deg, rgba(48, 14, 24, 0.98), rgba(8, 14, 25, 0.99));
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.confirmation-dialog h2 { margin: 0; color: #fff3f5; font-size: 1.05rem; }
.confirmation-dialog p { margin: 10px 0 18px; color: #f0d7dc; line-height: 1.55; }
.confirmation-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.confirmation-actions button { width: 100%; min-width: 0; min-height: 50px; }
.danger-confirm { border-color: #ff8795; background: linear-gradient(180deg, #c92e45, #8f1528); }

.processing-overlay {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(2, 8, 18, 0.72), rgba(2, 8, 18, 0.82)),
    repeating-linear-gradient(45deg, rgba(50, 174, 255, 0.035) 0 8px, transparent 8px 16px);
  -webkit-backdrop-filter: blur(8px) saturate(70%);
  backdrop-filter: blur(8px) saturate(70%);
  touch-action: none;
}
.processing-overlay strong {
  padding: 14px 24px;
  border: 1px solid rgba(104, 206, 255, 0.5);
  border-radius: 13px;
  color: #f4fbff;
  background: rgba(5, 22, 40, 0.94);
  box-shadow: 0 0 30px rgba(56, 200, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
}
body.operator-processing, body.operator-confirming { overflow: hidden; }
.tab:disabled { color: #536275; cursor: not-allowed; opacity: 0.58; }

@media (min-width: 721px) {
  body { display: grid; place-items: start center; padding: 24px; }
  main { min-height: auto; overflow: hidden; border: 1px solid rgba(105, 180, 255, 0.26); border-radius: 22px; box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58), 0 0 42px rgba(24, 137, 255, 0.1); }
}

@media (max-width: 420px) {
  .top-status { min-height: 114px; padding: 13px 15px 14px; }
  .top-status h1 { font-size: clamp(1.18rem, 5.35vw, 1.42rem); }
  .app-title { font-size: 1.08rem; }
  .status-grid { grid-template-columns: 1fr 1fr; }
  .status-grid .wide { grid-column: 1 / -1; }
  .action-grid.two, .form-grid.two { grid-template-columns: 1fr 1fr; }
  .action-grid.three { grid-template-columns: 1fr; }
  .command-monitor strong { font-size: 0.78rem; }
  .confirmation-dialog { width: calc(100vw - 28px); padding: 16px; }
}

@media (max-width: 350px) {
  main { padding-left: 11px; padding-right: 11px; }
  .top-status { padding: 13px; }
  .app-header { align-items: stretch; flex-direction: column; }
  .login { max-width: none; width: 100%; }
  .tabs { grid-template-columns: 1fr 1fr; }
  .action-grid.two, .form-grid.two, .status-grid { grid-template-columns: 1fr; }
  .status-grid .wide { grid-column: auto; }
  .manual-human-trigger { grid-template-columns: 1fr; }
  .manual-human-trigger .manual-order-cancel { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
