@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ===============================================================
   THEME SYSTEM — Dark (default) + Light
   =============================================================== */
:root {
  --radius: 0px 8px 0px 8px;
  --radius-sm: 0px 6px 0px 6px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

[data-theme="dark"] {
  --bg: #1b1b1f;
  --bg-alt: #161618;
  --surface: #202127;
  --surface2: #2b2b33;
  --border: rgba(82, 82, 89, 0.48);
  --border-hover: rgba(82, 82, 89, 0.68);
  --accent: #ff5caa;
  --accent-hover: #ff7dc0;
  --accent-soft: rgba(255, 92, 170, 0.14);
  --green: #3dd68c;
  --green-soft: rgba(61, 214, 140, 0.14);
  --red: #f66;
  --red-soft: rgba(255, 102, 102, 0.14);
  --orange: #e7a43a;
  --orange-soft: rgba(231, 164, 58, 0.14);
  --text: rgba(255, 255, 245, 0.86);
  --text2: rgba(235, 235, 245, 0.6);
  --text3: rgba(235, 235, 245, 0.38);
  --modal-overlay: rgba(0, 0, 0, 0.6);
  --modal-bg: #202127;
  --btn-bg: #000;
  --btn-text: #fff;
  --btn-border-idle: rgba(255,255,255,0.06), rgba(255,255,255,0.18), rgba(255,255,255,0.06);
}

[data-theme="light"] {
  --bg: #f5f5f7;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --surface2: #eeeef0;
  --border: rgba(0, 0, 0, 0.1);
  --border-hover: rgba(0, 0, 0, 0.18);
  --accent: #d63384;
  --accent-hover: #b02a70;
  --accent-soft: rgba(214, 51, 132, 0.1);
  --green: #1a9960;
  --green-soft: rgba(26, 153, 96, 0.1);
  --red: #dc3545;
  --red-soft: rgba(220, 53, 69, 0.1);
  --orange: #cc7a00;
  --orange-soft: rgba(204, 122, 0, 0.1);
  --text: #1a1a1f;
  --text2: #555;
  --text3: #999;
  --modal-overlay: rgba(0, 0, 0, 0.35);
  --modal-bg: #ffffff;
  --btn-bg: #fff;
  --btn-text: #1a1a1f;
  --btn-border-idle: rgba(0,0,0,0.06), rgba(0,0,0,0.14), rgba(0,0,0,0.06);
}

/* ===============================================================
   RESET & BASE
   =============================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; font-size: 14px; -webkit-font-smoothing: antialiased; transition: background 0.3s, color 0.3s; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }
code, .mono { font-family: var(--font-mono); font-size: 0.85em; background: var(--surface2); padding: 2px 6px; border-radius: 4px; }
.container { max-width: 100%; margin: 0 auto; padding: 20px; }

/* ===============================================================
   HEADER
   =============================================================== */
header { background: var(--bg-alt); border-bottom: 1px solid var(--border); padding: 0 24px; position: sticky; top: 0; z-index: 100; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
header .inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 28px; width: auto; }
.brand-text { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.brand-text .dim { color: var(--text2); font-weight: 400; margin-left: 4px; }
.network-badge { font-size: 10px; font-weight: 500; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 0px 6px 0px 6px; margin-left: 8px; }
.rpc-config-btn { background: none; border: none; color: var(--text2); cursor: pointer; padding: 2px; margin-left: 2px; opacity: 0.5; transition: opacity 0.2s; display: inline-flex; align-items: center; }
.rpc-config-btn:hover { opacity: 1; color: var(--accent); }
.rpc-config-popup { position: absolute; top: 100%; right: 0; margin-top: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; width: 360px; box-shadow: 0 8px 32px rgba(0,0,0,0.35); z-index: 10000; }
.rpc-popup-title { font-weight: 600; font-size: 12px; margin-bottom: 6px; color: var(--text); }
.rpc-popup-desc { font-size: 11px; color: var(--text2); margin-bottom: 8px; }
.rpc-popup-input { width: 100%; padding: 6px 8px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg); color: var(--text); font-family: var(--font-mono); font-size: 11px; box-sizing: border-box; }
.rpc-popup-input:focus { outline: none; border-color: var(--accent); }
.rpc-popup-actions { display: flex; gap: 6px; margin-top: 8px; }
.rpc-popup-apply { flex: 1; padding: 5px 8px; font-size: 11px; border-radius: var(--radius-sm); }
.rpc-popup-reset { flex: 0; padding: 5px 8px; font-size: 11px; background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); cursor: pointer; font-family: var(--font); transition: border-color 0.15s; }
.rpc-popup-reset:hover { border-color: var(--accent); }
.brand { position: relative; }
.header-right { display: flex; align-items: center; gap: 12px; }

