/* ============================================================
   GG HQ — Good Good Golf internal portal
   Design system v3 · per the Good Good Brand Manual
   Dark Navy PMS 7546 #243746 · Light Blue PMS 542 #6CACE4
   Neutral Black #221E1F · White #FFFFFF
   Oswald (heading stand-in for AlternateGotNo3D) · DM Sans (body)
   Logo assets live in /brand/ (script wordmark, never typeset)
   ============================================================ */

:root {
  /* palette — brand manual */
  --navy: #243746;
  --navy-deep: #1a2a37;
  --blue: #6cace4;
  --blue-tint: #eaf2fa;
  --blue-text: #33689c;      /* darker 542 for small text on white */
  --black: #221e1f;
  --paper: #ffffff;
  --bg: #f5f8fb;             /* very light blue-gray page background */
  --ink: #243746;
  --muted: #5c6b78;
  --faint: #8a97a3;
  --border: #dde5ec;
  --border-strong: #c3cfda;
  --danger: #b3352c;
  --danger-bg: #fdf0ee;
  --ok-bg: #eaf2fa;

  /* shape + depth */
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(36, 55, 70, .05), 0 4px 14px rgba(36, 55, 70, .07);
  --shadow-lift: 0 10px 28px rgba(36, 55, 70, .16);

  /* type */
  --font-head: "Oswald", "Arial Narrow", sans-serif;
  --font-body: "DM Sans", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, .display {
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
}

a { color: var(--navy); }
button { font-family: var(--font-body); }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============ Top bar ============ */
.topbar {
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 22px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 0 rgba(0,0,0,.08);
}
.topbar .brand {
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar .brand img { height: 30px; width: auto; display: block; }
.topbar .brand .hq {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--blue);
  border-left: 1px solid rgba(255,255,255,.25);
  padding-left: 10px;
  line-height: 1;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-right a, .topbar-right button.linkish {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  background: none;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 999px;
  padding: 6px 15px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s ease;
}
.topbar-right a:hover, .topbar-right button.linkish:hover { background: rgba(255,255,255,.13); }
.topbar-right a.active { background: rgba(108,172,228,.22); border-color: var(--blue); }
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--navy-deep);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  user-select: none;
}

/* ============ Layout ============ */
.wrap { max-width: 1060px; margin: 0 auto; padding: 30px 22px 100px; }

.page-head { margin: 8px 0 26px; }
.page-head h1 { font-size: 34px; line-height: 1.1; color: var(--navy); }
.page-head p { color: var(--muted); font-size: 15px; margin-top: 4px; }

/* Section header: kicker + rule, scales to any future section */
.section { margin-top: 40px; }
.section:first-of-type { margin-top: 0; }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 16px;
}
.section-head h2 {
  font-size: 19px;
  color: var(--navy);
  letter-spacing: .07em;
  white-space: nowrap;
}
.section-head .count {
  font-size: 12px;
  font-weight: 700;
  color: var(--blue-text);
  background: var(--blue-tint);
  border-radius: 999px;
  padding: 1px 9px;
  letter-spacing: .03em;
  transform: translateY(-2px);
}
.section-head .sub { font-size: 13px; color: var(--faint); white-space: nowrap; }
.section-head .rule { flex: 1; height: 1px; background: var(--border-strong); }

