:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Pretendard", system-ui, sans-serif;
  color: #e2e8f0;
  background: #090d14;
  font-size: 14px;
  line-height: 1.6;
  --bg-canvas: #090d14;
  --bg-surface: #101723;
  --bg-card: #151e2e;
  --bg-card-hover: #1b263a;
  --bg-input: #0b1018;
  --bg-terminal: #070a0f;
  --accent: #00e599;
  --accent-dim: #059669;
  --accent-glow: rgba(0, 229, 153, 0.28);
  --accent-soft: rgba(0, 229, 153, 0.12);
  --cyber-blue: #38bdf8;
  --danger: #fb7185;
  --danger-bg: rgba(244, 63, 94, 0.12);
  --danger-border: rgba(244, 63, 94, 0.35);
  --warning: #fbbf24;
  --muted: #94a3b8;
  --muted-dim: #64748b;
  --line: #202d40;
  --line-light: #2b3b52;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-phone: 40px;
  --shadow-card: 0 8px 24px -4px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 25px rgba(0, 229, 153, 0.15);
}

* {
  box-sizing: border-box;
}

::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: var(--bg-canvas);
}
::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--line-light);
}

body {
  max-width: 1440px;
  margin: auto;
  padding: 0 32px 48px;
  background: var(--bg-canvas);
  background-image: 
    radial-gradient(ellipse 60% 40% at 50% -20%, rgba(0, 229, 153, 0.07), transparent),
    radial-gradient(ellipse 40% 30% at 85% 10%, rgba(56, 189, 248, 0.05), transparent);
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 4px;
  transition: color 0.15s ease;
}
a:hover {
  color: #34d399;
  text-decoration: underline;
}

h1, h2, h3, p {
  margin: 0 0 12px;
}
h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #f8fafc;
  line-height: 1.25;
}
h2 {
  font-size: 18px;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.2px;
}
h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 8px;
}
small, .hint {
  color: var(--muted);
  font-size: 12px;
}
small {
  display: block;
  margin-top: 8px;
  line-height: 1.5;
}

/* Form controls */
button, input, select, textarea {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  background: var(--bg-input);
  color: #f1f5f9;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
input, select, textarea {
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}
textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.5;
}
label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  color: #cbd5e1;
  margin: 16px 0 6px;
}

/* Buttons */
button {
  margin: 8px 8px 0 0;
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: #f1f5f9;
  font-weight: 600;
  cursor: pointer;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
button:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--line-light);
  color: #ffffff;
  transform: translateY(-1px);
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
button:active:not(:disabled) {
  transform: translateY(1px);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
[hidden] {
  display: none !important;
}

/* Primary CTAs */
#login, #proposeAi, #executeAi, #startAuto, #enroll {
  background: linear-gradient(135deg, #00e599 0%, #059669 100%);
  color: #032115;
  border: 1px solid #00e599;
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(0, 229, 153, 0.28);
}
#login:hover:not(:disabled), #proposeAi:hover:not(:disabled), #executeAi:hover:not(:disabled), #startAuto:hover:not(:disabled), #enroll:hover:not(:disabled) {
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  box-shadow: 0 5px 18px rgba(0, 229, 153, 0.45);
  color: #01140c;
}

/* Danger buttons */
.stop, #stopView, #cancelAi {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}
.stop:hover:not(:disabled), #stopView:hover:not(:disabled), #cancelAi:hover:not(:disabled) {
  background: rgba(244, 63, 94, 0.22);
  border-color: var(--danger);
  color: #fff;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  z-index: 999;
}
.skip-link:focus {
  top: 12px;
  left: 12px;
}