/* Setup Banner */
.setup-banner { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; }
.setup-banner-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.setup-banner-title { font-size: 11px; font-weight: 600; color: var(--text2); letter-spacing: 0.05em; text-transform: uppercase; }
.setup-banner-close { background: none; border: none; color: var(--text2); cursor: pointer; padding: 2px; display: flex; align-items: center; justify-content: center; opacity: 0.4; transition: all 0.15s; }
.setup-banner-close:hover { opacity: 1; color: var(--accent); }
.setup-steps-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.setup-step { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.setup-step-num { display: flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700; border-radius: var(--radius-sm); flex-shrink: 0; }
.setup-step-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.setup-step-label { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; }
.setup-step-desc { font-size: 11px; color: var(--text2); line-height: 1.4; }
@media (max-width: 640px) { .setup-steps-row { grid-template-columns: 1fr; } }

/* Wallet Button */
#walletBtn { position: relative; background: var(--btn-bg); color: var(--btn-text); border: none; padding: 7px 16px; border-radius: 20px; cursor: pointer; font-size: 13px; font-weight: 500; font-family: var(--font); transition: all 0.25s; z-index: 0; overflow: hidden; }
#walletBtn::before { content: ''; position: absolute; inset: 0; border-radius: 20px; padding: 1px; background: conic-gradient(from var(--btn-angle, 0deg), var(--btn-border-idle)); -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; transition: all 0.25s; }
#walletBtn:hover::before { background: conic-gradient(from var(--btn-angle, 0deg), var(--accent), #fff, var(--accent)); animation: btn-rotate 2s linear infinite; }
#walletBtn:hover { background: rgba(128,128,128,0.06); }
#walletBtn.connected { color: var(--green); }
#walletBtn.connected::before { background: conic-gradient(from var(--btn-angle, 0deg), var(--green), rgba(128,128,128,0.1), var(--green)); animation: btn-rotate 3s linear infinite; }
.wallet-info { font-size: 12px; color: var(--text3); margin-top: 2px; text-align: right; }
.wallet-info .bal { color: var(--green); font-weight: 600; }

/* Hamburger */
.hamburger { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; cursor: pointer; flex-direction: column; gap: 4px; align-items: center; justify-content: center; width: 36px; height: 36px; transition: border-color 0.2s; }
.hamburger:hover { border-color: var(--accent); }
.hamburger span { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: all 0.3s; }
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

/* ===============================================================
   NAVIGATION — Dropdown system
   =============================================================== */
.nav-bar { background: var(--bg-alt); border-bottom: 1px solid var(--border); padding: 0 24px; }
.nav-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: stretch; gap: 2px; }

/* Shared base for Overview button and dropdown triggers */
.nav-item { display: flex; align-items: center; gap: 7px; padding: 11px 16px; cursor: pointer; color: var(--text3); font-size: 13.5px; font-weight: 500; white-space: nowrap; transition: color 0.15s, background 0.15s; border-bottom: 2px solid transparent; user-select: none; }
.nav-item:hover { color: var(--text); background: rgba(128,128,128,0.05); }
.nav-item.active { color: var(--accent); border-bottom-color: var(--accent); background: var(--accent-soft); }

/* nav-icon styles removed — SVGs stripped from nav items */

/* Chevron on dropdown triggers */
.nav-chevron { width: 10px; height: 10px; flex-shrink: 0; opacity: 0.5; transition: transform 0.2s, opacity 0.2s; margin-left: -2px; }
.nav-dropdown.open .nav-chevron { transform: rotate(180deg); opacity: 0.8; }

/* Dropdown wrapper */
.nav-dropdown { position: relative; }

/* Dropdown menu */
.nav-menu { position: absolute; top: calc(100% + 1px); left: 0; min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: 0px 8px 8px 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.18), 0 2px 6px rgba(0,0,0,0.1); padding: 6px; z-index: 300; opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity 0.15s, transform 0.15s, visibility 0.15s; }
.nav-dropdown.open .nav-menu { opacity: 1; visibility: visible; transform: translateY(0); }

