/* VAS Marketing Files. One stylesheet, no outside assets.
   Aims: readable in bright light (dark text on white, strong borders), large touch targets,
   works from 360 px wide, clear keyboard focus. */

:root {
  --ink: #111111;
  --ink-soft: #2f3640;
  --paper: #ffffff;
  --panel: #f1f3f6;
  --line: #5b6470;
  --brand: #0b3d91;
  --brand-dark: #072a66;
  --ok: #0a5c2b;
  --ok-bg: #e2f4e7;
  --bad: #9b1c1c;
  --bad-bg: #fde7e7;
  --warn: #5a4100;
  --warn-bg: #fff3c4;
  --focus: #ffbf00;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { font-size: 112.5%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.6rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 0.8rem; }
a { color: var(--brand); text-underline-offset: 0.15em; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", Menlo, monospace; font-size: 0.95em; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 0;
  box-shadow: 0 0 0 6px var(--ink);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: absolute; left: 0.5rem; top: -5rem; z-index: 50;
  background: var(--focus); color: var(--ink); padding: 0.7rem 1rem; font-weight: 700;
}
.skip:focus { top: 0.5rem; }

.wrap { max-width: 70rem; margin: 0 auto; padding: 0 0.75rem; }
main.wrap { padding-top: 1rem; padding-bottom: 4rem; }
main:focus { outline: none; box-shadow: none; }
.small { font-size: 0.9rem; color: var(--ink-soft); }
.gap-top { margin-top: 1rem; }

/* ---------- top bar ---------- */
.top { background: var(--brand-dark); color: #fff; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-height: 3.4rem; }
.brand { color: #fff; font-weight: 700; font-size: 1.05rem; text-decoration: none; padding: 0.6rem 0; }
@media (min-width: 420px) { .brand { font-size: 1.15rem; } }
.menu-toggle {
  min-height: 44px; padding: 0.4rem 0.9rem; font: inherit; font-weight: 700; white-space: nowrap; flex: 0 0 auto;
  color: #fff; background: transparent; border: 2px solid #fff; border-radius: 8px; cursor: pointer;
}
.site-nav { padding-bottom: 0.75rem; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.site-nav a, .site-nav .nav-button {
  display: flex; align-items: center; min-height: 48px; padding: 0.4rem 0.8rem; width: 100%;
  color: #fff; font: inherit; font-weight: 600; text-decoration: none; text-align: left;
  background: transparent; border: 2px solid transparent; border-radius: 8px; cursor: pointer;
}
.site-nav a[aria-current="page"] { background: #fff; color: var(--brand-dark); }
.site-nav .nav-button { border-color: #fff; justify-content: center; }
.who { padding: 0.4rem 0.8rem; font-size: 0.95rem; }

@media (min-width: 800px) {
  .menu-toggle { display: none; }
  .top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
  .site-nav { display: block !important; padding-bottom: 0; }
  .site-nav ul { flex-direction: row; align-items: center; gap: 0.3rem; }
  .site-nav a, .site-nav .nav-button { width: auto; min-height: 44px; }
}

/* ---------- buttons and fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  min-height: 48px; padding: 0.5rem 1rem;
  font: inherit; font-weight: 700; text-decoration: none; text-align: center; overflow-wrap: normal;
  color: var(--ink); background: #fff; border: 2px solid var(--ink); border-radius: 8px; cursor: pointer;
}
.btn:hover { background: var(--panel); }
.btn-primary { color: #fff; background: var(--brand); border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-danger { color: #fff; background: var(--bad); border-color: var(--bad); }
.btn-danger:hover { background: #7a1414; }
.btn-big { min-height: 56px; padding: 0.7rem 1.3rem; font-size: 1.1rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.link-button {
  font: inherit; color: var(--brand); background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: 0.15em; text-align: left;
}
.button-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.button-row .btn { flex: 1 1 auto; }
@media (min-width: 560px) { .button-row .btn { flex: 0 0 auto; } }

label, .label { display: block; font-weight: 700; margin-bottom: 0.3rem; }
.hint { font-weight: 400; color: var(--ink-soft); font-size: 0.95rem; margin: 0 0 0.35rem; }
input[type="text"], input[type="password"], input[type="search"], input[type="date"], select {
  display: block; width: 100%; min-height: 48px; padding: 0.5rem 0.7rem;
  font: inherit; color: var(--ink); background: #fff; border: 2px solid var(--ink); border-radius: 6px;
}
.field { margin-bottom: 1rem; }
.field-row { display: flex; gap: 0.5rem; align-items: stretch; }
.field-row input { flex: 1 1 auto; min-width: 0; }
.field-row .btn { flex: 0 0 auto; }
.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; min-height: 44px; }
.check input { width: 1.4rem; height: 1.4rem; }

.msg { padding: 0.7rem 0.9rem; border: 2px solid var(--ink); border-left-width: 10px; border-radius: 6px; margin: 0 0 1rem; }
.msg-error { border-color: var(--bad); background: var(--bad-bg); color: #5c0d0d; font-weight: 600; }
.msg-ok { border-color: var(--ok); background: var(--ok-bg); color: #06391b; font-weight: 600; }
.msg-warn { border-color: #a37500; background: var(--warn-bg); color: var(--warn); font-weight: 600; }
.msg-info { border-color: var(--brand); background: #e8eefb; }
.msg p:last-child { margin-bottom: 0; }

/* ---------- small public pages (sign in, set password) ---------- */
.card-page { background: var(--panel); min-height: 100vh; }
.card {
  max-width: 28rem; margin: 0 auto; padding: 1.25rem 1rem 2rem; background: #fff;
  border: 2px solid var(--ink); border-radius: 10px;
}
.card-wrap { padding: 1.25rem 0.75rem 3rem; }
.card .btn-primary { width: 100%; }
.product { font-weight: 700; color: var(--brand-dark); font-size: 1.05rem; margin-bottom: 0.4rem; }

/* ---------- panels ---------- */
.panel { border: 2px solid var(--line); border-radius: 10px; padding: 0.9rem; margin-bottom: 1.1rem; background: #fff; }
.panel > h2 { font-size: 1.15rem; }

.usage-text { font-weight: 700; font-size: 1.1rem; margin-bottom: 0.35rem; }
progress {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 1.05rem;
  border: 2px solid var(--ink); border-radius: 999px; background: #fff; overflow: hidden; color: var(--brand);
}
progress::-webkit-progress-bar { background: #fff; }
progress::-webkit-progress-value { background: var(--brand); }
progress::-moz-progress-bar { background: var(--brand); }
progress.is-low { color: var(--bad); }
progress.is-low::-webkit-progress-value { background: var(--bad); }
progress.is-low::-moz-progress-bar { background: var(--bad); }
progress.is-done { color: var(--ok); }
progress.is-done::-webkit-progress-value { background: var(--ok); }
progress.is-done::-moz-progress-bar { background: var(--ok); }
.usage progress { margin-bottom: 0.4rem; }
.usage p:last-child { margin-bottom: 0; }

.search label { margin-bottom: 0.3rem; }
.search { margin-bottom: 1.1rem; }

/* ---------- files view ---------- */
.crumbs ol { list-style: none; margin: 0 0 0.5rem; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.15rem 0.4rem; }
.crumbs li { display: flex; align-items: center; gap: 0.4rem; }
.crumbs li + li::before { content: "\203A"; font-weight: 700; color: var(--ink-soft); }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.crumbs [aria-current="page"] { font-weight: 700; }

.toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: flex-end; margin: 0.4rem 0 0.9rem; }
.toolbar .btn-big { flex: 1 1 9rem; }
.toolbar .sort { flex: 1 1 100%; }
.toolbar .sort label { font-weight: 600; font-size: 0.95rem; }
@media (min-width: 720px) {
  .toolbar .btn-big { flex: 0 0 auto; }
  .toolbar .sort { flex: 0 0 13rem; margin-left: auto; }
}

.dropzone { display: none; }
@media (hover: hover) and (min-width: 720px) {
  .dropzone {
    display: block; border: 3px dashed var(--line); border-radius: 10px; padding: 0.8rem 1rem;
    margin-bottom: 1rem; color: var(--ink-soft); background: var(--panel); text-align: center;
  }
  .dropzone p { margin: 0; }
}
.dropzone.is-over { display: block; border-color: var(--brand); background: #e8eefb; color: var(--ink); font-weight: 700; }

.list-head { display: none; }
.items { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--line); }
.item { padding: 0.7rem 0.15rem; border-bottom: 2px solid var(--line); }
.item-main { display: flex; align-items: flex-start; gap: 0.6rem; min-width: 0; }
.item-icon { flex: 0 0 auto; width: 32px; height: 32px; margin-top: 0.15rem; }
.item-name { font-weight: 700; font-size: 1.05rem; min-height: 44px; display: inline-flex; align-items: center; }
.item-where { display: block; }
.item-meta { margin: 0.15rem 0 0.5rem 2.6rem; color: var(--ink-soft); font-size: 0.95rem; }
.item-meta > span:not(.c-state):not(:empty) + span:not(.c-state):not(:empty)::before { margin: 0 0.4em; content: "\00B7"; font-weight: 700; }
.item-meta .c-state { display: block; margin-top: 0.3rem; }
.item-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-left: 2.6rem; }
.item-actions .btn { min-height: 44px; padding: 0.35rem 0.7rem; white-space: nowrap; }
.item-pending { background: #f6f8fc; }

.badge { display: inline-block; padding: 0.1rem 0.55rem; border: 2px solid var(--ink); border-radius: 999px; font-size: 0.9rem; font-weight: 700; color: var(--ink); background: #fff; }
.badge-ok { border-color: var(--ok); color: #06391b; background: var(--ok-bg); }
.badge-bad { border-color: var(--bad); color: #5c0d0d; background: var(--bad-bg); }
.badge-busy { border-color: var(--brand); color: var(--brand-dark); background: #e8eefb; }
.badge-wait { border-color: #a37500; color: var(--warn); background: var(--warn-bg); }

@media (min-width: 900px) {
  .list-head, .item {
    display: grid; grid-template-columns: minmax(0, 1fr) 5.5rem 9rem 7.5rem 9.5rem 14.5rem;
    column-gap: 0.8rem; align-items: center;
  }
  .list-head { font-weight: 700; padding: 0.4rem 0.15rem; font-size: 0.95rem; }
  .item-meta { display: contents; }
  .item-meta > span { color: var(--ink); font-size: 0.95rem; }
  .item-meta > span::before { content: none !important; }
  .item-meta .c-state { display: block; margin-top: 0; }
  .item-actions { margin-left: 0; justify-content: flex-end; flex-wrap: nowrap; }
  .item-main { align-items: center; }
  .item-icon { margin-top: 0; }
}

.empty { padding: 1.2rem 0.5rem; text-align: center; color: var(--ink-soft); border-bottom: 2px solid var(--line); }

/* ---------- uploads ---------- */
.upload-list, .plain-list { list-style: none; margin: 0; padding: 0; }
.upload-item { border: 2px solid var(--line); border-radius: 8px; padding: 0.7rem; margin-bottom: 0.7rem; background: #fff; }
.upload-item.is-done { border-color: var(--ok); }
.upload-item.is-bad { border-color: var(--bad); }
.upload-name { font-weight: 700; margin-bottom: 0.2rem; }
.upload-size { font-weight: 400; color: var(--ink-soft); white-space: nowrap; }
.upload-state { margin: 0.2rem 0 0.4rem; font-weight: 600; }
.upload-note { margin: 0.4rem 0 0; font-size: 0.95rem; color: var(--ink-soft); }
.upload-item .button-row { margin-top: 0.6rem; }
.upload-item .btn { min-height: 44px; }

/* ---------- dialogs ---------- */
dialog.dialog {
  width: min(36rem, calc(100vw - 1.2rem)); max-height: calc(100vh - 1.2rem); overflow: auto;
  padding: 1.1rem; color: var(--ink); background: #fff; border: 3px solid var(--ink); border-radius: 10px;
}
dialog.dialog::backdrop { background: rgba(0, 0, 0, 0.65); }
.dialog-title { font-size: 1.25rem; }
.facts { margin: 0 0 1rem; display: grid; grid-template-columns: 1fr; gap: 0.1rem 1rem; }
.facts dt { font-weight: 700; margin-top: 0.45rem; }
.facts dd { margin: 0; }
@media (min-width: 560px) {
  .facts { grid-template-columns: 9.5rem minmax(0, 1fr); }
  .facts dt { margin-top: 0.3rem; }
  .facts dd { margin-top: 0.3rem; }
}
.hash-box { border: 2px solid var(--ink); border-radius: 8px; padding: 0.7rem; background: var(--panel); margin-bottom: 1rem; }
.hash-value { display: block; font-size: 1rem; word-break: break-all; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 0.5rem; margin: 0.4rem 0 0.6rem; user-select: all; }
.secret-value { font-size: 1.2rem; letter-spacing: 0.06em; }

.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 1.3rem; border-left: 2px solid var(--line); padding-left: 0.5rem; }
.tree label { display: flex; align-items: center; gap: 0.55rem; min-height: 46px; font-weight: 600; margin: 0; cursor: pointer; }
.tree input[type="radio"] { width: 1.5rem; height: 1.5rem; flex: 0 0 auto; }
.tree .is-disabled { color: var(--ink-soft); font-weight: 400; cursor: default; }
.tree-box { max-height: 45vh; overflow: auto; border: 2px solid var(--line); border-radius: 8px; padding: 0.3rem 0.6rem; margin-bottom: 0.8rem; }

/* ---------- messages at the bottom of the screen ---------- */
.toasts { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; flex-direction: column; gap: 0.4rem; padding: 0.5rem; pointer-events: none; }
.toast {
  pointer-events: auto; margin: 0 auto; width: min(40rem, 100%);
  display: flex; align-items: center; gap: 0.6rem; justify-content: space-between;
  padding: 0.6rem 0.8rem; color: #fff; background: #14321f; border: 2px solid #fff; border-radius: 8px;
  box-shadow: 0 0 0 2px var(--ink); font-weight: 600;
}
.toast-error { background: #6f1010; }
.toast .btn { min-height: 40px; padding: 0.2rem 0.7rem; flex: 0 0 auto; }

/* ---------- tables that turn into cards on a phone ---------- */
.cards { list-style: none; margin: 0; padding: 0; }
.cards > li { border: 2px solid var(--line); border-radius: 8px; padding: 0.7rem; margin-bottom: 0.7rem; }
.cards h3 { margin-bottom: 0.3rem; }
.cards .facts { margin-bottom: 0.4rem; }
.filters { display: grid; grid-template-columns: 1fr; gap: 0.2rem 0.8rem; }
@media (min-width: 720px) { .filters { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; } }
.entry-what { font-weight: 700; }
.entry-line { margin: 0; }