/* Topbar Header */
.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 76px;
  border-bottom: 1px solid var(--line);
}
.brand {
  text-decoration: none;
  font-size: 18px;
  letter-spacing: 2px;
  font-weight: 900;
  color: #ffffff;
  display: flex;
  align-items: center;
}
.brand span {
  font-size: 10px;
  letter-spacing: 1.5px;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(0, 229, 153, 0.3);
  font-weight: 700;
}
.build-label {
  font-size: 11px;
  color: var(--muted-dim);
  background: rgba(255, 255, 255, 0.03);
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
nav {
  margin-left: auto;
  display: flex;
  gap: 18px;
}
nav a {
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}
nav a:hover {
  color: #ffffff;
  background: var(--bg-card);
}

/* Account Panel */
.app-registration { flex-basis: 100%; font-size: 14px; }
.app-registration p { margin: 8px 0; }
#accountPanel {
  display: flow-root;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
#accountPanel > h2, #accountPanel > .bootstrap-settings {
  display: none;
}
#identity {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  background: var(--bg-card);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
}
#identity::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}
#logout, #releaseLease {
  min-height: 30px;
  padding: 3px 12px;
  font-size: 12px;
  margin-top: 0;
}
#leaseStatus:empty {
  display: none;
}
#leaseStatus {
  font-size: 12px;
  margin: 8px 0 0;
  color: var(--muted);
}
.account-settings {
  float: right;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 130px;
}
.account-settings[open] {
  float: none;
  margin-top: 14px;
  max-width: 520px;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-card);
}
.account-settings > summary {
  text-align: right;
  color: var(--muted);
  font-size: 12px;
}
.account-settings > summary:hover {
  color: var(--accent);
}
.account-settings[open] > summary {
  text-align: left;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 14px;
}
#passwordPanel, #teamAdmin {
  font-size: 12px;
  margin-top: 12px;
  padding: 12px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

