/* The app shell: sign-in gate, sidebar, top bar, bottom bar, page frame. */

.brand {
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -.04em;
  color: var(--ink);
  text-decoration: none;
}
.brand span { color: var(--accent); font-weight: 700; }

/* ---- sign in ------------------------------------------------------------ */
.gate {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  padding: 32px 20px;
  gap: 32px;
}
@media (min-width: 900px) {
  .gate { grid-template-columns: minmax(0, 460px) 380px; justify-content: center; gap: 64px; }
  .gate.single { grid-template-columns: 380px; }
}
.gate-card input + input { margin-top: 8px; }
.gate-card .brand { display: block; font-size: 20px; margin-bottom: 8px; }
.gate-hero { max-width: 460px; }
.gate-hero .brand { font-size: 26px; display: block; margin-bottom: 18px; }
.gate-hero h1 { font-size: 30px; line-height: 1.15; margin-bottom: 12px; }
.gate-hero p { color: var(--muted); margin: 0 0 18px; }
.gate-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.gate-points li { display: flex; gap: 10px; font-size: 14px; }
.gate-points li::before {
  content: ""; flex: 0 0 8px; height: 8px; margin-top: 7px;
  border-radius: 50%; background: var(--accent);
}
@media (max-width: 899px) {
  .gate-hero h1 { font-size: 24px; }
  .gate:not(.landing) .gate-points { display: none; }
}
.gate-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
}
.gate-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 18px;
  background: var(--bg); border-radius: var(--radius-sm); padding: 4px; }
.gate-tabs button {
  border: none; background: none; padding: 8px; color: var(--muted); font-weight: 500;
}
.gate-tabs button[aria-selected="true"] { background: var(--card); color: var(--ink); }
.gate-card label { display: block; font-size: 13px; font-weight: 500; margin: 12px 0 4px; }
.gate-card .primary { margin-top: 16px; }
.gate-alt { margin: 14px 0 0; text-align: center; }
.gate-panel-text { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.gate-panel-text strong { color: var(--ink); }
.field-hint { font-size: 12px; color: var(--muted); margin: 4px 0 0; }
.field-hint.ok { color: var(--ok); }

/* ---- shell -------------------------------------------------------------- */
.shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  padding: 18px 12px;
  border-right: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 18px;
  z-index: 6;
}
.sidebar .brand { padding: 4px 10px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.nav a svg { width: 18px; height: 18px; flex: 0 0 18px; }
.nav a:hover { color: var(--ink); background: var(--card); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.nav .count {
  margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 99px;
  background: var(--accent); color: #fff; font-size: 11px; text-align: center; line-height: 20px;
}
.sidebar-foot { margin-top: auto; padding: 0 10px; font-size: 12px; color: var(--muted); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  height: var(--topbar);
  margin-left: var(--sidebar);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .brand { display: none; }
.topbar h1 { font-size: 17px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

main {
  margin-left: var(--sidebar);
  padding: 24px 28px 72px;
}
.page { max-width: 1080px; margin: 0 auto; }

.bottombar { display: none; }

@media (max-width: 899px) {
  .sidebar { display: none; }
  .topbar { margin-left: 0; padding: 0 16px; }
  .topbar .brand { display: block; }
  .topbar h1 { display: none; }
  main { margin-left: 0; padding: 16px 16px calc(var(--bottombar) + 32px); }
  .bottombar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    inset: auto 0 0 0;
    height: var(--bottombar);
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--card);
    border-top: 1px solid var(--line);
    z-index: 6;
  }
  .bottombar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    position: relative;
  }
  .bottombar a svg { width: 20px; height: 20px; }
  .bottombar a[aria-current="page"] { color: var(--accent); }
  .bottombar .count {
    position: absolute; top: 8px; left: calc(50% + 6px); min-width: 16px; padding: 0 4px;
    border-radius: 99px; background: var(--accent); color: #fff; font-size: 10px; line-height: 16px;
  }
}

/* ---- page chrome -------------------------------------------------------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.page-head h2 { font-size: 22px; letter-spacing: -.03em; margin: 0; }
.page-head p { margin: 2px 0 0; }
.page-head .spacer { flex: 1; }

.subnav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin: 0 0 18px;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.subnav a {
  padding: 8px 12px 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.subnav a:hover { color: var(--ink); }
.subnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

.page-head .subnav { flex: 1 1 320px; margin: 0; }
.page-head .chips { padding-bottom: 6px; }

.section-title { font-size: 15px; margin: 22px 0 10px; letter-spacing: -.01em; }
.section-title:first-child { margin-top: 4px; }

.guide-toc {
  display: flex; flex-wrap: wrap; gap: 8px 16px;
  margin: 0 0 8px; padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.guide-toc a { font-size: 13px; font-weight: 500; color: var(--accent); text-decoration: none; }
.guide-toc a:hover { text-decoration: underline; }
.guide-section, .guide-entry { scroll-margin-top: 72px; }
.guide-section > .muted { margin: -4px 0 12px; max-width: 42em; }
.guide-entry h3 { font-size: 15px; margin: 0 0 6px; }
.guide-entry > p { margin: 0; }
.guide-entry dl { margin: 10px 0 0; }
.guide-entry dt {
  font-size: 11px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); margin: 10px 0 2px;
}
.guide-entry dd { margin: 0; }

.page-head .btn-link { padding-bottom: 10px; }

.grid-2 { display: grid; gap: 12px; margin-bottom: 12px; }
@media (min-width: 860px) {
  .grid-2 { grid-template-columns: 1fr 1fr; align-items: start; }
  .grid-2 .span-2 { grid-column: 1 / -1; }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 20px 16px;
  margin-bottom: 12px;
}
.grid-2 > .card { margin-bottom: 0; }
.card > .muted { margin: 0 0 8px; max-width: 52em; }
.card-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 8px;
}
.card-head h2 { margin: 0; display: flex; align-items: center; gap: 6px; }
.card-head .composer { flex: 0 1 420px; }
.card-head .spacer { flex: 1; }

.bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
