:root {
  --bg: #f4f2ee;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --ink: #1d2327;
  --ink-2: #4a545b;
  --ink-3: #7a848b;
  --line: #e2ded6;
  --accent: #0f5c63;
  --accent-ink: #ffffff;
  --accent-soft: #e3efef;
  --danger: #b3261e;
  --danger-soft: #fbe9e7;
  --l1: #2e7d32; --l1-soft: #e6f2e6;
  --l2: #8a6d00; --l2-soft: #fbf3d6;
  --l3: #b45309; --l3-soft: #fdebd8;
  --l4: #b3261e; --l4-soft: #fbe2df;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 30, 35, 0.06), 0 2px 8px rgba(20, 30, 35, 0.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181b; --surface: #1c2125; --surface-2: #20262a; --ink: #e8ecee; --ink-2: #b4bec4; --ink-3: #87939a;
    --line: #2f373c; --accent: #5fb7bd; --accent-ink: #0c2224; --accent-soft: #1d3436;
    --danger: #f2a49d; --danger-soft: #3a2220;
    --l1: #8ccf8f; --l1-soft: #1e3020; --l2: #e8cf6a; --l2-soft: #332c12; --l3: #f0a861; --l3-soft: #3a2a17; --l4: #f2a49d; --l4-soft: #3d2220;
    --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top .wrap { display: flex; align-items: center; gap: 12px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 16px; }
.spacer { flex: 1; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { color: var(--danger); }
.btn.small { min-height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: 0.5; cursor: default; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 0 10px; min-height: 38px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }

/* country strip */
.strip { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0; scrollbar-width: thin; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-2);
}
.chip[aria-current="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.flag { font-size: 18px; line-height: 1; }

/* cards */
.grid { display: grid; gap: 14px; }
.grid.countries { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 16px; }
.ccard { padding: 16px; cursor: pointer; text-align: left; width: 100%; display: flex; flex-direction: column; gap: 10px; }
.ccard:hover { border-color: var(--ink-3); }
.ccard-head { display: flex; align-items: center; gap: 10px; }
.ccard-head .flag { font-size: 28px; }
.ccard-name { font-weight: 700; font-size: 16px; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.temp-big { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.between { justify-content: space-between; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.badge.l1 { background: var(--l1-soft); color: var(--l1); border-color: transparent; }
.badge.l2 { background: var(--l2-soft); color: var(--l2); border-color: transparent; }
.badge.l3 { background: var(--l3-soft); color: var(--l3); border-color: transparent; }
.badge.l4 { background: var(--l4-soft); color: var(--l4); border-color: transparent; }
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* detail */
.detail-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 6px 0 16px; }
.detail-head .flag { font-size: 44px; }
.detail-head h1 { margin: 0; font-size: 28px; letter-spacing: -0.02em; }
.layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }
.section-title { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 10px; }
.advisory { border-left: 5px solid var(--line); }
.advisory.l1 { border-left-color: var(--l1); } .advisory.l2 { border-left-color: var(--l2); }
.advisory.l3 { border-left-color: var(--l3); } .advisory.l4 { border-left-color: var(--l4); }
.advisory h2:not(.section-title) { margin: 6px 0 6px; font-size: 18px; }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.city-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.city { padding: 14px; }
.city h3 { margin: 0; font-size: 15px; }
.fc { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; text-align: center; font-size: 12.5px; }
.fc .ic { font-size: 18px; }
.fc .hi { font-weight: 700; }
.news { list-style: none; margin: 0; padding: 0; }
.news li { padding: 11px 0; border-bottom: 1px solid var(--line); }
.news li:last-child { border-bottom: 0; }
.news a { color: var(--ink); text-decoration: none; font-weight: 600; }
.news a:hover { color: var(--accent); text-decoration: underline; }
.footer { padding: 28px 16px 40px; color: var(--ink-3); font-size: 12.5px; }
.skel { background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 6px; min-height: 14px; }
@keyframes sk { to { background-position: -200% 0; } }
.empty { padding: 26px; text-align: center; color: var(--ink-3); }

/* portal */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab { border: 0; background: none; padding: 12px 12px; cursor: pointer; font-weight: 600; color: var(--ink-3); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label, .lbl { font-size: 13px; font-weight: 700; color: var(--ink-2); }
input[type=text], input[type=email], input[type=date], input[type=search], select, textarea {
  width: 100%; min-height: 42px; padding: 8px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.fname { font-weight: 600; word-break: break-word; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.tag.form { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.tag.admin { background: var(--l4-soft); color: var(--l4); border-color: transparent; }
.tag.lead { background: var(--l2-soft); color: var(--l2); border-color: transparent; }
.tag.off { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center; background: var(--surface-2); cursor: pointer; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 10px; font-weight: 600; z-index: 50; max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.toast.bad { background: var(--danger); color: #fff; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.checks label { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 14px; background: var(--surface); }
.note { padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--ink); font-size: 14px; }
.note.warn { background: var(--l2-soft); }
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 0; background: var(--surface); color: var(--ink); width: min(560px, calc(100% - 24px)); }
dialog::backdrop { background: rgba(10, 15, 18, 0.45); }
dialog .dh { padding: 16px 18px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 17px; }
dialog .db { padding: 16px 18px; max-height: 70vh; overflow: auto; }
dialog .df { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* files as cards on phones */
@media (max-width: 720px) {
  .table.resp thead { display: none; }
  .table.resp tr { display: block; border-bottom: 1px solid var(--line); padding: 10px 4px; }
  .table.resp td { display: block; border: 0; padding: 3px 8px; }
  .table.resp td[data-l]::before { content: attr(data-l) ": "; color: var(--ink-3); font-size: 12.5px; }
  .hide-sm { display: none; }
  .detail-head h1 { font-size: 23px; }
}

label.row { flex-wrap: nowrap; align-items: flex-start; cursor: pointer; }
label.row input[type=checkbox] { margin-top: 3px; flex: none; width: 18px; height: 18px; }
@media (max-width: 520px) { .brand { font-size: 15px; } .top .wrap { gap: 8px; } }
