/* Reusable components: cards, tiles, chips, buttons, lists */

/* Sign-in splash: covers the page until Entra ID resolves the user */
.auth-splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-splash[hidden] { display: none; }
.auth-splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  text-align: center;
  padding: 0 24px;
}
.auth-splash-inner img { height: 44px; width: auto; }
.auth-splash-inner p { margin: 0; font-size: 14px; color: var(--muted); max-width: 420px; }
body.is-authing { overflow: hidden; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}
.btn-light { background: var(--white); color: var(--sir-blue); font-weight: 600; }
.btn-light:hover { color: var(--sir-blue); box-shadow: 0 4px 14px rgba(0, 19, 41, 0.35); }
.btn-ghost { border: 1px solid var(--sir-blue-3); color: var(--white); font-weight: 500; }

/* Anything deliberately not linked yet */
.is-unlinked { cursor: default; opacity: 0.75; }

/* Search */
.search-pill, .search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 13px;
}
.search-pill { border-radius: 999px; padding: 9px 18px; }
.search-box { border-radius: var(--radius-sm); padding: 11px 16px; }
.search-pill input, .search-box input {
  border: 0;
  background: transparent;
  outline: none;
  font: inherit;
  color: var(--ink);
  width: 170px;
}
.search-box input { width: 100%; }
.search-pill:focus-within, .search-box:focus-within {
  border-color: var(--sir-blue-3);
  box-shadow: 0 0 0 2px var(--gold);
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--sir-blue);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  overflow: hidden;
  flex: 0 0 auto;
}
/* The signed-in person's Microsoft 365 photo, once auth.js has fetched it.
   The initials sit underneath until then, and stay if there is no photo. */
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.has-photo { background: var(--sir-blue-tint); box-shadow: inset 0 0 0 1px var(--sir-blue-5); }

/* The avatar is a button that opens the account menu (js/header-menu.js).
   Reset to nothing but the circle inside it. */
.avatar-button {
  font: inherit;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  border-radius: 999px;
  cursor: pointer;
  display: block;
  flex: 0 0 auto;
}
.avatar-button:hover .avatar { box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--sir-blue-3); }
.avatar-button:focus-visible { outline: none; }
.avatar-button:focus-visible .avatar { box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--gold); }
.avatar-button[aria-expanded="true"] .avatar { box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--sir-blue); }

.header-actions { position: relative; }
.user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 60;
  min-width: 232px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 14px 34px rgba(0, 19, 41, 0.18);
  padding: 6px;
}
.user-menu[hidden] { display: none; }
.user-menu-who {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.user-menu-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.user-menu-mail {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-menu-group { display: flex; flex-direction: column; }
.user-menu-group[hidden] { display: none; }
.user-menu-group + .user-menu-group { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 6px; }
.user-menu-item {
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  text-align: left;
  background: none;
  border: 0;
  border-radius: 4px;
  padding: 9px 12px;
  cursor: pointer;
  text-decoration: none;
  display: block;
  width: 100%;
}
.user-menu-item:hover { background: var(--sir-blue-tint); color: var(--sir-blue); }
.user-menu-item:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

/* Cards */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; }
.card-meta { font-size: 12px; color: var(--muted); }
.card-foot {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid var(--bg-grey);
  padding-top: 12px;
}

.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 13px; }

.section-link { font-size: 13px; font-weight: 600; color: var(--sir-blue); }
.section-link.small { font-size: 12px; }
.fine-print { font-size: 11px; color: var(--muted); }
.fine-print-dark { font-size: 12px; color: var(--sir-blue-4); }

/* "Beta testing" pill on a section only admins can see yet (js/beta.js). */
.beta-badge {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--sir-blue-tint);
  color: var(--sir-blue-3);
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* Quick-action tiles: icon + title only */
.quick-tile {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-card);
  color: var(--ink);
}
/* Unlinked quick tiles stay visually solid (Zachary, 8 Sep 2026) —
   they just don't navigate yet. */
.quick-tile.is-unlinked { opacity: 1; }
a.quick-tile:hover { border-color: var(--sir-blue-3); color: var(--ink); }
.quick-tile .tile-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: var(--radius-sm);
  background: var(--sir-blue);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
}
.quick-tile .tile-title { font-size: 15px; font-weight: 600; }

