:root {
  color-scheme: dark;
  --bg: #101522;
  --sidebar: #0c111d;
  --surface: #161d2b;
  --surface-raised: #1b2434;
  --border: #283247;
  --muted: #8c98ad;
  --text: #eef2fa;
  --accent: #8b7cff;
  --accent-light: #b0a7ff;
  --green: #6de0b0;
  font-family: "DM Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(ellipse at 74% -20%, rgba(108, 91, 220, .12), transparent 40%),
    var(--bg);
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }

.app-shell { min-height: 100vh; }

.sidebar {
  width: 252px;
  padding: 28px 18px 20px;
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  background: rgba(12, 17, 29, .96);
  border-right: 1px solid rgba(117, 132, 160, .12);
  z-index: 3;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 7px 53px;
  font-family: Manrope, sans-serif;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.8px;
}

.brand-light { color: #a7aec0; font-weight: 500; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: linear-gradient(140deg, #907fff, #6354d9); box-shadow: 0 5px 18px #6b5bdf4d; }
.brand-mark svg { width: 21px; stroke: white; stroke-width: 1.6; }
.side-label { margin: 0 10px 12px; color: #69758b; font-size: 10px; font-weight: 700; letter-spacing: 1.3px; }
.nav-link { height: 42px; display: flex; align-items: center; gap: 11px; padding: 0 11px; color: #9da8ba; border-radius: 8px; font-size: 13px; font-weight: 600; }
.nav-link svg { width: 18px; height: 18px; }
.nav-link.active { color: #d3ceff; background: linear-gradient(90deg, #685adb2b, #685adb0e); }
.nav-count { margin-left: auto; min-width: 22px; height: 20px; display: grid; place-items: center; border: 1px solid #ffffff0f; border-radius: 6px; color: #b9c3d5; font-size: 11px; }
.sidebar-bottom { margin-top: auto; }
.secure-card { display: flex; gap: 10px; padding: 13px 10px; background: #141c2a; border: 1px solid #273143; border-radius: 10px; }
.secure-icon { flex: 0 0 20px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; color: #80e6bc; background: #6de0b017; font-size: 12px; font-weight: 700; }
.secure-card strong { display: block; padding-top: 1px; font-size: 11px; font-weight: 600; }
.secure-card p { margin: 5px 0 0; color: #8793a7; font-size: 10px; line-height: 1.5; }
.help-link { display: flex; justify-content: space-between; padding: 17px 5px 0; color: #818da2; font-size: 11px; }
.help-link:hover, .notice-link:hover { color: #c1baff; }

.main-content { max-width: 1580px; min-height: 100vh; margin-left: 252px; padding: 0 54px 25px; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(117, 132, 160, .12); }
.breadcrumb { display: flex; align-items: center; gap: 10px; color: #8390a5; font-size: 12px; }
.breadcrumb strong { color: #d4dbea; font-weight: 500; }
.crumb-separator { color: #49556a; }
.install-button, .icon-button { border: 1px solid var(--border); background: #171e2b; cursor: pointer; }
.install-button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 8px; color: #c5ccda; font-size: 12px; }
.install-button:hover, .secondary-button:hover { border-color: #697895; background: #1d2738; }
.install-button svg { width: 16px; }

.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 42px 0 25px; }
.eyebrow { display: flex; align-items: center; gap: 8px; color: #a89dff; font-size: 9px; font-weight: 700; letter-spacing: 1.35px; }
.status-dot, .footer-dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px #6de0b077; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; padding-top: 11px; font: 700 31px/1.2 Manrope, sans-serif; letter-spacing: -1.2px; }
.page-subtitle { margin: 0; color: #929eb1; font-size: 13px; }
.primary-button { min-height: 39px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; border: 1px solid #9387ff; border-radius: 8px; background: linear-gradient(135deg, #8576f5, #695bdd); box-shadow: 0 4px 15px #6756dc35; color: #fff; cursor: pointer; font-size: 12px; font-weight: 700; transition: transform .15s, filter .15s; }
.primary-button:hover { filter: brightness(1.1); transform: translateY(-1px); }
.primary-button > span { font-size: 19px; line-height: 12px; font-weight: 400; }

.notice { min-height: 83px; display: flex; align-items: center; gap: 15px; padding: 15px 19px; border: 1px solid #423d70; border-radius: 10px; background: linear-gradient(100deg, #262344a3, #1a2030a3); }
.notice-icon { flex: 0 0 37px; width: 37px; height: 37px; display: grid; place-items: center; border: 1px solid #675dc861; border-radius: 11px; background: #7567ed1a; color: #aaa1ff; }
.notice-icon svg { width: 19px; height: 19px; }
.notice-copy { min-width: 100px; flex: 1; }
.notice-copy strong { font-size: 12px; font-weight: 700; }
.notice-copy p { margin: 5px 0 0; color: #a7adc0; font-size: 11px; line-height: 1.55; }
.notice-link { flex: 0 0 auto; color: #c2baff; font-size: 11px; font-weight: 600; }
.guide-link { padding: 0; border: 0; background: transparent; cursor: pointer; font-family: inherit; }
.guide-link:hover { color: #ddd8ff; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 34px 0 18px; }
.toolbar h2 { margin: 0 0 5px; font: 700 15px Manrope, sans-serif; }
.toolbar p { margin: 0; color: #8390a5; font-size: 11px; }
.search-box { width: 245px; height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid #2b3548; border-radius: 7px; background: #141b28; color: #7e8ba0; }
.search-box svg { flex: 0 0 16px; width: 16px; }
.search-box input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: #e8ebf3; font-size: 11px; }
.search-box input::placeholder { color: #6f7b8f; }
.search-box:focus-within { border-color: #7568db; box-shadow: 0 0 0 2px #7568db24; }
.search-box kbd { min-width: 17px; padding: 2px 4px; border: 1px solid #364157; border-radius: 4px; color: #77839a; font: 10px "DM Sans", sans-serif; text-align: center; }

.device-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 13px; }
.no-results { grid-column: 1 / -1; margin: 0; padding: 28px 0; color: #8c98ad; font-size: 12px; text-align: center; }
.device-card { min-width: 0; padding: 16px; border: 1px solid #283247; border-radius: 10px; background: linear-gradient(145deg, #1a2231, #151c29); transition: border-color .2s, transform .2s; }
.device-card:hover { border-color: #464d73; transform: translateY(-2px); }
.device-card-head { display: flex; align-items: flex-start; gap: 11px; }
.device-avatar { flex: 0 0 39px; width: 39px; height: 39px; display: grid; place-items: center; border: 1px solid #7567ed3b; border-radius: 10px; background: linear-gradient(145deg, #554ca02c, #5c71a224); color: #b1aaff; }
.device-avatar svg { width: 20px; height: 20px; }
.device-title { min-width: 0; flex: 1; padding-top: 1px; }
.device-title h3 { overflow: hidden; margin: 0 0 5px; color: #e6eaf3; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.device-id { overflow: hidden; color: #8895aa; font: 11px "DM Sans", sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.device-menu { width: 25px; height: 25px; display: grid; place-items: center; margin: -4px -5px 0 0; border: 0; border-radius: 6px; background: transparent; color: #8692a7; cursor: pointer; font-size: 17px; }
.device-menu:hover { background: #ffffff0c; color: white; }
.device-meta { display: flex; align-items: center; gap: 6px; margin: 17px 0 14px; color: #8190a4; font-size: 10px; }
.saved-dot { width: 6px; height: 6px; border-radius: 50%; background: #7e8aa0; }
.device-actions { display: flex; gap: 8px; }
.connect-button, .copy-button { min-height: 33px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 6px; cursor: pointer; font-size: 10px; font-weight: 600; }
.connect-button { flex: 1; border: 1px solid #7467e8; background: #6254dc; color: white; }
.connect-button:hover { background: #7568eb; }
.connect-button svg { width: 14px; }
.copy-button { width: 35px; border: 1px solid #354057; background: #1b2434; color: #aeb8c9; }
.copy-button:hover { border-color: #697895; color: white; }
.copy-button svg { width: 15px; }

.empty-state { padding: 32px 20px 25px; text-align: center; }
.empty-state[hidden] { display: none; }
.empty-illustration { width: 130px; height: 104px; position: relative; margin: 0 auto 17px; }
.illustration-orbit { position: absolute; inset: 5px 9px; border: 1px dashed #3b4260; border-radius: 50%; transform: rotate(-24deg); }
.orbit-two { inset: 14px 0; border-color: #353c59; transform: rotate(26deg); }
.illustration-screen { position: absolute; inset: 20px 36px 22px; display: grid; place-items: center; border: 1px solid #625bb28a; border-radius: 12px; background: linear-gradient(145deg, #342f5b, #202942); box-shadow: 0 10px 30px #6758d52b; color: #b5adff; }
.illustration-screen svg { width: 34px; stroke-width: 1.5; }
.illustration-plus { position: absolute; top: 8px; right: 21px; width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid #887bff; border-radius: 8px; background: #332e61; color: #c7c0ff; font-size: 17px; }
.empty-state h2 { margin-bottom: 7px; font: 700 14px Manrope, sans-serif; }
.empty-state p { margin-bottom: 17px; color: #8793a8; font-size: 11px; }
.page-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 31px; padding-top: 15px; border-top: 1px solid #252e40; color: #78859a; font-size: 10px; }
.page-footer > span:first-child { display: flex; align-items: center; gap: 7px; }
.footer-dot { width: 5px; height: 5px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 8; max-width: calc(100vw - 32px); padding: 11px 16px; border: 1px solid #3d4960; border-radius: 8px; background: #202a3b; box-shadow: 0 12px 35px #0005; color: #e6ebf4; font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.toast.visible { opacity: 1; transform: translateY(0); }

.device-dialog { width: min(440px, calc(100vw - 30px)); padding: 0; border: 1px solid #303a50; border-radius: 13px; background: #171e2c; color: var(--text); box-shadow: 0 25px 80px #0008; }
.device-dialog::backdrop { background: #080c14b8; backdrop-filter: blur(4px); }
.device-dialog form { padding: 23px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.dialog-heading h2 { margin: 7px 0 0; font: 700 19px Manrope, sans-serif; }
.icon-button { width: 29px; height: 29px; border-radius: 7px; color: #aeb7c8; font-size: 20px; line-height: 1; }
.dialog-description { margin: 10px 0 21px; color: #8f9bae; font-size: 12px; line-height: 1.55; }
.guide-list { margin: 0; padding-left: 20px; color: #aeb8c9; font-size: 11px; line-height: 1.65; }
.guide-list li { padding-left: 4px; margin-bottom: 8px; }
.guide-list strong { color: #e5e9f2; font-weight: 600; }
.host-unavailable { margin-top: 17px; padding: 10px 11px; border: 1px solid #554939; border-radius: 7px; background: #2b261e; color: #e0bd7d; font-size: 11px; }
.field-label { display: block; margin: 15px 0 7px; color: #c8d0df; font-size: 11px; font-weight: 600; }
.form-input { width: 100%; height: 39px; padding: 0 11px; border: 1px solid #333e52; border-radius: 7px; outline: 0; background: #111724; color: #edf0f7; font-size: 12px; }
.form-input:focus { border-color: #7568db; box-shadow: 0 0 0 2px #7568db24; }
.form-input::placeholder { color: #6e7a8e; }
.field-hint { margin: 7px 0 0; color: #8491a6; font-size: 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 25px; }
.secondary-button { min-height: 38px; padding: 0 14px; border: 1px solid #354057; border-radius: 7px; background: #1b2434; color: #c5ccda; cursor: pointer; font-size: 11px; }

@media (max-width: 900px) {
  .sidebar { width: 215px; }
  .main-content { margin-left: 215px; padding: 0 30px 24px; }
}

@media (max-width: 680px) {
  .sidebar { width: 60px; padding: 20px 9px 14px; align-items: center; }
  .brand { margin: 0 0 36px; }
  .brand > span:last-child, .side-label, .nav-link > span, .sidebar-bottom { display: none; }
  .brand-mark { flex: 0 0 34px; }
  .nav-link { width: 42px; justify-content: center; padding: 0; }
  .nav-link svg { width: 20px; }
  .main-content { margin-left: 60px; padding: 0 18px 20px; }
  .topbar { height: 62px; }
  .page-heading { align-items: flex-start; padding: 30px 0 20px; }
  h1 { font-size: 26px; }
  .page-subtitle { max-width: 340px; line-height: 1.55; }
  .page-heading > .primary-button { padding: 0 10px; font-size: 0; }
  .page-heading > .primary-button span { font-size: 21px; }
  .notice { align-items: flex-start; flex-wrap: wrap; gap: 10px; padding: 13px; }
  .notice-icon { flex-basis: 31px; width: 31px; height: 31px; }
  .notice-copy { flex-basis: calc(100% - 45px); }
  .notice-link { margin-left: 41px; }
  .toolbar { align-items: flex-start; flex-direction: column; padding-top: 27px; }
  .search-box { width: 100%; }
  .device-grid { grid-template-columns: 1fr; }
  .page-footer { flex-direction: column; }
}

@media (max-width: 420px) {
  .main-content { padding-right: 12px; padding-left: 12px; }
  .page-heading { gap: 8px; }
  .page-heading > div { min-width: 0; }
  .eyebrow { font-size: 8px; letter-spacing: .9px; }
  h1 { font-size: 23px; }
  .page-subtitle { font-size: 11px; }
  .breadcrumb { font-size: 11px; }
}