/* ============ App tiles ============ */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 16px;
  align-items: stretch;
}
.tile {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px 18px 24px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform .13s ease, box-shadow .13s ease, border-color .13s ease;
  position: relative;
  overflow: hidden;
}
.tile::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: var(--navy);
  transition: width .13s ease;
}
.tile:hover, .tile:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: var(--navy);
}
.tile:hover::before { width: 7px; }
.tile:active { transform: translateY(-1px); }
.tile .icon { font-size: 30px; line-height: 1.2; }
.tile h3 { font-size: 20px; color: var(--navy); line-height: 1.2; }
.tile p { font-size: 14px; color: var(--muted); line-height: 1.45; }
.tile .go {
  margin-top: auto;
  padding-top: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--blue-text);
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Hero tile — the "you have exactly one thing" experience */
.hero-tile {
  background: var(--navy);
  border: none;
  border-radius: 18px;
  padding: 34px 30px;
  text-decoration: none;
  color: #fff;
  box-shadow: 0 14px 34px rgba(36, 55, 70, .30);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: transform .13s ease, box-shadow .13s ease;
}
.hero-tile::after {
  content: "⛳️";
  position: absolute;
  right: -18px;
  bottom: -30px;
  font-size: 150px;
  opacity: .12;
  transform: rotate(-8deg);
  pointer-events: none;
}
.hero-tile:hover { transform: translateY(-3px); box-shadow: 0 18px 44px rgba(36, 55, 70, .38); }
.hero-tile .kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--blue);
}
.hero-tile h3 { font-size: 32px; color: #fff; line-height: 1.15; }
.hero-tile p { font-size: 15px; color: rgba(255,255,255,.78); max-width: 420px; }
.hero-tile .go {
  margin-top: 14px;
  align-self: flex-start;
  background: var(--blue);
  color: var(--navy-deep);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  padding: 11px 24px;
  border-radius: 999px;
}

/* ============ Walkthrough rows (compact, scan-fast) ============ */
.wt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}
.wt-row {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 1px 2px rgba(36,55,70,.04);
  transition: transform .1s ease, border-color .1s ease, box-shadow .1s ease;
}
.wt-row:hover, .wt-row:focus-visible {
  border-color: var(--navy);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.wt-row .flag { font-size: 17px; flex: 0 0 auto; }
.wt-row .face { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; object-position: top; flex: 0 0 auto; border: 1.5px solid var(--border); background: var(--bg); }
.wt-row .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wt-row .arr { color: var(--blue-text); font-weight: 700; flex: 0 0 auto; }

/* Search / filter input (walkthroughs, admin users) */
.searchbar { position: relative; margin-bottom: 14px; max-width: 340px; }
.searchbar input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: 15px;
  font-family: var(--font-body);
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a97a3' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='16.5' y1='16.5' x2='21' y2='21'/%3E%3C/svg%3E") 15px 50% no-repeat;
  color: var(--ink);
}
.searchbar input:focus { outline: none; border-color: var(--blue); }
.search-empty { color: var(--muted); font-size: 14px; padding: 10px 4px; }

/* ============ Empty state ============ */
.empty {
  background: var(--paper);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 48px 30px;
  text-align: center;
  color: var(--muted);
}
.empty .big { font-size: 40px; margin-bottom: 10px; }
.empty h3 { color: var(--navy); font-size: 20px; margin-bottom: 6px; }
.empty p { font-size: 14px; }

/* ============ Forms ============ */
.field { text-align: left; margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
input[type="email"], input[type="text"], select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
}
input:focus, select:focus { outline: none; border-color: var(--blue); }

.btn-brand {
  width: 100%;
  padding: 13px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: .09em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .12s ease, transform .08s ease;
}
.btn-brand:hover { background: var(--navy-deep); }
.btn-brand:active { transform: scale(.99); }
.btn-brand:disabled { opacity: .55; cursor: default; }

.msg { font-size: 14px; margin-top: 14px; min-height: 20px; }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--blue-text); }

/* ============ Login ============ */
.login-page {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(108, 172, 228, .18), transparent 60%),
    radial-gradient(700px 420px at -10% 110%, rgba(36, 55, 70, .10), transparent 55%),
    var(--bg);
}
.login-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(36, 55, 70, .15);
  padding: 40px 36px 34px;
  width: 100%;
  max-width: 410px;
  text-align: center;
}
.login-card .logo { width: 230px; max-width: 82%; height: auto; display: block; margin: 0 auto 4px; }
.login-card h1 {
  font-size: 16px;
  letter-spacing: .3em;
  color: var(--blue-text);
  margin: 10px 0 2px;
}
.login-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 28px; }

/* code digit boxes */
.code-boxes {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 4px 0 18px;
}
.code-boxes input {
  width: 46px;
  height: 56px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  padding: 0;
  caret-color: var(--navy);
}
.code-boxes input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(108,172,228,.22); }
.code-boxes.error input { border-color: var(--danger); animation: shake .3s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.sent-to {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 13px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 18px;
  max-width: 100%;
}
.sent-to b { color: var(--ink); font-weight: 700; overflow: hidden; text-overflow: ellipsis; }

.back-link, .resend-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.back-link:hover, .resend-link:hover:not(:disabled) { color: var(--navy); }
.resend-link:disabled { text-decoration: none; cursor: default; opacity: .6; }

/* ============ Cards (admin) ============ */
.card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 18px;
}
.card > h2 { font-size: 18px; color: var(--navy); margin-bottom: 14px; }