/* Logged out state - High tech modal card */
body:has(#loginForm:not([hidden])) #accountPanel {
  max-width: 440px;
  margin: 64px auto 24px;
  padding: 36px 32px;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 35px rgba(0, 229, 153, 0.08);
  position: relative;
}
body:has(#loginForm:not([hidden])) #accountPanel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
body:has(#loginForm:not([hidden])) #accountPanel > h2,
body:has(#loginForm:not([hidden])) #accountPanel > .bootstrap-settings {
  display: block;
}
body:has(#loginForm:not([hidden])) #accountPanel > h2 {
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 24px;
  color: #ffffff;
  letter-spacing: -0.3px;
}
body:has(#loginForm:not([hidden])) #identity,
body:has(#loginForm:not([hidden])) #workspace,
body:has(#loginForm:not([hidden])) nav,
body:has(#loginForm:not([hidden])) .account-settings,
body:has(#loginForm:not([hidden])) .skip-link {
  display: none;
}
body:has(#loginForm:not([hidden])) #login {
  width: 100%;
  margin-top: 24px;
  height: 44px;
}
body:has(#loginForm:not([hidden])) > .notice {
  max-width: 440px;
  margin: 0 auto 32px;
  text-align: center;
  padding: 0;
}
.bootstrap-settings {
  font-size: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* Notice Banner */
.notice {
  padding: 8px 0;
  color: var(--muted);
  font-size: 12px;
  min-height: 36px;
  margin: 0;
}

/* Workspace Header */
.workspace-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 24px 0 20px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 800;
  margin-bottom: 4px;
  text-transform: uppercase;
}
.workspace-heading h1 {
  margin: 0;
}
.workspace-heading .hint {
  margin: 0;
  font-size: 13px;
}

/* Connection Strip HUD */
.connection-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 24px;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
.connection-strip p {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.connection-strip p::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.connection-strip p:last-child {
  margin-left: auto;
  color: var(--muted);
  font-weight: 400;
}
.connection-strip p:last-child::before {
  display: none;
}

/* Workspace Grid Layout */
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 1fr);
  gap: 24px;
  align-items: start;
}

/* Panel Containers */
.device-panel, .ai-panel {
  min-width: 0;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  position: relative;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.panel-heading h2 {
  margin: 0;
}
.caption {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 8px;
  border-radius: 12px;
  border: 1px solid rgba(0, 229, 153, 0.25);
}
#viewStatus {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 16px;
  line-height: 1.5;
}

/* Phone Mockup Styling */
.device-stage {
  position: relative;
  margin: 12px auto;
  width: 100%;
  max-width: 320px;
  height: 570px;
  background: #000000;
  border-radius: var(--radius-phone);
  border: 8px solid #1e293b;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.9),
              inset 0 0 12px rgba(0, 0, 0, 0.9),
              0 0 0 2px #334155,
              0 0 35px rgba(0, 229, 153, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
}

/* Smartphone Top Speaker / Dynamic Island Decoration */
.device-stage::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 84px;
  height: 16px;
  background: #0b111a;
  border-radius: 10px;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

.device-stage #empty {
  color: var(--muted-dim);
  text-align: center;
  max-width: 220px;
  font-size: 13px;
  line-height: 1.6;
  padding: 20px;
}
.device-stage img, .device-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: crosshair;
  border-radius: 32px;
  background: #000;
  user-select: none;
  -webkit-user-drag: none;
}

/* Live Touch Pointer / Virtual Mouse Cursor Overlay */
.virtual-cursor {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 50;
  transform: translate(-50%, -50%);
  transition: opacity 0.12s ease;
}
.cursor-pointer {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #00e599;
  background: rgba(0, 229, 153, 0.22);
  box-shadow: 0 0 12px rgba(0, 229, 153, 0.65), inset 0 0 4px rgba(0, 229, 153, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.08s ease, background 0.08s ease;
}
.cursor-pointer::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 4px #00e599;
}
.cursor-ripple {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #00e599;
  transform: translate(-50%, -50%) scale(1);
  opacity: 0;
  pointer-events: none;
}
.virtual-cursor.is-touching .cursor-pointer {
  transform: scale(0.85);
  background: rgba(0, 229, 153, 0.55);
  border-color: #ffffff;
}
.virtual-cursor.is-touching .cursor-ripple {
  animation: cursorTouchRipple 0.45s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}
@keyframes cursorTouchRipple {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 0.9; }
  100% { transform: translate(-50%, -50%) scale(2.2); opacity: 0; }
}
.cursor-coord {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  background: rgba(9, 13, 20, 0.9);
  border: 1px solid rgba(0, 229, 153, 0.5);
  color: #00e599;
  font-size: 11px;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  padding: 2px 7px;
  border-radius: 5px;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

/* View Controls & Action Toolbar */
.view-controls {
  display: flex;
  gap: 10px;
  margin: 16px 0;
  justify-content: center;
}
.view-controls button {
  flex: 1;
  max-width: 160px;
}

.device-actions {
  margin-top: 20px;
  padding: 18px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.device-actions p {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}
.device-actions label {
  font-size: 12px;
  margin-top: 14px;
}
#text {
  width: calc(100% - 84px);
  display: inline-block;
  vertical-align: middle;
}
#sendText {
  margin-left: 8px;
  min-height: 38px;
  padding: 0 16px;
  vertical-align: middle;
}

/* AI Panel Elements */
.ai-panel {
  background: linear-gradient(180deg, #121926 0%, #0e141f 100%);
}
.ai-panel > .hint {
  margin: 0 0 14px;
}
.ai-actions {
  margin: 18px 0;
}
.ai-actions small {
  margin-bottom: 12px;
}

/* High-tech terminal aesthetic */
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--bg-terminal);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  font: 12px/1.65 ui-monospace, "SF Mono", Menlo, Consolas, "JetBrains Mono", monospace;
  color: #93c5fd;
  max-height: 240px;
  overflow: auto;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
}
#aiResult {
  min-height: 96px;
  color: #38bdf8;
  border-color: #1e3a5f;
}
#autoLog {
  color: #86efac;
}