/* Menu items */
.nav-menu-item { display: flex; align-items: center; padding: 9px 14px; border-radius: 0px 6px 0px 6px; cursor: pointer; color: var(--text2); font-size: 13.5px; font-weight: 500; transition: all 0.12s; }
.nav-menu-item:hover { background: rgba(128,128,128,0.08); color: var(--text); }
.nav-menu-item.active { background: var(--accent-soft); color: var(--accent); }

/* Active child highlight on trigger */
.nav-trigger.has-active { color: var(--accent); border-bottom-color: var(--accent); }

/* Active child label shown on trigger */
.nav-trigger-active-label { display: none; font-size: 11px; color: var(--accent); opacity: 0.8; margin-left: 2px; font-weight: 400; }
.nav-trigger.has-active .nav-trigger-active-label { display: inline; }

/* Mobile overlay nav */
.mobile-nav-overlay { display: none; position: fixed; inset: 0; top: 56px; background: var(--bg-alt); z-index: 200; overflow-y: auto; padding: 4px 0 24px; -webkit-overflow-scrolling: touch; }
.mobile-nav-overlay.open { display: block; animation: navSlideIn 0.2s ease-out; }
@keyframes navSlideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.mobile-nav-group { padding: 4px 12px 2px; }
.mobile-nav-group-label { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text2); padding: 6px 8px 3px; border-bottom: 1px solid var(--border); margin-bottom: 2px; }
.mobile-tab { display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin: 1px 4px; border-radius: var(--radius-sm); cursor: pointer; color: var(--text2); font-size: 14px; font-weight: 500; transition: all 0.15s; }
.mobile-tab:hover { background: var(--surface); color: var(--text); }
.mobile-tab.active { background: var(--accent-soft); color: var(--accent); }

@media (max-width: 900px) {
  .hamburger { display: flex; }
  .nav-bar { display: none; }
  header .inner { height: 52px; }
  .brand-text .dim { display: none; }
  .network-badge { margin-left: 4px; font-size: 9px; padding: 1px 6px; }
}

/* ===============================================================
   SCENARIO RUNNER
   =============================================================== */
