/* ============================================================================
   Page frame: topbar, two-column shell, footer, and the responsive collapse.

   The shell is a fixed-width rail plus a fluid content column. Below 900px the
   rail becomes a horizontal scroller so the hierarchy stays reachable on a
   phone without hiding it behind a toggle — with many keywords the rail is the
   primary navigation, so it must never disappear.
   ========================================================================== */

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  min-width: 0;
  gap: 16px; padding: 16px clamp(18px, 4vw, 44px);
  background: linear-gradient(180deg, rgba(10,11,14,.94), rgba(10,11,14,.7));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; flex: 0 0 auto; min-width: 0; text-decoration: none; color: var(--ink); }
.mark { width: 30px; height: 30px; color: var(--accent); filter: drop-shadow(0 0 10px rgba(61,220,151,.35)); }
.wordmark { font-family: var(--display); font-weight: 600; font-size: 22px; letter-spacing: -.01em; }
.sub { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-left: 2px; padding-left: 11px; border-left: 1px solid var(--line-2); white-space: nowrap; }

.topbar-right { display: flex; align-items: center; gap: 18px; min-width: 0; }
.live { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--dim); white-space: nowrap; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(61,220,151,.6); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(61,220,151,.5);} 70%{ box-shadow:0 0 0 6px rgba(61,220,151,0);} 100%{ box-shadow:0 0 0 0 rgba(61,220,151,0);} }

.account-pill { display: flex; flex: 0 0 auto; flex-direction: column; align-items: flex-end; line-height: 1.05; }
.account-pill b { color: var(--ink); font-size: .78rem; font-weight: 600; white-space: nowrap; }
.account-pill small, .role-note { color: var(--faint); font: 600 .59rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: .1em; }
.role-note { white-space: nowrap; }
.logout-form { flex: 0 0 auto; }
.logout-form button { border: 0; background: none; color: var(--faint); font: 600 .62rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; cursor: pointer; padding: .45rem .2rem; }
.logout-form button:hover { color: var(--ink); }
.scan-button:disabled, input:disabled { cursor: not-allowed; opacity: .48; }

.shell {
  position: relative; z-index: 1;
  max-width: 1320px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 32px);
  display: grid; grid-template-columns: 244px minmax(0, 1fr); gap: clamp(18px, 2.4vw, 32px);
  align-items: start;
}
main { position: relative; z-index: 1; min-width: 0; display: flex; flex-direction: column; gap: 20px; padding: clamp(18px, 3vw, 30px) 0 clamp(30px, 4vw, 44px); }

footer { position: relative; z-index: 1; max-width: 1320px; margin: 0 auto; padding: 26px clamp(16px,3vw,32px); border-top: 1px solid var(--line); display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12.5px; }
.f-mark { color: var(--accent); font-size: 16px; letter-spacing: -2px; }
footer b { color: var(--dim); font-weight: 600; }

@media (max-width: 1080px) {
  .topbar { gap: 10px; }
  .topbar-right { gap: 10px; }
  .live { display: none; }
}
@media (max-width: 900px) {
  /* The rail collapses to a horizontal scroller so the hierarchy stays
     reachable on a phone without hiding it behind a toggle. */
  .shell { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .sidenav {
    position: static; max-height: none; margin: 14px 0 0;
    flex-direction: row; align-items: flex-start; gap: 12px;
    padding: 12px; overflow-x: auto;
  }
  .nav { flex-direction: row; align-items: center; gap: 6px; flex: 0 0 auto; }
  .nav-k { display: none; }
  .nav-children { padding-left: 8px; margin-left: 0; border-left: 0; }
  .nav-group { flex-direction: row; align-items: center; gap: 4px; }
  .nav-head { flex-direction: row; align-items: center; }
  .nav-row { white-space: nowrap; }
  .nav-label { max-width: 160px; }
  .sidenav-actions {
    flex: 0 0 auto; flex-direction: row; align-items: center;
    border-top: 0; border-left: 1px solid var(--line); padding: 0 0 0 12px;
  }
}
