/* JDL Tech Portal. Palette, type and shapes follow /style.md. */
@font-face { font-family: 'Zekton'; src: local('Zekton'), local('Zekton Rg'), local('ZektonRg-Regular'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Zekton'; src: local('Zekton Bold'), local('Zekton Rg Bold'), local('ZektonRg-Bold'); font-weight: 700; font-display: swap; }

:root {
  --bg: #09171f;
  --raised: #0d1f29;
  --surface: #0f222d;
  --surface-2: #132a36;
  --slate: #3e4e5a;
  --border: rgb(62 78 90 / 0.75);
  --border-strong: #56697a;
  --text: #f1ede7;
  --muted: #a3b0b9;
  --accent: #cea17a;
  --accent-hover: #dcb592;
  --danger: #e48c7c;
  --ok: #8fc2a3;
  --font: 'Zekton', 'Exo 2', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --radius: 12px;
  --radius-sm: 8px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 100px; }
body { display: flow-root; margin: 0; min-height: 100svh; background: var(--bg); color: var(--text); font: 400 1rem/1.6 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; overflow-wrap: anywhere; }
h2 { font-size: 1.15rem; }
p { margin: 0; overflow-wrap: anywhere; }
ul { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
small { display: block; color: var(--muted); font-size: 0.85rem; overflow-wrap: anywhere; }
code { font-family: var(--mono); font-size: 0.88em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--bg); }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap !important; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 100; padding: 10px 16px; background: var(--accent); color: var(--bg); border-radius: var(--radius-sm); transform: translateY(-300%); }
.skip-link:focus { transform: none; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.nowrap { white-space: nowrap; }
.accent { color: var(--accent); }
.stack { display: grid; gap: 16px; }
.stack > * { min-width: 0; }
.empty { text-align: center; padding: 32px; }

/* Layout */
.container { width: min(1120px, 100% - 32px); margin: 32px auto 64px; }
.main-wide { width: min(1480px, 100% - 32px); margin: 20px auto 48px; }
.main-public { display: grid; place-items: center; min-height: 100svh; padding: 16px; }
.page-title { font-size: clamp(1.5rem, 3vw, 2rem); }
.section-title { margin: 32px 0 12px; }
.title-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.title-row .page-title { min-width: 0; flex: 1 1 260px; }
.grid-2, .grid-3 { display: grid; gap: 16px; margin-top: 20px; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.grid-2 > *, .grid-3 > * { min-width: 0; align-content: start; }

/* Navbar */
.navbar { position: sticky; top: 12px; z-index: 30; display: flex; align-items: center; gap: 20px; width: min(1480px, 100% - 32px); margin: 12px auto 0; padding: 10px 14px 10px 18px; background: var(--raised); border: 1px solid var(--border); border-radius: 16px; }
.brand { flex: none; }
.nav-links { display: flex; gap: 4px; flex: 1; min-width: 0; }
.nav-links a { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 500; }
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current] { color: var(--text); background: var(--surface-2); }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; border-radius: 999px; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 10px); z-index: 40; width: 250px; padding: 8px; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: 0 16px 40px rgb(0 0 0 / 0.45); }
.menu-panel a, .menu-panel form > button:not(.btn) { display: block; width: 100%; padding: 9px 12px; border: 0; border-radius: var(--radius-sm); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.menu-panel a:hover, .menu-panel form > button:not(.btn):hover { background: var(--surface); color: var(--text); }
.menu-panel .danger { color: var(--danger) !important; }
.menu-name { padding: 8px 12px 10px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.menu-links { display: none; }
.menu-form { display: flex; gap: 6px; padding: 4px 4px 8px; }
.menu-form input { min-width: 0; flex: 1; }
@media (max-width: 860px) { .navbar { justify-content: space-between; } .nav-links { display: none; } .menu-links { display: block; border-bottom: 1px solid var(--border); margin-bottom: 6px; padding-bottom: 6px; } }

/* Components */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
a.card { transition: border-color 0.2s, background 0.2s; }
a.card:hover { color: var(--text); border-color: var(--accent); background: var(--surface-2); }
.card-flush { padding: 0; margin-top: 16px; }
.narrow { width: min(560px, 100%); margin: 8vh auto 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 8px 20px; border: 1px solid var(--accent); border-radius: 999px; background: var(--accent); color: var(--bg); font: 600 0.95rem/1.2 var(--font); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--bg); }
.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { background: var(--surface-2); border-color: var(--accent); color: var(--text); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-small { min-height: 36px; padding: 6px 14px; font-size: 0.88rem; }
.btn-block { width: 100%; }
.link-btn { padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 0.85rem; text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: var(--danger); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pager { justify-content: center; margin-top: 24px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--accent); color: var(--bg); font-size: 0.75rem; font-weight: 600; line-height: 1.4; }
.pill { display: inline-block; padding: 2px 10px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.pill-warn { color: var(--danger); border-color: var(--danger); }
.notice { margin: 12px 0; padding: 12px 16px; border: 1px solid var(--accent); border-radius: var(--radius-sm); background: rgb(206 161 122 / 0.08); }
.notice a { text-decoration: underline; }
.notice-danger { border-color: var(--danger); background: rgb(228 140 124 / 0.08); }
.flash { position: fixed; left: 50%; bottom: 24px; z-index: 60; display: flex; align-items: center; gap: 14px; width: max-content; max-width: calc(100% - 32px); padding: 12px 18px; transform: translateX(-50%); background: var(--surface-2); border: 1px solid var(--accent); border-radius: var(--radius); box-shadow: 0 16px 40px rgb(0 0 0 / 0.45); }
.flash-warn { bottom: 90px; border-color: var(--danger); }
.flash a { text-decoration: underline; }
.flash button { border: 0; background: none; color: var(--muted); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.avatar { position: relative; display: inline-grid; place-items: center; flex: none; width: 38px; height: 38px; overflow: hidden; border-radius: 50%; background: var(--slate); color: var(--text); font-size: 0.85rem; font-weight: 600; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
/* A photo with transparent parts must not show the initials behind it. */
.avatar.has-photo > span { visibility: hidden; }
.avatar-lg { width: 76px; height: 76px; font-size: 1.5rem; }
.person, .profile { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person > div, .profile > div { min-width: 0; }
.crumbs { margin: 4px 0 10px; color: var(--muted); font-size: 0.88rem; }
.crumbs a:hover { text-decoration: underline; }
.tabs { scrollbar-width: thin; display: flex; gap: 4px; margin: 16px 0 20px; overflow-x: auto; border-bottom: 1px solid var(--border); }
.tabs a { padding: 10px 14px; color: var(--muted); white-space: nowrap; border-bottom: 2px solid transparent; }
.tabs a[aria-current] { color: var(--text); border-color: var(--accent); }
.dialog { width: min(440px, calc(100% - 32px)); padding: 24px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface-2); color: var(--text); }
.dialog::backdrop { background: rgb(4 11 15 / 0.7); }
.dialog p { margin-bottom: 20px; font-size: 1.05rem; }
.dialog .actions { justify-content: flex-end; }

/* Forms */
input:not([type='checkbox']), select, textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font: inherit; }
textarea { resize: vertical; }
::placeholder { color: var(--muted); opacity: 0.8; }
.field { display: grid; gap: 6px; font-size: 0.9rem; color: var(--muted); }
.form-row { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.form-row .field { flex: 1 1 190px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inline-form select { width: auto; }
.check { display: inline-flex; align-items: flex-start; gap: 8px; cursor: pointer; }
input[type='checkbox'] { flex: none; width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--accent); }
.search-box { position: relative; display: block; }
.search-box .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box input { padding-left: 44px; border-radius: 999px; }
.switch { width: 58px; height: 32px; padding: 3px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--bg); cursor: pointer; }
.switch span { display: block; width: 24px; height: 24px; border-radius: 50%; background: var(--slate); transition: transform 0.2s; }
.switch[aria-checked='true'] { background: var(--accent); border-color: var(--accent); }
.switch[aria-checked='true'] span { background: var(--bg); transform: translateX(26px); }

/* Tables and lists */
.table-wrap { max-width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { padding: 12px 16px; background: var(--surface-2); color: var(--muted); font-weight: 500; font-size: 0.85rem; text-align: left; }
.table td { padding: 12px 16px; border-top: 1px solid var(--border); vertical-align: middle; }
.table-dense td { padding: 8px 16px; font-size: 0.88rem; }
.table tr.is-off td { opacity: 0.6; }
.table a:hover { text-decoration: underline; }
.table a.btn:hover { text-decoration: none; }
.cell-actions { text-align: right; white-space: nowrap; }
.table td.depth-1 { padding-left: 40px; }
.table td.depth-2 { padding-left: 64px; }
.card-list { display: grid; gap: 10px; }
.card-list > li { min-width: 0; }
.row-card { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px 18px; }
.row-card > div:not(.row-end) { flex: 1 1 220px; min-width: 0; }
.row-end { margin-left: auto; text-align: right; }
.people li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.people li:first-child { border-top: 0; }
.people select { width: auto; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 20px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.link-list li + li { border-top: 1px solid var(--border); }
.link-list a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.link-list strong { font-weight: 500; }

/* Portal */
.login { display: grid; justify-items: center; gap: 18px; width: min(420px, 100%); padding: 44px 32px; text-align: center; }
.login .notice { width: 100%; margin: 0; }
.hero { display: grid; gap: 22px; padding: 28px 0 32px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); }
.hero .search-box { max-width: 560px; }
.hero .search-box input { padding-block: 13px; font-size: 1.05rem; }
.launcher { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 16px; }
.app-card { position: relative; display: grid; gap: 10px; align-content: start; padding: 26px; }
.app-card .badge { position: absolute; top: 22px; right: 22px; }
.app-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: var(--radius); background: var(--surface-2); color: var(--accent); }
.app-icon .icon { width: 28px; height: 28px; }
.setting { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.setting > div { flex: 1 1 300px; }
.stat strong { display: block; font-size: 2rem; line-height: 1.2; color: var(--accent); }

/* Email signatures. The preview is white because mail is. */
.nav-external { display: inline-flex; align-items: center; gap: 6px; }
.nav-external .icon { width: 14px; height: 14px; }
.account-signature { margin-top: 16px; }
.signature { padding: 18px; border-radius: var(--radius-sm); background: #fff; color: #fff; font: 12px/17px Arial, Helvetica, sans-serif; }
.signature-bar { display: flex; align-items: center; gap: 16px; padding: 12px 18px 12px 16px; border-top: 2px solid #cea17a; }
.signature-bar img { flex: none; }
.signature-text { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 16px; flex: 1; min-width: 0; }
.signature-name { font-size: 14px; font-weight: 700; line-height: 18px; }
.signature-burgundy { background: #5c1226 url('signature/burgundy.png'); }
.signature-green { background: #1d4a33 url('signature/green.png'); }
.signature-navy { background: #14284f url('signature/navy.png'); }
.signature-black { background: #141415 url('signature/black.png'); }
.signature-notice { padding: 8px 16px 0; color: #6f808c; font-size: 11px; line-height: 15px; text-align: center; }

/* Archive */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 12px; margin-top: 18px; }
.tile { display: grid; gap: 4px; height: 100%; overflow-wrap: anywhere; }
.content > .empty, .content > .card-list, .page-title + .card-list, .title-row + .tabs { margin-top: 18px; }
.change-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 14px; padding: 10px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); font-size: 0.9rem; }

/* Documents */
.doc { margin-top: 14px; padding: clamp(18px, 3vw, 36px); overflow-wrap: anywhere; }
.stack > .doc { margin-top: 0; }
.doc > * + *, .changed > * + * { margin-top: 10px; }
.doc a { color: var(--accent); text-decoration: underline; }
.doc mark { background: rgb(206 161 122 / 0.35); color: inherit; border-radius: 3px; }
.doc code { padding: 1px 5px; border-radius: 4px; background: var(--bg); }
.doc .b-h1 { font-size: 1.6rem; font-weight: 600; line-height: 1.25; color: var(--text); }
.doc .b-h2 { font-size: 1.3rem; font-weight: 600; line-height: 1.25; color: var(--text); }
.doc .b-h3 { font-size: 1.1rem; font-weight: 600; line-height: 1.3; color: var(--text); }
.b-li { display: flex; gap: 12px; }
.b-li > div { flex: 1; min-width: 0; }
.lvl-1 { margin-left: 26px; } .lvl-2 { margin-left: 52px; } .lvl-3 { margin-left: 78px; } .lvl-4 { margin-left: 104px; }
.b-ul .marker { flex: none; width: 7px; height: 7px; margin-top: 10px; background: var(--accent); border-radius: 1px; }
.b-ol .marker { flex: none; min-width: 22px; color: var(--accent); }
.b-todo .marker { flex: none; width: 18px; height: 18px; margin-top: 4px; border: 1px solid var(--border-strong); border-radius: 4px; }
.b-todo.is-done .marker { background: var(--accent); border-color: var(--accent); }
.b-todo.is-done > div { color: var(--muted); text-decoration: line-through; }
.b-quote { margin: 0; padding-left: 16px; border-left: 3px solid var(--slate); color: var(--muted); }
.b-callout { padding: 14px 18px; border: 1px solid var(--accent); border-radius: var(--radius-sm); background: rgb(206 161 122 / 0.08); }
.b-code { margin: 0; padding: 14px 16px; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); line-height: 1.5; }
.doc .b-code code { padding: 0; background: none; }
.b-hr { width: 100%; margin: 18px 0; border: 0; border-top: 1px solid var(--border-strong); }
.b-table { border-collapse: collapse; min-width: 100%; }
.b-table th, .b-table td { padding: 8px 12px; border: 1px solid var(--border-strong); text-align: left; vertical-align: top; min-width: 90px; }
.b-table th, .eb.b-table:not(.is-plain) tr:first-child td { background: var(--surface-2); font-weight: 600; }
.changed { position: relative; padding: 10px 14px; border-left: 3px solid var(--ok); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: rgb(143 194 163 / 0.09); }
.changed-mod { border-color: var(--accent); background: rgb(206 161 122 / 0.1); }
.changed-label { display: block; font-size: 0.75rem; color: var(--muted); }
.no-highlights .changed { padding: 0; border: 0; background: none; }
.no-highlights .changed-label { display: none; }
.diff { padding: 10px 14px; border-left: 3px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: rgb(206 161 122 / 0.08); }
.diff-new { min-width: 0; }
.diff.diff-new { border-color: var(--ok); background: rgb(143 194 163 / 0.09); }
.diff-removed { border-color: var(--danger); background: rgb(228 140 124 / 0.08); }
.diff-removed > :not(.changed-label), .diff-old { text-decoration: line-through; text-decoration-color: var(--danger); color: var(--muted); }
.diff-moved { border-color: var(--slate); background: var(--surface-2); }
.diff-pair { display: grid; gap: 10px; }
@media (min-width: 760px) { .diff-pair { grid-template-columns: 1fr 1fr; } }
.diff-pair > * { min-width: 0; }
.diff-same { opacity: 0.75; }
del { color: var(--danger); } ins { color: var(--ok); text-decoration: none; }

/* Changelog */
.post-card { display: grid; gap: 10px; }
.post-card.is-unread { border-left: 3px solid var(--accent); }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.post-stats { display: flex; gap: 18px; color: var(--muted); font-size: 0.9rem; }
.post-stats > span { display: inline-flex; align-items: center; gap: 6px; }
.reactions { display: flex; flex-wrap: wrap; gap: 10px; }
.reactions [aria-pressed='true'] { border-color: var(--accent); color: var(--accent); background: rgb(206 161 122 / 0.1); }
.reply { display: grid; gap: 10px; }
.reply-children { display: grid; gap: 16px; margin-left: 18px; padding-left: 18px; border-left: 1px solid var(--border); }
.reply-child { display: grid; gap: 8px; }
.reply-body { overflow-wrap: anywhere; }
.reply-answer summary, .receipts summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; }
.reply-answer form { margin-top: 10px; }
.receipts { margin-top: 24px; }

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