/* DKD Browser Agent · Nixtio-style glass shell + app.js dynamic UI */

.hidden { display: none !important; }

/* ── Nixtio / Rakuten glass dashboard ── */
:root {
  --rakuten: #bf0000;
  --rakuten-dark: #9e0000;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.85);
  --sidebar: #121218;
  --text: #111827;
  --muted: #6b7280;
  --radius-xl: 2rem;
  --radius-lg: 1.25rem;
  --shadow-soft: 0 24px 80px -20px rgba(17, 24, 39, 0.18);
}

.nixtio-app {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.nixtio-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 75% 55% at 15% 10%, rgba(191, 0, 0, 0.18), transparent 55%),
    radial-gradient(ellipse 65% 50% at 90% 5%,  rgba(220, 60, 60, 0.14), transparent 50%),
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(191, 0, 0, 0.1), transparent 55%),
    radial-gradient(ellipse 50% 40% at 80% 60%,  rgba(255, 180, 180, 0.12), transparent 50%),
    linear-gradient(155deg, #fff0f0 0%, #fde8e8 30%, #fff5f5 60%, #fff0ee 100%);
}
.nixtio-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='900' height='600' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 420 Q220 260 450 360 T900 300' fill='none' stroke='%23ffb3b3' stroke-width='1.2' opacity='.45'/%3E%3Cpath d='M0 520 Q260 380 520 460 T900 420' fill='none' stroke='%23ffc9c9' stroke-width='1' opacity='.35'/%3E%3Cpath d='M100 200 Q350 100 600 180 T900 140' fill='none' stroke='%23ffd5d5' stroke-width='0.8' opacity='.3'/%3E%3C/svg%3E") center/cover no-repeat;
  pointer-events: none;
}

.nixtio-shell {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 1.25rem auto;
  min-height: calc(100vh - 2.5rem);
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0 1rem 1rem;
}

.nixtio-sidebar {
  width: 56px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.85rem 0;
  margin-right: 0.75rem;
  background: var(--sidebar);
  border-radius: 999px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  align-self: center;
  position: sticky;
  top: 50%;
  transform: translateY(-50%);
  height: fit-content;
  gap: 0;
}
.nixtio-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0.65rem 0;
}
.nixtio-sidebar-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.15rem;
  transition: background 0.15s, color 0.15s, transform 0.12s;
}
.nixtio-sidebar-btn:hover,
.nixtio-sidebar-btn.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.nixtio-sidebar-btn--primary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.nixtio-sidebar-brand {
  margin-top: auto;
  padding-top: 0.75rem;
}
.nixtio-sidebar-logo {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: contain;
  background: #fff;
  padding: 2px;
}

.nixtio-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--glass);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.nixtio-topbar {
  position: relative;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 1rem 1.75rem 0.75rem;
  gap: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
}
.nixtio-topbar-left {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
}
.nixtio-topbar-icon { color: var(--rakuten); font-size: 1rem; }
.nixtio-topbar-chevron { display: none; }

.nixtio-model-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: rgba(17, 17, 27, 0.07);
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 999px;
  padding: 0.28rem 0.55rem 0.28rem 0.75rem;
  gap: 0.25rem;
  transition: background 0.15s, border-color 0.15s;
}
.nixtio-model-wrap:hover {
  background: rgba(17, 17, 27, 0.12);
  border-color: rgba(0, 0, 0, 0.16);
}
.nixtio-model-select {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  outline: none;
  padding: 0;
  line-height: 1.2;
}
.nixtio-model-chevron {
  font-size: 0.75rem;
  color: #6b7280;
  pointer-events: none;
  flex-shrink: 0;
}
.nixtio-topbar-title {
  text-align: center;
  color: #9ca3af;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.nixtio-topbar-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

/* ── Notification bell ── */
.nixtio-notif-btn {
  position: relative;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 999px;
  background: rgba(17,17,27,0.07);
  color: #374151;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background 0.15s;
}
.nixtio-notif-btn:hover { background: rgba(17,17,27,0.13); }
.nixtio-notif-btn.has-unread { color: var(--rakuten); }
.nixtio-notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--rakuten);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  line-height: 1;
}