/* stat strip */
.stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.stat {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  min-width: 110px;
  box-shadow: 0 1px 2px rgba(36,55,70,.04);
}
.stat .n { font-weight: 700; font-size: 26px; color: var(--navy); line-height: 1; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }

/* pills + toggles */
.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.pill.admin { background: var(--navy); color: #fff; }
.pill.member { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--blue-tint);
  color: var(--navy);
  border: 1px solid transparent;
}
.chip.wt { background: var(--bg); color: var(--blue-text); border-color: var(--border); }
.chip.none { background: transparent; color: var(--faint); border: 1px dashed var(--border-strong); }

.app-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--paper);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  transition: border-color .1s ease, background .1s ease, color .1s ease;
  user-select: none;
}
.app-toggle:hover { border-color: var(--border-strong); }
.app-toggle.on { border-color: var(--navy); background: var(--navy); color: #fff; }
.app-toggle .tick { display: inline; font-weight: 800; opacity: 0; }  /* reserved space — no width shift on toggle */
.app-toggle.on .tick { opacity: 1; }
.toggles { display: flex; flex-wrap: wrap; gap: 7px; }

.grant-group { margin-bottom: 16px; }
.grant-group:last-child { margin-bottom: 0; }
.grant-group .gg-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
}
.grant-group .gg-head .t {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.grant-group .gg-head .mini {
  font-size: 12px;
  font-weight: 600;
  color: var(--blue-text);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
}
.grant-group .gg-head .mini:hover { color: var(--navy); }

/* buttons */
.btn-sm {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--paper);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
  white-space: nowrap;
  transition: background .1s ease, border-color .1s ease;
}
.btn-sm:hover { border-color: var(--border-strong); background: var(--bg); }
.btn-sm:disabled { opacity: .35; cursor: default; }
.btn-sm:disabled:hover { border-color: var(--border); background: var(--paper); }
.btn-sm.danger { color: var(--danger); border-color: #e4c4c0; }
.btn-sm.danger:hover { background: var(--danger-bg); }
.btn-sm.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-sm.primary:hover { background: var(--navy-deep); }
.btn-sm.ghost { border-color: transparent; background: none; color: var(--blue-text); text-decoration: underline; text-underline-offset: 3px; }

/* ============ Admin: user cards ============ */
.user-list { display: flex; flex-direction: column; gap: 10px; }
.user-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(36,55,70,.05);
  overflow: hidden;
}
.user-card.open { border-color: var(--border-strong); box-shadow: var(--shadow); }
.uc-head {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
}
.uc-head:hover { background: #f8fafc; }
.uc-id { flex: 1; min-width: 0; }
.uc-id .nm { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.uc-id .em { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-sum { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.uc-caret { color: var(--faint); font-size: 13px; flex: 0 0 auto; transition: transform .12s ease; }
.user-card.open .uc-caret { transform: rotate(90deg); }
.uc-body {
  border-top: 1px solid var(--border);
  padding: 16px;
  background: #f8fafc;
}
.uc-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--faint);
  margin-bottom: 14px;
}
.uc-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.uc-actions .btn-sm.danger { margin-left: auto; }  /* keep destructive action away from the rest */
.uc-actions select {
  width: auto;
  min-width: 190px;
  padding: 7px 12px;
  font-size: 13px;
  border-radius: 999px;
}
.saved-flash {
  font-size: 12px;
  font-weight: 700;
  color: var(--blue-text);
  opacity: 0;
  transition: opacity .2s ease;
}
.saved-flash.show { opacity: 1; }

/* add-user grid */
.add-grid { display: grid; grid-template-columns: 2fr 2fr 1fr auto; gap: 10px; align-items: end; }
.add-grid .field { margin-bottom: 0; }
.add-extra { margin-top: 12px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.add-extra label { font-size: 13px; color: var(--muted); font-weight: 600; }
.add-extra select { width: auto; padding: 8px 12px; font-size: 14px; border-radius: 999px; }
.welcome-toggle { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; background: #fff; }
.welcome-toggle input { accent-color: #243746; width: 15px; height: 15px; cursor: pointer; }
.welcome-toggle span { font-size: 13px; font-weight: 600; color: #243746; }

.muted { color: var(--muted); font-size: 12px; }

/* ============ Toast ============ */
#toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  visibility: hidden;
  opacity: 0;
  transform: translateX(-50%) translateY(80px);
  background: var(--black);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(34,30,31,.3);
  z-index: 99;
  transition: transform .18s ease, opacity .18s ease, visibility .18s;
  max-width: calc(100vw - 40px);
  text-align: center;
}
#toast.show { visibility: visible; opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--danger); }

/* ============ Mobile ============ */
@media (max-width: 680px) {
  .wrap { padding: 22px 15px 110px; }
  .topbar { padding: 11px 14px; }
  .topbar .brand img { height: 24px; }
  .topbar .brand .hq { font-size: 13px; padding-left: 8px; }
  .topbar { flex-wrap: wrap; }
  .topbar-right { gap: 6px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
  .topbar-right a, .topbar-right button.linkish { font-size: 12px; padding: 5px 10px; }
  .topbar-right .avatar { width: 28px; height: 28px; font-size: 11px; }
  .page-head h1 { font-size: 28px; }
  .tiles { grid-template-columns: 1fr; }
  .wt-grid { grid-template-columns: 1fr; }
  .hero-tile { padding: 28px 22px; }
  .hero-tile h3 { font-size: 26px; }
  .login-card { padding: 32px 22px 28px; }
  .login-card .logo { width: 190px; }
  .code-boxes input { width: 42px; height: 52px; font-size: 22px; }
  .add-grid { grid-template-columns: 1fr; }
  .uc-sum { display: none; }               /* collapse chips on tiny screens; open card to see */
  .uc-head { padding: 13px 14px; }
  .stat { flex: 1; min-width: 90px; padding: 10px 14px; }
  .stat .n { font-size: 22px; }
}

/* Pull-to-refresh indicator (house convention) */
#ptr-badge {
  position: fixed; top: -60px; left: 50%; transform: translateX(-50%);
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--border);
  box-shadow: 0 4px 14px rgba(0,0,0,.14);
  display: flex; align-items: center; justify-content: center;
  z-index: 99; transition: top .15s ease; font-size: 20px; color: var(--navy);
}

/* ---- View-as (admin impersonation) banner ---- */
.viewas-bar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  background: #6CACE4; color: #14233f;
  font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 600;
  padding: 9px 16px; text-align: center;
}
.viewas-bar button {
  background: #14233f; color: #fff; border: 0; border-radius: 999px;
  font: 700 12px 'DM Sans', sans-serif; letter-spacing: .04em;
  padding: 6px 16px; cursor: pointer;
}
.viewas-bar button:hover { background: #0e1a30; }
@media (max-width: 600px) {
  .viewas-bar { flex-direction: column; gap: 6px; }
}

/* ---- Announcements (portal home) ---- */
.ann-list { display: flex; flex-direction: column; gap: 10px; }
.ann {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  box-shadow: 0 1px 2px rgba(36,55,70,.04);
  position: relative;
  overflow: hidden;
}
.ann::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; background: var(--border-strong);
}
.ann.pinned { border-color: #d8c9a5; background: #fdfbf5; }
.ann.pinned::before { background: #ac8c49; }
.ann-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ann-head h3 { font-size: 17px; color: var(--navy); letter-spacing: .04em; }
.ann-pin { font-size: 14px; }
.ann-meta { font-size: 12px; color: var(--faint); margin-left: auto; white-space: nowrap; }
.ann-body { font-size: 14px; color: var(--muted); margin-top: 6px; line-height: 1.55; max-width: 72ch; }

/* ---- Who's out this week (portal home) ---- */
.out-list {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 2px rgba(36,55,70,.04);
  overflow: hidden;
}
.out-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid #eef0f4;
  font-size: 14px;
}
.out-row:last-child { border-bottom: 0; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.out-who { display: flex; flex-direction: column; min-width: 0; }
.out-who .nm { font-weight: 700; }
.out-who .dept { font-size: 12px; color: var(--faint); }
.out-dates { margin-left: auto; color: var(--muted); font-weight: 600; white-space: nowrap; }
.out-cat {
  font-size: 12px; font-weight: 600; color: var(--blue-text);
  background: var(--blue-tint); border-radius: 999px; padding: 3px 11px;
  white-space: nowrap;
}
.out-empty {
  background: var(--paper);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

/* ---- Quick links (portal home) ---- */
.qlinks { display: flex; flex-wrap: wrap; gap: 9px; }
.qlink {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 14px; font-weight: 600;
  color: var(--ink); text-decoration: none;
  box-shadow: 0 1px 2px rgba(36,55,70,.04);
  transition: border-color .1s ease, transform .1s ease, box-shadow .1s ease;
}
.qlink:hover, .qlink:focus-visible { border-color: var(--navy); transform: translateY(-1px); box-shadow: var(--shadow); }
.qlink .qi { font-size: 16px; }

/* ---- Directory page ---- */
.dir-controls { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
.dept-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.dchip {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--paper);
  font-size: 13px; font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .1s ease, background .1s ease, color .1s ease;
}
.dchip:hover { border-color: var(--border-strong); }
.dchip.on { border-color: var(--navy); background: var(--navy); color: #fff; }
.dir-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.dir-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 1px 2px rgba(36,55,70,.04);
}
.dir-id { min-width: 0; }
.dir-id .nm { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.dir-id .em { font-size: 13px; color: var(--blue-text); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir-id .em:hover { text-decoration: underline; }
.dir-id .mgr { font-size: 12px; color: var(--faint); margin-top: 2px; }
.dir-id .mgr b { color: var(--muted); font-weight: 600; }

/* ---- Admin: announcements + quick links managers ---- */
.ann-form-grid { display: flex; flex-direction: column; gap: 10px; }
.ann-form-grid textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  resize: vertical;
}
.ann-form-grid textarea:focus { outline: none; border-color: var(--blue); }
.ann-form-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ann-admin-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #eef0f4;
  flex-wrap: wrap;
}
.ann-admin-row:last-child { border-bottom: 0; }
.ann-admin-row.pinned .t b { color: #8a6d33; }
.ann-admin-row.archived .ann-admin-main { opacity: 0.55; }
.arch-tag {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: #8a8577; background: #ece8dd;
  border-radius: 4px; padding: 1px 6px; vertical-align: 1px;
}
.ann-admin-main { flex: 1; min-width: 220px; }
.ann-admin-main .b { font-size: 13px; margin-top: 3px; }
.ann-admin-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.ql-form-grid { display: grid; grid-template-columns: 64px 1fr 2fr auto auto; gap: 10px; align-items: center; }
.ql-form-grid input#ql-icon { text-align: center; }
.ql-form-grid input[type="url"] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
}
.ql-form-grid input[type="url"]:focus { outline: none; border-color: var(--blue); }
.ql-admin-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #eef0f4;
  flex-wrap: wrap;
}
.ql-admin-row:last-child { border-bottom: 0; }
.ql-admin-row .qi { font-size: 18px; }
.ql-admin-main { flex: 1; min-width: 200px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.ql-admin-main a { overflow: hidden; text-overflow: ellipsis; max-width: 340px; white-space: nowrap; }
.ql-admin-actions { display: flex; gap: 6px; }

@media (max-width: 680px) {
  .ann-meta { margin-left: 0; }
  .out-row { flex-wrap: wrap; }
  .out-dates { margin-left: 40px; width: 100%; order: 3; }
  .out-cat { margin-left: 40px; order: 4; }
  .dir-grid { grid-template-columns: 1fr; }
  .ql-form-grid { grid-template-columns: 64px 1fr; }
  .ql-form-grid input[type="url"] { grid-column: 1 / -1; }
  .ql-form-grid button { grid-column: 1 / -1; padding: 10px 16px; }
}

/* ---- Walkthrough views panel ---- */
.wview-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #eef0f4; font-size: 14px; flex-wrap: wrap; }
.wview-row:last-child { border-bottom: 0; }
.wview-status { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.wview-row .chip { background: #eef0f4; color: #5a6577; border-radius: 999px; font: 600 11px 'DM Sans', sans-serif; letter-spacing: .03em; padding: 4px 10px; text-transform: uppercase; }
.wview-row .chip.ok { background: #6CACE4; color: #14233f; }

/* ---- Walkthrough views: tucked-away details at page bottom ---- */
.wviews-tuck { margin-top: 26px; border-top: 1px solid #e5e9f0; padding-top: 14px; }
.wviews-tuck summary { cursor: pointer; font: 600 14px 'DM Sans', sans-serif; color: #5a6577; list-style: none; display: flex; align-items: center; gap: 8px; }
.wviews-tuck summary::before { content: "▸"; font-size: 11px; transition: transform .15s; }
.wviews-tuck[open] summary::before { transform: rotate(90deg); }
.wviews-tuck summary:hover { color: #14233f; }