/* Details & Summaries */
details {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: #cbd5e1;
  padding: 4px 0;
  user-select: none;
  transition: color 0.15s ease;
}
summary:hover {
  color: var(--accent);
}
details[open] > summary {
  margin-bottom: 14px;
  color: #f1f5f9;
}

/* AI Health HUD */
.ai-health {
  margin-top: 20px;
  padding: 14px;
  background: var(--bg-card);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 12px;
  color: var(--muted);
}
.ai-health p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ai-health p + p {
  margin-top: 6px;
}

/* Management Folders */
.management {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  margin-top: 24px;
  box-shadow: var(--shadow-card);
}
.management h2 {
  font-size: 16px;
  margin-top: 12px;
}
.management > summary {
  font-size: 15px;
  font-weight: 700;
}
.management:target {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Footer */
footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 36px 0 16px;
  color: var(--muted-dim);
  font-size: 12px;
  border-top: 1px solid var(--line);
  margin-top: 36px;
}

/* Target Overlay */
.target-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
}
.target-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #ff4757;
  background: rgba(255, 71, 87, 0.25);
  box-shadow: 0 0 14px rgba(255, 71, 87, 0.85);
  animation: targetPulse 1.5s infinite;
}
.target-pin::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  background: #ff4757;
  border-radius: 50%;
  transform: translate(-50%, -50%)}
.target-label {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 15, 22, 0.95);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  margin-bottom: 6px;
  border: 1px solid #ff4757;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

@keyframes targetPulse {
  0% {
    transform: translate(-50%, -50%) scale(0.85);
    opacity: 1;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.35);
    opacity: 0.6;
  }
  100% {
    transform: translate(-50%, -50%) scale(0.85);
    opacity: 1;
  }
}

/* Set-of-Mark (SoM) Numbered Badges Overlay */
.som-overlay {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  overflow: hidden;
  z-index: 6;
}
.som-badge {
  position: absolute;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 13px;
  background: rgba(11, 238, 140, 0.95);
  color: #050e18;
  font-family: var(--mono, monospace);
  font-size: 13px;
  font-weight: 800;
  border: 2px solid #ffffff;
  box-shadow: 0 0 10px rgba(11, 238, 140, 0.9), 0 2px 6px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  z-index: 7;
}
.som-badge:hover {
  transform: translate(-50%, -50%) scale(1.25);
  background: #00ffcc;
  box-shadow: 0 0 16px rgba(0, 255, 204, 1);
  z-index: 10;
}
.som-badge:active {
  transform: translate(-50%, -50%) scale(0.92);
}
.som-box {
  position: absolute;
  border: 2px dashed rgba(11, 238, 140, 0.75);
  background: rgba(11, 238, 140, 0.1);
  pointer-events: none;
  border-radius: 4px;
}
.btn-som-active {
  background: #0bee8c !important;
  color: #050e18 !important;
  font-weight: 700 !important;
  box-shadow: 0 0 12px rgba(11, 238, 140, 0.7) !important;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
  pointer-events: none;
}
.toast {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: #151d2a;
  color: #f1f5f9;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: auto;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  backdrop-filter: blur(8px);
}
.toast.toast-show {
  opacity: 1;
  transform: translateY(0);
}
.toast-success {
  border-left-color: #10b981;
}
.toast-error {
  border-left-color: #f43f5e;
}
.toast-warning {
  border-left-color: #fbbf24;
}