/* ── Notification panel ── */
.nixtio-notif-panel {
  position: absolute;
  top: calc(100% - 4px);
  right: 1.75rem;
  width: min(320px, calc(100% - 2rem));
  max-height: min(420px, 70vh);
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 1.1rem;
  box-shadow: 0 20px 60px -12px rgba(17,24,39,0.22);
  z-index: 300;
  overflow: hidden;
  animation: card-pop 0.2s cubic-bezier(0.22,1,0.36,1);
}
.nixtio-notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  font-weight: 700;
  font-size: 0.8125rem;
}
.nixtio-notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  max-height: min(360px, calc(70vh - 50px));
}
.nixtio-notif-empty {
  padding: 1.5rem 1rem;
  font-size: 0.8125rem;
  color: #9ca3af;
  text-align: center;
}
.nixtio-notif-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 0.35rem 0.6rem;
  align-items: start;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #f9fafb;
  transition: background 0.12s;
}
.nixtio-notif-item:last-child { border-bottom: none; }
.nixtio-notif-item.is-unread { background: rgba(191,0,0,0.03); }
.nixtio-notif-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 1px;
}
.notif-icon--info    { background: #eff6ff; color: #2563eb; }
.notif-icon--success { background: #ecfdf5; color: #059669; }
.notif-icon--warn    { background: #fffbeb; color: #d97706; }
.notif-icon--error   { background: #fef2f2; color: #dc2626; }
.notif-icon--sched   { background: #faf5ff; color: #7c3aed; }
.notif-icon--reset   { background: #f0fdf4; color: #16a34a; }
.nixtio-notif-body { min-width: 0; }
.nixtio-notif-msg {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #111827;
  line-height: 1.4;
  word-break: break-word;
}
.nixtio-notif-time {
  font-size: 0.65rem;
  color: #9ca3af;
  white-space: nowrap;
  margin-top: 1px;
  grid-column: 3;
  grid-row: 1;
  align-self: start;
}
.nixtio-env {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--muted);
}
.nixtio-env[data-state="connected"] { color: #047857; }
.nixtio-env[data-state="error"] { color: #b45309; }
.nixtio-pill {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: #111;
  color: #fff;
  border: none;
}
.nixtio-pill--status[data-state="idle"] { background: #111; }
.nixtio-pill--status[data-state="running"] {
  background: var(--rakuten);
  animation: chip-pulse 1.8s ease-in-out infinite;
}
.nixtio-pill--status[data-state="error"] { background: #991b1b; }
@keyframes chip-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.65; } }

.nixtio-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 1.75rem 1rem;
}

.nixtio-banner {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  background: rgba(191, 0, 0, 0.08);
  border: 1px solid rgba(191, 0, 0, 0.2);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--rakuten-dark);
}

.nixtio-hero {
  transition: opacity 0.35s ease, transform 0.35s ease, max-height 0.45s ease;
  max-height: 800px;
  overflow: hidden;
}
.nixtio-hero.is-collapsed {
  opacity: 0;
  transform: translateY(-12px) scale(0.98);
  max-height: 0;
  margin: 0;
  pointer-events: none;
}
.nixtio-hero-head {
  position: relative;
  margin-top: 0.5rem;
}
.nixtio-greeting {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  max-width: 16ch;
  margin: 0 0 0.75rem;
}
.nixtio-mascot {
  position: absolute;
  right: 0;
  top: -0.5rem;
  width: 140px;
  pointer-events: none;
}
.nixtio-mascot-bubble {
  position: absolute;
  right: 0;
  top: 0;
  font-size: 0.65rem;
  font-weight: 600;
  background: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  white-space: nowrap;
}
.nixtio-mascot-bot {
  margin-top: 2.5rem;
  width: 112px;
  height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 14px 28px rgba(17, 24, 39, 0.18));
  animation: float 5s ease-in-out infinite;
}
.nixtio-mascot-bot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.nixtio-lede {
  font-size: 0.9375rem;
  color: var(--muted);
  max-width: 52ch;
  line-height: 1.55;
  margin: 0 0 1.5rem;
}
.nixtio-topology,
.topology {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(191, 0, 0, 0.12);
  font-size: 0.8125rem;
}

/* topology embedded inside middle feature card */
.nixtio-topology-inline {
  margin: 0.55rem 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: #374151;
  word-break: break-all;
  line-height: 1.5;
}
.nixtio-topology-inline:empty { display: none; }
.nixtio-topology-inline strong {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--rakuten);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}
.nixtio-topology-inline .flow {
  display: block;
  color: #6b7280;
  font-weight: 500;
  font-size: 0.6875rem;
  font-family: ui-monospace, monospace;
  margin-top: 0.15rem;
}
.nixtio-feature-card--lan { min-height: 160px; }

.nixtio-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin-bottom: 1rem;
}
@media (max-width: 820px) {
  .nixtio-feature-grid { grid-template-columns: 1fr; }
  .nixtio-mascot { display: none; }
}
.nixtio-feature-card {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 1.35rem;
  padding: 1.15rem 1.1rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 40px -16px rgba(17, 24, 39, 0.12);
  min-height: 140px;
  display: flex;
  flex-direction: column;
}
.nixtio-feature-icon {
  width: 36px;
  height: 36px;
  border-radius: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 0.65rem;
  background: #f3f4f6;
}
.nixtio-feature-icon--warm { background: #fff1f2; color: var(--rakuten); }
.nixtio-feature-icon--net  { background: #f0fdf4; color: #16a34a; }
.nixtio-feature-icon--cal  { background: #faf5ff; color: #7c3aed; }
.nixtio-feature-text {
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.45;
  margin: 0 0 auto;
  color: #374151;
}
.nixtio-feature-label {
  margin-top: 0.85rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #9ca3af;
}

.nixtio-workspace {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1), transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.nixtio-workspace.is-visible {
  opacity: 1;
  transform: none;
}
.nixtio-activity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}
@media (max-width: 900px) {
  .nixtio-activity-grid { grid-template-columns: 1fr; }
}

.nixtio-glass-card {
  background: rgba(255, 255, 255, 0.88);
  border-radius: 1.35rem;
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 16px 48px -20px rgba(17, 24, 39, 0.14);
  overflow: hidden;
  animation: card-pop 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes card-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.nixtio-glass-card:nth-child(2) { animation-delay: 0.06s; }

.nixtio-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid #f3f4f6;
  gap: 0.5rem;
}
.nixtio-card-head h2 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
}
.nixtio-card-head-left { display: flex; align-items: center; gap: 0.45rem; }
.nixtio-card-head-right { display: flex; align-items: center; gap: 0.5rem; }
.nixtio-card-meta { font-size: 0.6875rem; font-weight: 600; color: #9ca3af; }
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--rakuten);
}
.live-dot-pulse { animation: live-blink 1.4s ease-in-out infinite; }
@keyframes live-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.nixtio-live-frame {
  aspect-ratio: 16/10;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nixtio-live-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nixtio-log {
  max-height: min(380px, 45vh);
  overflow-y: auto;
  margin: 0.65rem 1rem;
  background: rgba(249, 250, 251, 0.9);
  border-radius: 1rem;
  border: 1px solid #f3f4f6;
}
.nixtio-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--muted);
}
.nixtio-empty-icon { font-size: 2rem; opacity: 0.35; margin-bottom: 0.5rem; }
.nixtio-empty-title { font-weight: 700; color: var(--text); margin: 0 0 0.25rem; }
.nixtio-empty-sub { font-size: 0.8125rem; margin: 0; }

.nixtio-stopwatch {
  font-family: ui-monospace, monospace;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--rakuten);
  background: rgba(191, 0, 0, 0.08);
  padding: 0.15rem 0.45rem;
  border-radius: 0.35rem;
}

