:root {
  color-scheme: dark;
  --bg: #0e1116;
  --panel: #161b23;
  --line: #263041;
  --text: #e6edf3;
  --muted: #8b98a9;
  --accent: #4da3ff;
  --up: #2ea043;
  --down: #d1495b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 24px 20px 64px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
h1 { font-size: 20px; margin: 0 0 20px; letter-spacing: .01em; }
h2 { font-size: 15px; margin: 0 0 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.nav { display: flex; align-items: center; gap: 12px; }
.who { color: var(--muted); font-size: 13px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 18px;
}
.card.narrow { max-width: 420px; margin: 40px auto; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
input, select, button {
  font: inherit;
  color: var(--text);
  background: #0d1218;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
}
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button { background: var(--accent); color: #06121f; border: 0; font-weight: 600; cursor: pointer; }
button.link { background: none; color: var(--muted); padding: 0; font-weight: 400; text-decoration: underline; }
button.danger { background: none; color: var(--down); padding: 0; font-weight: 400; text-decoration: underline; }
form.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; align-items: end; }
form.grid button { padding: 10px 16px; }
form > label + label { margin-top: 12px; }
form.card button[type=submit] { margin-top: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.actions { display: flex; gap: 10px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font: 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: #c9d6e6; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.pill.up { background: rgba(46, 160, 67, .18); color: #56d364; }
.pill.down { background: rgba(209, 73, 91, .18); color: #ff7b8a; }
.pill.unknown { background: rgba(139, 152, 169, .16); color: var(--muted); }
.tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 1px 7px; }
.err { color: #ff7b8a; background: rgba(209, 73, 91, .12); border: 1px solid rgba(209, 73, 91, .35); padding: 8px 10px; border-radius: 7px; }
.muted { color: var(--muted); }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 18px 0; }
.metric { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.metric .label { font-size: 12px; color: var(--muted); }
.metric .value { font-size: 20px; font-weight: 600; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 16px 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.row-actions { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.foot { margin-top: 32px; color: var(--muted); font-size: 12px; }

/* Cloudflare tab */
.navlink { padding: 4px 2px; color: var(--muted); font-weight: 600; }
.navlink.active { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.navlink:hover { color: var(--text); text-decoration: none; }
.zone-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.zone-name { font-size: 20px; color: var(--text); text-transform: none; letter-spacing: 0; margin: 0 0 4px; }
.zone-actions { display: flex; gap: 14px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.chip { border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; font-size: 12px; color: var(--muted); }
.chip.ok { color: #56d364; border-color: rgba(46, 160, 67, .35); }
.chip.warn { color: #e3b341; border-color: rgba(227, 179, 65, .35); }
.chip.bad { color: #ff7b8a; border-color: rgba(209, 73, 91, .35); }
form.filters { margin-top: 6px; }
.filter-actions { display: flex; gap: 14px; align-items: center; padding-bottom: 8px; }
.table-scroll { max-height: 70vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.table-scroll.short { max-height: 320px; }
.table-scroll table { border-collapse: separate; border-spacing: 0; }
.table-scroll thead th {
  position: sticky; top: 0; z-index: 1; background: #121821;
  box-shadow: inset 0 -1px 0 var(--line); padding-top: 11px; padding-bottom: 11px;
}
tr.group td { background: #121821; color: var(--text); border-bottom: 1px solid var(--line); }
.group-name { font-weight: 600; }
.banner { border-radius: 8px; padding: 10px 12px; margin: 0 0 16px; font-size: 14px; }
.banner.ok { background: rgba(46, 160, 67, .12); border: 1px solid rgba(46, 160, 67, .35); }
.banner.warn { background: rgba(227, 179, 65, .12); border: 1px solid rgba(227, 179, 65, .35); }
.banner.error { background: rgba(209, 73, 91, .12); border: 1px solid rgba(209, 73, 91, .35); color: #ffb3bd; margin-bottom: 14px; }
.warn-list { margin: 0; padding-left: 20px; }
.warn-list li { margin: 6px 0; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin: 0 0 14px; }
legend { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 0 6px; }
label .hint { font-size: 12px; color: var(--muted); }
textarea {
  font: inherit; color: var(--text); background: #0d1218;
  border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; resize: vertical;
}
textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 14px; }
.grid2 h3 { font-size: 14px; margin: 0 0 6px; }
.grid2 form { border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.grid2 form button[type=submit] { margin-top: 10px; }
button:disabled, select:disabled, textarea:disabled { opacity: .45; cursor: not-allowed; }
table.compact td, table.compact th { padding: 7px 9px; }
td.err-cell { color: #ff9aa6; max-width: 220px; overflow-wrap: anywhere; }
code { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .wrap { padding: 16px 12px 48px; }
  .top { flex-wrap: wrap; }
  table { display: block; overflow-x: auto; }
  .zone-head { flex-direction: column; }
  .chips { gap: 6px; }
}

/* Domains tab */
table.domains td { font-size: 13.5px; }
table.domains td strong { overflow-wrap: anywhere; }
table.domains form.geo { display: flex; align-items: center; gap: 6px; }
table.domains form.geo select { padding: 4px 6px; font-size: 12px; width: auto; }
table.domains form.geo button { padding: 4px 8px; font-size: 12px; }
.exp-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
}
.exp-badge.expired { background: rgba(209, 73, 91, .2); color: #ff7b8a; }
.exp-badge.d30 { background: rgba(227, 179, 65, .2); color: #e3b341; }
.exp-badge.d90 { background: rgba(216, 207, 90, .16); color: #d8cf5a; }
.exp-badge.ok { background: rgba(46, 160, 67, .16); color: #56d364; }
.exp-badge.unknown { background: rgba(139, 152, 169, .16); color: var(--muted); }
.domains-hint { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
details.domains-settings { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
details.domains-settings summary { cursor: pointer; color: var(--muted); font-size: 13px; }
details.domains-settings form { margin-top: 12px; }
details.domains-settings form + form { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
details.domains-settings form.grid { align-items: start; }
details.domains-settings .filter-actions { padding-bottom: 0; }
.prov-accounts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.prov-account h3 { margin: 0 0 4px; font-size: 15px; }
.prov-account p { margin: 2px 0; }
.prov-account code { font-size: 12px; word-break: break-all; }
.prov-account .chips { margin-top: 8px; }
.prov-nav { display: flex; gap: 12px; margin: 8px 0 4px; }
.prov-nav a { font-size: 13px; }
.apply-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.hint { font-size: 12px; color: var(--muted); }
.move-card { }
.move-warning { margin: 0 0 10px; }

/* Sites tab */
.sites-table td { font-size: 13.5px; }
.mono { font-size: 12px; overflow-wrap: anywhere; }
.site-warning { margin: 0 0 16px; line-height: 1.45; }
.site-warning strong { display: block; margin-bottom: 4px; }
.check { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; }
.check input { width: auto; }
.err-inline { color: #ff9aa6; font-size: 12.5px; overflow-wrap: anywhere; }
.grid2 form h3 { margin: 0 0 8px; }
.grid2 form .hint { margin: 8px 0 0; }