/* Responsive adjustments */
@media (max-width: 860px) {
  body {
    padding: 0 16px 32px;
  }
  .topbar {
    min-height: 64px;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 0;
  }
  .build-label {
    display: none;
  }
  nav {
    gap: 10px;
    font-size: 12px;
  }
  .brand {
    font-size: 16px;
  }
  .brand span {
    display: none;
  }
  .workspace-heading {
    display: block;
    margin-top: 20px;
  }
  .workspace-heading .hint {
    margin-top: 6px;
  }
  .workspace-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  .device-panel, .ai-panel {
    padding: 18px;
  }
  .connection-strip {
    display: block;
  }
  .connection-strip p + p {
    margin-top: 6px;
  }
  .device-stage {
    height: 480px;
    max-width: 290px;
  }
  footer {
    display: block;
  }
  footer span {
    display: block;
    margin-top: 8px;
  }
  body:has(#loginForm:not([hidden])) #accountPanel {
    margin: 32px auto;
    padding: 24px 20px;
  }
/* Reward Automation Widgets */
.reward-automation {
  margin-top: 18px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
}
.reward-automation summary {
  color: var(--accent);
  font-size: 14px;
}
.preset-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}
.preset-pill {
  min-height: 32px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  background: #101724;
  color: #cbd5e1;
  border: 1px solid var(--line);
  margin: 0;
}
.preset-pill:hover {
  border-color: var(--accent);
  color: #fff;
  background: #182335;
}
.harvest-controls {
  display: flex;
  gap: 10px;
  margin: 14px 0 10px;
}
.harvest-controls button {
  flex: 1;
}
#startHarvest {
  background: linear-gradient(135deg, #00e599 0%, #059669 100%);
  color: #032115;
  border: 1px solid #00e599;
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(0, 229, 153, 0.28);
}
#startHarvest:hover:not(:disabled) {
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  box-shadow: 0 5px 18px rgba(0, 229, 153, 0.45);
}
#harvestStatus {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0;
}
#harvestLog {
  color: #6ee7b7;
  max-height: 200px;
  min-height: 80px;
}
.batch-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #ffffff;
  border: 1px solid #60a5fa;
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(59, 130, 246, 0.28);
}
.batch-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
  box-shadow: 0 5px 18px rgba(59, 130, 246, 0.45);
}
.harvest-toolbar {
  display: flex;
  align-items: center;
  margin: 6px 0 10px;
}
.toggle-label {
  font-size: 12px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}
.toggle-label input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
}
.harvest-stats-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  margin: 10px 0 12px;
}
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.stat-num {
  font-size: 16px;
  font-weight: 800;
  color: var(--accent);
}
.stat-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.semantic-badge {
  position: absolute;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(14, 165, 233, 0.88);
  color: #ffffff;
  font-family: monospace;
  font-size: 10px;
  font-weight: 700;
  pointer-events: none;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  z-index: 100;
  white-space: nowrap;
}

/* Consumer-Ready Apptech Dashboard */
.apptech-hero-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}

.batch-hero-btn {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 50%, #0f172a 100%);
  border: 1px solid #3b82f6;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.35);
  cursor: pointer;
  text-align: left;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.batch-hero-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.5);
  border-color: #60a5fa;
}
.hero-btn-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}
.hero-btn-icon {
  font-size: 26px;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(250, 204, 21, 0.5));
}
.hero-btn-content {
  display: flex;
  flex-direction: column;
}
.hero-btn-title {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.2px;
}
.hero-btn-desc {
  font-size: 11px;
  color: #bfdbfe;
  margin-top: 2px;
}

.section-subheading {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-top: 4px;
}

