/* Site shell: navbar, mobile header + tab bar, hero, footer, admin shell */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.page { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 28px 24px 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 30px; font-weight: 800; margin: 0; font-family: var(--display); letter-spacing: -.02em; } .page-head p { margin: 4px 0 0; color: var(--muted); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; } .toolbar .field { min-width: 150px; } .toolbar .grow { flex: 1; min-width: 200px; }
#view.enter { animation: viewin .35s ease both; } @keyframes viewin { from { opacity: 0; transform: translateY(8px); } }
.demo-banner { background: repeating-linear-gradient(45deg, #2a1f06, #2a1f06 12px, #1f1704 12px, #1f1704 24px); color: #fbbf24; text-align: center; font-size: 12.5px; padding: 6px 12px; border-bottom: 1px solid #5b4310; }
:root[data-theme="light"] .demo-banner { background: #fff3cd; color: #6b4a00; border-color: #f0d68a; }

/* ---------- top navbar (laptop) */
.topbar { position: sticky; top: 0; z-index: 50; height: var(--nav-h); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1600px; margin: 0 auto; height: 100%; padding: 0 20px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; }
.brand .word { display: flex; flex-direction: column; line-height: 1; } .brand .word b { font: italic 900 30px/1 var(--display); letter-spacing: -.02em; } .brand .word small { font: italic 700 9.5px var(--display); letter-spacing: .02em; margin-top: 3px; text-transform: uppercase; opacity: .9; }
.nav { display: flex; gap: 0; margin-left: 4px; border-left: 1px solid var(--line); padding-left: 10px; }
.nav a { display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: none; transition: .15s; }
.nav a:hover { color: var(--text); background: var(--tile); } .nav a.on { color: #fff; background: linear-gradient(180deg, #1f6bff, #1050d6); box-shadow: 0 4px 16px rgba(31, 107, 255, .45); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; border-left: 1px solid var(--line); padding-left: 14px; }
.menu-wrap { display: flex; gap: 8px; align-items: center; }
.searchbox { position: relative; } .searchbox input { width: 250px; border-radius: 999px; padding: 9px 40px 9px 16px; background: var(--panel2); font-size: 13.5px; }
.searchbox button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--accent2); padding: 6px; display: grid; }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; box-shadow: var(--shadow); padding: 8px; z-index: 80; animation: pop .15s; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 12px; border-radius: 9px; background: none; border: 0; color: var(--text); font-size: 14px; text-decoration: none; } .menu a:hover, .menu button:hover { background: var(--tile); }
.menu .who { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; } .menu .who b { display: block; } .menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.user-btn { display: flex; align-items: center; gap: 8px; background: var(--panel2); border: 1px solid var(--line2); border-radius: 999px; padding: 4px 12px 4px 4px; font-weight: 600; font-size: 13.5px; }

/* ---------- mobile header + bottom tabs */
.m-head, .tabbar { display: none; }
@media (max-width: 1560px) { .searchbox input { width: 170px; } .nav a { padding: 9px 9px; font-size: 13.5px; } }
@media (max-width: 1400px) { .nav a span.t { display: none; } .nav a { padding: 9px 11px; } .searchbox input { width: 170px; } }
@media (max-width: 980px) {
  .topbar { display: none; }
  .m-head { display: flex; position: sticky; top: 0; z-index: 50; align-items: center; justify-content: space-between; padding: 10px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); }
  .m-head .brand .word b { font-size: 28px; } .m-head .acts { display: flex; gap: 10px; }
  .m-head .sq { width: 46px; height: 46px; border-radius: 14px; border: 1px solid var(--line2); background: var(--panel2); display: grid; place-items: center; color: var(--text); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; height: var(--tab-h); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--bg2) 94%, transparent); backdrop-filter: blur(16px); border-top: 1px solid var(--line2); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11.5px; font-weight: 600; background: none; border: 0; text-decoration: none; }
  .tabbar .on { color: var(--accent2); } .tabbar .on .icon { filter: drop-shadow(0 0 8px rgba(63, 164, 255, .7)); }
  .app { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); }
  .page { padding: 18px 16px 36px; } .page-head h1 { font-size: 25px; }
  .grid.g2, .grid.g3, .grid.g4, .form-grid { grid-template-columns: 1fr; } .grid.g4.keep, .grid.g2.keep { grid-template-columns: repeat(2, 1fr); }
  .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv dt { margin-top: 8px; }
}
.sheet-back { position: fixed; inset: 0; z-index: 90; background: rgba(2, 6, 18, .65); animation: fade .15s; }
.sheet { position: fixed; z-index: 91; left: 0; right: 0; bottom: 0; background: var(--panel); border-radius: 22px 22px 0 0; padding: 14px 16px calc(var(--tab-h) + 16px); border-top: 1px solid var(--line2); animation: slideup .22s; max-height: 85dvh; overflow: auto; }
@keyframes slideup { from { transform: translateY(40px); opacity: 0; } }
.sheet .grab { width: 44px; height: 5px; background: var(--line2); border-radius: 9px; margin: 0 auto 14px; }
.sheet .links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sheet .links a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border-radius: 14px; background: var(--tile); color: var(--text); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.sheet .links a .icon { color: var(--accent2); }
.sheet .searchbox input { width: 100%; }

