:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: rgba(16, 30, 49, 0.82);
  --panel-strong: #13263e;
  --line: rgba(185, 215, 255, 0.15);
  --text: #f3f7ff;
  --muted: #a6b4c8;
  --indigo: #8b88ff;
  --cyan: #4cd7df;
  --violet: #be8cff;
  --amber: #ffbd63;
  --danger: #ff8a9b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(circle at 15% -10%, #172e54 0, transparent 34rem), var(--bg);
  color: var(--text);
}
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.48; }
code { color: var(--cyan); }

.ambient { position: fixed; z-index: -1; width: 28rem; height: 28rem; filter: blur(70px); opacity: 0.2; border-radius: 50%; pointer-events: none; }
.ambient-one { top: 18%; right: -10rem; background: #7b63ff; }
.ambient-two { bottom: -12rem; left: -11rem; background: #00cfdb; }
.shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 22px 0 52px; }
.topbar { min-height: 54px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 56px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 15px; font-weight: 760; letter-spacing: 0.01em; }
.brand-mark { display: grid; place-items: center; width: 31px; height: 31px; border: 1px solid rgba(148, 146, 255, 0.8); border-radius: 10px; color: #b6b5ff; background: rgba(105, 99, 239, 0.18); }
.text-button, .secondary-button { border: 1px solid var(--line); border-radius: 10px; padding: 9px 13px; color: var(--muted); background: rgba(8, 17, 29, 0.24); }
.text-button:hover, .secondary-button:hover { color: var(--text); border-color: rgba(190, 216, 255, 0.38); }
.is-hidden { display: none !important; }

.center-card { width: min(510px, 100%); padding: 48px; margin: 12vh auto 0; text-align: center; border: 1px solid var(--line); border-radius: 24px; background: var(--panel); box-shadow: 0 20px 80px rgba(0, 0, 0, 0.28); }
.center-card h1 { margin: 12px 0 10px; font-size: clamp(24px, 4vw, 32px); }
.center-card p { margin: 0; color: var(--muted); line-height: 1.7; }
.spinner { width: 34px; height: 34px; margin: 0 auto 20px; border: 3px solid rgba(154, 180, 215, 0.22); border-top-color: var(--cyan); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-tile { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 16px; border-radius: 18px; font-size: 26px; color: #d1d0ff; background: rgba(126, 119, 255, 0.18); }
.icon-tile.muted { color: var(--muted); background: rgba(144, 160, 183, 0.12); }

.hero { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.eyebrow { margin: 0 0 8px; color: var(--cyan); font-size: 11px; font-weight: 800; letter-spacing: 0.13em; }
.hero h1, .section-heading h2 { margin: 0; letter-spacing: -0.035em; }
.hero h1 { font-size: clamp(35px, 6vw, 54px); line-height: 1; }
.hero-copy { max-width: 620px; margin: 16px 0 0; color: var(--muted); line-height: 1.65; }
.session-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 999px; color: #c7d4e8; font-size: 13px; background: rgba(12, 25, 42, 0.5); }
.session-dot, .status-light { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 4px rgba(76, 215, 223, 0.12); }

.connection-banner { display: flex; align-items: center; gap: 13px; padding: 15px 18px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 15px; background: rgba(16, 33, 54, 0.7); }
.connection-banner strong, .connection-banner span { display: block; }
.connection-banner span:last-child { margin-top: 3px; color: var(--muted); font-size: 13px; }
.connection-banner.is-offline .status-light { background: var(--danger); box-shadow: 0 0 0 4px rgba(255, 138, 155, 0.13); }

.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); gap: 16px; }
.action-card, .activity-card { border: 1px solid var(--line); border-radius: 20px; background: var(--panel); box-shadow: 0 14px 44px rgba(0, 0, 0, 0.15); }
.action-card { min-height: 310px; display: flex; flex-direction: column; justify-content: space-between; padding: 22px; overflow: hidden; position: relative; }
.action-card::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 3px; opacity: 0.95; }
.accent-indigo::before { background: var(--indigo); }.accent-cyan::before { background: var(--cyan); }.accent-violet::before { background: var(--violet); }.accent-amber::before { background: var(--amber); }
.card-head { display: flex; justify-content: space-between; align-items: center; }
.action-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: var(--text); font-size: 20px; background: rgba(150, 177, 218, 0.13); }
.permission-badge { padding: 5px 8px; border-radius: 999px; color: #c6d0df; background: rgba(159, 177, 203, 0.12); font-size: 11px; font-weight: 700; }
.permission-badge.used { color: #c9d2dd; background: rgba(108, 125, 145, 0.19); }.permission-badge.available { color: #092424; background: var(--cyan); }
.card-kicker { margin: 22px 0 6px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.11em; }
.action-card h2 { margin: 0; font-size: 25px; letter-spacing: -0.02em; }
.action-card p:not(.card-kicker) { min-height: 47px; margin: 9px 0 18px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.primary-button { width: 100%; padding: 12px 15px; border: 0; border-radius: 11px; color: #07131f; background: linear-gradient(135deg, #82e9ed, #77c8ff); font-weight: 800; transition: transform 130ms ease, filter 130ms ease; }
.primary-button:not(:disabled):hover { transform: translateY(-1px); filter: brightness(1.06); }

.activity-card { margin-top: 18px; padding: 24px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.section-heading h2 { font-size: 21px; }.refresh-note { color: var(--muted); font-size: 12px; }
.command-list { display: grid; gap: 8px; padding: 0; margin: 18px 0 0; list-style: none; }
.command-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: rgba(6, 16, 28, 0.34); }
.command-symbol { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: rgba(102, 141, 189, 0.15); color: var(--cyan); font-weight: 800; }
.command-main { flex: 1; min-width: 0; }.command-main strong, .command-main span { display: block; }.command-main span { color: var(--muted); margin-top: 2px; font-size: 12px; }
.command-status { color: #c7d4e8; font-size: 12px; }.empty-state { padding: 22px 0; color: var(--muted); text-align: center; }

.settings-help { margin: 17px 0; color: var(--muted); line-height: 1.6; }
.settings-targets { display: grid; gap: 12px; }
.target-editor { display: grid; grid-template-columns: 0.7fr 1fr 1.1fr 1fr 82px auto; gap: 10px; align-items: end; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: rgba(6, 16, 28, 0.3); }
.field { display: grid; gap: 6px; }.field label { color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: 0.04em; }.field input { min-width: 0; padding: 10px; border: 1px solid rgba(178, 208, 244, 0.2); border-radius: 9px; color: var(--text); background: rgba(2, 10, 18, 0.45); }
.remove-button { padding: 10px; border: 1px solid rgba(255, 138, 155, 0.3); border-radius: 9px; color: #ffc4cc; background: rgba(255, 93, 121, 0.09); }
.settings-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 20px; }.settings-footer .primary-button { width: auto; }.settings-footer span { color: var(--muted); font-size: 13px; }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: min(420px, calc(100vw - 48px)); padding: 13px 16px; border: 1px solid rgba(133, 232, 238, 0.36); border-radius: 12px; color: var(--text); background: #163249; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35); }
.toast.error { border-color: rgba(255, 138, 155, 0.48); background: #4b2431; }

@media (max-width: 800px) { .topbar { margin-bottom: 34px; }.hero { align-items: start; flex-direction: column; }.action-grid { grid-template-columns: 1fr; }.action-card { min-height: 265px; }.target-editor { grid-template-columns: 1fr 1fr; }.target-editor .remove-button { grid-column: span 2; } }
@media (max-width: 480px) { .shell { width: min(100% - 22px, 1120px); padding-top: 12px; }.center-card { padding: 34px 22px; }.activity-card { padding: 18px; }.session-chip { font-size: 12px; }.target-editor { grid-template-columns: 1fr; }.target-editor .remove-button { grid-column: auto; }.settings-footer { align-items: stretch; flex-direction: column; }.settings-footer .primary-button { width: 100%; } }