/* Feature slot */
.feature-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.feature-media {
  height: 300px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(160deg, var(--sir-blue-3) 0%, var(--sir-blue-2) 45%, var(--sir-blue-dark) 100%);
  background-size: cover;
  background-position: center;
}
.feature-tag {
  position: absolute;
  top: 20px;
  left: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
  background: rgba(0, 19, 41, 0.55);
  padding: 6px 12px;
  border-radius: 4px;
}
.feature-caption {
  background: linear-gradient(180deg, rgba(0, 19, 41, 0) 0%, rgba(0, 19, 41, 0.85) 100%);
  padding: 56px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.feature-title {
  font-family: var(--font-serif);
  font-size: 26px;
  line-height: 1.25;
  color: var(--white);
}
.feature-sub { font-size: 13px; color: var(--sir-blue-4); }
.feature-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
}
.feature-note { font-size: 12px; color: var(--muted); }
.dots { display: flex; gap: 6px; align-items: center; }
.dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--border);
  cursor: pointer;
}
.dot.is-active { background: var(--sir-blue); }
.dot:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Announcement cards */
.news-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.news-meta-row { display: flex; align-items: center; gap: 10px; }
.chip {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sir-blue);
  background: var(--sir-blue-tint);
  border-radius: 4px;
  padding: 4px 10px;
}
.news-when { font-size: 12px; color: var(--muted); }
.news-title { font-size: 17px; font-weight: 600; color: var(--ink); }
.news-body { font-size: 14px; color: var(--muted); }
.news-social { display: flex; align-items: center; gap: 18px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.news-social span { display: inline-flex; align-items: center; gap: 6px; }

/* Events */
.event-row { display: flex; gap: 14px; align-items: center; }
.date-block {
  width: 46px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-align: center;
}
.date-block .m {
  background: var(--sir-blue);
  color: var(--white);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 3px 0;
  text-transform: uppercase;
}
.date-block .d { font-size: 17px; font-weight: 600; color: var(--ink); padding: 4px 0; }
.event-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.event-where { font-size: 12px; color: var(--muted); }

/* Leaderboard — ranks styled like the Ops Console board: a crowned medallion for 1,
   ribboned medallions for 2 & 3, plain numbers below that. */
.lb-row { display: flex; flex-direction: column; gap: 5px; }
/* Fixed columns (rank | name | office | calls) keep every row's office starting at the same
   x and every row the same height, medallion or not. */
.lb-line { display: grid; grid-template-columns: 22px minmax(0, 1fr) 92px 34px; gap: 8px; align-items: center; min-height: 22px; font-size: 13px; }
.lb-rank { font-weight: 700; font-size: 12px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.lb-medal { position: relative; z-index: 0; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex: 0 0 auto; }
.lb-medal svg { position: absolute; left: 50%; transform: translateX(-50%); }
.lb-medal-num { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.lb-medal-1 .lb-medal-num { background: var(--sir-blue); color: var(--white); }
.lb-medal-1 svg { top: -7px; color: var(--gold); }                 /* the crown */
.lb-medal-2 svg, .lb-medal-3 svg { top: 8px; }                     /* ribbon tails drop just below */
.lb-medal-2 .lb-medal-num { background: var(--sir-blue-5); color: var(--sir-blue); }
.lb-medal-2 svg { color: var(--sir-blue-4); }
/* Third place wears tints of --gold (#c29b40): light wash, deeper numeral, soft ribbon. */
.lb-medal-3 .lb-medal-num { background: #f4edda; color: #8f733a; }
.lb-medal-3 svg { color: #dcc794; }
.lb-name { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-office { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-count { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; }
.lb-track { height: 4px; background: var(--border); border-radius: 999px; }
.lb-bar { height: 4px; border-radius: 999px; background: var(--sir-blue); }

/* Tool tiles */
.tool-tile {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
}
a.tool-tile:hover { box-shadow: var(--shadow-card); color: var(--ink); }
.tool-tile.is-overflow { border: 1px dashed var(--border-dash); }
.tool-mono {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--sir-blue);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 17px;
}
.tool-mono.is-soft { background: var(--bg-grey); color: var(--sir-blue); }
/* White chip holding a tool's official brand icon (their own colours read
   correctly on white). Sits alongside the blue lettermark chips. */
.tool-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--white);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.tool-logo img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  display: block;
}
.tool-name { font-size: 14px; font-weight: 600; }
.tool-desc { font-size: 12px; color: var(--muted); }

/* All-tools directory page */
.tools-search-box { max-width: 440px; }
.tool-group { margin-top: 34px; }
.tool-group:first-of-type { margin-top: 4px; }
.tool-group-title {
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--sir-blue);
  margin: 0 0 16px;
}
.tools-directory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
/* [hidden] must beat the tiles' own display so search can hide them. */
.tool-tile[hidden], .tool-group[hidden] { display: none !important; }
@media (max-width: 900px) {
  .tools-directory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .tools-directory-grid { grid-template-columns: minmax(0, 1fr); }
}
.tool-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }

/* Library tiles */
.file-tile {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 148px;
  color: var(--ink);
}
a.file-tile:hover { border-color: var(--sir-blue-3); color: var(--ink); }
.file-icon {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  background: var(--sir-blue);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
}
.file-name { font-size: 16px; font-weight: 600; }
.file-desc { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.file-open {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--sir-blue);
}

/* People */
.person-row {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
}
.person-avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--sir-blue-tint);
  color: var(--sir-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}
.person-text { display: flex; flex-direction: column; gap: 1px; flex: 1 1 0; min-width: 0; }
.person-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.person-role { font-size: 12px; color: var(--muted); }
.person-links { display: flex; gap: 10px; color: var(--sir-blue); }
.empty-note { font-size: 13px; color: var(--muted); padding: 8px 2px; }

.notable-card {
  background: var(--sir-blue-tint);
  border-radius: var(--radius);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.notable-kind {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sir-blue);
}
.notable-title { font-size: 16px; font-weight: 600; color: var(--ink); }
.notable-body { font-size: 13px; color: var(--muted); }

/* Footer lockup */
.footer-lockup { display: flex; align-items: baseline; gap: 14px; color: var(--white); }
.lockup-region { font-size: 15px; font-weight: 300; letter-spacing: 0.02em; }
.lockup-pipe { color: var(--sir-blue-3); }
.lockup-name { font-family: var(--font-serif); font-size: 19px; }
.lockup-sub { font-size: 10px; letter-spacing: 0.22em; color: var(--sir-blue-4); }
.footer-tagline { font-family: var(--font-serif); font-style: italic; font-size: 16px; color: var(--sir-blue-4); }
.footer-link-set { display: flex; flex-wrap: wrap; gap: 28px; font-size: 12px; }
.footer-link-set a, .footer-link-set span { color: var(--sir-blue-4); }
.footer-link-set a:hover { color: var(--white); }

/* ---------------------------------------------------------------------
   My files page
   Scannable over decorative: shortcuts first, then one card per library
   with its folders as quiet rows. Hover is the only colour that moves.
   --------------------------------------------------------------------- */
.files-search-box { max-width: 520px; }
.files-search-box input::placeholder { color: var(--muted); }

#frequent-section, #library-section { margin-top: 34px; }
#frequent-section[hidden], .lib-card[hidden], .folder-row[hidden] { display: none !important; }

/* Frequently used shortcuts */
.frequent-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.freq-tile {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px 18px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.freq-tile:hover {
  color: var(--ink);
  border-color: var(--sir-blue-3);
  box-shadow: var(--shadow-card);
}
.freq-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: var(--radius-sm);
  background: var(--sir-blue);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
}
.freq-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.freq-label { font-size: 14px; font-weight: 600; }
.freq-lib { font-size: 11.5px; color: var(--muted); }

/* One card per library */
.lib-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px 8px;
  margin-bottom: 16px;
}
.lib-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--bg-grey);
}
.lib-heading { min-width: 0; }
.lib-name {
  font-family: var(--font-serif);
  font-size: 21px;
  color: var(--sir-blue);
  margin: 0;
}
.lib-desc { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.lib-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sir-blue);
}
.lib-note { margin: 14px 0 16px; font-size: 13px; color: var(--muted); }

