:root { --bg: #000221; --fg: #fff; --ink: #111; --muted: #5b6070; --line: #e3e5ec; --primary: #2254F6; --soft: #f3f5fa; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* hidden always wins over a layout's display */
body { margin: 0; font-family: var(--body-font, Roboto, system-ui, -apple-system, "Segoe UI", Arial, sans-serif); background: var(--page-bg, var(--soft)); background-color: var(--soft); background-attachment: fixed; min-height: 100vh; color: var(--ink); }
.top { background: var(--bar-bg, var(--bg)); color: var(--fg); display: flex; justify-content: space-between; align-items: center; padding: 14px clamp(16px, 4vw, 40px); gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.05rem; min-width: 0; }
.brand img { height: 34px; width: auto; max-width: 160px; object-fit: contain; object-position: left center; flex: none; }   /* (a set height: an SVG logo without a size of its own otherwise leaves no room for the name) */
@media (max-width: 560px) { .brand img:not([hidden]) + #org { display: none; } }   /* (a phone: the logo alone) */
/* (the portal's name on one line, shortened with … when the bar is narrow) */
.brand #org { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.who { display: flex; align-items: center; gap: 12px; font-size: 0.9rem; }
main { max-width: 980px; margin: 0 auto; padding: clamp(16px, 4vw, 40px); }
.card { background: #fff; border-radius: var(--radius-lg, 16px); padding: 24px; box-shadow: var(--card-shadow-on, 0 4px 20px rgba(0, 2, 33, 0.08)); }
.narrow { max-width: 420px; margin: 6vh auto; }
h1 { font-family: var(--head-font, "Roboto Condensed", Roboto, sans-serif); font-weight: var(--head-weight, 700); letter-spacing: var(--head-spacing, normal); margin: 0 0 6px; font-size: 1.9rem; }
.sub { color: var(--muted); margin: 0 0 14px; }
label { display: block; font-weight: 500; margin: 12px 0 4px; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=search] { width: 100%; padding: 11px 12px; border: 1.5px solid #c9ccd6; border-radius: 10px; font: inherit; }
button { font: inherit; cursor: pointer; }
.primary { background: var(--btn-bg, var(--primary)); color: var(--btn-fg, #fff); border: 1.5px solid var(--btn-border, transparent); box-shadow: var(--btn-glow, none); border-radius: var(--pill, 999px); padding: 11px 22px; font-weight: 600; margin-top: 14px; width: 100%; }
.ghost { background: transparent; color: inherit; border: 1.5px solid currentColor; border-radius: var(--pill, 999px); padding: 7px 16px; }
.ghost.wide { width: 100%; margin-top: 10px; color: var(--primary); }
.error { color: #b00020; min-height: 1.2em; margin: 8px 0 0; }
.head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.head input { max-width: 320px; }
.newline { background: #eaf7f2; border-radius: 10px; padding: 10px 14px; font-weight: 500; }
.folder { font-weight: 700; margin: 22px 0 6px; color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; }
.file { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: var(--radius, 12px); padding: 12px 16px; margin: 6px 0; box-shadow: 0 1px 4px rgba(0, 2, 33, 0.06); }
.file .n { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.file small { color: var(--muted); display: block; }
.badge { background: #6AE3C0; color: #000221; border-radius: 999px; font-size: 0.72rem; font-weight: 700; padding: 1px 8px; margin-left: 8px; vertical-align: middle; }
.file a { text-decoration: none; border-radius: var(--pill, 999px); padding: 7px 16px; font-weight: 600; font-size: 0.9rem; white-space: nowrap; }
.file a.dl { background: var(--btn-bg, var(--primary)); color: var(--btn-fg, #fff); border: 1.5px solid var(--btn-border, transparent); } .file a.open { color: var(--primary); border: 1.5px solid var(--primary); }
.empty { color: var(--muted); padding: 30px 0; text-align: center; }

.tools { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.ghost.dark { color: var(--primary); }
.send { margin-top: 36px; background: #fff; border-radius: 16px; padding: 20px 22px; box-shadow: 0 1px 4px rgba(0, 2, 33, 0.06); }
.send h2 { font-family: "Roboto Condensed", Roboto, sans-serif; margin: 0 0 4px; }
.send h3 { margin: 18px 0 6px; font-size: 1rem; }
.drop { display: block; border: 2px dashed #c9ccd6; border-radius: 12px; padding: 22px; text-align: center; cursor: pointer; color: var(--muted); font-weight: 500; }
.drop.over { border-color: var(--primary); color: var(--primary); }
.pbar { height: 8px; background: var(--soft); border-radius: 999px; overflow: hidden; margin-top: 12px; } .pbar div { height: 100%; width: 0; background: var(--primary); transition: width 0.3s; }
.sent { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 0.92rem; }

.terms-text { white-space: pre-wrap; max-height: 50vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin: 12px 0; line-height: 1.5; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }

.pk-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; background: #fff; border: 2px solid var(--primary); border-radius: 14px; padding: 14px 18px; margin: 12px 0; flex-wrap: wrap; }
.pk-card .sub { margin: 4px 0 0; } .pk-acts { display: flex; gap: 8px; } .primary.small, .ghost.small { width: auto; margin: 0; padding: 8px 16px; font-size: 0.9rem; }
.hist { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 0.92rem; }
.hist a { color: var(--primary); font-weight: 600; text-decoration: none; white-space: nowrap; }

.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.viewas-bar { position: sticky; top: 0; z-index: 60; display: flex; justify-content: center; align-items: center; gap: 14px; flex-wrap: wrap; background: #ffcc00; color: #1a1a1a; font-weight: 600; padding: 8px 14px; }
.viewas-bar button { background: #1a1a1a; color: #fff; border: 0; border-radius: 999px; padding: 6px 14px; font: inherit; cursor: pointer; }

.linkish { background: none; border: 0; color: var(--primary); text-decoration: underline; cursor: pointer; font: inherit; margin-top: 12px; padding: 0; }

/* Help: training videos */
.help-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.help-player { margin: 8px 0 18px; } .help-player h2 { font-size: 1.15rem; margin: 0 0 8px; }
.help-player video { width: 100%; aspect-ratio: 1280 / 900; display: block; background: #000; border-radius: 12px; }
#help .file { box-shadow: none; border: 1px solid var(--line); }

/* The files: a card per folder, files as quiet rows (names in regular weight, light buttons) */
.fcard { background: #fff; border-radius: 14px; box-shadow: 0 1px 4px rgba(0, 2, 33, 0.06); margin: 14px 0; overflow: hidden; }
.fhead { display: flex; align-items: baseline; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.fhead h2 { margin: 0; flex: 1; font-size: 1rem; font-weight: 600; font-family: Roboto, system-ui, sans-serif; }
.fcount { color: var(--muted); font-size: 0.85rem; }
.fhead a.zip { color: var(--primary); font-weight: 500; font-size: 0.88rem; text-decoration: none; white-space: nowrap; }
.fhead a.zip:hover, .fcard .file a.open:hover { text-decoration: underline; }
.fcard .file { background: none; box-shadow: none; border-radius: 0; margin: 0; padding: 10px 16px; border-top: 1px solid var(--line); gap: 14px; }
.fcard .fhead + .file { border-top: 0; }
.fcard .file .t { font-weight: 400; }
.fcard .file small { font-size: 0.8rem; margin-top: 1px; }
.fcard .ext { flex: none; min-width: 38px; text-align: center; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.03em; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 3px 5px; }
.fcard .file a { font-weight: 500; font-size: 0.88rem; padding: 5px 4px; }
.fcard .file a.open { color: var(--primary); border: 0; }
.fcard .file a.dl { background: none; color: var(--primary); border: 1.5px solid var(--primary); padding: 5px 14px; }
.fcard .file a.dl:hover { background: var(--primary); color: #fff; }
@media (max-width: 520px) {
  .fcard .file { flex-wrap: wrap; row-gap: 6px; }
  .fcard .file .n { flex: 1 1 calc(100% - 60px); }
  .fcard .file a.open { margin-left: 52px; }
}
/* Your downloads, and files sent: the same quiet rows */
.send h2 { font-family: Roboto, system-ui, sans-serif; font-size: 1rem; font-weight: 600; }
.hist b, .sent span:first-child { font-weight: 400; }
.hist a { font-weight: 500; }

.file .n .snippet { display: block; color: var(--muted, #5b6070); font-style: italic; margin-top: 2px; overflow-wrap: anywhere; }

/* The assistant: a question, the answer, and its sources */
.ask { margin-top: 18px; }
.ask-row { display: flex; gap: 8px; margin-top: 10px; }
.ask-row input { flex: 1; min-width: 0; margin: 0; }
.ask-answer { margin: 14px 0 4px; line-height: 1.55; white-space: pre-wrap; }
.ask-answer.wait { color: var(--muted); font-style: italic; }
.ask-src { margin: 8px 0 0; padding: 0; list-style: none; font-size: 0.9rem; }
.ask-src li { padding: 6px 0; border-top: 1px solid var(--line); }
.ask-src a { color: var(--primary); text-decoration: none; font-weight: 500; }
.ask-src q { display: block; color: var(--muted); font-style: italic; margin-top: 2px; }
.ask-note { font-size: 0.8rem; margin: 10px 0 0; }
/* the language picker, in the top bar */
.who-in { display: flex; align-items: center; gap: 12px; }
.who-in[hidden] { display: none; }
.lang { background: transparent; color: inherit; border: 1px solid rgba(255,255,255,0.35); border-radius: 8px; padding: 4px 6px; font: inherit; font-size: 0.85rem; }
.lang option { color: #000; }
@media (max-width: 560px) { .who { flex-wrap: wrap; justify-content: flex-end; gap: 8px; } #whoName { display: none; } }
/* Talk to us */
.chat-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 10px 0; }
.chat-pick select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff; }
.chat-pick span { display: inline-flex; align-items: center; gap: 8px; }
.chat-msgs { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; padding: 4px 0; }
.chat-msg { max-width: 85%; border-radius: 12px; padding: 8px 12px; background: var(--soft); align-self: flex-start; }
.chat-msg.them { align-self: flex-end; background: color-mix(in srgb, var(--primary) 14%, #fff); }
.chat-msg small { display: block; color: var(--muted); font-size: 0.78rem; }
.chat-msg .tx { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-row { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; }
.chat-row textarea { flex: 1; min-width: 0; resize: vertical; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.chat-away { background: #FFF6DB; border: 1px solid #F0D58A; color: #5C4400; border-radius: 10px; padding: 8px 12px; margin: 6px 0; }
.chat-attach { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; min-width: 44px; min-height: 40px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 1.1rem; }
.chat-file img { display: block; max-width: 220px; max-height: 180px; border-radius: 8px; margin: 4px 0; }
.chat-file a { overflow-wrap: anywhere; }
