:root {
  font-family: Inter, system-ui, sans-serif;
  color: #eef0fc;
  background: #10121a;
  color-scheme: dark;
  font-synthesis: none;
  --muted: #a6abc2;
  --line: #2d3144;
  --surface: #191c28;
  --accent: #b8abff;
  --green: #90e0bb;
}

* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
h1, h2, h3, p { margin: 0; }
input, select, button { font: inherit; }
.sidebar {
  width: 14rem;
  height: 100dvh;
  position: fixed;
  display: flex;
  flex-direction: column;
  padding: 2rem 1.1rem 1.25rem;
  background: #151822;
  border-right: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 0 .45rem 2.5rem;
  font-size: 1.22rem;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -.025em;
}
.brand small { display: block; color: var(--muted); font-size: .85rem; font-weight: 500; margin-top: .18rem; letter-spacing: 0; }
.mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: .7rem;
  background: #343054;
  color: var(--accent);
}
.mark i { width: 3px; height: .7rem; background: currentColor; border-radius: 3px; }
.mark i:nth-child(2) { height: 1.15rem; }
.sidebar nav { display: flex; flex-direction: column; gap: .35rem; }
.sidebar nav a { padding: .58rem .75rem; border-radius: .55rem; color: #c1c6da; font-weight: 580; }
.sidebar nav a:hover { color: #f0ecff; background: #24263b; }
.sidebar-note {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-top: auto;
  padding: .7rem .8rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .9rem;
}
.signal { display: inline-block; width: .46rem; height: .46rem; border-radius: 50%; background: var(--green); }
.signal.sample { background: #d6b67b; }

main {
  margin-left: 14rem;
  max-width: 105rem;
  padding: 3rem clamp(1.25rem, 4vw, 4rem) 2rem;
}
.heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 2.3rem; }
h1 { font-size: clamp(2rem, 3vw, 2.85rem); line-height: 1.15; letter-spacing: -.045em; font-weight: 760; }
.heading p { margin-top: .5rem; color: var(--muted); }
.tag, .count {
  align-self: flex-start;
  border: 1px solid #3a3d54;
  border-radius: 999px;
  padding: .28rem .7rem;
  color: #c4c6df;
  font-size: .85rem;
  white-space: nowrap;
}
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 2.25fr) minmax(16rem, 1fr); align-items: start; gap: 1.2rem; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: .95rem; background: var(--surface); scroll-margin-top: 1rem; }
.panel-heading { display: flex; justify-content: space-between; gap: .8rem; padding: 1.25rem 1.25rem 1rem; }
h2 { font-size: 1.2rem; letter-spacing: -.02em; line-height: 1.3; }
.panel-heading p { margin-top: .3rem; color: var(--muted); font-size: .9rem; }
.filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(6rem, .57fr) minmax(6.6rem, .58fr) auto;
  align-items: end;
  gap: .6rem;
  margin: 0 1.25rem 1rem;
}
.filters label { display: grid; min-width: 0; gap: .35rem; color: #d2d5e7; font-size: .875rem; font-weight: 620; }
.filters input, .filters select, .filters button {
  width: 100%;
  min-width: 0;
  height: 2.55rem;
  border: 1px solid #41465d;
  border-radius: .5rem;
  font-size: .9rem;
}
.filters input, .filters select { background: #121521; color: #edf0fc; padding: 0 .55rem; }
.filters input::placeholder { color: #9fa5be; }
.filter-actions { display: flex; align-items: center; gap: .6rem; }
.filters button { cursor: pointer; padding: 0 .85rem; border-color: var(--accent); background: var(--accent); color: #1b1633; font-weight: 720; }
.filters button:hover { background: #d3caff; }
.filter-actions a { color: var(--accent); font-size: .875rem; text-decoration: underline; text-underline-offset: .2em; }
.feed { border-top: 1px solid var(--line); }
.event { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr) auto; gap: .75rem; align-items: start; padding: .9rem 1.25rem; }
.event + .event { border-top: 1px solid var(--line); }
.event-icon {
  display: grid; place-items: center; width: 2.2rem; height: 2.2rem;
  border-radius: .55rem; background: #30304f; color: #c8bcff; font-size: 1.15rem;
}
.event-icon[data-kind="Sync"] { background: #243d3c; color: var(--green); }
.event-icon[data-kind="Archive"] { background: #44382b; color: #f4c28c; }
.event-icon[data-kind="Up Next"] { background: #263852; color: #a7ccff; }
h3 { font-size: .98rem; font-weight: 680; line-height: 1.35; }
.episode { margin-top: .15rem; color: #dcdef0; font-size: .9rem; overflow-wrap: anywhere; }
.detail, .event-time { color: var(--muted); font-size: .85rem; }
.detail { margin-top: .2rem; }
.event-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); padding: 1.25rem; }

.device-list { margin: 0 1.25rem 1rem; display: grid; gap: .7rem; }
.device { padding: .85rem; background: #141723; border: 1px solid var(--line); border-radius: .65rem; }
.device-name { display: flex; flex-wrap: wrap; gap: .26rem .55rem; justify-content: space-between; align-items: center; }
.device-status { display: inline-flex; align-items: center; gap: .35rem; color: var(--green); font-size: .8rem; }
.device-time { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; font-size: .85rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: .55rem; margin-top: .7rem; }
.device-time time { color: #dfe2f3; white-space: nowrap; }
.device-footer { border-top: 1px solid var(--line); color: var(--muted); padding: .75rem 1.25rem; font-size: .85rem; }
.device-footer span { color: #edeeff; font-weight: 720; }
.scope { margin: 1rem 0 0; color: var(--muted); font-size: .87rem; }

@media (max-width: 79rem) {
  .filters { grid-template-columns: 1fr 1fr auto; }
  .search { grid-column: 1 / -1; }
}
@media (max-width: 62rem) {
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .device-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 44rem) {
  .sidebar {
    position: static; width: auto; height: auto; border-right: 0;
    border-bottom: 1px solid var(--line); padding: .85rem 1rem;
    display: grid; grid-template-columns: 1fr auto; gap: .65rem;
  }
  .brand { margin: 0; }
  .sidebar nav { grid-row: 2; grid-column: 1 / -1; flex-direction: row; }
  .sidebar-note { grid-column: 2; grid-row: 1; align-self: center; margin: 0; border: 0; padding: 0; }
  main { margin: 0; padding: 1.5rem 1rem; }
  .heading { flex-wrap: wrap; margin-bottom: 1.3rem; }
  .filters, .device-list { margin-left: .9rem; margin-right: .9rem; }
  .event, .panel-heading { padding-left: .9rem; padding-right: .9rem; }
}
@media (max-width: 28rem) {
  .event { grid-template-columns: 2.2rem minmax(0, 1fr); gap: .35rem .65rem; }
  .event-time { grid-column: 2; white-space: normal; }
  .device-list { grid-template-columns: minmax(0, 1fr); }
  .filter-actions { flex-direction: column; align-items: stretch; }
}

.signout { margin-top: 1rem; }
.signout button { width: 100%; }
.snapshot-time { margin: -.75rem 0 1.25rem; color: var(--muted); font-size: .85rem; }
.notice { padding: 1rem 1.25rem; }
.signin { display: grid; min-height: 100vh; place-items: center; padding: 1rem; }
.signin main { margin: 0; padding: clamp(1.5rem, 5vw, 2.5rem); width: min(100%, 27rem); }
.signin .brand { margin-bottom: 1.6rem; }
.signin form { display: grid; gap: 1rem; margin-top: 1rem; }
.signin form input { width: 100%; margin-top: .4rem; }
.signin button:disabled { opacity: .6; cursor: wait; }
#passkey-status { min-height: 1.5em; }