/* Folders — two columns of quiet rows, so a long library stays scannable */
.folder-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 20px;
  padding: 10px 0 14px;
}
.folder-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 14px;
  transition: background 0.12s ease;
}
.folder-row:hover { background: var(--sir-blue-tint); color: var(--sir-blue); }
.folder-icon {
  flex: 0 0 auto;
  color: var(--sir-blue-3);
  display: flex;
  align-items: center;
}
.folder-row:hover .folder-icon { color: var(--sir-blue); }
.folder-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1100px) {
  .frequent-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .frequent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .folder-list { grid-template-columns: minmax(0, 1fr); }
  .lib-head { flex-direction: column; align-items: flex-start; gap: 8px; }
}
@media (max-width: 520px) {
  .frequent-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------------------------------------------------------------
   Announcements page
   One chronological feed in a narrow, readable column (news reads badly
   at 1440px). Featured items keep their image; everything else is quiet.
   --------------------------------------------------------------------- */
.ann-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
  max-width: 820px;
  margin: 0 auto 8px;
  width: 100%;
}
/* Search on its own row, tabs beneath it: the readable column is 820px and
   a search box plus the full set of category tabs will not share a line. */
.ann-search-box { flex: 1 1 100%; }
.ann-chips { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 auto; }
.ann-chip {
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.ann-chip:hover { border-color: var(--sir-blue-3); color: var(--sir-blue); }
.ann-chip.is-active {
  background: var(--sir-blue);
  border-color: var(--sir-blue);
  color: var(--white);
}
.ann-chip:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.ann-count {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
  white-space: nowrap;
}

.ann-feed {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
}

.ann-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.ann-body { padding: 22px 26px; display: flex; flex-direction: column; gap: 9px; }
.ann-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ann-when { font-size: 12px; color: var(--muted); }

/* Author-only delete, on the right of the meta row. Sits above the card's
   click overlay (.ann-open::after), the same way the reaction bar does, so
   pressing Delete deletes rather than opening the reader. */
.ann-manage {
  position: relative;
  z-index: 1;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ann-delete {
  font: inherit;
  font-size: 12px;
  color: var(--muted);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.ann-delete:hover { color: #A3282D; }
.ann-delete:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.ann-delete[disabled] { opacity: 0.5; cursor: default; }
.ann-delete.is-armed { color: #A3282D; font-weight: 600; }
.ann-delete-error { font-size: 12px; color: #A3282D; }
.ann-title {
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1.3;
  color: var(--sir-blue);
  margin: 0;
}
.ann-text {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text);
}
.ann-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sir-blue);
}

/* Featured: the image band, same treatment as the home page slot */
.ann-card.is-featured { border-color: var(--sir-blue-4); }
.ann-media {
  position: relative;
  height: 240px;
  background: linear-gradient(160deg, var(--sir-blue-3) 0%, var(--sir-blue-2) 45%, var(--sir-blue-dark) 100%);
  background-size: cover;
  background-position: center;
}
.ann-media-tag {
  position: absolute;
  top: 18px;
  left: 18px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
  background: rgba(0, 19, 41, 0.55);
  padding: 6px 12px;
  border-radius: 4px;
}
.ann-card.is-featured .ann-title { font-size: 25px; }

#ann-empty { max-width: 820px; margin: 0 auto; }

@media (max-width: 700px) {
  .ann-count { margin-left: 0; }
  .ann-media { height: 180px; }
  .ann-body { padding: 20px; }
  .ann-title { font-size: 20px; }
  .ann-card.is-featured .ann-title { font-size: 21px; }
}

/* Featured with no image: the tag sits inline instead of on a photo band. */
.ann-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--sir-blue);
  padding: 5px 11px;
  border-radius: 4px;
}

/* Archive: everything past the tenth item on the current tab. Present but
   quiet — it should read as "there is more here", not as a second feed. */
.ann-archive {
  max-width: 820px;
  width: 100%;
  margin: 18px auto 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.ann-archive-toggle {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--sir-blue);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 18px;
  align-self: center;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.ann-archive-toggle:hover { border-color: var(--sir-blue-3); background: var(--white); }
.ann-archive-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.ann-archive-feed .ann-card { background: transparent; }
.ann-archive-feed .ann-title { font-size: 19px; }
.ann-archive-feed .ann-card.is-featured .ann-title { font-size: 19px; }

/* Shared modal shell (js/modal.js): the announcement reader and the
   composer both sit in this. Only what every modal needs — each one styles
   its own contents. */
body.is-modal { overflow: hidden; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 19, 41, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}
.modal-panel {
  background: var(--white);
  border-radius: 6px;
  width: 100%;
  max-width: 620px;
  box-shadow: 0 24px 60px rgba(0, 19, 41, 0.32);
}
.modal-panel:focus { outline: none; }
.cmp-panel { padding: 30px 32px 26px; }

/* The announcement reader. */
.rd-panel { overflow: hidden; }
.rd-media {
  height: 260px;
  background: linear-gradient(160deg, var(--sir-blue-3) 0%, var(--sir-blue-2) 45%, var(--sir-blue-dark) 100%);
  background-size: cover;
  background-position: center;
}
.rd-body { padding: 28px 32px 24px; display: flex; flex-direction: column; gap: 14px; }
.rd-title {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink);
  margin: 0;
}
/* pre-wrap keeps the author's own line breaks without any of their text
   being treated as markup. */
.rd-text {
  font-size: 15px;
  line-height: 1.68;
  color: var(--text);
  margin: 0;
  white-space: pre-wrap;
}
.rd-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
/* The sign-in pop-up (js/popup.js) is the reader with one line above the
   headline saying why it opened. */
.rd-eyebrow {
  margin: 0 0 -4px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

/* The headline is the control that opens the reader; its ::after covers
   the card, so the whole card is clickable but there is still one thing to
   tab to and its name is the headline. */
.ann-card { position: relative; }
.ann-open {
  font: inherit;
  font-family: var(--font-serif);
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  text-align: left;
  cursor: pointer;
}
.ann-open::after { content: ''; position: absolute; inset: 0; border-radius: 5px; }
.ann-card:hover { border-color: var(--sir-blue-3); }
.ann-card:hover .ann-open { color: var(--sir-blue); }
.ann-open:focus-visible { outline: none; }
.ann-open:focus-visible::after { outline: 2px solid var(--gold); outline-offset: 2px; }

@media (max-width: 700px) {
  .modal-backdrop { padding: 16px 12px; }
  .rd-media { height: 180px; }
  .rd-body { padding: 22px 20px 20px; }
  .rd-title { font-size: 21px; }
}

/* Favourite tools — the star beside a tile, and the cell holding both.
   The tile stays a plain link; the star is a sibling button placed over
   its top-right corner, so a click on the star never opens the tool. */
.tool-cell { position: relative; min-width: 0; }
.tool-cell > .tool-tile { height: 100%; box-sizing: border-box; padding-right: 46px; }
.tool-star {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--sir-blue-4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.tool-star svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.tool-star:hover, .tool-star:focus-visible { background: var(--sir-blue-tint); color: var(--sir-blue); }
.tool-star:focus-visible { outline: 2px solid var(--sir-blue-3); outline-offset: 1px; }
.tool-star.is-on { color: var(--gold); }
.tool-star.is-on svg { fill: currentColor; }
.tool-star:disabled { cursor: default; opacity: 0.5; }
/* Until the person's list has loaded a star cannot be trusted either way. */
.tool-star.is-pending { opacity: 0.35; pointer-events: none; }
.tool-cell[hidden] { display: none !important; }
.tools-hint { margin: 10px 0 18px; }

/* Toast — one short status message at the foot of the page */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 1000;
  max-width: min(92vw, 480px);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: var(--sir-blue);
  color: var(--white);
  font-size: 14px;
  line-height: 1.4;
  box-shadow: var(--shadow-card);
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.toast.is-in { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { border-left: 3px solid var(--gold); }
.toast[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
}