.nixtio-guidance {
  display: flex;
  gap: 0.5rem;
  padding: 0 1rem 1rem;
}
.nixtio-guidance input {
  flex: 1;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 0.5rem 0.75rem;
  font: inherit;
  font-size: 0.8125rem;
}
.nixtio-guidance button {
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 0.75rem;
  padding: 0.5rem 0.85rem;
  font-weight: 600;
  font-size: 0.8125rem;
  cursor: pointer;
}

.nixtio-result {
  margin: 0 1rem 1rem;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}
.nixtio-result-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
  color: #065f46;
}
#resultBody {
  margin: 0;
  font-size: 0.75rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 220px;
  overflow-y: auto;
}

.nixtio-plan { padding: 1.1rem 1.25rem 1.25rem; margin-bottom: 0.85rem; }
.nixtio-plan-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.nixtio-plan-head h2 { margin: 0; font-size: 1.05rem; }
#planIntent { margin: 0.25rem 0 0; font-size: 0.8125rem; color: var(--muted); }
.nixtio-plan-badge {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #92400e;
  align-self: flex-start;
}
.nixtio-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.nixtio-label span { font-weight: 500; color: #9ca3af; }
#planSteps,
.nixtio-more textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e5e7eb;
  border-radius: 0.85rem;
  padding: 0.65rem 0.85rem;
  font: inherit;
  font-size: 0.8125rem;
  resize: vertical;
  background: #fafafa;
}
.nixtio-plan-msg { font-size: 0.75rem; color: #9ca3af; margin-top: 0.35rem; }
.nixtio-plan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.nixtio-btn {
  font: inherit;
  font-weight: 700;
  font-size: 0.8125rem;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  border: none;
  position: relative;
}
.nixtio-btn--primary {
  background: #111;
  color: #fff;
  flex: 1;
  min-width: 140px;
}
.nixtio-btn--primary:hover { background: var(--rakuten); }
.nixtio-btn--ghost {
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #374151;
}
.nixtio-btn.is-loading .btn-label { visibility: hidden; }
.btn-spinner { display: none !important; }
.nixtio-btn.is-loading .btn-spinner {
  display: flex !important;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
}
.nixtio-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 999px;
  animation: spin 0.65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.nixtio-subpanel { padding: 1rem 1.15rem; margin-bottom: 0.85rem; }
.nixtio-subpanel-title { margin: 0 0 0.75rem; font-size: 0.9375rem; }
.nixtio-link-btn {
  background: none;
  border: none;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: #9ca3af;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.nixtio-link-btn:hover { color: var(--rakuten); }

.nixtio-dock {
  padding: 0.65rem 1.75rem 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(16px);
}
.nixtio-dock-meta {
  margin-bottom: 0.45rem;
}
.nixtio-dock-meta iconify-icon { vertical-align: -2px; margin-right: 0.15rem; }

/* ── Rakuten service chips ── */
.nixtio-service-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.nixtio-svc-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.1);
  background: rgba(255,255,255,0.85);
  font: inherit;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: background 0.13s, border-color 0.13s, transform 0.1s;
  white-space: nowrap;
}
.nixtio-svc-chip:hover {
  background: rgba(255,255,255,1);
  border-color: rgba(0,0,0,0.18);
  transform: translateY(-1px);
}
.nixtio-svc-chip.is-active {
  background: #111;
  color: #fff;
  border-color: #111;
}
.nixtio-svc-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  flex-shrink: 0;
}