/* ---------- footer */
.footer { margin-top: auto; border-top: 1px solid var(--line); background: var(--bg2); }
.footer-in { max-width: 1480px; margin: 0 auto; padding: 22px 24px; display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.footer .blurb { border-left: 1px solid var(--line2); padding-left: 24px; font-size: 13px; color: var(--muted); max-width: 230px; }
.footer .links { display: flex; gap: 0; margin: 0 auto; flex-wrap: wrap; justify-content: center; } .footer .links a { color: var(--text); font-size: 13.5px; padding: 0 16px; border-left: 1px solid var(--line2); text-decoration: none; } .footer .links a:first-child { border: 0; } .footer .links a:hover { color: var(--accent2); }
.footer .social { display: flex; gap: 14px; } .footer .social a { color: var(--text); opacity: .85; display: grid; } .footer .social a:hover { color: var(--accent2); }
.footer .motto { font: italic 600 19px var(--display); color: var(--accent2); }
.footer-sub { max-width: 1480px; margin: 0 auto; padding: 0 24px 18px; font-size: 12px; color: var(--faint); }
@media (max-width: 980px) { .footer-in { flex-direction: column; align-items: flex-start; gap: 14px; padding: 20px 16px; } .footer .blurb { border: 0; padding: 0; max-width: none; } .footer .links { margin: 0; justify-content: flex-start; } .footer .links a { padding: 4px 12px 4px 0; border: 0; margin-right: 12px; } .footer-sub { padding: 0 16px 24px; } }

/* ---------- admin shell */
.admin { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.a-side { position: sticky; top: 0; height: 100vh; overflow: auto; background: var(--bg2); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; }
.a-side .brand { padding: 4px 10px 16px; } .a-side .tag { font-size: 10px; letter-spacing: .12em; color: var(--accent2); font-weight: 800; margin: 2px 10px 0; text-transform: uppercase; }
.a-side a.item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: none; }
.a-side a.item:hover { background: var(--tile); color: var(--text); } .a-side a.item.on { background: var(--accent-soft); color: var(--accent2); box-shadow: inset 3px 0 0 var(--accent2); }
.a-side .sp { flex: 1; } .a-main { min-width: 0; } .a-top { display: none; }
.a-page { padding: 26px 28px 60px; max-width: 1400px; }
@media (max-width: 980px) {
  .admin { grid-template-columns: 1fr; }
  .a-side { position: fixed; z-index: 120; width: 280px; transform: translateX(-100%); transition: transform .22s; box-shadow: var(--shadow); } .a-side.open { transform: none; }
  .a-top { display: flex; align-items: center; gap: 12px; padding: 10px 14px; position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); } .a-top b { font-size: 16px; }
  .a-page { padding: 18px 14px 50px; }
}
