/* State | Ukraine GTA 5 RP — стилі порталу.
   Палітра: темно-синій + золото. Розділи: основа → шапка/меню → макет → компоненти → сторінки → адаптив → друк. */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Playfair+Display:wght@700;800&display=swap");

:root {
  --navy-950: #07101e;
  --navy-900: #0e1f3a;
  --navy-800: #16345e;
  --navy-700: #1f4a80;
  --navy-600: #2d5f9e;
  --sky: #e8f0fb;
  --gold: #d4a72c;
  --gold-600: #b98f1c;
  --gold-soft: #f1d98a;
  --gold-tint: #fff7e0;
  --paper: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --ink: #152033;
  --ink-2: #2d3a50;
  --muted: #647086;
  --line: #e2e7ef;
  --line-strong: #cfd7e3;
  --ok: #15704a;
  --ok-tint: #e7f5ee;
  --draft: #6a4fd0;
  --draft-tint: #f0ecff;
  --warn: #8a6300;
  --warn-tint: #fff4d6;
  --dead: #677084;
  --dead-tint: #eef0f4;
  --danger: #a3292f;
  --danger-tint: #fdecec;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 44px rgba(14, 31, 58, .12);
  --shadow-soft: 0 1px 2px rgba(14, 31, 58, .05), 0 8px 24px rgba(14, 31, 58, .06);
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --content: 1200px;
}

/* ---------- Основа ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { height: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 420px at 50% -120px, rgba(31, 74, 128, .10), transparent 70%),
    var(--paper);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  line-height: 1.55;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy-700); text-decoration: none; }
a:hover { color: var(--navy-600); }
img { max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: rgba(212, 167, 44, .28); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- Шапка ---------- */
.topbar {
  background: var(--navy-950);
  color: #aebbd0;
  font-size: 12px;
  letter-spacing: .02em;
  padding: 6px 16px;
  text-align: center;
}
.header {
  background:
    radial-gradient(600px 200px at 12% 0, rgba(212, 167, 44, .18), transparent 70%),
    linear-gradient(180deg, var(--navy-900), var(--navy-800));
  color: #fff;
}
.header-inner, .wrap, .footer-inner, .nav-inner {
  width: min(var(--content), calc(100% - 32px));
  margin: 0 auto;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 0;
}
.brand { display: flex; gap: 12px; align-items: center; color: #fff; margin-right: auto; min-width: 0; }
.brand:hover { color: #fff; }
.crest {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--gold-soft);
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.18), transparent 50%), rgba(212, 167, 44, .14);
  border: 1px solid rgba(241, 217, 138, .6);
  box-shadow: inset 0 0 0 4px rgba(212, 167, 44, .10);
  font-weight: 800;
  letter-spacing: .06em;
  font-size: 14px;
}
/* Знак «U зі зіркою» замість кружечка SA */
.crest.crest-logo {
  width: auto; height: 64px;
  border: 0; border-radius: 0; background: none; box-shadow: none;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .35));
  transition: transform .2s ease;
}
.brand:hover .crest-logo { transform: translateY(-2px) scale(1.03); }
.hero-logo { display: block; height: 128px; width: auto; margin: 0 0 14px; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .4)); position: relative; z-index: 1; }
.brand h1 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: .04em; line-height: 1.2; }
.brand p { margin: 2px 0 0; font-size: 12.5px; color: var(--gold-soft); }

.search {
  display: flex;
  flex: 0 1 380px;
  min-width: 220px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 12px;
  padding: 3px;
}
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 9px 12px;
  font-size: 14px;
  background: #fff;
  border-radius: 9px 0 0 9px;
  box-shadow: none;
}
.search input:focus { box-shadow: none; }
.search button {
  background: var(--gold);
  border: 0;
  padding: 0 16px;
  font: 700 14px var(--sans);
  cursor: pointer;
  border-radius: 0 9px 9px 0;
  color: var(--navy-950);
}
.search button:hover { background: var(--gold-soft); }

