/* Municipal Police Department. Colours taken from the Alamo and Santos badges. */
:root {
  --navy: #0E1D54;
  --navy-deep: #081236;
  --navy-line: #24356F;
  --gold: #EDB302;
  --gold-soft: #F7D667;
  --sky: #0A78C2;
  --black: #0B0C0F;
  --ink: #141824;
  --muted: #586079;
  --paper: #F4F6FA;
  --card: #FFFFFF;
  --line: #DCE1EB;
  --radius: 10px;
  --wrap: 1360px;
  --head: 'Oswald', 'Arial Narrow', sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.6 var(--body); }
img { max-width: 100%; height: auto; }
a { color: var(--sky); }
h1, h2, h3 { font-family: var(--head); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; letter-spacing: .01em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); text-transform: uppercase; }
h2 { font-size: 1.45rem; text-transform: uppercase; }
h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--gold); color: var(--black); padding: 8px 12px; z-index: 10; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Header */
.site-header { background: var(--black); border-bottom: 3px solid var(--gold); position: sticky; top: 0; z-index: 5; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-family: var(--head); font-size: 1.15rem; text-transform: uppercase; letter-spacing: .04em; }
.brand img { height: 40px; width: auto; }
.brand span { margin-left: 6px; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a { color: #E6E9F2; text-decoration: none; font-weight: 500; font-size: .95rem; padding: 8px 12px; border-radius: 6px; }
nav a:hover { background: rgba(255, 255, 255, .08); }
nav a[aria-current="page"] { color: var(--black); background: var(--gold); }

/* Hero */
.hero { background: radial-gradient(1200px 500px at 15% 0%, var(--navy-line), transparent 60%), linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%); color: #fff; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: linear-gradient(90deg, var(--gold), var(--gold-soft), var(--gold)); }
.hero-row { display: flex; align-items: center; gap: 48px; padding-top: 64px; padding-bottom: 72px; }
.hero-badges { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.hero-badges img { height: 220px; width: auto; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .45)); }
.eyebrow { font-variant-ligatures: none; font-family: var(--head); text-transform: uppercase; letter-spacing: .22em; font-size: .9rem; color: var(--gold); margin-bottom: .6em; }
.hero h1 { color: #fff; }
.lead { font-size: 1.15rem; color: #C9D0E3; max-width: 560px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.button { display: inline-block; background: var(--gold); color: var(--black); font-family: var(--head); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; text-decoration: none; padding: 12px 22px; border-radius: 6px; border: 2px solid var(--gold); }
.button:hover { background: var(--gold-soft); border-color: var(--gold-soft); }
.button.ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .5); }
.button.ghost:hover { border-color: #fff; background: rgba(255, 255, 255, .06); }

/* Stats */
.stats { background: var(--card); border-bottom: 1px solid var(--line); }
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat { padding: 24px 16px; text-align: center; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat .value { display: block; font-family: var(--head); font-size: 2.4rem; font-weight: 600; color: var(--navy); line-height: 1.1; }
.stat.main .value { color: var(--sky); }
.stat .label { display: block; font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-top: 4px; }

/* Chief's message */
.message { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; padding-top: 48px; padding-bottom: 64px; }
.message-card, .leadership, .division, .top-command { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.message-card { padding: 32px; border-top: 5px solid var(--navy); }
.message-card blockquote { margin: 0; padding-left: 20px; border-left: 3px solid var(--gold); font-size: 1.1rem; }
.signature { font-family: var(--head); text-transform: uppercase; letter-spacing: .08em; color: var(--navy); margin: 16px 0 0 20px; }
.leadership { padding: 28px; border-top: 5px solid var(--gold); }
.text-link { display: inline-block; margin-top: 12px; font-weight: 600; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* People lists */
.people { list-style: none; margin: 0; padding: 0; }
.person { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.person:first-child { border-top: 0; }
.callsign { flex-shrink: 0; min-width: 52px; text-align: center; font-family: var(--head); font-weight: 600; font-size: .95rem; color: #fff; background: var(--navy); border-radius: 5px; padding: 3px 8px; }
.who { display: flex; flex-direction: column; line-height: 1.3; }
.name { font-weight: 600; }
.rank { font-size: .85rem; color: var(--muted); }
.vacant .name { color: var(--muted); font-weight: 500; font-style: italic; }
.vacant .callsign { background: #8A93A8; }
.people.compact .person { padding: 6px 0; }

/* Chain of command */
.page-head { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%); color: #fff; padding: 48px 0 40px; border-bottom: 6px solid var(--gold); }
.page-head h1 { color: #fff; }
.chart { padding-top: 40px; padding-bottom: 64px; }
.top-command { max-width: 520px; margin: 0 auto; padding: 16px 24px; border-top: 5px solid var(--gold); position: relative; }
.top-command::after { content: ''; position: absolute; left: 50%; bottom: -33px; width: 2px; height: 32px; background: var(--line); }
.divisions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 32px; }
.division { padding: 24px; border-top: 5px solid var(--navy); }
.division h2 { color: var(--navy); }
.division h3 { margin-top: 24px; }
.units { list-style: none; margin: 0; padding: 0; }
.unit { padding: 12px 0; border-top: 1px solid var(--line); }
.unit-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.unit-name { font-weight: 600; }
.unit-parent { display: block; font-weight: 400; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.unit-count { flex-shrink: 0; font-size: .8rem; font-weight: 600; color: var(--navy); background: #E8ECF6; border-radius: 999px; padding: 2px 10px; }

/* Footer */
.site-footer { background: var(--black); color: #A9B0C2; border-top: 3px solid var(--gold); padding: 32px 0; font-size: .9rem; }
.footer-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand img { height: 44px; width: auto; }
.footer-brand strong { display: block; color: #fff; font-family: var(--head); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.footer-brand span { color: var(--gold); font-size: .85rem; }
.site-footer p { margin: 0; max-width: 520px; }

@media (max-width: 900px) {
  .hero-row { flex-direction: column; text-align: center; gap: 28px; padding-top: 40px; padding-bottom: 48px; }
  .hero-badges img { height: 150px; }
  .lead { margin-left: auto; margin-right: auto; }
  .actions { justify-content: center; }
  .message { grid-template-columns: 1fr; }
  .divisions { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .brand span { display: none; }
  .stat { border-left: 0; border-top: 1px solid var(--line); }
  .stat:first-child { border-top: 0; }
  .message-card, .leadership, .division { padding: 20px; }
}

/* Account area in the header */
.header-row nav { margin-left: auto; }
.login { color: var(--black); background: var(--gold); text-decoration: none; font-weight: 600; font-size: .9rem; padding: 7px 14px; border-radius: 6px; white-space: nowrap; }
.login:hover { background: var(--gold-soft); }
.account { display: flex; align-items: center; gap: 8px; margin: 0; color: #E6E9F2; font-size: .9rem; }
.account img { width: 28px; height: 28px; border-radius: 50%; }
.account button { font: inherit; font-size: .85rem; color: #E6E9F2; background: transparent; border: 1px solid rgba(255, 255, 255, .35); border-radius: 6px; padding: 5px 10px; cursor: pointer; }
.account button:hover { border-color: #fff; }

/* Status chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: #E8ECF6; color: var(--navy); }
.chip.good { background: #DDF3E6; color: #17663A; }
.chip.bad { background: #FBE1E1; color: #9B1C1C; }
.chip.warn { background: #FFF1C9; color: #7A5600; }
.chip.info { background: #DCEEFB; color: #0A5A93; }

/* Profiles */
.profile-row { display: flex; align-items: center; gap: 24px; }
.avatar { width: 88px; height: 88px; border-radius: 50%; border: 3px solid var(--gold); background: var(--navy-line); flex-shrink: 0; }
.profile-head .lead { margin-bottom: .6em; }
.profile { display: grid; grid-template-columns: 1fr 1.3fr; gap: 24px; padding-top: 40px; padding-bottom: 64px; align-items: start; }
.card { background: var(--card); border: 1px solid var(--line); border-top: 5px solid var(--navy); border-radius: var(--radius); padding: 24px; }
.fields { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.field { padding: 10px 0; border-top: 1px solid var(--line); }
.field dt { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.field dd { margin: 2px 0 0; font-weight: 500; }
.muted { color: var(--muted); font-weight: 400; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.history li:first-child { border-top: 0; }
.when { font-size: .85rem; color: var(--muted); }
.reason { display: block; margin-top: 4px; font-size: .92rem; color: var(--ink); background: var(--paper); border-left: 3px solid var(--gold); padding: 6px 10px; border-radius: 4px; }

/* Officer list */
.list { padding-top: 32px; padding-bottom: 64px; }
.section-title { margin-top: 40px; color: var(--navy); }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.officers { width: 100%; border-collapse: collapse; font-size: .95rem; }
.officers th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: #F8F9FC; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.officers td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.officers tbody tr:first-child td { border-top: 0; }
.officers tbody tr:hover { background: #F8F9FC; }
.officers a { font-weight: 600; text-decoration: none; }
.officers a:hover { text-decoration: underline; }
.num { text-align: right; }

@media (max-width: 900px) {
  .profile { grid-template-columns: 1fr; }
  .account span { display: none; }
}
@media (max-width: 560px) {
  .profile-row { flex-direction: column; align-items: flex-start; gap: 16px; }
  .fields { grid-template-columns: 1fr; }
  .history li { grid-template-columns: 1fr; gap: 2px; }
  .header-row { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
}

/* Header menu: inline on wide screens, a menu button on phones */
.menu { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.menu nav { margin-left: 0; }
.menu-toggle, .menu-button { display: none; }

/* Roster */
.roster { padding-top: 32px; padding-bottom: 72px; }
.area-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.area-card { display: grid; gap: 6px; background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--navy); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
.area-card:hover { border-top-color: var(--gold); transform: translateY(-2px); }
.area-card-name { font-family: var(--head); font-size: 1.15rem; text-transform: uppercase; letter-spacing: .03em; color: var(--navy); }
.area-card-count { font-size: .9rem; color: var(--muted); }
.area-card-count strong { color: var(--ink); font-size: 1.05rem; }
.area-card-open { font-size: .8rem; color: var(--muted); }
.bar { appearance: none; -webkit-appearance: none; width: 100%; height: 6px; border: 0; border-radius: 999px; background: #E8ECF6; overflow: hidden; }
.bar::-webkit-progress-bar { background: #E8ECF6; border-radius: 999px; }
.bar::-webkit-progress-value { background: var(--sky); border-radius: 999px; }
.bar::-moz-progress-bar { background: var(--sky); border-radius: 999px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 28px 0 8px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); position: sticky; top: 76px; z-index: 3; box-shadow: 0 6px 16px rgba(14, 29, 84, .06); }
.toolbar[hidden] { display: none; }
.toolbar input[type="search"] { flex: 1 1 260px; font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.toolbar input[type="search"]:focus { outline: none; border-color: var(--sky); background: #fff; box-shadow: 0 0 0 3px rgba(10, 120, 194, .15); }
.toggle { display: flex; align-items: center; gap: 8px; font-size: .92rem; font-weight: 500; cursor: pointer; white-space: nowrap; }
.toggle input { width: 18px; height: 18px; accent-color: var(--navy); }
.no-match { text-align: center; color: var(--muted); padding: 32px 0; }

.area { margin-top: 36px; scroll-margin-top: 150px; }
.area[hidden], .r-section[hidden], .r-row[hidden] { display: none; }
.area-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--navy); color: #fff; border-radius: var(--radius) var(--radius) 0 0; padding: 14px 20px; border-bottom: 4px solid var(--gold); }
.area-head h2 { margin: 0; color: #fff; font-size: 1.35rem; }
.area-count { font-size: .85rem; color: #C9D0E3; white-space: nowrap; }
.r-section { background: var(--card); border: 1px solid var(--line); border-top: 0; }
.area .r-section:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.r-section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px 10px; }
.r-section-head h3 { margin: 0; font-size: 1.05rem; color: var(--navy); letter-spacing: .06em; }
.r-sub { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-top: 2px; }
.r-counts { display: flex; gap: 6px; flex-shrink: 0; }
.pill { font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #E8ECF6; color: var(--navy); white-space: nowrap; }
.pill.open { background: #FFF1C9; color: #7A5600; }
.pill.full { background: #DDF3E6; color: #17663A; }

.r-cols, .r-row { display: grid; grid-template-columns: 76px minmax(150px, 1.2fr) minmax(130px, 1fr) minmax(180px, 1.6fr) 64px 104px; gap: 12px; align-items: center; padding: 0 20px; }
.r-cols { padding-top: 6px; padding-bottom: 8px; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); border-bottom: 1px solid var(--line); }
.r-rows { list-style: none; margin: 0; padding: 0; }
.r-row { min-height: 48px; padding-top: 8px; padding-bottom: 8px; border-top: 1px solid var(--line); }
.r-rows .r-row:first-child { border-top: 0; }
.r-row:hover { background: #F8F9FC; }
.r-name { font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.r-name a { color: var(--ink); text-decoration: none; }
.r-name a:hover { color: var(--sky); text-decoration: underline; }
.r-rank { font-size: .92rem; }
.r-duties { font-size: .88rem; color: var(--muted); }
.r-badge, .r-hired { font-size: .88rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.r-row .callsign { display: inline-block; }

.r-row.is-vacant { background: repeating-linear-gradient(135deg, #FAFBFD 0 10px, #F3F5FA 10px 20px); }
.r-row.is-vacant:hover { background: #F1F4FA; }
.r-row.is-vacant .callsign { background: transparent; color: #7C869C; border: 1.5px dashed #A6AEC0; padding: 1.5px 6.5px; }
.vacant-label { font-weight: 500; font-style: italic; color: #7C869C; }
.r-row.is-vacant .r-rank { color: var(--muted); }

@media (max-width: 900px) {
  .header-row { flex-wrap: wrap; }
  .menu-button { display: inline-flex; flex-direction: column; justify-content: center; gap: 5px; width: 42px; height: 42px; margin-left: auto; padding: 0 9px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 6px; cursor: pointer; }
  .menu-button span { display: block; height: 2px; background: #fff; border-radius: 2px; }
  .menu { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 8px; padding: 8px 0 14px; }
  .menu-toggle:checked ~ .menu { display: flex; }
  .menu nav { flex-direction: column; }
  .menu nav a { padding: 10px 12px; }
  .account { padding: 12px 12px 0; border-top: 1px solid rgba(255, 255, 255, .12); }
  .account span { display: inline; margin-right: auto; }
  .toolbar { position: static; box-shadow: none; }

  .r-cols { display: none; }
  .r-row { grid-template-columns: 64px 1fr auto; grid-template-areas: "cs name hired" "cs rank badge" "cs duties duties"; gap: 2px 12px; padding: 12px 16px; }
  .r-callsign { grid-area: cs; align-self: start; }
  .r-name { grid-area: name; }
  .r-rank { grid-area: rank; }
  .r-duties { grid-area: duties; }
  .r-badge { grid-area: badge; text-align: right; }
  .r-hired { grid-area: hired; text-align: right; }
  .r-section-head { padding: 14px 16px 8px; }
  .area-head { padding: 12px 16px; }
}
@media (max-width: 560px) {
  .r-section-head { flex-direction: column; align-items: flex-start; }
  .area-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .area-card { padding: 12px 14px; }
  .area-card-name { font-size: .95rem; }
  .area-card-count { font-size: .82rem; }
}

/* Roster pages: each section is its own card */
.roster .area { margin-top: 8px; }
.roster .area .r-section { border: 1px solid var(--line); border-top: 4px solid var(--navy); border-radius: var(--radius); margin-top: 20px; overflow: hidden; }

/* Header dropdown (Roster) */
.nav-group { position: relative; }
.nav-group summary { list-style: none; cursor: pointer; color: #E6E9F2; font-weight: 500; font-size: .95rem; padding: 8px 12px; border-radius: 6px; display: flex; align-items: center; gap: 6px; user-select: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after { content: ''; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
.nav-group[open] summary::after { transform: translateY(1px) rotate(-135deg); }
.nav-group summary:hover { background: rgba(255, 255, 255, .08); }
.nav-group summary[aria-current="page"] { color: var(--black); background: var(--gold); }
.dropdown { position: absolute; top: calc(100% + 8px); left: 0; min-width: 190px; background: #fff; border-radius: 8px; box-shadow: 0 12px 32px rgba(8, 18, 54, .25); padding: 6px; display: flex; flex-direction: column; z-index: 10; }
.dropdown::before { content: ''; position: absolute; top: -6px; left: 22px; width: 12px; height: 12px; background: #fff; transform: rotate(45deg); }
nav .dropdown a { color: var(--ink); padding: 9px 12px; border-radius: 6px; }
nav .dropdown a:hover { background: var(--paper); }
nav .dropdown a[aria-current="page"] { background: var(--navy); color: #fff; }

/* Employment Log */
.officers.log th, .officers.log td { padding: 9px 12px; }
.officers.log tr.groups th { text-align: center; background: var(--navy); color: #fff; font-family: var(--head); font-size: .8rem; letter-spacing: .12em; border-left: 2px solid #fff; }
.officers.log tr.groups th:first-child { border-left: 0; }
.officers .sub { display: block; font-size: .78rem; color: var(--muted); font-weight: 400; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; color: var(--muted); }
.mid { text-align: center; }
.tick { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .04em; color: #17663A; background: #DDF3E6; border-radius: 999px; padding: 2px 8px; }
.dash { color: #B3BACB; }
.count { display: inline-block; min-width: 24px; text-align: center; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.count.bad { background: #FBE1E1; color: #9B1C1C; }
.count.warn { background: #FFF1C9; color: #7A5600; }
.officers tr.is-former td { color: var(--muted); }
.officers tr.is-former a { color: var(--muted); }

@media (max-width: 900px) {
  .nav-group summary { padding: 10px 12px; }
  .dropdown { position: static; box-shadow: none; background: transparent; padding: 0 0 4px 14px; min-width: 0; }
  .dropdown::before { display: none; }
  nav .dropdown a { color: #C9D0E3; }
  nav .dropdown a:hover { background: rgba(255, 255, 255, .08); }
  nav .dropdown a[aria-current="page"] { background: var(--gold); color: var(--black); }
}

/* Header fits on one line: name + picture open My profile */
.brand { white-space: nowrap; }
.menu { gap: 12px; }
nav a, .nav-group summary { white-space: nowrap; }
.account .me { display: flex; align-items: center; gap: 8px; color: #E6E9F2; text-decoration: none; padding: 4px 8px 4px 4px; border-radius: 999px; }
.account .me:hover { background: rgba(255, 255, 255, .08); }
.account .me.current { background: var(--gold); color: var(--black); }
.account button { white-space: nowrap; }
@media (max-width: 1240px) and (min-width: 901px) {
  .brand span { display: none; }
}

/* Employment Log: wider page, short wrapped division headings */
.wrap.wide { max-width: 1600px; }
.officers.log td .chip + .chip { margin-left: 4px; }

/* Home: photos */
.photos { padding: 48px 0 0; }
.photos-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.photo { position: relative; margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--navy); box-shadow: 0 10px 30px rgba(8, 18, 54, .18); aspect-ratio: 16 / 9; }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.photo:hover img { transform: scale(1.03); }
.photo figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 48px 22px 18px; background: linear-gradient(to top, rgba(8, 18, 54, .92), rgba(8, 18, 54, 0)); color: #C9D0E3; font-size: .9rem; }
.photo figcaption span { display: block; color: #fff; font-family: var(--head); font-size: 1.4rem; text-transform: uppercase; letter-spacing: .04em; border-left: 4px solid var(--gold); padding-left: 10px; margin-bottom: 2px; }

/* Profile: awards above history */
.stack { display: grid; gap: 24px; }
.medals { list-style: none; margin: 0; padding: 0; }
.medals li { display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.medals li:first-child { border-top: 0; }
.medal { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #FBE08A, var(--gold) 55%, #B98900); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--gold), 0 3px 8px rgba(0, 0, 0, .15); position: relative; }
.medal::after { content: ''; position: absolute; inset: 7px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .55); }
.medal.big { width: 48px; height: 48px; }
.medal.big::after { inset: 10px; }

/* Awards page */
.awards { padding-top: 32px; padding-bottom: 72px; }
.flash { padding: 12px 16px; border-radius: 8px; font-weight: 500; margin: 0 0 20px; }
.flash.good { background: #DDF3E6; color: #17663A; }
.flash.bad { background: #FBE1E1; color: #9B1C1C; }
.give { border-top-color: var(--gold); margin-bottom: 32px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid label { display: grid; gap: 6px; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid select, .form-grid textarea { font: inherit; font-size: 1rem; text-transform: none; letter-spacing: 0; color: var(--ink); padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.form-grid select:focus, .form-grid textarea:focus { outline: none; border-color: var(--sky); background: #fff; box-shadow: 0 0 0 3px rgba(10, 120, 194, .15); }
.form-grid textarea { resize: vertical; min-height: 84px; }
.form-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 16px; }
.form-foot p { margin: 0; font-size: .88rem; }
.button { cursor: pointer; font-size: .95rem; }
.award-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.award-type { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 6px; align-content: start; }
.award-type h3 { margin: 8px 0 0; color: var(--navy); font-size: 1.05rem; letter-spacing: .04em; }
.award-type.empty .medal { filter: grayscale(1); opacity: .45; }
.award-count { font-size: .85rem; color: var(--muted); }
.award-type ul { list-style: none; margin: 6px 0 0; padding: 0; font-size: .92rem; }
.award-type li { padding: 4px 0; border-top: 1px solid var(--line); }
.award-type li:first-child { border-top: 0; }
.chip.gold { background: #FFF1C9; color: #7A5600; }
.awards-table td { white-space: normal; }
.wrap-text { min-width: 260px; }
.link-button { font: inherit; font-size: .88rem; color: #9B1C1C; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }

@media (max-width: 900px) {
  .photos-row, .form-grid { grid-template-columns: 1fr; }
}

/* Edit officer */
.profile > .stack:first-child { align-content: start; }
.profile-flash { margin: 24px 0 -8px; }
.edit-card summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.edit-card summary::-webkit-details-marker { display: none; }
.edit-card summary h2 { margin: 0; }
.edit-card summary h2::after { content: ' +'; color: var(--gold); }
.edit-card[open] summary h2::after { content: ' -'; }
.edit-card form { margin-top: 18px; }
.form-grid input[type="text"], .form-grid input[type="date"] { font: inherit; font-size: 1rem; text-transform: none; letter-spacing: 0; color: var(--ink); padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.checks { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px 12px; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.checks legend { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 0 6px; }
.form-grid .check { display: flex; align-items: center; gap: 8px; font-size: .95rem; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--ink); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--navy); }

/* Edit buttons */
.profile-row { position: relative; }
.edit-button { margin-left: auto; align-self: center; box-shadow: 0 6px 18px rgba(237, 179, 2, .35); }
.row-edit { display: inline-block; font-size: .8rem; font-weight: 600; color: var(--navy) !important; border: 1.5px solid var(--navy); border-radius: 6px; padding: 3px 12px; text-decoration: none !important; }
.row-edit:hover { background: var(--navy); color: #fff !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.edit-page { max-width: 820px; padding-top: 32px; padding-bottom: 72px; }
.edit-page .card { border-top-color: var(--gold); }
.hint { display: block; width: 100%; font-size: .8rem; font-weight: 400; color: var(--muted); margin-left: 26px; }
.checks { flex-direction: column; }
.form-grid .check { flex-wrap: wrap; }
.actions-row { display: flex; gap: 10px; }
.button.ghost-dark { background: transparent; color: var(--navy); border-color: var(--line); }
.button.ghost-dark:hover { border-color: var(--navy); background: transparent; }
@media (max-width: 560px) { .edit-button { margin-left: 0; } }

/* Moving officers on the roster */
.move-hint { margin: 4px 0 0; font-size: .9rem; color: var(--muted); }
.r-row.movable { cursor: grab; }
.r-row.movable:active { cursor: grabbing; }
.move-button { margin-left: auto; font: inherit; font-size: .75rem; font-weight: 600; color: var(--navy); background: #fff; border: 1.5px solid var(--line); border-radius: 6px; padding: 2px 10px; cursor: pointer; opacity: 0; transition: opacity .15s; }
.r-row:hover .move-button, .move-button:focus-visible { opacity: 1; }
.move-button:hover { border-color: var(--navy); }
.r-row.moving { opacity: .45; }
body.is-moving .r-row.drop-target { cursor: pointer; background: #EEF8F1; box-shadow: inset 4px 0 0 #2E9E5B; }
body.is-moving .r-row.drop-target .vacant-label::after { content: 'Drop here'; margin-left: 10px; font-style: normal; font-weight: 600; color: #17663A; }
.r-row.drop-target.drop-hover, body.is-moving .r-row.drop-target:hover { background: #D7F0E0; box-shadow: inset 6px 0 0 #17663A; }
.moving-banner { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 16px; background: var(--navy); color: #fff; padding: 12px 14px 12px 20px; border-radius: 10px; box-shadow: 0 12px 32px rgba(8, 18, 54, .35); border-top: 3px solid var(--gold); max-width: calc(100% - 32px); }
.moving-banner[hidden] { display: none; }
.moving-banner .button { padding: 7px 14px; }

.modal { border: 0; border-radius: 12px; padding: 0; width: min(520px, calc(100% - 32px)); box-shadow: 0 24px 60px rgba(8, 18, 54, .35); }
.modal::backdrop { background: rgba(8, 18, 54, .55); }
.modal form { padding: 26px 28px 24px; border-top: 5px solid var(--gold); }
.modal h2 { color: var(--navy); margin-bottom: 12px; }
.move-summary { margin: 16px 0; display: grid; gap: 8px; }
.move-summary div { display: flex; justify-content: space-between; gap: 16px; background: var(--paper); border-radius: 8px; padding: 10px 14px; }
.move-summary dt { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.move-summary dd { margin: 0; font-weight: 600; text-align: right; }
.move-summary.rank-change div:last-child { background: #FFF1C9; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.button[disabled] { opacity: .6; cursor: wait; }
@media (hover: none) { .move-button { opacity: 1; } }

/* Awards on profiles: ribbon rack and issuing */
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.button.small { padding: 8px 16px; font-size: .85rem; }
.rack { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; width: fit-content; max-width: 100%; padding: 12px; margin: 8px 0 16px; background: var(--navy-deep); border-radius: 8px; box-shadow: inset 0 0 0 2px var(--gold); }
.rack .ribbon { width: 128px; height: auto; display: block; border-radius: 2px; }
.rack:has(.ribbon:nth-child(4)) { width: 420px; }
.award-list { list-style: none; margin: 0; padding: 0; }
.award-list li { display: grid; grid-template-columns: 120px 1fr; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); align-items: start; }
.ribbon.small { width: 120px; height: auto; display: block; margin-top: 3px; border-radius: 2px; }
.award-list form { margin-top: 6px; }
.wide-modal { width: min(760px, calc(100% - 32px)); }
.ribbon-picker { border: 0; padding: 0; margin: 8px 0 16px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ribbon-picker legend, .field-label { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.ribbon-option { position: relative; display: grid; gap: 6px; justify-items: center; text-align: center; font-size: .82rem; font-weight: 600; color: var(--ink); padding: 10px 8px; border: 2px solid var(--line); border-radius: 8px; cursor: pointer; transition: border-color .15s, background .15s; }
.ribbon-option:hover { border-color: #B9C1D4; }
.ribbon-option input { position: absolute; opacity: 0; pointer-events: none; }
.ribbon-option .ribbon { width: 100%; height: auto; display: block; }
.ribbon-option:has(input:checked) { border-color: var(--gold); background: #FFF8E1; box-shadow: 0 0 0 3px rgba(237, 179, 2, .25); }
.ribbon-option:has(input:focus-visible) { outline: 3px solid var(--sky); outline-offset: 2px; }
.field-label { display: grid; gap: 6px; }
.field-label textarea { font: inherit; font-size: 1rem; text-transform: none; letter-spacing: 0; color: var(--ink); padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); resize: vertical; }
@media (max-width: 560px) {
  .ribbon-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rack, .rack:has(.ribbon:nth-child(4)) { width: auto; }
  .rack .ribbon { width: calc(50% - 2px); }
  .award-list li { grid-template-columns: 1fr; }
}

/* ---- Documents ---- */
.head-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.docs, .doc-view, .doc-editor { padding-top: 28px; padding-bottom: 72px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .9rem; margin-bottom: 18px; color: var(--muted); }
.crumbs a { color: var(--sky); text-decoration: none; font-weight: 500; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { color: #B3BACB; }
.crumbs span:last-child { color: var(--ink); font-weight: 600; }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 24px; }
.folder { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
.folder:hover { border-color: var(--gold); transform: translateY(-2px); }
.folder-icon { grid-row: 1 / 3; width: 44px; height: 34px; position: relative; background: var(--gold); border-radius: 3px 6px 6px 6px; }
.folder-icon::before { content: ''; position: absolute; top: -6px; left: 0; width: 18px; height: 8px; background: var(--gold); border-radius: 3px 3px 0 0; }
.folder-icon::after { content: ''; position: absolute; inset: 7px 0 0; background: #F7D667; border-radius: 3px 6px 6px 6px; }
.folder-name { font-weight: 600; }
.folder-meta { font-size: .8rem; color: var(--muted); }
.doc-toolbar { position: static; box-shadow: none; margin-top: 0; }
.label-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.label-filter .filter { cursor: pointer; border: 2px solid transparent; font: inherit; font-size: .75rem; font-weight: 600; opacity: .55; }
.label-filter .filter[aria-pressed="true"] { opacity: 1; border-color: currentColor; }
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-list.card { padding: 4px 20px; }
.doc-item { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.doc-item:first-child { border-top: 0; }
.doc-item[hidden] { display: none; }
.doc-icon { flex-shrink: 0; width: 40px; height: 48px; border-radius: 4px; display: grid; place-items: end center; padding-bottom: 6px; font-family: var(--head); font-size: .7rem; letter-spacing: .06em; color: #fff; background: var(--navy); box-shadow: inset 0 6px 0 rgba(255, 255, 255, .12); }
.doc-icon.pdf { background: #9B1C1C; }
.doc-main { flex: 1; min-width: 0; }
.doc-title { font-weight: 600; font-size: 1.02rem; color: var(--ink); text-decoration: none; }
.doc-title:hover { color: var(--sky); text-decoration: underline; }
.doc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 3px; font-size: .82rem; }
.doc-label { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 9px; border-radius: 999px; }
.c-navy { background: #E3E8F5; color: var(--navy); }
.c-gold { background: #FFF1C9; color: #7A5600; }
.c-sky { background: #DCEEFB; color: #0A5A93; }
.c-green { background: #DDF3E6; color: #17663A; }
.c-red { background: #FBE1E1; color: #9B1C1C; }
.c-orange { background: #FFE6D2; color: #9A4A0B; }
.c-purple { background: #EEE3FA; color: #5B2A91; }
.c-grey { background: #ECEEF2; color: #4A5163; }
.required-card { border-top-color: var(--gold); margin-bottom: 24px; }
.empty { padding: 24px 0; }

/* Reading a document */
.doc-view { max-width: 1000px; }
.ack-bar { padding: 12px 16px; border-radius: 8px; background: #FFF1C9; color: #5A4000; margin-bottom: 16px; }
.ack-bar.done { background: #DDF3E6; color: #17663A; }
.protected { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 48px 56px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; overflow: hidden; }
.protected::after { content: ''; position: absolute; inset: 0; background: url('/static/img/watermark.svg') repeat; pointer-events: none; z-index: 2; }
.protected img { pointer-events: none; -webkit-user-drag: none; }
.doc-text { font-size: 1.02rem; line-height: 1.7; }
.doc-text h1 { font-size: 1.9rem; text-transform: none; color: var(--navy); margin-top: 0; }
.doc-text h2 { font-size: 1.4rem; text-transform: none; color: var(--navy); margin-top: 1.6em; }
.doc-text h3 { font-size: 1.12rem; text-transform: none; letter-spacing: 0; color: var(--ink); margin-top: 1.4em; }
.doc-text blockquote { margin: 1em 0; padding: 8px 16px; border-left: 4px solid var(--gold); background: var(--paper); }
.doc-text table { border-collapse: collapse; width: 100%; margin: 1em 0; }
.doc-text td, .doc-text th { border: 1px solid var(--line); padding: 8px 10px; vertical-align: top; }
.doc-text .ql-align-center { text-align: center; }
.doc-text .ql-align-right { text-align: right; }
.doc-text .ql-align-justify { text-align: justify; }
.doc-text .ql-indent-1 { padding-left: 3em; } .doc-text .ql-indent-2 { padding-left: 6em; } .doc-text .ql-indent-3 { padding-left: 9em; }
.pdf-pages { display: grid; gap: 16px; }
.pdf-pages img { width: 100%; height: auto; display: block; border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(8, 18, 54, .08); }
.protected:has(.pdf-pages) { padding: 24px; background: var(--paper); }
.ack-form { margin-top: 20px; text-align: center; }
.protect-note { margin-top: 16px; text-align: center; font-size: .8rem; color: var(--muted); }
@media print {
  body * { display: none !important; }
  body::after { content: 'Printing Municipal Police Department documents is not permitted.'; display: block; padding: 40px; font: 16px sans-serif; }
}

/* Editor */
.doc-editor { max-width: 1000px; }
.doc-editor .form-grid { margin-bottom: 18px; }
.checks.inline { flex-direction: row; flex-wrap: wrap; }
.doc-editor .ql-toolbar.ql-snow { border-color: var(--line); border-radius: 8px 8px 0 0; background: var(--paper); font-family: var(--body); }
.doc-editor .ql-container.ql-snow { border-color: var(--line); border-radius: 0 0 8px 8px; font-family: var(--body); font-size: 1rem; }
.doc-editor .ql-editor { min-height: 420px; line-height: 1.7; }
.small { font-size: .82rem; }
.file-drop { display: grid; gap: 10px; padding: 28px; border: 2px dashed var(--line); border-radius: 10px; text-align: center; background: var(--paper); cursor: pointer; }
.file-drop:hover { border-color: var(--sky); }
.doc-editor .field-label { margin-top: 18px; }
.doc-editor .field-label input { font: inherit; font-size: 1rem; text-transform: none; letter-spacing: 0; color: var(--ink); padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.danger-zone { margin-top: 24px; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; border-top: 5px solid #C0392B; }
.danger-zone h2 { color: #9B1C1C; margin-bottom: 4px; font-size: 1.15rem; }
.danger-zone p { margin: 0; }
.button.danger { background: #fff; color: #9B1C1C; border-color: #E3B4B4; }
.button.danger:hover { background: #9B1C1C; border-color: #9B1C1C; color: #fff; }
.inline-form { display: inline; }
.nowrap { white-space: nowrap; }
.nowrap .row-edit + .inline-form, .nowrap .row-edit + .inline-form .row-edit { margin-left: 6px; }
button.row-edit { font: inherit; font-size: .8rem; font-weight: 600; background: #fff; cursor: pointer; }

/* Folders and labels */
.manage-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: start; }
.manage-list { list-style: none; margin: 0; padding: 0; }
.manage-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.manage-list li:first-child { border-top: 0; }
.manage-list .link-button { margin-left: 10px; }
.label-edit { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.label-edit input, .label-edit select { font: inherit; font-size: .9rem; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; }
.folder-form input[type="text"], .folder-form select, .manage .form-grid input, .manage .form-grid select { font: inherit; font-size: 1rem; text-transform: none; letter-spacing: 0; color: var(--ink); padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.doc-editor .form-grid input[type="text"], .doc-editor .form-grid select { font: inherit; font-size: 1rem; text-transform: none; letter-spacing: 0; color: var(--ink); padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
@media (max-width: 900px) {
  .manage-grid { grid-template-columns: 1fr; }
  .protected { padding: 24px 18px; }
}

/* Whole document row opens the document */
.doc-item { position: relative; border-radius: 6px; transition: background .15s; }
.doc-item:hover { background: #F8F9FC; }
.doc-title::after { content: ''; position: absolute; inset: 0; }
.doc-item .chip, .doc-item .doc-label { position: relative; }
.doc-list.card .doc-item { margin: 0 -12px; padding-left: 12px; padding-right: 12px; }

/* Backend */
.backend { display: grid; grid-template-columns: 220px 1fr; gap: 28px; padding-top: 32px; padding-bottom: 72px; align-items: start; }
.backend-nav { position: sticky; top: 84px; display: grid; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.backend-nav a { padding: 8px 12px; border-radius: 6px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: .92rem; }
.backend-nav a:hover { background: var(--paper); color: var(--navy); }
.backend-main { display: grid; gap: 24px; min-width: 0; }
.backend-card { scroll-margin-top: 90px; }
.backend-card > h2 { margin-bottom: 4px; }
.backend-card > .muted { margin-bottom: 18px; }
.backend-card h3 { margin: 22px 0 8px; }
.backend .form-grid input[type="text"], .backend .form-grid input[type="number"], .backend .form-grid select, .backend .form-grid textarea { font: inherit; font-size: .95rem; text-transform: none; letter-spacing: 0; color: var(--ink); padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); width: 100%; }
.backend .form-grid input[type="color"] { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); padding: 4px; }
.backend .form-grid select[multiple] { padding: 4px; }
.backend .form-grid textarea { resize: vertical; }
.status-grid { margin-bottom: 18px; }
.restart-form { display: flex; justify-content: flex-end; }
.perm-rows { display: grid; gap: 6px; }
.perm-row { display: grid; grid-template-columns: 190px 1fr auto; gap: 12px; align-items: center; }
.perm-key { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; color: var(--navy); font-weight: 600; }
.perm-row input[type="text"] { font: inherit; font-size: .92rem; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.perm-row input[readonly] { color: var(--muted); background: #ECEEF2; }
.perm-row .check { font-size: .82rem; color: var(--muted); white-space: nowrap; display: flex; align-items: center; gap: 6px; }
textarea.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; line-height: 1.5; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: #0B1230; color: #E3E8F5; width: 100%; resize: vertical; text-transform: none; letter-spacing: 0; }
.backend-card form + form { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.backend-restart { padding-top: 32px; padding-bottom: 72px; }
@media (max-width: 900px) {
  .backend { grid-template-columns: 1fr; }
  .backend-nav { position: static; grid-template-columns: repeat(2, 1fr); }
  .perm-row { grid-template-columns: 1fr; gap: 4px; }
}
