/* Hosting panel. Palette: steel sidebar, cool paper, one accent set in config.php. */
:root {
  --accent: #0e7c66;
  --steel: #1f3044;
  --steel-2: #2b4159;
  --paper: #edf1f5;
  --surface: #ffffff;
  --ink: #16202b;
  --muted: #5a6878;
  --line: #d3dbe4;
  --ok: #0e7c66;
  --warn: #b7791f;
  --bad: #b3261e;
  --display: Bahnschrift, "DIN Alternate", "Franklin Gothic Medium", "Segoe UI", system-ui, sans-serif;
  --body: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --side-w: 15.5rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 0.9375rem/1.5 var(--body);
  display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh;
}
a { color: var(--accent); text-underline-offset: 0.15em; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.2; margin: 0; letter-spacing: 0.005em; }
h1 { font-size: 1.75rem; margin-bottom: 1.25rem; }
h2 { font-size: 1.125rem; margin-bottom: 0.75rem; }
h3 { font-size: 0.9375rem; }
code { font: 0.8125rem/1.4 var(--mono); }
small { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 0.5rem; top: 0.5rem; background: var(--surface); padding: 0.5rem 0.75rem; z-index: 20; }

/* ---- sidebar ---- */
.side {
  background: var(--steel); color: #dbe4ee; padding: 1.25rem 0 1rem;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side .brand {
  font: 600 1.25rem/1.2 var(--display); color: #fff; text-decoration: none; padding: 0 1.25rem 1rem;
}
.side h2 { font: 400 0.75rem/1 var(--body); color: #8fa3b8; margin: 1.1rem 1.25rem 0.35rem; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side li a {
  display: block; padding: 0.4rem 1.25rem; color: inherit; text-decoration: none;
  border-left: 3px solid transparent;
}
.side li a:hover { background: var(--steel-2); color: #fff; }
.side li a.on { background: var(--steel-2); color: #fff; border-left-color: var(--accent); font-weight: 600; }
.side .native { margin: auto 1.25rem 0; padding-top: 1.25rem; color: #8fa3b8; font-size: 0.8125rem; }
.nav-toggle, .burger { display: none; }

/* ---- top bar ---- */
.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  display: flex; align-items: center; gap: 1rem; padding: 0.6rem 2rem;
  background: var(--surface); border-bottom: 1px solid var(--line); min-height: 3.25rem;
}
.domain-pick { display: flex; align-items: center; gap: 0.5rem; }
.domain-pick label { color: var(--muted); }
.domain-pick select { font-weight: 600; }
.who { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; }
.who .acct { color: var(--muted); }
.acting {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; justify-content: space-between;
  background: #fff4d6; border-bottom: 1px solid #e8cf8a; padding: 0.55rem 2rem;
}
main { padding: 1.75rem 2rem 3rem; max-width: 68rem; width: 100%; }
main > section { margin-top: 2rem; }
.lede { color: var(--muted); max-width: 44rem; margin: -0.5rem 0 1.25rem; }
.hint { color: var(--muted); font-size: 0.8125rem; margin: 0.75rem 0 0; max-width: 46rem; }

/* ---- forms ---- */
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea {
  background: var(--surface); border: 1px solid #b9c4d0; border-radius: 3px; padding: 0.4rem 0.55rem; min-height: 2.25rem; max-width: 100%;
}
input[type=checkbox] { min-height: 0; width: 1rem; height: 1rem; accent-color: var(--accent); }
textarea { width: 100%; font-family: var(--mono); font-size: 0.8125rem; }
textarea[name=text] { font-family: var(--body); font-size: inherit; }
label { min-width: 0; display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.8125rem; color: var(--muted); margin-bottom: 0.75rem; }
label > input, label > select, label > textarea, label > .affix { color: var(--ink); font-size: 0.9375rem; }
label.check { flex-direction: row; align-items: center; gap: 0.4rem; color: var(--ink); font-size: 0.875rem; margin: 0; }
.row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.row > label { margin-bottom: 0; }
.row + .row, .row + label, .checks + .btn, label + .btn { margin-top: 0.75rem; }
.grow { flex: 1 1 14rem; }
.grow > input, .grow > .affix { width: 100%; }
.narrow { max-width: 22rem; }
.narrow input { width: 100%; }
.affix { display: flex; align-items: stretch; }
.affix input { flex: 1 1 0; min-width: 0; width: 100%; border-radius: 3px 0 0 3px; }
.affix span { display: flex; align-items: center; padding: 0 0.55rem; background: var(--paper); border: 1px solid #b9c4d0; border-left: 0; border-radius: 0 3px 3px 0; color: var(--muted); white-space: nowrap; }
.affix span:first-child { border-left: 1px solid #b9c4d0; border-right: 0; border-radius: 3px 0 0 3px; }
.affix span:first-child + input { border-radius: 0 3px 3px 0; }
.checks { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin-bottom: 0.25rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none;
  background: var(--accent); color: #fff; border: 1px solid transparent; border-radius: 3px;
  padding: 0.4rem 0.9rem; min-height: 2.25rem; font-weight: 600; white-space: nowrap;
}
.btn:hover { filter: brightness(0.92); }
.btn.small { padding: 0.2rem 0.6rem; min-height: 1.85rem; font-size: 0.8125rem; }
.btn.ghost { background: transparent; color: var(--ink); border-color: #b9c4d0; font-weight: 400; }
.btn.bad { background: transparent; color: var(--bad); border-color: currentColor; }
.btn.bad:hover { background: var(--bad); color: #fff; filter: none; }
.btn.wide { width: 100%; }

/* ---- content blocks ---- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 1.25rem 1.25rem 1.1rem; }
.notice { border-left: 4px solid var(--muted); background: var(--surface); padding: 0.65rem 0.9rem; margin: 0 0 1rem; max-width: 52rem; }
.notice.ok { border-color: var(--ok); }
.notice.warn { border-color: var(--warn); }
.notice.err { border-color: var(--bad); }
.empty { border: 1px dashed #b9c4d0; border-radius: 4px; padding: 1.25rem; color: var(--muted); }
.empty p { margin: 0; }
.empty .btn { margin-top: 0.75rem; }
.tag { display: inline-block; font-size: 0.75rem; padding: 0 0.4rem; border-radius: 2px; border: 1px solid currentColor; line-height: 1.5; }
.tag.ok { color: var(--ok); } .tag.warn { color: var(--warn); } .tag.bad { color: var(--bad); }

table.list { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; }
table.list th { text-align: left; font-weight: 400; font-size: 0.8125rem; color: var(--muted); padding: 0.5rem 0.9rem; border-bottom: 1px solid var(--line); }
table.list td { padding: 0.55rem 0.9rem; border-bottom: 1px solid #e6ebf1; vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list .actions { text-align: right; white-space: nowrap; }
table.list td.actions form { display: inline-flex; gap: 0.6rem; align-items: center; justify-content: flex-end; }
table.list td.actions.inline > * { display: inline-flex; vertical-align: middle; margin-left: 0.4rem; }
table.list td.links a { margin-left: 0.9rem; }
td.wrap { overflow-wrap: anywhere; }
.rtype { font: 600 0.8125rem var(--display); background: var(--steel); color: #fff; padding: 0.05rem 0.4rem; border-radius: 2px; }
.meter-cell { min-width: 12rem; }

details > summary { cursor: pointer; color: var(--accent); font-size: 0.8125rem; list-style: none; display: inline-block; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: " \25BE"; }
details.danger > summary { color: var(--bad); }
table.list td.actions details[open] { text-align: left; white-space: normal; }
table.list td.actions details form { display: block; margin-top: 0.6rem; padding: 0.8rem; background: var(--paper); border-radius: 3px; min-width: 17rem; }
table.list td.actions details form + form { background: none; padding: 0; margin-top: 0.5rem; }
td.actions details form p { margin: 0 0 0.6rem; font-size: 0.8125rem; }
td.actions details form input:not([type=checkbox]), td.actions details form select { width: 100%; }
td.actions details form .checks { margin-bottom: 0.75rem; }

dl.facts { overflow: hidden; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; }
dl.facts > div { padding: 0.65rem 0.9rem; border-bottom: 1px solid #e6ebf1; margin-bottom: -1px; }
dl.facts dt { font-size: 0.8125rem; color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }

/* ---- usage meters: a strip of segments, lit like port lights on a switch ---- */
.meter { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; height: 0.75rem; margin: 0.35rem 0 0.3rem; }
.meter i { background: #d7dee6; border-radius: 1px; }
.meter.ok i.on { background: var(--ok); }
.meter.warn i.on { background: var(--warn); }
.meter.bad i.on { background: var(--bad); }
.meter-text { font-size: 0.8125rem; color: var(--muted); }
.meter-text strong { color: var(--ink); font-weight: 600; }
.meter-text .pct { float: right; }
.usage { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; }
.usage-main { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 1.1rem 1.25rem; }
.usage-main h2, .usage-main h3 { margin-bottom: 0.5rem; }
.usage-main .meter { height: 1.6rem; gap: 3px; }
.usage-main .meter-text { font-size: 0.9375rem; }
.usage-main .meter-text strong { font: 600 1.375rem var(--display); }
.counts { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: 0 1.5rem; margin-top: 1.25rem; }
.counts a { color: inherit; text-decoration: none; padding: 0.7rem 0; border-top: 1px solid var(--line); }
.counts a:hover h3 { color: var(--accent); }
.counts .meter { height: 0.4rem; }

/* ---- sign-in ---- */
body.login { display: grid; grid-template-columns: 1fr; place-items: center; background: var(--steel); padding: 1.5rem; }
.login-box { background: var(--surface); width: 100%; max-width: 24rem; padding: 2rem 2rem 1.75rem; border-radius: 4px; }
.login-box h1 { margin-bottom: 0.5rem; }
.login-box .lede { margin: 0 0 1.25rem; }
.login-box input, .login-box select { width: 100%; }
.login-strip { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; height: 0.5rem; margin-bottom: 1.5rem; }
.login-strip i { background: #d7dee6; border-radius: 1px; }
.login-strip i.on { background: var(--accent); }

/* ---- small screens ---- */
@media (max-width: 52rem) {
  body { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: var(--side-w); transform: translateX(-100%); z-index: 10; }
  .nav-toggle:checked ~ .side { transform: none; box-shadow: 0 0 0 100vmax rgba(22, 32, 43, 0.45); }
  .burger { display: inline-flex; width: 2.25rem; height: 2.25rem; align-items: center; justify-content: center; cursor: pointer; margin: 0; }
  .burger span, .burger span::before, .burger span::after { display: block; width: 1.1rem; height: 2px; background: var(--ink); position: relative; content: ""; }
  .burger span::before { position: absolute; top: -6px; } .burger span::after { position: absolute; top: 6px; }
  .nav-toggle:checked ~ .main .burger { position: relative; z-index: 11; left: var(--side-w); }
  .top, .acting { padding-left: 1rem; padding-right: 1rem; flex-wrap: wrap; }
  .who .acct { display: none; }
  main { padding: 1.25rem 1rem 2.5rem; }
  .row > label { flex: 1 1 100%; }
  .row > label > input, .row > label > select { width: 100%; }
  .panel { padding: 1rem; }
  table.list, table.list tbody, table.list tr, table.list td { display: block; }
  table.list thead { display: none; }
  table.list tr { border-bottom: 1px solid var(--line); padding: 0.4rem 0; }
  table.list td { border: 0; padding: 0.2rem 0.9rem; }
  table.list .actions { text-align: left; white-space: normal; }
  table.list td.actions form { justify-content: flex-start; flex-wrap: wrap; }
  table.list td.actions.inline > * { margin: 0 0.4rem 0 0; }
  table.list td.links a { margin: 0 0.9rem 0 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .side { transition: transform 0.18s ease; }
}

table.list td:first-child { overflow-wrap: anywhere; }
@media (min-width: 52.01rem) { table.list td:first-child { white-space: nowrap; overflow-wrap: normal; } table.list td.wrap:first-child { white-space: normal; } }

[hidden] { display: none !important; }

/* ---- account and package tools ---- */
.toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: flex-start; margin-top: 1rem; }
.toolbar form.row { gap: 0.4rem; }
.toolbar details { align-self: center; }
.confirm-box { margin-top: 0.6rem; padding: 0.8rem; background: var(--paper); border-radius: 3px; max-width: 24rem; }
.confirm-box p { margin: 0 0 0.6rem; font-size: 0.8125rem; }
.confirm-box input { width: 100%; }
dl.facts.spaced, .checks.spaced, label.check.spaced { margin-top: 1rem; }
label.check.spaced, .checks.spaced { margin-bottom: 0.9rem; }
.hint.above { margin: 0 0 0.75rem; }
.lede.below { margin-top: 1.25rem; }
h2 small { font: 400 0.8125rem var(--body); }
.panel > h2 .tag { vertical-align: middle; font-family: var(--body); font-weight: 400; }

/* ---- zone list and nameserver box ---- */
.row.between { justify-content: space-between; }
table.list.spaced { margin-top: 0.9rem; }
table.list tr.current td { background: #eef6f3; font-weight: 600; }
.ns-box { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.ns-box p { margin: 0.3rem 0; }
.ns-box ol { margin: 0.4rem 0 0.2rem; padding-left: 1.4rem; }
.ns-box ol code { font-size: 0.9375rem; font-weight: 600; }

/* ---- file manager ---- */
.crumbs { display: flex; flex-wrap: wrap; gap: 0.2rem 0.4rem; align-items: center; margin: 0 0 1rem; }
.crumbs span { color: var(--muted); }
table.files td.name a { text-decoration: none; }
table.files td.name a.dir { font-weight: 600; }
table.files td.name a.dir::before { content: "\25B8  "; color: var(--muted); }
input[type=file] { border: 1px dashed #b9c4d0; padding: 0.5rem; width: 100%; }
table.files td.actions details:not([open]) { display: inline-block; margin-left: 0.6rem; vertical-align: middle; }