.account-actions { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.account-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--gold);
  color: var(--navy-950);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  position: relative;
}
.account-main:hover { background: var(--gold-soft); color: var(--navy-950); }
.account-main.is-user { background: rgba(255, 255, 255, .10); color: #fff; border: 1px solid rgba(255, 255, 255, .18); padding: 5px 12px 5px 5px; }
.account-main.is-user:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.account-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: var(--gold); color: var(--navy-950);
  font-weight: 800; font-size: 13px; object-fit: cover;
}
.account-sub { color: #c9d5e8; font-size: 13.5px; font-weight: 600; }
.account-sub:hover { color: var(--gold-soft); }
.nav-badge {
  display: inline-grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px;
  background: #e0453b; color: #fff;
  font: 700 11.5px var(--sans);
  line-height: 1;
}

/* ---------- Головне меню ---------- */
.nav {
  background: rgba(7, 16, 30, .94);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  position: sticky;
  top: 0;
  z-index: 40;
}
.nav-inner { display: flex; align-items: center; gap: 4px; }
.nav-links { display: flex; gap: 2px; flex-wrap: wrap; }
.nav a {
  position: relative;
  color: #c3cee0;
  padding: 13px 14px;
  display: block;
  font-size: 14px;
  font-weight: 500;
}
.nav a:hover { color: #fff; }
.nav a.active { color: #fff; font-weight: 600; }
.nav a.active::after {
  content: "";
  position: absolute; left: 14px; right: 14px; bottom: 0;
  height: 2px; border-radius: 2px;
  background: var(--gold);
}
.nav-toggle {
  display: none;
  align-items: center; gap: 8px;
  margin: 8px 0;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 10px;
  background: transparent;
  color: #fff;
  font: 600 14px var(--sans);
  cursor: pointer;
}

/* ---------- Макет ---------- */
.wrap { padding: 32px 0 64px; flex: 1 0 auto; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.crumbs a { color: var(--navy-700); }
h2.page-title {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 800;
  color: var(--navy-900);
  line-height: 1.12;
  letter-spacing: -.005em;
}
.lead { margin: 0 0 22px; color: var(--muted); font-size: 15.5px; }
.muted { color: var(--muted); font-size: 13.5px; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--gold-600);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.grid-2 { display: grid; grid-template-columns: 1.35fr .9fr; gap: 20px; align-items: start; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-soft);
  min-width: 0;
}
.card h3 { margin: 0 0 6px; color: var(--navy-900); font-size: 18px; font-weight: 700; }
.card > .lead { font-size: 14px; margin-bottom: 14px; }
.section-head, .admin-actions {
  display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap;
  margin-bottom: 16px;
}
.section-head h3 { margin-bottom: 4px; }

/* Кабінет: бічне меню + вміст */
.cabinet-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; }
.side-nav {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: var(--shadow-soft);
  position: sticky;
  top: 62px;
}
.side-me { display: flex; align-items: center; gap: 10px; padding: 8px 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.side-me img, .side-avatar {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
  display: grid; place-items: center;
  background: var(--navy-800); color: var(--gold-soft); font-weight: 800;
}
.side-me b { display: block; font-size: 14px; color: var(--navy-900); line-height: 1.25; }
.side-me small { display: block; font-size: 12px; color: var(--muted); line-height: 1.3; }
.side-me > div { min-width: 0; }
.side-me b, .side-me small { overflow: hidden; text-overflow: ellipsis; }
.side-links { display: grid; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
}
.side-nav a .ico { color: var(--muted); flex: 0 0 auto; }
.side-nav a span:not(.nav-badge):not(.pill) { flex: 1; }
.side-nav a .pill { padding: 1px 8px; font-size: 12px; }
.side-nav a:hover { background: var(--surface-2); color: var(--navy-900); }
.side-nav a.active { background: var(--sky); color: var(--navy-900); font-weight: 600; }
.side-nav a.active .ico { color: var(--navy-700); }
.side-nav a.create-doc-link {
  justify-content: center;
  margin: 2px 0 10px;
  padding: 11px 12px;
  background: var(--gold);
  color: var(--navy-950);
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(212, 167, 44, .28);
}
.side-nav a.create-doc-link .ico { color: var(--navy-950); }
.side-nav a.create-doc-link span { flex: 0 0 auto; }
.side-nav a.create-doc-link:hover, .side-nav a.create-doc-link.active { background: var(--navy-800); color: #fff; }
.side-nav a.create-doc-link:hover .ico, .side-nav a.create-doc-link.active .ico { color: #fff; }
.side-nav .side-logout { margin-top: 8px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; color: var(--muted); }

/* ---------- Кнопки, статуси, мітки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--navy-800);
  color: #fff !important;
  padding: 9px 16px;
  font: 600 14px/1.3 var(--sans);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, box-shadow .15s ease, transform .15s ease;
}
.btn:hover { background: var(--navy-700); box-shadow: 0 6px 16px rgba(22, 52, 94, .2); }
.btn:active { transform: translateY(1px); }
.btn.gold { background: var(--gold); color: var(--navy-950) !important; }
.btn.gold:hover { background: #e2b843; }
/* Вхід через Discord — фірмовий колір Discord */
.btn.discord-btn { background: #5865f2; border-color: #5865f2; color: #fff !important; }
.btn.discord-btn:hover { background: #4752c4; }
.portal-login-card .discord-btn { margin-top: 8px; }
.discord-register { display: grid; gap: 6px; justify-items: start; margin: 4px 0 18px; }
.discord-register .muted { margin: 0; font-size: 13px; }
.badge.discord { background: #eef0ff; color: #3b45c4; border-color: #c9cdfb; }
:root[data-theme="dark"] .badge.discord { background: #2a2f63; color: #c9cdfb; border-color: #3b45c4; }
.user-discord { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.btn.ghost { background: var(--surface); color: var(--navy-800) !important; border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--navy-600); box-shadow: none; }
.btn.ghost.light { color: #fff !important; border-color: rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .08); }
.btn.danger, .btn.ghost.danger { color: var(--danger) !important; border-color: #efc2c2 !important; background: var(--surface); }
.btn.ghost.danger:hover { background: var(--danger-tint); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.danger { color: var(--danger) !important; }

.badge {
  display: inline-flex; align-items: center;
  font: 700 11px/1 var(--sans);
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 6px 9px;
  border-radius: 999px;
  white-space: nowrap;
  background: var(--dead-tint);
  color: var(--dead);
}
.badge.ok { background: var(--ok-tint); color: var(--ok); }
.badge.draft { background: var(--draft-tint); color: var(--draft); }
.badge.dead { background: var(--dead-tint); color: var(--dead); }
.badge.warn { background: var(--warn-tint); color: var(--warn); }
.pill-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pill {
  display: inline-block;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12.5px;
}
.notice {
  border: 1px solid #f0dca0;
  border-left: 4px solid var(--gold);
  background: var(--gold-tint);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 14px 0;
  font-size: 14px;
}
.notice.danger { border-color: #f0c4c4; border-left-color: var(--danger); background: var(--danger-tint); color: var(--ink) !important; }
.hint, .guide-step {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 13.5px;
}
.hint b, .guide-step b { display: block; color: var(--navy-900); margin-bottom: 4px; }
.guide-step span { color: var(--muted); }
.admin-guide { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0 0 14px; }
.hint-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin: 12px 0; }
.empty-note { padding: 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); text-align: center; background: var(--surface-2); }

/* ---------- Форми ---------- */
input, select, textarea {
  font: 14.5px var(--sans);
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--navy-700); }
input[type="file"] { padding: 7px; background: var(--surface-2); }
input:focus, select:focus, textarea:focus {
  outline: 0;
  border-color: var(--navy-600);
  box-shadow: 0 0 0 3px rgba(45, 95, 158, .15);
}
textarea { min-height: 180px; resize: vertical; line-height: 1.5; }
label { font-size: 13.5px; color: var(--ink-2); }
label > input, label > select, label > textarea { margin-top: 5px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; margin-bottom: 12px; }
.form-grid label { display: block; }
.field-help { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }
.inline-check { display: flex; gap: 8px; align-items: center; margin-top: 6px; color: var(--ink); }
.inline-check input { width: auto; }
.people-row select { min-width: 220px; width: auto; }
.permission-grid .pill { cursor: pointer; }

/* ---------- Таблиці ---------- */
.meta-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 6px 0 22px;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}
.meta-table th, .meta-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.meta-table tr:last-child th, .meta-table tr:last-child td { border-bottom: 0; }
.meta-table th { width: 200px; background: var(--surface-2); color: var(--muted); font-weight: 600; }

/* ---------- Списки документів ---------- */
.act-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 16px;
  padding: 14px 12px;
  margin: 0 -12px;
  border-bottom: 1px solid var(--line);
  align-items: start;
  border-radius: 10px;
  transition: background .15s ease;
}
.act-row:hover { background: var(--surface-2); }
.act-row:last-child { border-bottom: 0; }
.act-num { font-size: 12px; color: var(--muted); line-height: 1.45; font-variant-numeric: tabular-nums; }
.act-row h3 { margin: 0 0 4px; font-size: 16px; line-height: 1.3; font-weight: 650; }
.act-row h3 a { color: var(--navy-900); }
.act-row h3 a:hover { color: var(--navy-700); text-decoration: underline; text-underline-offset: 3px; }
.act-meta { font-size: 13px; color: var(--muted); }
.act-row > span, .row-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; }
.route-line { margin-top: 6px; font-size: 12.5px; color: var(--navy-700); }
/* Рядки з кнопками дій: кнопки під описом, щоб назва не стискалась */
.act-row:has(.btn) { grid-template-columns: 96px minmax(0, 1fr); }
.act-row:has(.btn) > span { grid-column: 2; justify-content: flex-start; }

/* Повідомлення */
.inbox-h { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; font-size: 16px; color: var(--navy-900); }
.inbox-h:first-child { margin-top: 0; }
.inbox-h .count { min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--sky); color: var(--navy-800); font-size: 12px; display: inline-grid; place-items: center; }
#appeal-inbox { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.vote-tally { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.vote-tally span { padding: 3px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.vote-tally .pro { color: var(--ok); background: var(--ok-tint); border-color: transparent; font-weight: 600; }
.vote-tally .contra { color: var(--danger); background: var(--danger-tint); border-color: transparent; font-weight: 600; }

/* Універсальні рядки-картки (адмінка, звернення, новини) */
.admin-list { display: grid; gap: 10px; }
.admin-list-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.admin-list-row.is-attention { border-color: #efd489; background: linear-gradient(90deg, var(--gold-tint), #fff 60%); }
.user-avatar, .admin-code {
  display: grid; place-items: center;
  width: 42px; min-width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--sky);
  color: var(--navy-800);
  font-weight: 800; font-size: 13px;
}
.admin-code { width: auto; min-width: 42px; padding: 0 10px; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.admin-code.note-returned, .admin-code.note-rejected { background: var(--danger-tint); color: var(--danger); }
.admin-code.note-published { background: var(--ok-tint); color: var(--ok); }
.admin-code.note-appeal, .admin-code.note-answer { background: var(--gold-tint); color: var(--warn); }
.admin-row-main { min-width: 0; }
.admin-row-title { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 4px; }
.admin-row-title b { color: var(--navy-900); }
.admin-row-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--muted); font-size: 13px; }
.admin-row-meta span + span::before { content: "·"; margin-right: 10px; color: var(--line-strong); }
.admin-row-main p { margin: 6px 0 0; font-size: 14px; }
.admin-row-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.admin-empty { padding: 16px; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--muted); background: var(--surface-2); }

/* Хронологія та підписанти */
.lifecycle-card { margin-top: 22px; }
.lifecycle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.lifecycle-grid h4 { margin: 0 0 12px; color: var(--navy-900); }
.timeline-item { position: relative; border-left: 2px solid var(--line); padding: 0 0 14px 16px; margin: 0; }
.timeline-item::before { content: ""; position: absolute; left: -6px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px #fff; }
.timeline-item b { display: block; color: var(--navy-900); font-size: 14px; }
.timeline-item span { display: block; color: var(--muted); font-size: 12.5px; margin: 2px 0; }
.timeline-item p { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-2); }
.signer-list { list-style: none; margin: 14px 0 0; padding: 0; counter-reset: signer; display: grid; gap: 10px; }
.signer-row {
  counter-increment: signer;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--surface);
}
.signer-row::before {
  content: counter(signer);
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font: 700 13px var(--sans);
  background: var(--dead-tint); color: var(--dead);
}
.signer-row.is-ok::before { content: "✓"; background: var(--ok-tint); color: var(--ok); }
.signer-row.is-draft { border-color: #d9d0fa; background: #fbfaff; }
.signer-row.is-draft::before { background: var(--draft-tint); color: var(--draft); }
.signer-row.is-dead::before { content: "↩"; background: var(--danger-tint); color: var(--danger); }
.signer-row small { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.signer-row b { display: block; color: var(--navy-900); }
.signer-row div > span { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.signer-state { display: grid; justify-items: end; gap: 4px; }
.signer-state small { text-transform: none; letter-spacing: 0; }

/* ---------- Головна ---------- */
.portal-hero, .citizen-portal {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr);
  gap: 28px;
  align-items: end;
  color: #fff;
  background:
    radial-gradient(520px 260px at 100% 0, rgba(212, 167, 44, .22), transparent 70%),
    linear-gradient(140deg, var(--navy-900), var(--navy-700));
  border-radius: 20px;
  padding: clamp(24px, 5vw, 48px);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  overflow: hidden;
}
.portal-hero::after {
  content: "";
  position: absolute; right: -90px; top: -90px;
  width: 300px; height: 300px;
  border: 1px solid rgba(241, 217, 138, .22);
  border-radius: 50%;
  box-shadow: 0 0 0 40px rgba(241, 217, 138, .04);
  pointer-events: none;
}
.portal-hero .page-title, .portal-hero .lead, .citizen-portal .page-title, .citizen-portal .lead { color: #fff; position: relative; z-index: 1; }
.portal-hero .lead, .citizen-portal .lead { color: #d3def0; max-width: 640px; }
.portal-hero .eyebrow, .citizen-portal .eyebrow { color: var(--gold-soft); }
.hero-actions, .hero-stats { position: relative; z-index: 1; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hero-stats div { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); border-radius: 14px; padding: 14px; }
.hero-stats b { display: block; font-size: 30px; color: var(--gold-soft); line-height: 1; font-variant-numeric: tabular-nums; }
.hero-stats span { display: block; margin-top: 6px; color: #d3def0; font-size: 12.5px; }
.quick-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.quick-links a {
  display: grid; gap: 4px;
  padding: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  transition: border-color .15s ease, transform .15s ease;
}
.quick-links a:hover { border-color: var(--gold); transform: translateY(-2px); color: var(--ink); }
.quick-links b { color: var(--navy-900); font-size: 15px; }
.quick-links span { color: var(--muted); font-size: 13px; }

/* Портал громадянина */
.citizen-portal { grid-template-columns: minmax(0, 1fr) 380px; align-items: center; }
.portal-login-card { background: #fff; color: var(--ink); border: 0; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.portal-login-card label { display: block; margin-bottom: 10px; }
.portal-login-card .btn { width: 100%; margin-top: 6px; }
.portal-service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.portal-service-grid .card { display: flex; flex-direction: column; align-items: flex-start; }
.portal-service-grid .card .muted { flex: 1; }

/* Органи влади */
.org-list { list-style: none; padding: 0; margin: 0; }
.org-list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.org-list b { display: block; color: var(--navy-900); }
.branch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.branch-card h3 { display: flex; align-items: center; gap: 10px; }
.branch-card .branch-tag { font: 700 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--gold-600); }
.structure-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.structure-row:first-of-type { border-top: 0; }
.structure-row b { color: var(--navy-900); display: block; }
.structure-row span { color: var(--muted); font-size: 13px; }
.structure-row > .pill { align-self: start; color: var(--ink-2); font-size: 12px; }

/* Метрики */
.mini-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.metric { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-soft); }
.metric b { display: block; color: var(--navy-900); font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }

/* ---------- Профіль ---------- */
.profile-page, .appeals-page, .admin-page { display: grid; gap: 18px; min-width: 0; }
.profile-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px; align-items: center; }
.profile-photo { width: 112px; height: 112px; object-fit: cover; border-radius: 18px; background: var(--sky); border: 3px solid #fff; box-shadow: var(--shadow-soft); }
.profile-photo.large { width: 124px; height: 124px; }
.photo-placeholder { display: grid; place-items: center; background: linear-gradient(140deg, var(--navy-900), var(--navy-700)); color: var(--gold-soft); font: 800 46px var(--serif); }
.profile-main { min-width: 0; }
.profile-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.profile-details div { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); }
.profile-details span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.profile-details b { color: var(--navy-900); font-weight: 600; overflow-wrap: anywhere; }
.cabinet-news { margin-top: 6px; }

/* ---------- Звернення ---------- */
.appeal-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--surface); box-shadow: var(--shadow-soft); }
.appeal-card > p { margin: 10px 0; }
.appeal-thread { display: grid; gap: 8px; margin: 12px 0; }
.appeal-thread div { border-radius: 12px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); max-width: 88%; }
.appeal-thread div.from-office { justify-self: end; background: var(--sky); border-color: #cfdcf0; }
.appeal-thread b, .appeal-thread span { display: block; }
.appeal-thread span { color: var(--muted); font-size: 12px; }
.appeal-thread p { margin: 4px 0 0; }
.reply-form textarea { min-height: 90px; }

/* ---------- Адмін-панель ---------- */
.admin-hero-panel {
  display: flex; justify-content: space-between; gap: 18px; align-items: flex-start;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #fff, #eef4fc);
  box-shadow: var(--shadow-soft);
}
.admin-hero-panel .page-title { margin: 0 0 8px; }
.admin-quick-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; min-width: 280px; }
.admin-dashboard { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.admin-stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); box-shadow: var(--shadow-soft); }
.admin-stat span, .admin-stat small { display: block; color: var(--muted); font-size: 12px; }
.admin-stat b { display: block; margin: 4px 0; color: var(--navy-900); font-size: 24px; line-height: 1.15; }
.admin-stat.is-text { grid-column: span 2; }
.admin-stat.is-text b { font-size: 15px; line-height: 1.35; margin: 6px 0; }
.admin-section-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 14px; }
.admin-section-head h3 { margin: 0 0 4px; color: var(--navy-900); }
.admin-search { min-width: 240px; margin: 0; }
.admin-search span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.route-steps { color: var(--muted); font-size: 13px; line-height: 1.45; }
.route-builder { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--surface-2); margin: 14px 0; }
.route-step-list { display: grid; gap: 8px; }
.route-step-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }

/* Адмін-панель: вкладки, апарати, вибір рівня доступу */
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.admin-tabs button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border: 0; border-radius: 10px; background: transparent;
  font: 600 14px var(--sans); color: var(--ink-2); cursor: pointer;
}
.admin-tabs button:hover { background: var(--surface-2); }
.admin-tabs button.active { background: var(--navy-800); color: #fff; }
.admin-tabs button.active .pill { background: rgba(255,255,255,.18); color: #fff; border-color: transparent; }
.admin-tab { display: grid; gap: 18px; }
.assign-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.assign-row { grid-template-columns: auto minmax(0, 1fr); }
.assign-row .admin-row-actions { grid-column: 2; justify-content: flex-start; }
.assign-controls select { padding: 7px 10px; }
.office-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.office-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: flex; flex-direction: column; }
.office-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.office-card header b { display: block; color: var(--navy-900); font-size: 15.5px; }
.office-card header small { color: var(--muted); font-size: 12.5px; }
.office-card header .btn { padding: 6px 12px; font-size: 13px; }
.position-list { list-style: none; margin: 0; padding: 6px 16px; flex: 1; }
.position-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.position-list li:last-child { border-bottom: 0; }
.position-list b { display: block; font-size: 14px; color: var(--ink); font-weight: 600; }
.position-list small { color: var(--muted); font-size: 12.5px; }
.office-card footer { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 16px 14px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); font-size: 12.5px; }
.route-inline { color: var(--navy-700); flex: 1 1 200px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--navy-600); font: 600 13px var(--sans); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.link-btn:hover { color: var(--navy-900); }
.choice-list { display: grid; gap: 8px; margin: 10px 0; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer; margin: 0 !important; }
.choice:has(input:checked) { border-color: var(--navy-600); background: var(--sky); }
.choice input { margin-top: 3px; }
.choice b { display: block; color: var(--navy-900); font-size: 14px; }
.choice small { color: var(--muted); font-size: 12.5px; }
.advanced { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.advanced summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--navy-700); }
.perm-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin-top: 10px; }
.perm-list .inline-check { margin: 0; font-size: 13.5px; }
.route-step-row { grid-template-columns: 28px minmax(0, 1fr) auto; }
.step-num { width: 26px; height: 26px; border-radius: 50%; background: var(--sky); color: var(--navy-800); font: 700 12.5px var(--sans); display: grid; place-items: center; }
.congress-add { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.congress-add label { flex: 1 1 280px; }
.admin-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--navy-900); color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow); transition: opacity .2s ease, transform .2s ease; z-index: 200; }
.admin-toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 640px) {
  .assign-controls, .perm-list { grid-template-columns: 1fr; }
  .office-grid { grid-template-columns: 1fr; }
}

