/* BNSD Landing Hub
   District navy + gold, signage type (Bahnschrift ships with Windows 10/11),
   plain bordered surfaces. No gradients, no glass, no entrance animations. */

:root {
  --navy: #1b2e4b;
  --navy-deep: #132239;
  --gold: #d9a22b;

  --page: #eef0f3;
  --surface: #ffffff;
  --surface-hover: #f5f7fa;
  --line: #d6dbe2;
  --line-soft: #e6e9ee;

  --ink: #1d2430;
  --ink-2: #485365;
  --ink-3: #687284;
  --link: #1f5fad;
  --chip: #e9edf3;

  --ok: #2b7a4b;
  --degraded: #a86400;
  --outage: #b42318;
  --maint: #4f5bb5;

  --info-bg: #e7effa;   --info-line: #a9c3e8;   --info-ink: #173a68;   --info-icon: #2a63b0;
  --warn-bg: #fcf1d7;   --warn-line: #e3c06a;   --warn-ink: #4d3500;   --warn-icon: #a86d00;
  --urgent-bg: #fbe7e5; --urgent-line: #e4a39b; --urgent-ink: #6d1410; --urgent-icon: #b42318;

  --f-head: Bahnschrift, "DIN Alternate", "DIN 2014", "Segoe UI", system-ui, sans-serif;
  --f-body: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --r: 6px;
  --focus: 0 0 0 3px rgba(31, 95, 173, .35);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --navy: #142440; --navy-deep: #0d1a2f;
  --page: #0f151e; --surface: #161e2a; --surface-hover: #1c2634;
  --line: #2a3546; --line-soft: #222c3a;
  --ink: #e4e8ef; --ink-2: #b3bccb; --ink-3: #8e99ab;
  --link: #8db6f2; --chip: #222d3d;
  --ok: #5cc28a; --degraded: #e5a64a; --outage: #f07a6e; --maint: #9aa4f0;
  --info-bg: #15253d;   --info-line: #2f4f7d;   --info-ink: #d3e3fb;   --info-icon: #8db6f2;
  --warn-bg: #2e2410;   --warn-line: #6d5418;   --warn-ink: #f6e2b3;   --warn-icon: #e8b54a;
  --urgent-bg: #351816; --urgent-line: #78322c; --urgent-ink: #fbd4cf; --urgent-icon: #f07a6e;
  --focus: 0 0 0 3px rgba(141, 182, 242, .45);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --navy: #142440; --navy-deep: #0d1a2f;
    --page: #0f151e; --surface: #161e2a; --surface-hover: #1c2634;
    --line: #2a3546; --line-soft: #222c3a;
    --ink: #e4e8ef; --ink-2: #b3bccb; --ink-3: #8e99ab;
    --link: #8db6f2; --chip: #222d3d;
    --ok: #5cc28a; --degraded: #e5a64a; --outage: #f07a6e; --maint: #9aa4f0;
    --info-bg: #15253d;   --info-line: #2f4f7d;   --info-ink: #d3e3fb;   --info-icon: #8db6f2;
    --warn-bg: #2e2410;   --warn-line: #6d5418;   --warn-ink: #f6e2b3;   --warn-icon: #e8b54a;
    --urgent-bg: #351816; --urgent-line: #78322c; --urgent-ink: #fbd4cf; --urgent-icon: #f07a6e;
    --focus: 0 0 0 3px rgba(141, 182, 242, .45);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--page); color: var(--ink);
  font: 15px/1.5 var(--f-body); -webkit-font-smoothing: antialiased;
}
a { color: var(--link); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.wrap { width: min(1160px, 100% - 48px); margin-inline: auto; }

.skip { position: fixed; left: 12px; top: -48px; z-index: 50; padding: 8px 14px; background: var(--gold); color: #1b1300; font-weight: 600; border-radius: 4px; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- Masthead ---------- */
.masthead { background: var(--navy); color: #fff; border-bottom: 4px solid var(--gold); }
.masthead-row { display: flex; align-items: center; gap: 28px; min-height: 76px; padding-block: 14px; }

.wordmark { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; margin-right: auto; }
.mark {
  position: relative; display: grid; place-items: center; width: 44px; height: 44px; flex: none;
  background: #fff; color: var(--navy); border-radius: 4px; overflow: hidden;
  font: 700 13px/1 var(--f-head); letter-spacing: .02em;
}
.mark img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 6px; background: #fff; }
.wordmark-text { display: flex; flex-direction: column; }
.site-title { font: 600 22px/1.1 var(--f-head); letter-spacing: .005em; }
.site-sub { margin-top: 4px; font-size: 13.5px; color: #b8c4d8; }
.site-sub:empty { display: none; }

.search { position: relative; width: min(380px, 100%); }
.search .ico { position: absolute; left: 12px; top: 50%; translate: 0 -50%; color: #6a7486; pointer-events: none; width: 18px; height: 18px; }
.search input {
  width: 100%; height: 42px; padding: 0 42px 0 38px;
  border: 1px solid transparent; border-radius: 4px; background: #fff; color: #1d2430;
  font: inherit; font-size: 15px;
}
.search input::placeholder { color: #6a7486; }
.search input::-webkit-search-cancel-button { display: none; }
.search input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217, 162, 43, .45); }
.search kbd {
  position: absolute; right: 10px; top: 50%; translate: 0 -50%;
  min-width: 22px; padding: 1px 6px; border: 1px solid #c9cfd9; border-radius: 3px;
  color: #687284; background: #f4f6f9; font: 600 12px/1.4 var(--f-body); text-align: center; pointer-events: none;
}
.search input:focus + kbd, .search input:not(:placeholder-shown) + kbd { display: none; }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border: 1px solid rgba(255, 255, 255, .22); border-radius: 4px; background: transparent; color: #dfe6f1; cursor: pointer;
}
.icon-btn:hover { background: rgba(255, 255, 255, .1); }

/* ---------- Announcements ---------- */
.alert { border-bottom: 1px solid var(--a-line); background: var(--a-bg); color: var(--a-ink); }
.alert.info    { --a-bg: var(--info-bg);   --a-line: var(--info-line);   --a-ink: var(--info-ink);   --a-icon: var(--info-icon); }
.alert.warning { --a-bg: var(--warn-bg);   --a-line: var(--warn-line);   --a-ink: var(--warn-ink);   --a-icon: var(--warn-icon); }
.alert.urgent  { --a-bg: var(--urgent-bg); --a-line: var(--urgent-line); --a-ink: var(--urgent-ink); --a-icon: var(--urgent-icon); }
.alert-row { display: flex; gap: 12px; align-items: flex-start; padding-block: 12px; }
.alert-row > .ico { color: var(--a-icon); margin-top: 1px; stroke-width: 2; }
.alert-text { flex: 1; min-width: 0; font-size: 14.5px; }
.alert-text > strong { font-weight: 650; margin-right: 8px; }
.alert-text a { color: inherit; font-weight: 600; text-underline-offset: 2px; }
.alert-text p { display: inline; margin: 0; }
.alert-text ul, .alert-text h3 { display: none; }
.alert-close { display: inline-grid; place-items: center; width: 28px; height: 28px; margin: -3px -6px 0 0; border: 0; border-radius: 4px; background: transparent; color: inherit; cursor: pointer; opacity: .75; }
.alert-close:hover { opacity: 1; background: rgba(0, 0, 0, .06); }
.alert-close .ico { width: 16px; height: 16px; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 40px; align-items: start; padding-block: 32px 48px; flex: 1; }
.apps:focus { outline: none; }

.block-head {
  margin: 0 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--navy);
  font: 600 19px/1.2 var(--f-head); color: var(--ink); letter-spacing: .005em;
}
:root[data-theme="dark"] .block-head { border-bottom-color: #3c5683; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .block-head { border-bottom-color: #3c5683; } }

/* ---------- Application sections ---------- */
.category + .category { margin-top: 34px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }

.tile {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; align-items: start; height: 100%;
  padding: 14px 16px 14px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  color: var(--ink); text-decoration: none;
}
.tile:hover { border-color: var(--navy); background: var(--surface-hover); box-shadow: inset 3px 0 0 var(--gold); }
.tile:hover .tile-title { text-decoration: underline; text-underline-offset: 3px; }
.tile-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 4px; background: var(--chip); color: var(--navy); }
:root[data-theme="dark"] .tile-icon { color: #c3d4f0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tile-icon { color: #c3d4f0; } }
.tile-body { min-width: 0; }
.tile-title { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 15.5px; line-height: 1.3; color: var(--link); }
.tile-title .ico { width: 14px; height: 14px; color: var(--ink-3); stroke-width: 2; }
.tile-desc { display: block; margin-top: 3px; font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.tile-host { display: block; margin-top: 6px; font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.no-results { margin: 0; padding: 28px 20px; border: 1px dashed var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink-2); }
.no-results button { padding: 0; border: 0; background: none; color: var(--link); font: inherit; text-decoration: underline; cursor: pointer; }

/* ---------- Right rail ---------- */
.rail { display: flex; flex-direction: column; gap: 32px; }

.status-summary { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-weight: 600; font-size: 14.5px; }
.status-summary.ok { color: var(--ok); }
.status-summary.issue { color: var(--degraded); }
.status-summary.down { color: var(--outage); }
.status-list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.status-list li { padding: 10px 14px; }
.status-list li + li { border-top: 1px solid var(--line-soft); }
.status-row { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.status-name { flex: 1; min-width: 0; color: var(--ink); text-decoration: none; }
a.status-name:hover { text-decoration: underline; }
.status-state { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.status-note { margin: 4px 0 0 18px; font-size: 13px; color: var(--ink-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ok); }
.dot.degraded { background: var(--degraded); }
.dot.outage { background: var(--outage); }
.dot.maintenance { background: var(--maint); }
li.not-ok .status-state { font-weight: 600; }
li.not-ok.degraded .status-state { color: var(--degraded); }
li.not-ok.outage .status-state { color: var(--outage); }
li.not-ok.maintenance .status-state { color: var(--maint); }

.news-list { margin: 0; padding: 0; list-style: none; }
.news-list li + li { border-top: 1px solid var(--line); }
.news-item {
  display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 14px; width: 100%;
  padding: 14px 4px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.news-list li:first-child .news-item { padding-top: 4px; }
.news-item:hover .news-title { text-decoration: underline; text-underline-offset: 3px; }
.cal {
  display: flex; flex-direction: column; align-items: center; width: 46px; overflow: hidden;
  border: 1px solid var(--line); border-radius: 4px; background: var(--surface); line-height: 1;
}
.cal-m { width: 100%; padding: 3px 0; background: var(--navy); color: #fff; font: 600 11px/1.2 var(--f-head); text-align: center; }
.cal-d { padding: 5px 0 6px; font: 600 20px/1 var(--f-head); color: var(--ink); }
.news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12.5px; color: var(--ink-3); }
.news-meta .pinned { display: inline-flex; align-items: center; gap: 3px; color: var(--ink-2); font-weight: 600; }
.news-meta .pinned .ico { width: 13px; height: 13px; }
.news-title { display: block; margin-top: 2px; font-weight: 600; font-size: 15px; line-height: 1.35; color: var(--link); }
.news-summary { display: block; margin-top: 3px; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.text-btn { margin-top: 6px; padding: 6px 0; border: 0; background: none; color: var(--link); font: 600 14px var(--f-body); cursor: pointer; }
.text-btn:hover { text-decoration: underline; }

/* ---------- Reader dialog ---------- */
.reader {
  width: min(640px, calc(100% - 32px)); max-height: min(80vh, 760px); padding: 0;
  border: 1px solid var(--line); border-top: 4px solid var(--navy); border-radius: var(--r);
  background: var(--surface); color: var(--ink); box-shadow: 0 20px 50px rgba(10, 20, 40, .28);
}
.reader::backdrop { background: rgba(15, 25, 45, .5); }
.reader article { padding: 24px 28px 28px; }
.reader-head { position: relative; padding-right: 44px; margin-bottom: 14px; }
.reader-meta { margin: 0 0 6px; font-size: 13px; color: var(--ink-3); }
.reader h2 { margin: 0; font: 600 24px/1.2 var(--f-head); }
.reader-close { position: absolute; right: -8px; top: -8px; color: var(--ink-2); border-color: var(--line); }
.reader-close:hover { background: var(--surface-hover); }
.prose { font-size: 15.5px; line-height: 1.6; max-width: 66ch; }
.prose p, .prose ul { margin: 0 0 12px; }
.prose ul { padding-left: 20px; }
.prose li + li { margin-top: 4px; }
.prose h3 { margin: 18px 0 6px; font: 600 17px/1.3 var(--f-head); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 18px; font-size: 13.5px; color: var(--ink-2); }
.footer-row p { margin: 0; }
.admin-link { color: var(--ink-3); text-decoration: none; white-space: nowrap; }
.admin-link:hover { color: var(--link); text-decoration: underline; }

/* ---------- Small screens ---------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; gap: 36px; }
}
@media (max-width: 720px) {
  .wrap { width: calc(100% - 32px); }
  .masthead-row { flex-wrap: wrap; gap: 14px; min-height: 0; }
  .search { order: 3; width: 100%; }
  .search input { font-size: 16px; }
  .search kbd { display: none; }
  .site-title { font-size: 19px; }
  .tiles { grid-template-columns: 1fr; }
  .layout { padding-block: 24px 36px; }
  .footer-row { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