/* Inspect Toolbar & App Registration Card */
.inspect-app-toolbar {
  margin-bottom: 12px;
}
.inspect-action-btn {
  width: 100%;
  padding: 10px 14px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(0, 229, 153, 0.4);
  color: #00e599;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}
.inspect-action-btn:hover {
  background: #1e293b;
  border-color: #00e599;
  box-shadow: 0 0 12px rgba(0, 229, 153, 0.2);
}
.inspect-result-card {
  background: #0f172a;
  border: 1px solid rgba(0, 229, 153, 0.5);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.inspect-result-card .card-title {
  font-size: 13px;
  font-weight: 700;
  color: #00e599;
  margin-bottom: 10px;
}
.inspect-result-card .form-row {
  margin-bottom: 8px;
}
.inspect-result-card .form-row label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 3px;
}
.inspect-result-card .form-row input {
  width: 100%;
  padding: 6px 10px;
  background: #1e293b;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  box-sizing: border-box;
}
.inspect-result-card .form-row input:focus {
  border-color: #00e599;
  outline: none;
}
.inspect-result-card .card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.btn-save-app {
  flex: 1;
  padding: 8px;
  background: #00e599;
  color: #032115;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.btn-cancel-app {
  padding: 8px 12px;
  background: #334155;
  color: #cbd5e1;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
.inspect-meta {
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

/* Goal Chips Container */
.goal-chips-wrapper {
  margin-top: 6px;
  margin-bottom: 8px;
}
.goal-chips-label {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 4px;
}
.goal-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.goal-chip {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  cursor: pointer;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: #1e293b;
  color: #cbd5e1;
  transition: all 0.15s ease;
  user-select: none;
}
.goal-chip:hover {
  background: #334155;
  color: #fff;
}
.goal-chip.selected {
  background: rgba(0, 229, 153, 0.2);
  border-color: #00e599;
  color: #00e599;
  font-weight: 600;
}
.app-status-badge {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: auto;
  white-space: nowrap;
}
.app-status-badge.running {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}
.app-status-badge.done {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.app-status-badge.error {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

/* Preset Section Header & Checkboxes */
.preset-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.preset-section-header .section-subheading {
  margin: 0;
}
.preset-selection-actions {
  display: flex;
  gap: 6px;
}
.mini-btn {
  padding: 3px 8px;
  background: #1e293b;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  border-radius: 4px;
  cursor: pointer;
}
.mini-btn:hover {
  background: #334155;
  color: #fff;
}
.preset-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #00e599;
  flex-shrink: 0;
}
.preset-delete-btn {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 13px;
  margin-left: auto;
  opacity: 0.6;
}
.preset-delete-btn:hover {
  opacity: 1;
}
.custom-badge {
  font-size: 9px;
  background: rgba(0, 229, 153, 0.15);
  color: #00e599;
  padding: 1px 4px;
  border-radius: 4px;
  margin-left: 4px;
}

/* Preset App Cards Grid */
.preset-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.preset-card {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #0f172a;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.preset-card:hover {
  border-color: rgba(0, 229, 153, 0.5);
  background: #131d33;
}
.preset-card.active {
  border-color: var(--accent);
  background: rgba(0, 229, 153, 0.08);
  box-shadow: 0 0 12px rgba(0, 229, 153, 0.18);
}
.app-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 13px;
  color: #ffffff;
  flex-shrink: 0;
}
.app-icon.naver { background: #03c75a; }
.app-icon.toss { background: #0064ff; }
.app-icon.cashwalk { background: #f59e0b; }
.app-icon.kbpay { background: #d97706; }
.app-icon.monimo { background: #6366f1; }

.app-info {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
}
.app-name {
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-mission {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* Controls */
.action-btn {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.action-btn.start {
  background: linear-gradient(135deg, #00e599 0%, #059669 100%);
  color: #032115;
  border: 1px solid #00e599;
  box-shadow: 0 3px 12px rgba(0, 229, 153, 0.28);
}
.action-btn.start:hover:not(:disabled) {
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  box-shadow: 0 5px 18px rgba(0, 229, 153, 0.45);
}
.action-btn.stop {
  background: #261214;
  border: 1px solid #7f1d1d;
  color: #fca5a5;
}
.action-btn.stop:hover:not(:disabled) {
  background: #451a1d;
}

/* Timeline box */
.harvest-timeline-box {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}
.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.timeline-header p {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}
.timeline-header .toggle-label {
  flex-shrink: 0;
  font-size: 11px;
}

/* Encapsulated Developer / Advanced AI Settings */
.developer-settings {
  margin-top: 14px;
  border-top: 1px dashed rgba(148, 163, 184, 0.2);
  padding-top: 10px;
}
.developer-settings summary {
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}
.developer-settings summary:hover {
  color: #cbd5e1;
}

@media (max-width: 480px) {
  .preset-card-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
