/* MC Verified Pro. Same visual family as mcverified.com: cool paper, ink, one blue. */
:root {
  --paper: #F3F4F6; --surface: #FFFFFF; --ink: #14171D; --muted: #525967; --line: #DCDFE5; --track: #E7E9ED;
  --accent: #1F48C7; --accent-ink: #FFFFFF; --accent-bg: #EAF0FD; --accent-line: #C9D6F6;
  --good: #13633D; --good-bg: #E3F2E9; --warn: #8A3B0C; --warn-bg: #FCEFD9; --bad: #A3221A; --bad-bg: #FCE5E2;
  --font-display: 'IBM Plex Sans Condensed', 'Arial Narrow', sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-data: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0E1115; --surface: #161A20; --ink: #E7E9ED; --muted: #A2A9B6; --line: #2A3039; --track: #262B33;
    --accent: #8AA8FF; --accent-ink: #0E1115; --accent-bg: #18213A; --accent-line: #2C3B66;
    --good: #82D6A6; --good-bg: #11301F; --warn: #F3B86D; --warn-bg: #382711; --bad: #FF9D92; --bad-bg: #3B1613;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.5; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
button, input, select, textarea { font: inherit; color: inherit; }

/* header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-in { max-width: 1240px; margin: 0 auto; padding: 10px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.brand b { color: var(--accent); }
.brand-box { fill: var(--ink); }
.brand-check { stroke: var(--surface); stroke-width: 2.4; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1 1 auto; }
.nav a { padding: 8px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 500; }
.nav a[aria-current="page"] { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.who { display: flex; align-items: center; gap: 14px; font-size: 14px; flex-wrap: wrap; }
.who-name { color: var(--muted); }
.who-link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; font-size: 14px; }

/* layout */
.view { max-width: 1240px; margin: 0 auto; padding: 24px 20px 64px; display: flex; flex-direction: column; gap: 20px; }
.view:focus { outline: none; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 24px; }
.page-head h1 { font-family: var(--font-display); font-size: 32px; line-height: 1.1; letter-spacing: -0.015em; }
.sub { color: var(--muted); margin: 4px 0 0; max-width: 70ch; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.card h2 { font-size: 16px; font-weight: 700; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-data); font-size: 13px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* buttons and fields */
.btn { min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; font-weight: 500; }
label.f { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
  min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); padding: 0 12px; font-weight: 400; width: 100%;
}
textarea { padding: 10px 12px; min-height: 72px; resize: vertical; }
.err { color: var(--bad); font-size: 14px; min-height: 1.4em; margin: 0; }
.hint { color: var(--muted); font-size: 13px; font-weight: 400; }

/* sign-in */
.auth { max-width: 440px; margin: 48px auto; display: flex; flex-direction: column; gap: 18px; }
.auth .brand { justify-content: center; font-size: 26px; }
.auth form { display: flex; flex-direction: column; gap: 14px; }
.auth h1 { font-family: var(--font-display); font-size: 26px; }

/* policy builder */
.status-bar { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; }
.status-bar .facts { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 14px; }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.none { background: var(--track); color: var(--muted); }
.pill.accent { background: var(--accent-bg); color: var(--accent); }
.builder { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.areas { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.area { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.area-head { padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--paper); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; align-items: baseline; }
.area-head h2 { font-size: 15px; }
.area-note { font-size: 13px; color: var(--muted); }
.rule { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.rule:first-of-type { border-top: 0; }
.rule.off .rule-controls { opacity: .55; }
.rule-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; align-items: center; }
.rule-label { font-weight: 600; }
.rule-value { display: flex; align-items: center; gap: 8px; }
.rule-value input[type="number"] { width: 130px; font-family: var(--font-data); }
.rule-value .unit { color: var(--muted); font-size: 14px; }
.rule-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.rule-controls label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.rule-controls select { min-height: 38px; font-size: 14px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.chk { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); font-size: 14px; cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: var(--accent); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--muted); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .knob { width: 44px; height: 26px; border-radius: 999px; background: var(--track); border: 1px solid var(--line); position: relative; transition: background .15s; flex: none; }
.switch .knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + .knob { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .knob::after { transform: translateX(18px); }
.switch input:focus-visible + .knob { outline: 3px solid var(--accent); outline-offset: 2px; }
.locked { font-size: 13px; }

.doc { position: sticky; top: 76px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; min-width: 0; }
.doc-head { padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--paper); display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; }
.doc-body { padding: 22px 26px 26px; max-height: calc(100vh - 220px); overflow: auto; font-size: 15px; line-height: 1.6; }
.doc-body h2 { font-family: var(--font-display); font-size: 24px; margin-bottom: 2px; }
.doc-body .doc-meta { color: var(--muted); font-size: 13.5px; margin: 0 0 8px; }
.doc-body h3 { font-size: 15px; margin: 18px 0 6px; }
.doc-body p { margin: 0 0 8px; }
.doc-body ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.doc-body .changed { background: var(--warn-bg); border-radius: 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.fingerprint { font-family: var(--font-data); font-size: 12.5px; color: var(--muted); word-break: break-all; }

/* tables */
.table-box { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: var(--paper); }
tr:last-child td { border-bottom: 0; }
td select { min-height: 36px; width: auto; }
.inactive td { color: var(--muted); }

/* team */
.add-form { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(0, .8fr) auto; gap: 12px; align-items: end; }
.secret { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: var(--accent-bg); border: 1px solid var(--accent-line); border-radius: 12px; padding: 14px 18px; }
.secret code { font-family: var(--font-data); font-size: 18px; letter-spacing: .04em; user-select: all; }

/* dialog */
.scrim { position: fixed; inset: 0; background: rgba(10, 12, 16, .5); display: grid; place-items: center; padding: 20px; z-index: 20; }
.dialog { background: var(--surface); border-radius: 14px; max-width: 520px; width: 100%; padding: 22px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.dialog h2 { font-family: var(--font-display); font-size: 24px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 10px; font-weight: 600; z-index: 30; }

@media (max-width: 900px) {
  .builder { grid-template-columns: minmax(0, 1fr); }
  .doc { position: static; }
  .doc-body { max-height: none; }
  .add-form { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) { .rule-controls { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .switch .knob, .switch .knob::after { transition: none; } }