.scenario-card { display: flex; flex-direction: column; }
.scenario-card h4 { margin: 0 0 6px; font-size: 14px; }
.scenario-card p { margin: 0 0 8px; line-height: 1.4; }
.scenario-actors { font-size: 11px; color: var(--text2); margin-bottom: 10px; line-height: 1.5; }
.scenario-actors b { color: var(--text); }
.scenario-steps { flex: 1; margin-bottom: 12px; min-height: 24px; }
.scenario-step { display: flex; align-items: flex-start; gap: 8px; padding: 4px 0; font-size: 12px; line-height: 1.4; color: var(--text2); }
.scenario-step .step-icon { flex-shrink: 0; width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; font-size: 11px; margin-top: 1px; }
.scenario-step.pending .step-icon::after { content: "\25CB"; color: var(--text3); }
.scenario-step.running .step-icon::after { content: "\25CF"; color: var(--accent); animation: stepPulse 1s infinite; }
.scenario-step.done .step-icon::after { content: "\2713"; color: var(--green, #22c55e); font-weight: 700; }
.scenario-step.fail .step-icon::after { content: "\2717"; color: var(--red, #ef4444); font-weight: 700; }
.scenario-step.done { color: var(--text); }
.scenario-step.fail { color: var(--red, #ef4444); }
.scenario-step .step-label { flex: 1; }
.scenario-step .step-wallet { font-size: 10px; color: var(--text3); font-family: var(--mono, monospace); white-space: nowrap; }
@keyframes stepPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.scenario-card .btn { margin-top: auto; align-self: flex-start; }
.scenario-card .btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===============================================================
   PANELS & CARDS
   =============================================================== */
.panel { display: none; padding: 24px; }
.panel.active { display: block; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; transition: border-color 0.2s; }
.card:hover { border-color: var(--border-hover); }
.card h3 { font-size: 14px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; letter-spacing: -0.01em; }
.card h3 .badge { font-size: 11px; background: var(--accent-soft); color: var(--accent); padding: 2px 8px; border-radius: 0px 6px 0px 6px; font-weight: 500; }

/* ===============================================================
   FORMS
   =============================================================== */
.form-row { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.form-group { flex: 1; min-width: 200px; }
.form-group label { display: block; font-size: 12px; color: var(--text2); margin-bottom: 6px; font-weight: 500; }
.form-group input, .form-group select { width: 100%; padding: 8px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 13px; font-family: var(--font); transition: border-color 0.2s; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.form-group input::placeholder { color: var(--text3); }

/* ===============================================================
   BUTTONS — rotating gradient border
   =============================================================== */
.btn { position: relative; padding: 7px 16px; border: none; border-radius: var(--radius); cursor: pointer; font-size: 13px; font-weight: 500; font-family: var(--font); transition: all 0.25s; background: var(--btn-bg); color: var(--text); z-index: 0; overflow: hidden; }
.btn::before { content: ''; position: absolute; inset: 0; border-radius: var(--radius); padding: 1px; background: conic-gradient(from var(--btn-angle, 0deg), var(--btn-border-idle)); -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; transition: all 0.25s; }
.btn:hover::before { background: conic-gradient(from var(--btn-angle, 0deg), var(--accent), #fff, var(--accent)); animation: btn-rotate 2s linear infinite; }
.btn:hover { filter: brightness(1.05); }
@property --btn-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes btn-rotate { to { --btn-angle: 360deg; } }
.btn-primary { background: var(--btn-bg); color: var(--btn-text); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-success { background: var(--btn-bg); color: var(--green); }
.btn-success:hover::before { background: conic-gradient(from var(--btn-angle, 0deg), var(--green), #fff, var(--green)); animation: btn-rotate 2s linear infinite; }
.btn-success:hover { background: var(--green-soft); }
.btn-danger { background: var(--btn-bg); color: var(--red); }
.btn-danger:hover::before { background: conic-gradient(from var(--btn-angle, 0deg), var(--red), #fff, var(--red)); animation: btn-rotate 2s linear infinite; }
.btn-danger:hover { background: var(--red-soft); }
.btn-warning { background: var(--btn-bg); color: var(--orange); }
.btn-warning:hover::before { background: conic-gradient(from var(--btn-angle, 0deg), var(--orange), #fff, var(--orange)); animation: btn-rotate 2s linear infinite; }
.btn-warning:hover { background: var(--orange-soft); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:disabled:hover::before { animation: none; background: conic-gradient(from 0deg, var(--btn-border-idle)); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ===============================================================
   MAIN LAYOUT — content + log sidebar
   =============================================================== */
.main-layout {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  padding-right: 340px;
  gap: 0;
}
.main-content {
  flex: 1;
  min-width: 0;
}

/* ===============================================================
   LOG SIDEBAR (desktop)
   =============================================================== */
.log-sidebar {
  width: 340px;
  flex-shrink: 0;
  position: fixed;
  top: 56px;
  right: 0;
  height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: var(--bg-alt);
  transition: width 0.25s ease, opacity 0.25s ease;
  z-index: 50;
}
.log-sidebar.collapsed {
  width: 40px;
  overflow: hidden;
}
.main-layout.log-collapsed {
  padding-right: 40px;
}
.log-sidebar.collapsed .log-sidebar-body,
.log-sidebar.collapsed .log-sidebar-title { display: none; }
.log-sidebar.collapsed .log-sidebar-header { justify-content: center; padding: 12px 0; }

.log-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.log-sidebar-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 8px;
}
.log-sidebar-title .log-count {
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 0px 6px 0px 6px;
  font-weight: 600;
}
.log-toggle-btn {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.log-toggle-btn:hover { color: var(--text); background: var(--surface); }
.log-sidebar.collapsed .log-toggle-btn svg { transform: rotate(180deg); }

.log-sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.7;
}
#globalLog { padding: 0; }
.log-entry { padding: 4px 16px; border-bottom: 1px solid rgba(128,128,128,0.08); }
.log-entry:last-child { border-bottom: none; }
.log-entry .time { color: var(--text3); }
.log-entry.success { color: var(--green); }
.log-entry.error { color: var(--red); }
.log-entry.info { color: var(--accent); }
.log-entry.warn { color: var(--orange); }

/* LOG BUTTON (mobile) */
.log-mobile-btn {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 400;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0px 10px 0px 10px;
  padding: 8px 16px;
  cursor: pointer;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  transition: all 0.2s;
  align-items: center;
  gap: 6px;
}
.log-mobile-btn:hover { border-color: var(--accent); }
.log-mobile-btn .log-mobile-count {
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  padding: 0 6px;
  border-radius: 0px 6px 0px 6px;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}

/* LOG MODAL (mobile) */
.log-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--modal-overlay);
  z-index: 500;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.log-modal-overlay.open {
  display: flex;
  animation: modalFadeIn 0.2s ease-out;
}
.log-modal {
  background: var(--modal-bg);
  border: 1px solid var(--border);
  border-radius: 0px 12px 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.3);
  animation: logModalSlideUp 0.25s ease-out;
}
@keyframes logModalSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.log-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.log-modal-header h3 { font-size: 14px; font-weight: 600; }
.log-modal-close {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.log-modal-close:hover { color: var(--text); }
.log-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.7;
  -webkit-overflow-scrolling: touch;
}
.log-modal-body .log-entry { padding: 4px 20px; }

@media (max-width: 900px) {
  .log-sidebar { display: none; }
  .log-mobile-btn { display: flex; }
  .time-warp-fab { bottom: 20px; right: 20px; }
  .main-layout { padding-right: 0; }
}

body.log-collapsed .time-warp-fab {
  right: 64px;
}
body.log-collapsed .run-all-fab {
  right: 124px;
}

/* ===============================================================
   TIME WARP FAB
   =============================================================== */
.time-warp-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 400;
}
.time-warp-btn {
  width: 48px;
  height: 48px;
  border-radius: 0px 12px 0px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  transition: all 0.2s;
}
.time-warp-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.time-warp-fab.open .time-warp-btn {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.time-warp-menu {
  display: none;
  position: absolute;
  bottom: 56px;
  right: 0;
  background: var(--modal-bg);
  border: 1px solid var(--border);
  border-radius: 0px 10px 0px 10px;
  padding: 8px 0;
  min-width: 180px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  animation: timeMenuIn 0.15s ease-out;
}
.time-warp-fab.open .time-warp-menu { display: block; }
@keyframes timeMenuIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.time-warp-header {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text3);
  padding: 4px 14px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.time-warp-option {
  display: block;
  width: 100%;
  padding: 8px 14px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  text-align: left;
  transition: all 0.1s;
}
.time-warp-option:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.time-warp-option.rewind {
  color: var(--orange, #f59e0b);
  font-size: 12px;
}
.time-warp-option.rewind:hover {
  background: rgba(245, 158, 11, 0.1);
  color: var(--orange, #f59e0b);
}
.time-warp-custom {
  display: flex;
  gap: 4px;
  padding: 6px 10px 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.time-warp-custom input {
  flex: 1;
  padding: 5px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0px 6px 0px 6px;
  color: var(--text);
  font-size: 12px;
  font-family: var(--font);
  min-width: 0;
}
.time-warp-custom input:focus { outline: none; border-color: var(--accent); }
.time-warp-custom .time-warp-option {
  width: auto;
  padding: 5px 10px;
  border-radius: 0px 6px 0px 6px;
  background: var(--surface2);
  flex-shrink: 0;
}

/* ===============================================================
   STATUS BADGES
   =============================================================== */
.status-badge { display: inline-block; padding: 2px 10px; border-radius: 0px 6px 0px 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; }
.status-open { background: rgba(255, 92, 170, 0.14); color: var(--accent); }
.status-accepted { background: var(--orange-soft); color: var(--orange); }
.status-inreview { background: rgba(255, 92, 170, 0.2); color: var(--accent); }
.status-paid { background: var(--green-soft); color: var(--green); }
.status-expired { background: rgba(128, 128, 128, 0.18); color: var(--text3); }
.status-disputed { background: var(--red-soft); color: var(--red); }

/* ===============================================================
   READ DISPLAY
   =============================================================== */
.read-result { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin-top: 8px; font-family: var(--font-mono); font-size: 12px; word-break: break-all; }
.read-result .label { color: var(--text3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.read-result .value { color: var(--green); }

/* ===============================================================
   GRID
   =============================================================== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 768px) { .grid-2 { grid-template-columns: 1fr; } }

/* Quest list */
.quest-item { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.quest-item.clickable { cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.quest-item.clickable:hover { border-color: var(--accent); background: var(--accent-soft, rgba(255,92,170,0.06)); }
.quest-item-left { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.quest-item-id { font-weight: 600; font-size: 12px; color: var(--text2); white-space: nowrap; }
.quest-item-addr { font-family: var(--font-mono); font-size: 11px; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quest-item-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; margin-left: 12px; }
.quest-item-reward { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; }
.quest-items-list { max-height: 400px; overflow-y: auto; }

/* Quest status filters */
.quest-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.quest-filter-btn { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text2); font-size: 11px; font-weight: 500; cursor: pointer; transition: all 0.15s; font-family: var(--font); }
.quest-filter-btn:hover { border-color: var(--accent); color: var(--text); }
.quest-filter-btn.active { background: var(--accent-soft, rgba(255,92,170,0.14)); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.quest-filter-btn .qf-count { font-size: 10px; opacity: 0.7; }

/* Quest Detail Modal */
.quest-detail-overlay { position: fixed; inset: 0; z-index: 99999; display: none; align-items: center; justify-content: center; background: var(--modal-overlay, rgba(0,0,0,0.6)); }
.quest-detail-overlay.open { display: flex; }
.quest-detail-modal { background: var(--modal-bg, var(--surface)); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; max-width: 560px; width: 92%; max-height: 85vh; overflow-y: auto; position: relative; }
.quest-detail-close { position: absolute; top: 12px; right: 16px; background: none; border: none; color: var(--text3); font-size: 22px; cursor: pointer; line-height: 1; padding: 4px; }
.quest-detail-close:hover { color: var(--text); }
.qd-status-row { margin-bottom: 6px; }
.qd-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.qd-quest-id { font-weight: 700; font-size: 1.1rem; color: var(--text); }
.qd-addr { font-family: var(--font-mono); font-size: 11px; color: var(--accent); margin-bottom: 16px; word-break: break-all; }
.qd-review-section { border-radius: var(--radius-sm); padding: 12px; margin-bottom: 4px; }
.qd-review-badge { display: inline-block; padding: 4px 12px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.card-highlight { animation: card-flash 2s ease-out; }
@keyframes card-flash { 0%,20% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: none; } }
.qd-section { border-top: 1px solid var(--border); padding: 12px 0 4px; margin-top: 4px; }
.qd-section-title { font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text3); margin-bottom: 8px; }
.qd-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; font-size: 13px; }
.qd-label { color: var(--text2); }
.qd-value { color: var(--text); font-weight: 500; text-align: right; }
.qd-value.qd-mono { font-family: var(--font-mono); font-size: 11px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.qd-value.qd-highlight { color: var(--accent); font-weight: 700; font-size: 14px; }
.qd-actions { display: flex; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }

/* Run History Modal */
.rh-title { font-weight: 700; font-size: 1.1rem; margin-bottom: 16px; }
.rh-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rh-table th { text-align: left; padding: 8px 10px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text3); border-bottom: 1px solid var(--border); }
.rh-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.rh-table tr:hover td { background: rgba(128,128,128,0.04); }
.rh-mono { font-family: var(--font-mono); font-size: 12px; }
.rh-badge { display: inline-block; padding: 2px 8px; border-radius: var(--radius-sm); font-size: 10px; font-weight: 700; letter-spacing: 0.04em; }
.rh-pass { background: var(--green-soft); color: var(--green); }
.rh-fail { background: var(--red-soft); color: var(--red); }
.rh-view-btn { display: inline-block; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 12px; cursor: pointer; font-size: 11px; font-weight: 500; color: var(--accent); font-family: var(--font); text-decoration: none; transition: all 0.15s; }
.rh-view-btn:hover { border-color: var(--accent); background: var(--accent-soft, rgba(255,92,170,0.14)); }
.rh-empty { text-align: center; padding: 40px; color: var(--text3); }

/* Run history mobile cards */
@media (max-width: 640px) {
  .rh-table, .rh-table thead, .rh-table tbody, .rh-table tr, .rh-table th, .rh-table td { display: block; }
  .rh-table thead { display: none; }
  .rh-table tr { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 10px; }
  .rh-table td { padding: 3px 0; border: none; display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
  .rh-table td::before { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text3); font-weight: 600; }
  .rh-table td:nth-child(1)::before { content: 'Date'; }
  .rh-table td:nth-child(2)::before { content: 'Time'; }
  .rh-table td:nth-child(3)::before { content: 'Status'; }
  .rh-table td:nth-child(4)::before { content: 'Passed'; }
  .rh-table td:nth-child(5)::before { content: 'Failed'; }
  .rh-table td:nth-child(6)::before { content: 'Total'; }
  .rh-table td:nth-child(7)::before { content: 'Duration'; }
  .rh-table td:nth-child(8) { justify-content: center; margin-top: 6px; }
  .rh-table td:nth-child(8) .rh-view-btn { width: 100%; text-align: center; padding: 8px; }
}

/* ===============================================================
   SPINNER
   =============================================================== */
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.6s linear infinite; margin-right: 6px; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===============================================================
   TOAST
   =============================================================== */
.toast-container { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 100002; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 20px; font-size: 13px; opacity: 0; transition: opacity 0.3s, transform 0.3s; pointer-events: none; transform: translateY(-8px); white-space: nowrap; max-width: 90vw; text-overflow: ellipsis; overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,0.25); }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error { border-color: var(--red); color: var(--red); }
.toast.warn { border-color: var(--orange); color: var(--orange); }
.toast.info { border-color: var(--accent); color: var(--accent); }

/* ===============================================================
   FOOTER
   =============================================================== */
.site-footer { text-align: center; padding: 32px 24px; color: var(--text3); font-size: 12px; border-top: 1px solid var(--border); margin-top: 40px; }
.site-footer a { color: var(--text2); }
.site-footer a:hover { color: var(--accent); }

/* ===============================================================
   WALLET MODAL
   =============================================================== */
.wallet-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--modal-overlay);
  z-index: 500;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.wallet-modal-overlay.open {
  display: flex;
  animation: modalFadeIn 0.2s ease-out;
}
@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }

.wallet-modal {
  background: var(--modal-bg);
  border: 1px solid var(--border);
  border-radius: 0px 12px 0px 12px;
  padding: 0;
  width: 360px;
  max-width: 92vw;
  box-shadow: 0 16px 48px rgba(0,0,0,0.25);
  animation: modalSlideUp 0.25s ease-out;
  overflow: hidden;
}
@keyframes modalSlideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.wallet-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.wallet-modal-header h3 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.wallet-modal-close {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
  border-radius: 6px;
}
.wallet-modal-close:hover { color: var(--text); background: var(--surface2); }

.wallet-modal-body { padding: 12px 20px 16px; }

.wallet-modal-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 13px;
}
.wallet-modal-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text3);
  flex-shrink: 0;
}
.wallet-modal-status .dot.connected { background: var(--green); box-shadow: 0 0 6px var(--green); }
.wallet-modal-status .addr { font-family: var(--font-mono); font-size: 11px; color: var(--text2); font-weight: 500; word-break: break-all; }
.wallet-modal-status .label { color: var(--text3); font-size: 12px; }

.wallet-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  transition: all 0.15s;
}
.modal-action-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.modal-action-btn .icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  flex-shrink: 0;
  color: var(--text2);
}
.modal-action-btn:hover .icon { color: var(--accent); }
.modal-action-btn .action-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}
.modal-action-btn .action-text .sub {
  font-size: 11px;
  color: var(--text3);
  font-weight: 400;
  margin-top: 1px;
}
.modal-action-btn.danger .icon { color: var(--text3); }
.modal-action-btn.danger:hover {
  border-color: var(--red);
  background: var(--red-soft);
}
.modal-action-btn.danger:hover .icon { color: var(--red); background: var(--red-soft); }

/* Theme toggle in modal */
.theme-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 16px;
}
.theme-toggle-row .label {
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}
.theme-toggle-row .label .icon {
  font-size: 18px;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-switch .slider {
  position: absolute;
  inset: 0;
  background: var(--surface2);
  border-radius: 24px;
  border: 1px solid var(--border);
  transition: all 0.25s;
}
.toggle-switch .slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  bottom: 2px;
  background: var(--text);
  border-radius: 50%;
  transition: transform 0.25s;
}
.toggle-switch input:checked + .slider { background: var(--accent-soft); border-color: var(--accent); }
.toggle-switch input:checked + .slider::before { transform: translateX(20px); background: var(--accent); }

/* ===============================================================
   RUN ALL SCENARIOS MODAL
   =============================================================== */
.runall-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--modal-overlay);
  z-index: 500;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.runall-overlay.open {
  display: flex;
  animation: modalFadeIn 0.2s ease-out;
}
.runall-modal {
  background: var(--modal-bg);
  border: 1px solid var(--border);
  border-radius: 0px 12px 0px 12px;
  padding: 0;
  width: 520px;
  max-width: 94vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(0,0,0,0.25);
  animation: modalSlideUp 0.25s ease-out;
  overflow: hidden;
}
.runall-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.runall-header h3 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.runall-close {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
  border-radius: 6px;
}
.runall-close:hover { color: var(--text); background: var(--surface2); }
.runall-body {
  padding: 16px 20px 20px;
  overflow-y: auto;
  flex: 1;
}

/* Setup screen */
.runall-estimate {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 10px;
}
.runall-estimate .est-value {
  color: var(--accent);
  font-weight: 600;
  font-family: var(--font-mono);
}
.runall-mode-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.runall-mode-btn {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  transition: all 0.15s;
  text-align: center;
}
.runall-mode-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}
.runall-mode-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.runall-categories {
  display: none;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  max-height: 220px;
  overflow-y: auto;
}
.runall-categories.visible { display: flex; }
.runall-cat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s;
  font-size: 12px;
}
.runall-cat-item:hover { border-color: var(--border-hover); }
.runall-cat-item input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  cursor: pointer;
}
.runall-cat-item .cat-name { font-weight: 500; color: var(--text); flex: 1; }
.runall-cat-item .cat-count { font-size: 11px; color: var(--text3); font-family: var(--font-mono); }
.runall-start-btn {
  width: 100%;
  padding: 10px;
  margin-top: 8px;
}

/* Progress screen */
.runall-progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}
.runall-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}
.runall-progress-label {
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
}
.runall-progress-label .pct { color: var(--accent); font-weight: 600; font-family: var(--font-mono); }
.runall-live-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 260px;
  overflow-y: auto;
}
.runall-live-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
}
.runall-live-item .ra-icon {
  flex-shrink: 0;
  width: 16px;
  text-align: center;
  font-size: 11px;
}
.runall-live-item.pending .ra-icon::after { content: "\25CB"; color: var(--text3); }
.runall-live-item.running .ra-icon::after { content: "\25CF"; color: var(--accent); animation: stepPulse 1s infinite; }
.runall-live-item.pass .ra-icon::after { content: "\2713"; color: var(--green); font-weight: 700; }
.runall-live-item.fail .ra-icon::after { content: "\2717"; color: var(--red); font-weight: 700; }
.runall-live-item.skip .ra-icon::after { content: "\2014"; color: var(--text3); }
.runall-live-item .ra-name { flex: 1; color: var(--text); }
.runall-live-item .ra-time { font-size: 11px; color: var(--text3); font-family: var(--font-mono); }
.runall-live-item.fail .ra-name { color: var(--red); }

/* Done screen */
.runall-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.runall-summary-stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-align: center;
}
.runall-summary-stat .stat-value {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-mono);
}
.runall-summary-stat .stat-label {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}
.runall-summary-stat.passed .stat-value { color: var(--green); }
.runall-summary-stat.failed .stat-value { color: var(--red); }
.runall-summary-stat.total .stat-value { color: var(--accent); }
.runall-done-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.runall-done-actions .btn { flex: 1; }

/* ---- Completed Accordion ---- */
.ra-completed-accordion {
  margin: 8px 0 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.ra-completed-summary {
  cursor: pointer;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text2);
  user-select: none;
  list-style: none;
}
.ra-completed-summary::-webkit-details-marker { display: none; }
.ra-completed-summary::before {
  content: ">";
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.15s;
  font-family: monospace;
}
.ra-completed-accordion[open] > .ra-completed-summary::before { transform: rotate(90deg); }
.ra-completed-list {
  max-height: 200px;
  overflow-y: auto;
  border-top: 1px solid var(--border);
}

/* ---- Background FAB ---- */
.run-all-fab {
  position: fixed;
  bottom: 24px;
  right: 84px;
  z-index: 9999;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 48px;
  padding: 0 16px;
  border-radius: 0px 12px 0px 12px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transition: background 0.3s, transform 0.15s;
  font-family: var(--font);
  white-space: nowrap;
}
.run-all-fab:hover { transform: scale(1.04); }
.run-all-fab.running { animation: ra-fab-pulse 2s infinite; }
.run-all-fab.done { background: var(--green); animation: none; }
.ra-fab-pct {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
}
.ra-fab-label {
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  opacity: 0.9;
}
@keyframes ra-fab-pulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(255,92,170,0.3); }
  50% { box-shadow: 0 4px 24px rgba(255,92,170,0.6); }
}

/* ---- Background Confirm Dialog ---- */
.ra-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 100001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--modal-overlay);
  opacity: 0;
  transition: opacity 0.15s;
}
.ra-confirm-overlay.open { opacity: 1; }
.ra-confirm-box {
  background: var(--modal-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 400px;
  width: 90%;
}
.ra-confirm-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 8px;
  color: var(--text);
}
.ra-confirm-text {
  font-size: 0.9rem;
  color: var(--text2);
  margin-bottom: 16px;
  line-height: 1.5;
}
.ra-confirm-actions {
  display: flex;
  gap: 8px;
}
.ra-confirm-actions .btn { flex: 1; font-size: 0.85rem; }