/* ── Rakuten Services Panel ── */
.nixtio-services-panel .svc-panel-lead {
  font-size: 0.775rem;
  color: #6b7280;
  margin: 0 0 1rem;
  line-height: 1.55;
}
.svc-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}
.svc-panel-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1.5px solid rgba(0,0,0,0.07);
  background: rgba(255,255,255,0.72);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s, transform 0.12s, box-shadow 0.15s;
  font: inherit;
}
.svc-panel-card:hover {
  background: rgba(255,255,255,0.95);
  border-color: color-mix(in srgb, var(--svc-color, #BF0000) 35%, transparent);
  box-shadow: 0 4px 18px color-mix(in srgb, var(--svc-color, #BF0000) 14%, transparent);
  transform: translateY(-2px);
}
.svc-panel-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--svc-color, #BF0000) 12%, white);
  color: var(--svc-color, #BF0000);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.svc-panel-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.svc-panel-body strong {
  font-size: 0.825rem;
  font-weight: 700;
  color: #111;
}
.svc-panel-body > span {
  font-size: 0.68rem;
  color: #9ca3af;
  font-weight: 500;
}
.svc-panel-body ul {
  margin: 0.35rem 0 0;
  padding-left: 1rem;
  list-style: disc;
}
.svc-panel-body ul li {
  font-size: 0.68rem;
  color: #4b5563;
  line-height: 1.55;
}

/* ── Active domain skill badge ── */
.nixtio-skill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  border: 1.5px solid var(--badge-color, #BF0000);
  background: color-mix(in srgb, var(--badge-color, #BF0000) 10%, white);
  color: var(--badge-color, #BF0000);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  order: -1; /* stays left of textarea */
  flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.nixtio-skill-badge iconify-icon {
  font-size: 0.75rem;
}

.nixtio-composer {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 0.45rem 0.45rem 0.45rem 0.65rem;
  box-shadow: 0 8px 32px -8px rgba(17, 24, 39, 0.12);
}
.nixtio-composer-plus {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: #9ca3af;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nixtio-composer-input {
  flex: 1;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.875rem;
  resize: none;
  min-height: 24px;
  max-height: 120px;
  line-height: 1.45;
  padding: 0.35rem 0;
  outline: none;
}
.nixtio-composer-input::placeholder { color: #9ca3af; }
.nixtio-composer-send {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  background: #111;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background 0.15s, transform 0.12s;
}
.nixtio-composer-send:hover { background: var(--rakuten); transform: scale(1.03); }
.nixtio-composer-send[data-mode="stop"] { background: var(--rakuten); }
.nixtio-composer-send[data-mode="stop"]:hover { background: var(--rakuten-dark); transform: scale(1.03); }

.nixtio-mem-toggle {
  height: 40px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.7rem;
  border: 1px solid rgba(191, 0, 0, 0.18);
  border-radius: 999px;
  background: rgba(191, 0, 0, 0.06);
  color: var(--rakuten);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.nixtio-mem-toggle:hover { background: rgba(191, 0, 0, 0.1); }
.nixtio-mem-toggle:focus-visible { outline: 2px solid var(--rakuten); outline-offset: 2px; }
.nixtio-mem-toggle iconify-icon { font-size: 0.95rem; }
.nixtio-mem-toggle-track {
  position: relative;
  width: 26px;
  height: 15px;
  border-radius: 999px;
  background: var(--rakuten);
  transition: background 0.18s;
}
.nixtio-mem-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 13px;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: left 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}
.nixtio-mem-toggle.is-off {
  color: #6b7280;
  background: rgba(17, 17, 27, 0.05);
  border-color: #e5e7eb;
}
.nixtio-mem-toggle.is-off .nixtio-mem-toggle-track { background: #d1d5db; }
.nixtio-mem-toggle.is-off .nixtio-mem-toggle-thumb { left: 2px; }
@media (max-width: 640px) {
  .nixtio-mem-toggle-label { display: none; }
}

.nixtio-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
}
.nixtio-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: none;
  background: #111;
  color: #fff;
  font: inherit;
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s, transform 0.1s;
}
.nixtio-chip:hover { background: var(--rakuten); }
.nixtio-chip--stop {
  background: #fff;
  color: #374151;
  border: 1px solid #e5e7eb;
}
.nixtio-chip--stop:disabled { opacity: 0.45; cursor: not-allowed; }
.nixtio-chip--stop:not(:disabled):hover { border-color: var(--rakuten); color: var(--rakuten); background: #fff; }

.nixtio-more {
  margin-top: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #e5e7eb;
  font-size: 0.8125rem;
}
.nixtio-toggle-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.15rem 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
  cursor: pointer;
}
.nixtio-toggle-row small { grid-column: 2; color: #9ca3af; font-size: 0.6875rem; }
.nixtio-inline { display: flex; align-items: center; gap: 0.5rem; margin: 0.5rem 0; }
.nixtio-more-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.6875rem;
  color: #9ca3af;
}
.nixtio-more-foot button {
  background: none;
  border: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--rakuten);
}

.nixtio-sheet {
  background: #fff;
  border-radius: 1.5rem;
  padding: 1.75rem;
  max-width: 28rem;
  width: 100%;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}
.nixtio-sheet-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: none;
  background: #f3f4f6;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  cursor: pointer;
}
.nixtio-sheet-icon { font-size: 1.75rem; color: #d97706; margin-bottom: 0.5rem; }
.nixtio-sheet-actions { display: flex; gap: 0.5rem; margin-top: 1rem; }

.sheet-scrim:not(.hidden) {
  display: flex !important;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(17, 24, 39, 0.45);
  backdrop-filter: blur(6px);
}

.token-current {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}
.token-stat {
  background: #fafafa;
  border: 1px solid #f3f4f6;
  border-radius: 0.85rem;
  padding: 0.75rem 0.85rem;
}
.token-stat-label {
  display: block;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
  margin-bottom: 0.55rem;
}
/* row: label + value pairs */
.token-io {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.45rem;
}
.token-io > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem;
}
.token-io-label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: #9ca3af;
  white-space: nowrap;
}
.token-io strong {
  font-size: 0.875rem;
  font-weight: 700;
  color: #111827;
  font-variant-numeric: tabular-nums;
}
.token-sub {
  display: block;
  font-size: 0.6875rem;
  color: #9ca3af;
  border-top: 1px solid #f3f4f6;
  padding-top: 0.35rem;
  margin-top: 0.1rem;
}
.nixtio-token-details {
  border-top: 1px solid #f3f4f6;
  padding-top: 0.65rem;
}
.nixtio-token-details summary {
  font-size: 0.75rem;
  font-weight: 600;
  color: #9ca3af;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.nixtio-token-details summary::-webkit-details-marker { display: none; }
.nixtio-token-details summary::before { content: "▸"; font-size: 0.65rem; transition: transform 0.15s; }
.nixtio-token-details[open] summary::before { transform: rotate(90deg); }
.token-table-wrap { margin-top: 0.5rem; }
.token-empty { font-size: 0.75rem; color: #9ca3af; padding: 0.35rem 0; }

.mode-activity .nixtio-dock { box-shadow: 0 -8px 32px rgba(17, 24, 39, 0.06); }

@media (max-width: 640px) {
  .nixtio-shell { flex-direction: column; padding: 0 0.5rem 0.5rem; }
  .nixtio-sidebar {
    flex-direction: row;
    width: 100%;
    max-height: none;
    min-height: 0;
    border-radius: 999px;
    padding: 0.5rem 1rem;
    margin: 0 0 0.5rem;
  }
  .nixtio-sidebar-nav { flex-direction: row; margin: 0 0 0 auto; }
  .nixtio-sidebar-brand { margin: 0; padding: 0; }
}

/* ── Activity log (app.js injects) ── */
.log-entry {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  animation: log-slide 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.log-entry:last-child { border-bottom: none; }
@keyframes log-slide {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.log-entry .meta {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9ca3af;
  margin-bottom: 0.25rem;
}
.log-entry .goal {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0.15rem 0;
}
.log-entry .detail {
  font-size: 0.8125rem;
  color: #6b7280;
  margin: 0.15rem 0;
  line-height: 1.45;
}
.log-entry a {
  color: #bf0000;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.log-step-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.35rem;
}
.log-step-num {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #bf0000;
  background: #fdf0f0;
  border-radius: 99px;
  padding: 0.1rem 0.45rem;
}
.log-phase {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.4rem;
  border-radius: 99px;
  background: #f3f4f6;
  color: #6b7280;
}
.log-step-status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.12rem 0.5rem;
  border-radius: 99px;
}
.log-step-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: currentColor;
}
.log-step-status.is-thinking { color: #6b7280; background: #f3f4f6; }
.log-step-status.is-thinking::before { animation: step-pulse 1s ease-in-out infinite; }
.log-step-status.is-running { color: #b45309; background: #fef3c7; }
.log-step-status.is-running::before { animation: step-pulse 0.8s ease-in-out infinite; }
.log-step-status.is-ok { color: #047857; background: #ecfdf5; }
.log-step-status.is-fail { color: #b91c1c; background: #fef2f2; }
@keyframes step-pulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) {
  .log-step-status::before { animation: none !important; }
}
.log-actions { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.3rem 0; }
.log-action {
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 0.4rem;
  background: #f5f5f7;
  color: #374151;
  word-break: break-all;
}
.log-step-error {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: #b91c1c;
}
.log-stuck {
  font-size: 0.78rem;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 0.6rem;
  padding: 0.4rem 0.6rem;
}
.log-url {
  font-size: 0.75rem;
  font-family: ui-monospace, monospace;
  color: #6b7280;
  word-break: break-all;
  margin: 0.2rem 0;
}
.log-goal {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0.15rem 0;
  line-height: 1.45;
}
.log-eval {
  margin-top: 0.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.45;
}
.log-eval.ok { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.log-eval.warn { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }
.log-eval.fail { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }

.log-details { margin-top: 0.35rem; }
.log-details-toggle {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  user-select: none;
}
.log-details-toggle::-webkit-details-marker { display: none; }
.log-details-toggle::before {
  content: "▸";
  font-size: 0.65rem;
  transition: transform 0.15s;
  display: inline-block;
}
details[open] > .log-details-toggle::before { transform: rotate(90deg); }
.log-details-body {
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  color: #4b5563;
  line-height: 1.5;
  white-space: pre-wrap;
}
.log-thinking { font-family: ui-monospace, monospace; font-size: 0.75rem; }

/* ── Plan card (app.js injects) ── */
.plan-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #6b7280;
  margin-right: 0.35rem;
}
.plan-chip {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 99px;
  background: #fdf0f0;
  border: 1px solid #f0cccc;
  color: #9e0000;
  margin: 0 0.25rem 0.25rem 0;
}
#planAssumptions ul {
  margin: 0.35rem 0 0.6rem;
  padding-left: 1.15rem;
  font-size: 0.875rem;
  color: #4b5563;
}
#planAssumptions ul.plan-factors {
  list-style: none;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  background: #f0f7ff;
  border: 1px solid #d6e8fb;
  color: #1e3a5f;
}
#planAssumptions ul.plan-factors li { padding: 0.1rem 0; }
#planAssumptions ul.plan-factors li::before { content: "◆ "; color: #3b82f6; font-size: 0.65rem; }

/* ── Host topology (app.js injects) ── */
.topology .flow {
  display: block;
  margin-top: 0.35rem;
  font-weight: 600;
  color: #374151;
  font-size: 0.875rem;
}

/* ── Result variants (app.js toggles) ── */
#result.error {
  background: #fef2f2 !important;
  border-color: #fca5a5 !important;
}
#result.error .result-title { color: #991b1b !important; }
#result.scheduled.success {
  background: #eff6ff !important;
  border-color: #93c5fd !important;
}

/* ── Stage: full-width activity when live browser hidden ── */
.stage-area:not(:has(#liveCard:not(.hidden))) > section:last-child {
  grid-column: 1 / -1;
}

/* ── Token table ── */
.token-table { width: 100%; border-collapse: collapse; font-size: 0.75rem; }
.token-table th,
.token-table td {
  padding: 0.4rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid #f3f4f6;
}
.token-table th {
  background: #fafafa;
  font-weight: 700;
  position: sticky;
  top: 0;
  color: #9ca3af;
  text-transform: uppercase;
  font-size: 0.625rem;
  letter-spacing: 0.05em;
}
.token-table tr:last-child td { border-bottom: none; }

/* ── Schedule list (app.js injects) ── */
.schedule-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  background: #fafafa;
  margin-bottom: 0.5rem;
}
.schedule-item[data-status="running"] { border-color: #f0cccc; background: #fdf0f0; }
.schedule-item[data-status="completed"] { border-color: #a7f3d0; background: #ecfdf5; }
.schedule-item[data-status="failed"] { border-color: #fca5a5; background: #fef2f2; }
.schedule-item-main { min-width: 0; }
.schedule-task { margin: 0 0 0.2rem; font-weight: 600; font-size: 0.8125rem; word-break: break-word; }
.schedule-meta { margin: 0; font-size: 0.75rem; color: #9ca3af; line-height: 1.4; }
.schedule-countdown {
  font-family: ui-monospace, monospace;
  font-weight: 700;
  font-size: 0.8125rem;
  color: #9e0000;
  align-self: start;
  white-space: nowrap;
}
.schedule-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 0.35rem; }

.btn-ghost {
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background: #fff;
  color: #4b5563;
  cursor: pointer;
  transition: border-color 0.14s, color 0.14s;
}
.btn-ghost:hover {
  border-color: #bf0000;
  color: #9e0000;
}

/* ── Dynamic buttons (clarify options) ── */
.btn.btn-secondary.clarify-opt,
.clarify-option-btn {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 0.875rem;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s, color 0.14s;
}
.btn.btn-secondary.clarify-opt:hover,
.clarify-option-btn:hover {
  border-color: #bf0000;
  background: #fdf0f0;
  color: #9e0000;
}

.recovery-alts .muted { color: #9ca3af; font-style: italic; }

.sheet-scrim:not(.hidden) { display: flex !important; }

/* ── Reasoning / thinking highlights ── */
.think-tag {
  font-weight: 700;
  font-family: ui-monospace, monospace;
  padding: 0 3px;
  border-radius: 3px;
}
.think-tag--Observe { color: #0369a1; background: #e0f2fe; }
.think-tag--Reason  { color: #92400e; background: #fef3c7; }
.think-tag--Decide  { color: #065f46; background: #d1fae5; }

.log-details-toggle--think { color: #4f46e5; font-weight: 700; }
.log-details-toggle--think:hover { color: #bf0000; }

/* ── Decision point log entries ── */
.log-decision-point,
.log-decision-answer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
  margin: 0.6rem 0 0.25rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.75rem;
  border-left: 3px solid #7c3aed;
  background: #f5f3ff;
  font-size: 0.8125rem;
}
.log-decision-answer {
  border-left-color: #059669;
  background: #ecfdf5;
}
.log-decision-icon { font-size: 1rem; flex-shrink: 0; }
.log-decision-label {
  font-weight: 700;
  color: #5b21b6;
  flex-shrink: 0;
}
.log-decision-answer .log-decision-label { color: #065f46; }
.log-decision-question {
  width: 100%;
  color: #111827;
  font-weight: 500;
  margin-top: 0.2rem;
  line-height: 1.45;
}
.log-decision-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  width: 100%;
  margin-top: 0.3rem;
}
.log-decision-opt {
  display: inline-block;
  font-size: 0.74rem;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  background: #ede9fe;
  color: #5b21b6;
  border: 1px solid #c4b5fd;
}
.log-decision-answer-text { font-weight: 600; color: #065f46; }
.log-decision-answer-inline {
  margin-top: 0.25rem;
  width: 100%;
  font-size: 0.8125rem;
}

/* Active submitted task (shown at top of workspace while run is active) */
.nixtio-active-task {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.7rem;
  border: 1px solid #f1d1d1;
  background: #fff7f7;
}
.nixtio-active-task-label {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #bf0000;
}
.nixtio-active-task-text {
  font-size: 0.84rem;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── System Memory UI (in More panel) ── */
.sysmem-section {
  margin-top: 0.85rem;
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 0.75rem;
}
.sysmem-section.is-disabled {
  opacity: 0.45;
  filter: grayscale(0.35);
}
.sysmem-header {
  margin-bottom: 0.55rem;
}
.sysmem-title {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #e2e8f0;
}
.sysmem-subtitle {
  display: block;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.45);
  margin-top: 0.1rem;
}
.sysmem-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.6rem;
  max-height: 160px;
  overflow-y: auto;
}
.sysmem-empty {
  font-size: 0.775rem;
  color: rgba(255,255,255,0.35);
  font-style: italic;
  padding: 0.25rem 0;
}
.sysmem-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.45rem;
  padding: 0.3rem 0.55rem;
  gap: 0.4rem;
}
.sysmem-kv {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.sysmem-key {
  font-size: 0.72rem;
  font-weight: 700;
  color: #a78bfa;
  white-space: nowrap;
  flex-shrink: 0;
}
.sysmem-key::after { content: ":"; margin-left: 1px; }
.sysmem-val {
  font-size: 0.775rem;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sysmem-del {
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0 0.15rem;
  flex-shrink: 0;
  transition: color 0.12s;
}
.sysmem-del:hover { color: #f87171; }

.sysmem-add-row {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}
.sysmem-input {
  flex: 1;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 0.45rem;
  color: #fff;
  font-size: 0.775rem;
  padding: 0.35rem 0.55rem;
  outline: none;
  min-width: 0;
  transition: border-color 0.14s;
}
.sysmem-input--key { flex: 0 0 38%; }
.sysmem-input::placeholder { color: rgba(255,255,255,0.3); }
.sysmem-input:focus { border-color: #a78bfa; }

.sysmem-add-btn {
  background: #7c3aed;
  border: none;
  border-radius: 0.45rem;
  color: #fff;
  font-size: 0.775rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.13s;
  flex-shrink: 0;
}
.sysmem-add-btn:hover { background: #6d28d9; }

.sysmem-quick-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}
.sysmem-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.55rem;
}
.sysmem-quick-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 99px;
  color: rgba(255,255,255,0.6);
  font-size: 0.68rem;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}
.sysmem-quick-btn:hover {
  background: rgba(124,58,237,0.25);
  color: #e9d5ff;
  border-color: #a78bfa;
}

.sysmem-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.3rem;
}
.sysmem-count-badge {
  font-size: 0.72rem;
  color: #a78bfa;
  font-weight: 600;
}
.sysmem-clear-btn {
  background: none;
  border: none;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  transition: color 0.13s;
}
.sysmem-clear-btn:hover { color: #f87171; }

/* ── Real-time token pulse ── */
@keyframes tokenPulse {
  0%   { box-shadow: 0 0 0 0 rgba(191, 0, 0, 0.18); }
  60%  { box-shadow: 0 0 0 6px rgba(191, 0, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(191, 0, 0, 0); }
}
.token-pulse {
  animation: tokenPulse 0.55s ease-out;
}

/* ── Run History panel ── */
.history-empty {
  color: #9ca3af;
  font-size: 0.8125rem;
  padding: 1.25rem 1.5rem;
}
.history-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem 1.5rem;
  cursor: pointer;
  transition: background 0.13s;
  border-bottom: 1px solid #f9fafb;
  outline: none;
}
.history-item:hover,
.history-item:focus {
  background: #fdf0f0;
}
.history-item-header {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}
.history-status-icon { flex-shrink: 0; font-size: 1.05rem; margin-top: 1px; }
.hist-icon--done   { color: #059669; }
.hist-icon--failed  { color: #dc2626; }
.hist-icon--running { color: var(--rakuten); }
.bg-run-clock { animation: spin 2s linear infinite; }

/* background run badge on sidebar history button */
.nixtio-sidebar-btn { position: relative; }
.bg-run-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--rakuten);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  color: #fff;
  border: 2px solid var(--sidebar);
}

/* in-progress history row */
.history-item--bg {
  background: rgba(191, 0, 0, 0.04);
  border-left: 3px solid var(--rakuten);
}
.history-task {
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.4;
  word-break: break-word;
}
.history-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding-left: 1.35rem;
  flex-wrap: wrap;
}
.history-time { font-size: 0.73rem; color: #9ca3af; }
.history-chips { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.history-chip {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 99px;
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #e5e7eb;
}
.history-chip--decision {
  background: #ede9fe;
  color: #5b21b6;
  border-color: #c4b5fd;
}

/* History detail view */
.hist-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #f3f4f6;
  margin-bottom: 0.85rem;
}
.hist-status-icon { font-size: 1.4rem; }
.hist-task-title {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.4;
}
.hist-meta-row { font-size: 0.75rem; color: #9ca3af; }
.hist-result {
  font-size: 0.8125rem;
  color: #374151;
  background: #f9fafb;
  border: 1px solid #f3f4f6;
  border-radius: 0.75rem;
  padding: 0.65rem 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 1rem;
  line-height: 1.5;
}
.hist-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.hist-step {
  border-left: 2px solid #e5e7eb;
  padding: 0.35rem 0 0.35rem 0.85rem;
}
.hist-step-hd {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.2rem;
}
.hist-step-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: #9ca3af;
}
.hist-url {
  font-size: 0.72rem;
  font-family: ui-monospace, monospace;
  color: #9ca3af;
  word-break: break-all;
  margin-bottom: 0.15rem;
}
.hist-goal {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #374151;
  line-height: 1.45;
}

/* ── Continue this task panel ── */
.hist-continue {
  margin-top: 1.25rem;
  padding: 1rem;
  border: 1.5px dashed #c4b5fd;
  border-radius: 0.875rem;
  background: #faf5ff;
}
.hist-continue-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}
.hist-continue-icon { font-size: 1rem; }
.hist-continue-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #5b21b6;
}
.hist-continue-hint {
  font-size: 0.775rem;
  color: #7c3aed;
  opacity: 0.8;
  margin-bottom: 0.65rem;
  line-height: 1.45;
}
.hist-followup-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 0.875rem;
  border: 1.5px solid #c4b5fd;
  border-radius: 0.6rem;
  background: #fff;
  color: #111827;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
  line-height: 1.45;
}
.hist-followup-input:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}
.hist-followup-input::placeholder { color: #a78bfa; opacity: 0.75; }
.hist-continue-footer {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.55rem;
}
.hist-continue-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.45rem 1.1rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #fff;
  background: #7c3aed;
  border: none;
  border-radius: 0.55rem;
  cursor: pointer;
  transition: background 0.14s, transform 0.1s;
}
.hist-continue-btn:hover { background: #6d28d9; }
.hist-continue-btn:active { transform: scale(0.97); }
.hist-continue-btn:disabled { background: #a78bfa; cursor: not-allowed; }
.hist-continue-status {
  font-size: 0.775rem;
  color: #6b7280;
}
.hist-continue-status--err { color: #dc2626; }
