:root {
  --navy: #00267F;
  --navy-deep: #001A5C;
  --royal: #004AAD;
  --gold: #FFC726;
  --gold-soft: #FFF4CF;
  --ink: #14213D;
  --muted: #5A6478;
  --line: #DDE3EE;
  --paper: #F4F6FA;
  --card: #FFFFFF;
  --lock: #8A5A00;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 26, 92, .06), 0 4px 14px rgba(0, 26, 92, .06);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh; overflow-x: hidden;
}
a { color: var(--royal); }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button { font: inherit; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; z-index: 99; background: #fff; padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 6px;
  padding: calc(8px + var(--safe-top)) 8px 8px; background: var(--navy); color: #fff;
  border-bottom: 3px solid var(--gold);
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; flex: 1; min-width: 0; }
.brand img { width: 44px; height: auto; }
.brand span { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand b { font-size: 18px; letter-spacing: .02em; }
.brand small { font-size: 12px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iconbtn { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: #fff; cursor: pointer; }
.iconbtn:hover { background: rgba(255, 255, 255, .12); }
.searchbar { position: sticky; top: calc(63px + var(--safe-top)); z-index: 19; background: var(--navy); padding: 0 12px 12px; }
.searchbar input { width: 100%; height: 46px; border: 0; border-radius: 12px; padding: 0 16px; font-size: 16px; color: var(--ink); }

/* Drawer */
.scrim { position: fixed; inset: 0; background: rgba(0, 16, 50, .45); z-index: 30; }
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0; width: min(320px, 86vw); z-index: 31; background: #fff;
  overflow-y: auto; padding: calc(16px + var(--safe-top)) 0 calc(24px + var(--safe-bottom)); box-shadow: 0 0 40px rgba(0, 0, 0, .25);
}
.drawer h2 { margin: 18px 20px 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.drawer a { display: flex; align-items: center; gap: 14px; padding: 11px 20px; color: var(--ink); text-decoration: none; font-weight: 500; }
.drawer a:hover, .drawer a[aria-current] { background: var(--paper); }
.drawer a[aria-current] { box-shadow: inset 4px 0 0 var(--gold); }
.drawer a svg { color: var(--royal); }
.drawer .dhead { display: flex; align-items: center; gap: 12px; padding: 0 20px 12px; border-bottom: 1px solid var(--line); }
.drawer .dhead img { width: 52px; }
.drawer .dhead b { display: block; color: var(--navy); }
.drawer .dhead small { color: var(--muted); }

/* Notice */
.notice { background: var(--gold); color: var(--navy-deep); font-weight: 600; padding: 10px 16px; text-align: center; font-size: 15px; }

/* Layout */
main { max-width: 980px; margin: 0 auto; padding: 16px 16px calc(32px + var(--safe-bottom)); outline: none; }
.crumbs { font-size: 14px; margin: 4px 0 8px; }
.crumbs a { text-decoration: none; }
h1 { font-size: 26px; line-height: 1.2; margin: 4px 0 8px; color: var(--navy); }
h2.sec { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 26px 0 10px; }
.lede { color: var(--muted); margin: 0 0 8px; max-width: 70ch; }

/* Home */
.hero {
  margin: -16px -16px 0; padding: 26px 16px 42px; color: #fff; text-align: center;
  background: radial-gradient(120% 90% at 50% 0%, var(--royal) 0%, var(--navy) 55%, var(--navy-deep) 100%);
}
.hero img { width: 120px; height: auto; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .3)); }
.hero h1 { color: #fff; font-size: 24px; margin: 12px 0 4px; }
.hero p { margin: 0 auto; opacity: .85; max-width: 36ch; }
.hubcta {
  display: flex; align-items: center; gap: 14px; margin: -22px auto 0; max-width: 560px; position: relative;
  background: var(--gold); color: var(--navy-deep); text-decoration: none; border-radius: var(--radius); padding: 16px 18px;
  box-shadow: 0 8px 22px rgba(0, 26, 92, .25); font-weight: 700;
}
.hubcta svg { width: 30px; height: 30px; }
.hubcta span { flex: 1; display: flex; flex-direction: column; font-size: 18px; line-height: 1.25; }
.hubcta small { font-weight: 500; font-size: 14px; opacity: .85; }
.mine { margin-top: 22px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.mine h2 { margin: 0 0 4px; font-size: 17px; color: var(--navy); }
.mine p { margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 8px 14px;
  font-size: 15px; cursor: pointer; text-decoration: none; min-height: 40px; display: inline-flex; align-items: center;
}
.chip:hover { border-color: var(--royal); }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.minecard { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.minecard .big { width: 52px; height: 52px; border-radius: 12px; background: var(--gold-soft); color: var(--navy); display: grid; place-items: center; }
.minecard .big svg { width: 28px; height: 28px; }
.minecard div { flex: 1; }
.minecard b { display: block; font-size: 18px; color: var(--navy); }
.minecard small { color: var(--muted); }
.textbtn { background: none; border: 0; color: var(--royal); padding: 6px 0; cursor: pointer; font-size: 14px; text-decoration: underline; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile {
  display: flex; flex-direction: column; gap: 10px; padding: 16px; min-height: 112px; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); text-decoration: none; color: var(--ink); border: 1px solid transparent;
}
.tile:hover { border-color: var(--line); }
.tile .ic { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--navy); color: var(--gold); }
.tile b { font-size: 16px; line-height: 1.25; }
.tile small { color: var(--muted); font-size: 13px; }

/* Link cards */
.links { display: grid; gap: 10px; }
.card {
  display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); text-decoration: none; color: var(--ink); border: 1px solid transparent; min-height: 64px;
}
.card:hover { border-color: var(--line); }
.card .ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.card .body { flex: 1; min-width: 0; }
.card b { display: block; font-size: 16px; line-height: 1.3; }
.card p { margin: 3px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.card .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.badge { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--paper); color: var(--muted); }
.badge.lock { background: #FFF1D6; color: var(--lock); display: inline-flex; align-items: center; gap: 4px; }
.badge.lock svg { width: 13px; height: 13px; stroke-width: 2.5; }
.card .go { color: #A0A8B8; align-self: center; }
.t-slides { background: #FFF2D9; color: #B26A00; }
.t-folder { background: #E6EEFF; color: var(--royal); }
.t-file { background: #FDE8E8; color: #B42318; }
.t-form { background: #EFE7FB; color: #6B3FB8; }
.t-sheet { background: #E3F5EA; color: #1E7B45; }
.t-video { background: #FDE8E8; color: #C4161C; }
.t-sway { background: #E2F4F3; color: #0F766E; }
.t-web { background: #EEF0F4; color: #46506A; }

.callout {
  display: flex; gap: 12px; background: #FFF8E6; border: 1px solid #F5DFA0; border-radius: var(--radius); padding: 14px 16px; margin: 14px 0 4px; font-size: 15px;
}
.callout svg { color: var(--lock); margin-top: 2px; }
.callout p { margin: 0 0 6px; }
.callout p:last-child { margin: 0; }
.pagebtns { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 0; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; color: var(--navy); font-weight: 600; cursor: pointer; text-decoration: none; font-size: 15px;
}
.btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn svg { width: 18px; height: 18px; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }

/* Hub view */
.hubview { position: fixed; inset: 0; z-index: 40; background: #fff; display: flex; flex-direction: column; }
.hubbar {
  display: flex; align-items: center; gap: 8px; padding: calc(6px + var(--safe-top)) 10px 6px; background: var(--navy); color: #fff;
  border-bottom: 3px solid var(--gold); min-height: 52px;
}
.hubbar b { flex: 1; text-align: center; }
.hubback, .hubopen { color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 2px; font-size: 15px; min-height: 40px; padding: 0 6px; }
.hubopen { font-size: 13px; opacity: .9; text-decoration: underline; }
.hubview iframe { flex: 1; width: 100%; border: 0; display: block; background: #fff; }
.hubwait { position: absolute; inset: 60px 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); background: #fff; pointer-events: none; transition: opacity .3s; }
.hubwait.gone { opacity: 0; }
body.inhub { overflow: hidden; }

.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 10px 16px calc(28px + var(--safe-bottom)); }
.foot a { color: var(--muted); }

@media (min-width: 640px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .links.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  h1 { font-size: 30px; }
  .hero { padding: 40px 16px 44px; border-radius: 0 0 24px 24px; }
  .hero h1 { font-size: 30px; }
}
@media (min-width: 900px) {
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
