.boot { min-height: 100dvh; display: grid; place-items: center; }
.boot-mark { width: 44px; height: 44px; color: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

.app { display: grid; grid-template-columns: 312px minmax(0, 1fr); min-height: 100dvh; }

.side {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 24px;
  padding: 28px 18px 24px; border-right: 1px solid var(--line); background: var(--surface-2);
}
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; text-decoration: none; color: var(--ink); padding: 0 8px; }
.brand svg { width: 28px; height: 28px; color: var(--accent); }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm);
  color: var(--ink-2); text-decoration: none; font-weight: 550; transition: background 0.15s, color 0.15s;
}
.nav a svg { width: 22px; height: 22px; }
.nav a:hover { background: var(--accent-soft); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.nav a[aria-current="page"] svg { color: var(--accent); }

.side-foot .btn { justify-content: flex-start; margin-left: -12px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 8px; }
.who { display: flex; flex-direction: column; font-size: 0.875rem; min-width: 0; }
.who strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.content:focus { outline: none; }
.content { padding: 40px clamp(16px, 4vw, 56px) 120px; width: 100%; max-width: 1000px; margin-inline: auto; min-width: 0; }
.view { display: flex; flex-direction: column; gap: 28px; animation: rise 0.28s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.page-head { display: flex; flex-direction: column; gap: 4px; }
.page-head p { color: var(--ink-2); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }

.banner {
  position: sticky; top: var(--bar-h, 0px); z-index: 30; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px clamp(16px, 4vw, 56px); background: var(--failed-bg); color: var(--failed-ink); font-weight: 550;
  border-bottom: 1px solid var(--line);
}
.mobile-brand { display: none; }
.banner .btn { margin-left: auto; }

.toasts { position: fixed; z-index: 80; left: 50%; transform: translateX(-50%); bottom: 96px; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast {
  pointer-events: auto; background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; animation: rise 0.2s ease-out both;
}
.toast.is-error { background: var(--danger); color: #fff; }

@media (max-width: 768px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; align-items: center; gap: 10px;
    padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); background: var(--surface);
  }
  :root { --bar-h: 69px; }
  .mobile-brand { display: block; padding: 14px clamp(16px, 4vw, 56px) 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
  .mobile-brand + .content { padding-top: 8px; }
  body[data-flow] .nav { display: none; }
  body[data-flow] .toasts { bottom: 24px; }
  .side .brand { padding: 0; font-size: 0; gap: 0; min-width: 44px; justify-content: center; }
  .side .brand span { display: none; }
  .side .switcher { flex: 1; min-width: 0; }
  .side-foot { margin: 0; padding: 0; flex-direction: row; align-items: center; gap: 6px; }
  .demo-slot:empty { display: none; }
  .side-foot .who { display: none; }
  .side-foot .btn { margin-left: 0; }
  .side-foot .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .nav {
    position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; flex-direction: row; justify-content: space-around;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); gap: 2px;
  }
  .nav a { flex: 1; flex-direction: column; gap: 2px; padding: 8px 4px; font-size: 0.75rem; justify-content: center; align-items: center; }
  .nav a[aria-current="page"] { box-shadow: none; background: var(--accent-soft); }
  .content { padding-top: 24px; padding-bottom: 120px; }
  .toasts { bottom: 84px; }
}

@media (max-width: 768px) and (max-height: 480px) {
  :root { --bar-h: 0px; }
  .side { position: static; }
  .nav { padding-block: 2px calc(2px + env(safe-area-inset-bottom)); }
  .nav a { flex-direction: row; justify-content: center; gap: 8px; padding: 8px 4px; }
  .content { padding-bottom: 72px; }
  .day-head { position: static; }
}

@media (min-width: 769px) and (max-height: 560px) {
  .side { gap: 12px; padding-block: 12px; overflow-y: auto; }
  .nav a { padding-block: 8px; }
}