/* ---------- Модальні вікна ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(7, 16, 30, .55); backdrop-filter: blur(3px); }
.modal-card {
  width: min(620px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(7, 16, 30, .35);
  padding: 24px;
  position: relative;
}
.modal-card h3 { margin: 0 40px 8px 0; color: var(--navy-900); font-size: 20px; }
.modal-card label { display: block; margin: 12px 0; }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); color: var(--navy-900);
  cursor: pointer; font-size: 22px; line-height: 1;
}
.modal-close:hover { background: var(--sky); }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* ---------- Футер ---------- */
.footer { background: var(--navy-950); color: #9fadc3; font-size: 13px; padding: 26px 0; margin-top: auto; flex-shrink: 0; width: 100%; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px 28px; flex-wrap: wrap; }
.footer-brand b { display: block; color: #fff; letter-spacing: .04em; font-size: 13.5px; }
.footer-brand span { display: block; margin-top: 2px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: #c9d5e8; }
.footer-links a:hover { color: var(--gold-soft); }
.footer-note { color: #7d8ba2; }

/* ---------- Конституція й тексти актів ---------- */
.article { line-height: 1.65; }
.article h3 { margin-top: 28px; color: var(--navy-800); }
.const-doc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-soft); padding: clamp(20px, 4vw, 40px) clamp(18px, 5vw, 56px) 48px; }
.const-kicker { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-600); margin: 0 0 6px; text-align: center; font-weight: 700; }
.const-title { text-align: center; margin: 0 0 18px; font: 800 clamp(26px, 3.4vw, 36px) var(--serif); color: var(--navy-950); }
.const-toc { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px 8px; margin: 20px 0 28px; }
.const-toc h3 { margin: 0 0 10px; }
.const-toc ol { margin: 0 0 12px; padding-left: 22px; }
.const-toc li { margin: 4px 0; }
.const-toc .muted a { margin-right: 2px; }
.const-sec { scroll-margin-top: 64px; padding-top: 8px; }
.const-sec h3 { border-top: 2px solid var(--navy-900); padding-top: 18px; color: var(--navy-950); letter-spacing: .02em; font-family: var(--serif); }
.to-toc { font-size: 12px; margin: -8px 0 16px; }
.const-art { scroll-margin-top: 64px; padding: 10px 0 6px; border-bottom: 1px solid var(--line); }
.const-art h4 { margin: 0 0 8px; color: var(--navy-900); font-size: 17px; }
.const-art h4 a { color: inherit; }
.art-body { margin: 0 0 8px; text-align: justify; }
.art-letters { margin: 0 0 8px; padding-left: 22px; }
.art-letters li { margin: 4px 0; }

/* Аркуш документа (перегляд). Класи doc-* — розмітка документів зі старого A4-редактора */
.published-paper { overflow-x: auto; padding: 8px 0 4px; }
.a4-page {
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto;
  padding: 24mm 22mm;
  background: #fffdf8;
  color: #101010;
  border: 1px solid #e3dac0;
  box-shadow: 0 18px 40px rgba(15, 20, 30, .16);
  font-family: "Times New Roman", Georgia, serif;
  font-size: 17px;
  line-height: 1.55;
  position: relative;
  overflow: hidden;
}
.a4-page > *:not(.doc-watermark) { position: relative; z-index: 1; }
.a4-page h2 { text-align: center; font-size: 22px; margin: 22px 0 26px; color: #111; }
.doc-head { text-align: center; border-bottom: 2px solid #1c1c1c; padding-bottom: 18px; margin-bottom: 28px; }
.doc-kicker { font-family: Arial, sans-serif; font-size: 12px; letter-spacing: .18em; color: #7a1f1f; }
.doc-head h1 { margin: 10px 0 8px; font-size: 28px; letter-spacing: .08em; color: #111; }
.doc-body h3 { margin: 20px 0 8px; font-size: 18px; }
.doc-table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15px; }
.doc-table th, .doc-table td { border: 1px solid #444; padding: 7px 9px; vertical-align: top; }
.doc-table th { background: #f3efe2; }
.doc-meta-block th { width: 120px; }
.doc-sign { margin-top: 54px; display: grid; grid-template-columns: 1fr 150px 1fr; gap: 18px; align-items: end; }
.sign-line { border-bottom: 1px solid #111; height: 28px; }
.doc-seal { width: 118px; height: 118px; border: 4px double #7a1f1f; border-radius: 50%; color: #7a1f1f; display: grid; place-items: center; text-align: center; font: 700 13px Arial, sans-serif; line-height: 1.2; margin: 28px 0 0 auto; }
.doc-watermark { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; color: rgba(122, 31, 31, .08); font: 900 96px Arial, sans-serif; letter-spacing: .18em; transform: rotate(-28deg); z-index: 0; }
.doc-free-field { position: absolute; left: 24mm; top: 48mm; width: 180px; min-height: 42px; padding: 8px; }

/* Законодавча база: фільтри */
.act-filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.act-filters label { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.act-filters select, .act-filters input { min-width: 200px; }

/* ---------- Адаптив ---------- */
@media (max-width: 1000px) {
  .quick-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-service-grid { grid-template-columns: 1fr 1fr; }
  .header-inner { flex-wrap: wrap; }
  .search { order: 3; flex: 1 1 100%; max-width: none; }
}
@media (max-width: 860px) {
  .grid-2, .portal-hero, .citizen-portal, .lifecycle-grid { grid-template-columns: 1fr; }
  .hero-stats { margin-top: 4px; }
  .cabinet-layout { grid-template-columns: 1fr; gap: 16px; }
  .side-nav { position: static; }
  .side-links { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .nav-toggle { display: inline-flex; }
  .nav-links { display: none; width: 100%; flex-direction: column; padding-bottom: 8px; }
  .nav-inner { flex-wrap: wrap; }
  .nav-inner.open .nav-links { display: flex; }
  .nav a.active::after { left: 0; right: auto; top: 10px; bottom: 10px; width: 3px; height: auto; }
  .admin-guide { grid-template-columns: 1fr 1fr; }
  .a4-page { width: 794px; min-height: 1123px; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .topbar { display: none; }
  .wrap { width: calc(100% - 24px); padding-top: 20px; }
  .header-inner { width: calc(100% - 24px); gap: 12px; padding: 12px 0; }
  .brand { flex: 1 1 0; }
  .brand > div:last-child { min-width: 0; }
  .brand h1 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand p { display: none; }
  .account-main.is-user { padding-right: 10px; }
  .crest { width: 40px; height: 40px; font-size: 12px; }
  .crest.crest-logo { width: auto; height: 48px; }
  .hero-logo { height: 96px; }
  .account-sub { display: none; }
  .card { padding: 16px; }
  .quick-links, .portal-service-grid, .form-grid, .profile-hero, .admin-guide { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); }
  .hero-stats b { font-size: 22px; }
  .act-row, .act-row:has(.btn) { grid-template-columns: 1fr; gap: 6px; }
  .act-row:has(.btn) > span { grid-column: auto; }
  .act-row > span, .row-actions { justify-content: flex-start; }
  .meta-table th { width: 38%; }
  .admin-list-row { grid-template-columns: 1fr; }
  .admin-row-actions { justify-content: flex-start; }
  .admin-actions, .section-head, .admin-section-head, .admin-hero-panel { display: grid; }
  .admin-quick-actions, .admin-search { min-width: 0; width: 100%; justify-content: flex-start; }
  .signer-row { grid-template-columns: 30px minmax(0, 1fr); }
  .signer-state { grid-column: 2; justify-items: start; }
  .footer-inner { display: grid; }
  .modal-card { padding: 18px; }
  .act-filters select, .act-filters input { min-width: 0; }
  .act-filters label { flex: 1 1 100%; }
}

/* ---------- Друк ---------- */
@media print {
  body { background: #fff; }
  .topbar, .header, .nav, .footer, .side-nav, .crumbs, .meta-table, .lifecycle-card { display: none !important; }
  .wrap { width: 100%; padding: 0; }
  .cabinet-layout { display: block; }
  .a4-page { width: 210mm; min-height: 297mm; border: 0; box-shadow: none; margin: 0; }
}

/* ---------- Шлях погодження: Автор → кроки → Публікація ---------- */
.approval-path { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; align-items: stretch; row-gap: 8px; }
.approval-path li {
  position: relative; display: flex; flex-direction: column; justify-content: center; min-width: 0;
  margin-right: 24px; padding: 6px 11px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); font-size: 12.5px; line-height: 1.25;
}
.approval-path li:last-child { margin-right: 0; }
.approval-path li:not(:last-child)::after { content: "→"; position: absolute; right: -18px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.approval-path li b { color: var(--ink); font-weight: 600; }
.approval-path li small { color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.approval-path li.done b::before { content: "✓ "; color: var(--ok); }
.approval-path li.current { border-color: var(--gold); background: var(--gold-tint); box-shadow: 0 0 0 2px rgba(212, 167, 44, .22); }
.approval-path li.current b::before { content: "● "; color: var(--gold-600); }
.approval-path li.back { border-color: var(--danger); background: var(--danger-tint); }
.approval-path li.back b::before { content: "↩ "; color: var(--danger); }
.approval-path li.wait { opacity: .85; }
.approval-path li.final.done { border-color: var(--ok); background: var(--ok-tint); }
.approval-path.compact li { padding: 4px 9px; font-size: 12px; }
.approval-set { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px 4px; margin: 12px 0 4px; display: grid; gap: 6px; }
.approval-set legend { padding: 0 6px; font-weight: 600; font-size: 13.5px; color: var(--ink); }

/* ---------- Темна тема ----------
   Вмикається атрибутом data-theme="dark" на <html> (перемикач у шапці, вибір зберігається в браузері).
   Темно-сині змінні лишаються фоном шапки й кнопок, тому тексти, що ними пофарбовані, перевизначено окремо.
   Аркуші документів (.a4-page, .ch-sheet) навмисно лишаються світлими — як папір. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --sky: #1b2a42;
  --gold-tint: #2a2413;
  --paper: #0a111d;
  --surface: #111a2a;
  --surface-2: #162133;
  --ink: #e5eaf2;
  --ink-2: #c3ccda;
  --muted: #8e9bb1;
  --line: #223049;
  --line-strong: #30405c;
  --ok: #52c08f;
  --ok-tint: #11301f;
  --draft: #a792f7;
  --draft-tint: #221c3b;
  --warn: #e2b64d;
  --warn-tint: #2d250f;
  --dead: #9aa3b4;
  --dead-tint: #1b2232;
  --danger: #f2787e;
  --danger-tint: #37161a;
  --shadow: 0 18px 44px rgba(0, 0, 0, .45);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
}
:root[data-theme="dark"] body {
  background: radial-gradient(1200px 420px at 50% -120px, rgba(60, 110, 190, .14), transparent 70%), var(--paper);
}
/* Заголовки й підписи, що були темно-синіми */
:root[data-theme="dark"] :is(.page-title, .card h3, .side-me b, .side-nav a:hover, .side-nav a.active, .hint b, .guide-step b,
  .act-row h3 a, .inbox-h, .admin-row-title b, .lifecycle-grid h4, .timeline-item b, .signer-row b, .quick-links b, .org-list b,
  .structure-row b, .metric b, .profile-details b, .admin-stat b, .admin-section-head h3, .office-card header b, .link-btn:hover,
  .choice b, .modal-card h3, .modal-close, .article h3, .const-title, .const-sec h3, .const-art h4) { color: var(--ink); }
/* Посилання й акценти */
/* Звичайні посилання: :where дає вагу як у базового «a», тож кнопки й пункти меню зберігають свої кольори */
:where(:root[data-theme="dark"]) a { color: #8fb6ec; }
:where(:root[data-theme="dark"]) a:hover { color: #b5cff4; }
:root[data-theme="dark"] .crumbs a,
:root[data-theme="dark"] .route-line,
:root[data-theme="dark"] .route-inline,
:root[data-theme="dark"] .link-btn,
:root[data-theme="dark"] .advanced summary,
:root[data-theme="dark"] .side-nav a.active .ico { color: #8fb6ec; }
:root[data-theme="dark"] .act-row h3 a:hover { color: #b5cff4; }
:root[data-theme="dark"] :is(.side-nav a:not(.create-doc-link), .account-sub, .footer-links a) { color: var(--ink-2); }
:root[data-theme="dark"] :is(.side-nav a:not(.create-doc-link):hover, .side-nav a.active:not(.create-doc-link)) { color: var(--ink); }
:root[data-theme="dark"] :is(.user-avatar, .admin-code, .step-num, .inbox-h .count) { color: #bcd3f2; }
:root[data-theme="dark"] .btn.ghost { color: #dbe6f6 !important; }
:root[data-theme="dark"] .btn.gold, :root[data-theme="dark"] .account-main:not(.is-user) { color: var(--navy-950) !important; }
:root[data-theme="dark"] .const-sec h3 { border-top-color: var(--line-strong); }
/* Поверхні, що були білими */
:root[data-theme="dark"] :is(input, select, textarea, .search input, .portal-login-card, .modal-card) { background: var(--surface); color: var(--ink); }
:root[data-theme="dark"] .search input { background: var(--surface-2); }
:root[data-theme="dark"] .admin-hero-panel { background: linear-gradient(135deg, var(--surface), var(--sky)); }
:root[data-theme="dark"] .admin-list-row.is-attention { border-color: #5a4a1e; background: linear-gradient(90deg, var(--gold-tint), var(--surface) 60%); }
:root[data-theme="dark"] .signer-row.is-draft { border-color: #3b3263; background: var(--draft-tint); }
:root[data-theme="dark"] .appeal-thread div.from-office { border-color: var(--line-strong); }
:root[data-theme="dark"] .profile-photo { border-color: var(--surface); }
:root[data-theme="dark"] .notice { border-color: #5a4a1e; }
:root[data-theme="dark"] .notice.danger { border-color: #5c2a2e; }
:root[data-theme="dark"] .btn.danger, :root[data-theme="dark"] .btn.ghost.danger { border-color: #5c2a2e !important; }
:root[data-theme="dark"] .admin-tabs button.active { background: var(--navy-700); }
:root[data-theme="dark"] .footer { background: #050a13; }

/* Перемикач теми в шапці */
.theme-toggle {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; flex: 0 0 auto;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .08);
  color: #fff; cursor: pointer;
}
.theme-toggle:hover { background: rgba(255, 255, 255, .18); }
.theme-toggle .ico { width: 18px; height: 18px; }
@media print {
  :root[data-theme="dark"] { color-scheme: light; }
}

/* Повідомлення: вкладки й підказка під ними */
.inbox-tabs { margin: 6px 0 4px; }
.inbox-tab-hint { margin: 8px 2px 4px; font-size: 13px; }
.inbox-row.is-attention { border-left: 3px solid var(--danger); padding-left: 10px; }

/* Пошук: уривок тексту зі збігом */
.search-snippet { margin: 6px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.search-snippet mark { background: var(--gold-tint); color: inherit; border-radius: 3px; padding: 0 2px; box-shadow: inset 0 -2px 0 var(--gold); }

/* Адмін-панель: журнал дій */
.audit-filter { min-width: 220px; }
.audit-list { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.audit-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) minmax(0, 220px); gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13.5px; background: var(--surface); }
.audit-row:last-child { border-bottom: 0; }
.audit-row time { color: var(--muted); font-variant-numeric: tabular-nums; }
.audit-row small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; overflow-wrap: anywhere; }
.audit-row > span { text-align: right; overflow-wrap: anywhere; }
@media (max-width: 720px) { .audit-row { grid-template-columns: 1fr; gap: 2px; } .audit-row > span { text-align: left; } }

/* Повідомлення: документ чекає рішення понад добу */
.inbox-row.is-overdue { border-left: 3px solid var(--warn); padding-left: 10px; }
.inbox-row h3 .badge { margin-left: 8px; vertical-align: middle; font-size: 11px; }

/* Лічильники статусів у реєстрі — клікабельні фільтри */
.pill-btn { cursor: pointer; font: inherit; }
.pill-btn:hover { border-color: var(--navy-600); }

/* Фото у вікні профілю: попередній перегляд і кнопки «Завантажити» / «З Discord» */
.profile-photo-edit { display: grid; gap: 8px; margin: 4px 0 14px; }
.profile-photo-label { font-weight: 600; }
.profile-photo-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.profile-photo-preview { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); font: 700 26px var(--serif); color: var(--navy-800); flex: none; }
.profile-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.profile-photo-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Життєвий цикл: згортання довгих журналів, порівняння редакцій */
.fold-btn { margin-top: 4px; font-size: 13px; padding: 6px 12px; }
.timeline-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--navy-600); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-btn:hover { color: var(--gold-600); }
.version-modal { width: min(960px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; }
.version-modal .published-paper { margin: 0; }
.diff-text { white-space: normal; line-height: 1.7; font-size: 15px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow-wrap: anywhere; }
.diff-text ins, .diff-meta ins, .diff-legend ins { background: #dcf5e3; color: #14532d; text-decoration: none; border-radius: 3px; padding: 0 2px; }
.diff-text del, .diff-meta del, .diff-legend del { background: #fde2e1; color: #7f1d1d; border-radius: 3px; padding: 0 2px; }
:root[data-theme="dark"] .diff-text ins, :root[data-theme="dark"] .diff-meta ins, :root[data-theme="dark"] .diff-legend ins { background: #14532d; color: #dcf5e3; }
:root[data-theme="dark"] .diff-text del, :root[data-theme="dark"] .diff-meta del, :root[data-theme="dark"] .diff-legend del { background: #7f1d1d; color: #fde2e1; }
.diff-meta { margin: 0 0 12px; padding-left: 18px; }
.diff-legend { display: flex; gap: 10px; font-size: 12.5px; }
.fund-anchor { scroll-margin-top: 72px; }
.fund-anchor:target { background: rgba(212, 166, 47, .18); border-radius: 4px; }
@media (max-width: 720px) { .lifecycle-grid { grid-template-columns: 1fr; } }

/* Головна: блок «Основний закон штату» */
.fundamental-card { margin-bottom: 18px; border-top: 3px solid var(--gold); }
.fundamental-card h3 { margin-top: 2px; }
.fund-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.fund-item { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: inherit; text-decoration: none; }
.fund-item b { color: var(--navy-900); font-family: var(--serif); font-size: 16px; }
.fund-item span { color: var(--muted); font-size: 12.5px; }
.fund-item:hover { border-color: var(--gold); box-shadow: var(--shadow-soft); }
:root[data-theme="dark"] .fund-item b { color: var(--ink); }
.btn.ghost.is-on { border-color: var(--gold); background: rgba(212, 166, 47, .14); }

/* Звернення: список + переписка (як месенджер) */
.appeals-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.appeals-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.appeals-toolbar input[type=search] { flex: 1 1 220px; min-width: 0; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.seg button, .seg label span { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font: 600 13px var(--sans); color: var(--ink-2); cursor: pointer; display: inline-block; }
.seg button.active, .seg input:checked + span { background: var(--navy-800); color: #fff; }
.seg label { margin: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.kind-seg { margin-bottom: 12px; }
.appeals-layout { display: grid; grid-template-columns: minmax(260px, 360px) 1fr; gap: 14px; align-items: start; min-width: 0; }
.appeals-list { display: grid; gap: 6px; max-height: 70vh; overflow: auto; padding-right: 2px; }
.appeal-item { display: grid; gap: 3px; text-align: left; width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: inherit; font: inherit; cursor: pointer; position: relative; }
.appeal-item:hover { border-color: var(--navy-600); }
.appeal-item.is-active { border-color: var(--navy-800); box-shadow: inset 3px 0 0 var(--navy-800); background: var(--sky); }
.appeal-item.is-unread::after { content: ""; position: absolute; top: 12px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: #d64545; }
.appeal-item-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding-right: 12px; }
.appeal-item-top b { font-size: 14px; color: var(--navy-900); }
.appeal-item-meta { font-size: 12px; color: var(--muted); }
.appeal-item-last { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appeal-detail { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); min-height: 320px; display: flex; flex-direction: column; min-width: 0; }
.appeal-empty { margin: auto; display: grid; gap: 4px; text-align: center; color: var(--muted); padding: 40px 16px; }
.appeal-empty b { color: var(--ink-2); }
.appeal-detail-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.appeal-detail-head h3 { margin: 0 0 4px; }
.appeal-back { display: none; }
.appeal-chat { display: flex; flex-direction: column; gap: 10px; padding: 16px; max-height: 52vh; overflow: auto; }
.chat-msg { max-width: 82%; padding: 9px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); align-self: flex-start; }
.chat-msg.from-office { background: var(--sky); border-color: #cfdcf0; }
.chat-msg.is-own { align-self: flex-end; }
.chat-who { display: block; font-weight: 700; font-size: 13px; color: var(--navy-900); }
.chat-who small { font-weight: 400; color: var(--muted); }
.chat-msg p { margin: 4px 0; white-space: normal; overflow-wrap: anywhere; }
.chat-msg time { display: block; font-size: 11.5px; color: var(--muted); text-align: right; }
.appeal-reply { padding: 12px 16px 16px; border-top: 1px solid var(--line); }
.appeal-reply textarea { width: 100%; min-height: 76px; }
.appeal-reply .form-actions { margin-top: 8px; }
.appeal-closed { padding: 12px 16px; margin: 0; border-top: 1px solid var(--line); }
.appeal-modal { width: min(620px, calc(100vw - 32px)); }
:root[data-theme="dark"] .appeal-item.is-active, :root[data-theme="dark"] .chat-msg.from-office { background: #1b2a44; border-color: #2c4064; }
:root[data-theme="dark"] .appeal-item-top b, :root[data-theme="dark"] .chat-who { color: var(--ink); }
@media (max-width: 900px) {
  .appeals-layout { grid-template-columns: 1fr; }
  .appeals-layout.has-selection .appeals-list { display: none; }
  .appeals-layout:not(.has-selection) .appeal-detail { display: none; }
  .appeal-back { display: inline-flex; }
  .appeal-detail-head { flex-wrap: wrap; }
  .chat-msg { max-width: 92%; }
}

/* Вкладення: мініатюри фото й файли PDF у переписці */
.att-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.att { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; padding: 0; color: inherit; font: inherit; }
.att-img { width: 96px; height: 72px; overflow: hidden; display: grid; place-items: center; }
.att-img img { width: 100%; height: 100%; object-fit: cover; }
.att-ph { font-size: 22px; opacity: .6; }
.att-file { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; padding: 6px 10px; max-width: 240px; text-align: left; }
.att-file span { grid-row: span 2; font-size: 20px; }
.att-file b { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-file small { color: var(--muted); font-size: 11.5px; }
.att:hover { border-color: var(--navy-600); }
.att-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.att-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); font-size: 12.5px; max-width: 260px; }
.att-chip button { border: 0; background: none; cursor: pointer; font-size: 15px; line-height: 1; color: var(--muted); }
.att-picker { display: grid; gap: 4px; margin: 4px 0 10px; justify-items: start; }
.att-add { cursor: pointer; }
.appeal-case-link { padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: 13.5px; }

/* Суд: картка справи */
.case-body { padding: 14px 16px 0; display: grid; gap: 12px; min-width: 0; }
.case-meta { margin: 0; }
.case-decision { margin: 6px 0 0; }
.case-summary p { margin: 8px 0 0; }
.case-actions { display: grid; gap: 8px; padding: 12px; border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--surface-2); }
.case-action-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.case-action-row > b { min-width: 110px; font-size: 13px; color: var(--navy-900); }
.case-action-row select, .case-action-row input { width: auto; min-width: 0; flex: 1 1 160px; }
.case-decide textarea { flex: 1 1 100%; min-height: 64px; }
.case-h { margin: 6px 0 0; }
.case-timeline { padding: 4px 0 12px; max-height: 46vh; }
.case-event { display: flex; gap: 10px; align-items: flex-start; align-self: stretch; padding: 6px 10px; border-left: 3px solid var(--gold); background: var(--surface-2); border-radius: 0 8px 8px 0; }
.case-event b { display: block; font-size: 13.5px; font-weight: 600; }
.case-event small { color: var(--muted); font-size: 12px; }
:root[data-theme="dark"] .case-action-row > b { color: var(--ink); }

/* Робочий простір кабінету */
.office-head { align-items: flex-start; }
.office-switch select { width: auto; margin-left: 6px; }
.ws-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.ws-card { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-soft); display: grid; gap: 2px; }
.ws-card b { font: 800 26px var(--serif); color: var(--navy-900); }
.ws-card span { color: var(--muted); font-size: 13px; }
.ws-points { display: grid; justify-items: end; }
.ws-points b { font-size: 20px; color: var(--navy-900); }
.ws-points small { color: var(--muted); font-size: 11.5px; }
.ws-settings .form-grid { margin-bottom: 8px; }
.ws-list { display: grid; gap: 8px; }
.ws-item { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.ws-item.is-open { border-color: var(--navy-600); box-shadow: var(--shadow-soft); }
.ws-item-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; background: none; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.ws-item-head > span:first-child { display: grid; gap: 2px; min-width: 0; }
.ws-item-head small { color: var(--muted); font-size: 12.5px; }
.ws-item-side { display: flex; gap: 6px; align-items: center; flex: none; }
.ws-link { text-decoration: none; color: inherit; }
.ws-link:hover { border-color: var(--navy-600); }
.ws-item-body { padding: 0 14px 14px; display: grid; gap: 8px; }
.ws-text { margin: 0; line-height: 1.6; overflow-wrap: anywhere; }
.ws-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items: start; }
.ws-col { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 8px; min-width: 0; }
.ws-col h4 { margin: 0 0 2px; font-size: 13.5px; }
.ws-empty { margin: 0; text-align: center; }
.ws-task { display: grid; gap: 4px; text-align: left; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: inherit; font: inherit; cursor: pointer; }
.ws-task:hover, .ws-task.is-active { border-color: var(--navy-600); }
.ws-task b { font-size: 13.5px; overflow-wrap: anywhere; }
.ws-task small { color: var(--muted); font-size: 12px; }
.ws-task .pill { justify-self: start; }
.ws-overdue { color: #b42318; font-weight: 700; }
.ws-task-detail .case-action-row { margin-top: 10px; }
.ws-range { display: inline-flex; gap: 6px; align-items: center; }
.ws-range input { width: auto; }
.table-scroll { overflow-x: auto; }
.ws-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ws-table th, .ws-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.ws-table th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ws-table td small { display: block; color: var(--muted); font-size: 12px; }
.ws-bonus { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.ws-bonus summary { cursor: pointer; }
:root[data-theme="dark"] .ws-card b, :root[data-theme="dark"] .ws-points b { color: var(--ink); }
@media (max-width: 900px) { .ws-board { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .ws-board { grid-template-columns: 1fr; } }

/* Бічне меню кабінету: «Мій кабінет» — перший і виділений; список усіх кабінетів для адміністрації */
.my-office-link { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; padding: 12px 14px; border-radius: 12px; text-decoration: none;
  background: linear-gradient(120deg, var(--navy-900, #10284a), var(--navy-700, #1d4373)); color: #fff !important; box-shadow: 0 8px 20px rgba(16, 40, 74, .25); border: 1px solid rgba(212, 166, 47, .55); }
.my-office-link:hover { filter: brightness(1.08); }
.my-office-link .my-office-ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; background: rgba(255,255,255,.12); border: 1px solid var(--gold); flex: none; }
.my-office-link b { display: block; font-size: 14.5px; }
.my-office-link small { display: block; font-size: 11.5px; color: rgba(255,255,255,.72); line-height: 1.3; }
.my-office-link > span:last-child { margin-left: auto; color: var(--gold); font-weight: 800; }
.side-offices { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.side-offices p { margin: 0 0 4px 10px; font: 700 11px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.side-offices a { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 9px; text-decoration: none; color: var(--ink-2); font-size: 13.5px; }
.side-offices a:hover { background: var(--surface-2); color: var(--navy-900); }
.side-offices a span:first-child { width: 22px; text-align: center; }
/* Судовий інтерфейс у сайті кабінету суду: заголовок дає сам сайт */
.ws-content .court-page .appeals-head h2 { display: none; }
/* Уточнення: загальне правило .side-nav a span { flex: 1 } не має розтягувати значки */
.side-nav a.my-office-link { padding: 12px; gap: 10px; color: #fff; }
.side-nav a.my-office-link:hover { background: linear-gradient(120deg, var(--navy-900, #10284a), var(--navy-700, #1d4373)); color: #fff; }
.side-nav a.my-office-link span.my-office-ico { flex: 0 0 34px; }
.side-nav a.my-office-link span:nth-child(2) { flex: 1 1 auto; min-width: 0; }
.side-nav a.my-office-link span:last-child { flex: 0 0 auto; }
.side-nav .side-offices a { padding: 7px 10px; }
.side-nav .side-offices a span:first-child { flex: 0 0 22px; }
.side-nav .side-offices a span:last-child { flex: 1 1 auto; line-height: 1.3; }
