:root {
  --bg: #f4f6f8; --card: #ffffff; --ink: #1b2430; --muted: #5d6b7a; --line: #d9e0e7;
  --accent: #b93a26; --accent-ink: #ffffff; --bad: #b3261e; --warn: #9a5b00; --ok: #0b7a53;
  --badge-bad: #fde8e6; --badge-warn: #fff1d6; --badge-ok: #dff3ea; --badge-off: #e8ecf0;
  --title: #e8573f; /* the logo's "Msg" colour on light pages */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12171d; --card: #1b232c; --ink: #e6ebf0; --muted: #9aa8b6; --line: #2e3a46;
    --accent: #ff8a70; --accent-ink: #1f2430; --bad: #ff8a80; --warn: #ffc266; --ok: #38b887;
    --badge-bad: #43211f; --badge-warn: #43331a; --badge-ok: #173a2d; --badge-off: #26313b;
    --title: #ff8a70;
  }
}
:root[data-theme="dark"] {
  --bg: #12171d; --card: #1b232c; --ink: #e6ebf0; --muted: #9aa8b6; --line: #2e3a46;
  --accent: #ff8a70; --accent-ink: #1f2430; --bad: #ff8a80; --warn: #ffc266; --ok: #38b887;
  --badge-bad: #43211f; --badge-warn: #43331a; --badge-ok: #173a2d; --badge-off: #26313b;
  --title: #ff8a70;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, "Segoe UI", sans-serif; }
.shell { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; background: var(--card); border-right: 1px solid var(--line); padding: 0.75rem 0.6rem; z-index: 30; }
.side-head { padding: 0.2rem 0.4rem 0.8rem; }
.brand { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.brand .sub { font-size: 0.85rem; font-weight: 600; color: var(--muted); overflow-wrap: anywhere; }
.brand .who-name { font-size: 0.95rem; font-weight: 600; overflow-wrap: anywhere; }
.side nav { display: flex; flex-direction: column; gap: 0.1rem; flex: 1; }
.side nav a { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; color: var(--muted); padding: 0.5rem 0.6rem; border-radius: 6px; text-decoration: none; }
.side nav a:hover { color: var(--ink); background: var(--bg); }
.side nav a.on { background: var(--badge-off); color: var(--ink); font-weight: 600; }
.pill { display: inline-block; min-width: 1.35rem; padding: 0 0.4rem; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 0.75rem; font-weight: 700; line-height: 1.35rem; text-align: center; }
.side-foot { border-top: 1px solid var(--line); margin-top: 0.75rem; padding: 0.75rem 0.4rem 0.2rem; display: flex; flex-direction: column; gap: 0.5rem; }
.side-foot .who { overflow-wrap: anywhere; }
.theme-switch { display: flex; gap: 0.35rem; }
.theme-switch button { flex: 1; }
.theme-switch button[aria-pressed='true'] { background: var(--badge-off); color: var(--accent); font-weight: 600; }
.topbar, .scrim { display: none; }
.menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--card); cursor: pointer; }
.menu-btn svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.shell > main { min-width: 0; max-width: 52rem; width: 100%; padding: 1rem 1.25rem; }
@media (max-width: 52rem) {
  .shell { display: block; }
  .topbar { display: flex; align-items: center; gap: 0.6rem; position: sticky; top: 0; z-index: 20; padding: 0.5rem 0.75rem; background: var(--card); border-bottom: 1px solid var(--line); }
  .topbar .brand { flex-direction: row; align-items: center; gap: 0.5rem; }
  .side { position: fixed; top: 0; left: 0; bottom: 0; height: auto; width: min(17rem, 86vw); transform: translateX(-102%); transition: transform 0.18s ease; }
  .shell.open .side { transform: none; box-shadow: 0 0 24px rgba(0, 0, 0, 0.35); }
  .shell.open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 25; }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }
h2 { font-size: 1.15rem; margin: 1.5rem 0 0.6rem; }
h3 { font-size: 1rem; margin: 0 0 0.6rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; margin-bottom: 1rem; }
.narrow { max-width: 24rem; margin: 8vh auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button.btn { border: 1px solid var(--line); background: var(--card); padding: 0.45rem 0.9rem; border-radius: 6px; cursor: pointer; }
button.btn:hover { border-color: var(--muted); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.small { padding: 0.2rem 0.6rem; font-size: 0.9rem; }
button:disabled { opacity: 0.5; cursor: default; }
label.field { display: block; margin-bottom: 0.7rem; }
label.field > span { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.15rem; }
label.check { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.7rem; }
input, select, textarea { width: 100%; padding: 0.5rem; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
input[type=checkbox] { width: auto; }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.err { color: var(--bad); margin: 0.5rem 0; }
.ok { color: var(--accent); margin: 0.5rem 0; }
.code { font-size: 1.4rem; letter-spacing: 0.3em; text-align: center; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1rem; margin: 0 0 0.8rem; }
dt { color: var(--muted); }
dd { margin: 0; }
.badge { display: inline-block; padding: 0.05rem 0.6rem; border-radius: 999px; font-size: 0.85rem; background: var(--badge-off); white-space: nowrap; }
.badge.ok { background: var(--badge-ok); color: var(--ok); }
.badge.warn { background: var(--badge-warn); color: var(--warn); }
.badge.bad { background: var(--badge-bad); color: var(--bad); }
.title { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.3rem 0.5rem; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }
.gap { margin-top: 1rem; }
dialog { border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); max-width: 28rem; width: calc(100% - 2rem); padding: 1rem; }
dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.toast { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 0.6rem 1rem; border-radius: 8px; max-width: calc(100% - 2rem); }
.logos { display: inline-flex; align-items: center; }
.logo { height: 1.7rem; width: auto; display: block; }
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-light { display: none; } :root:not([data-theme="light"]) .logo-dark { display: block; } }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
.narrow .logos { display: flex; justify-content: center; margin-bottom: 1rem; }
.narrow .logo { height: 2.4rem; }
.inv-list { list-style: none; margin: 0; padding: 0; }
.inv { display: grid; grid-template-columns: 1fr auto; gap: 0.1rem 0.8rem; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.inv:last-child { border-bottom: 0; }
.inv-main { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; overflow-wrap: anywhere; }
.inv-sub { grid-column: 1; }
.inv a.btn { text-decoration: none; color: inherit; border: 1px solid var(--line); border-radius: 6px; padding: 0.3rem 0.7rem; white-space: nowrap; }
.inv a.btn:hover { border-color: var(--muted); }
.inv.cancelled .inv-main strong { text-decoration: line-through; color: var(--muted); }
.renew { border-top: 1px solid var(--line); margin-top: 1rem; }
.plan { display: flex; flex-wrap: wrap; gap: 0.2rem 0.6rem; align-items: center; padding: 0.5rem 0.6rem; margin-bottom: 0.4rem; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.plan input { width: auto; margin: 0; }
.plan span:nth-of-type(1) { flex: 1; min-width: 8rem; }
.plan .price { font-weight: 600; white-space: nowrap; }
.state-form { margin-top: 0.6rem; }
.licence { margin-bottom: 1rem; }
h3.big { font-size: 1.25rem; margin: 0; }
h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 0.5rem; }
.title { justify-content: flex-start; }
.title .key { margin-left: auto; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.serial { font-size: 1.05rem; font-weight: 600; letter-spacing: 0.04em; overflow-wrap: anywhere; }
.bar { height: 8px; background: var(--badge-off); border-radius: 9px; overflow: hidden; margin: 0.6rem 0 0.25rem; }
.bar i { display: block; height: 100%; background: var(--accent); }
.bar i.w0 { width: 0; } .bar i.w5 { width: 5%; } .bar i.w10 { width: 10%; } .bar i.w15 { width: 15%; } .bar i.w20 { width: 20%; } .bar i.w25 { width: 25%; }
.bar i.w30 { width: 30%; } .bar i.w35 { width: 35%; } .bar i.w40 { width: 40%; } .bar i.w45 { width: 45%; } .bar i.w50 { width: 50%; } .bar i.w55 { width: 55%; }
.bar i.w60 { width: 60%; } .bar i.w65 { width: 65%; } .bar i.w70 { width: 70%; } .bar i.w75 { width: 75%; } .bar i.w80 { width: 80%; } .bar i.w85 { width: 85%; }
.bar i.w90 { width: 90%; } .bar i.w95 { width: 95%; } .bar i.w100 { width: 100%; }
.bar-text { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.2rem 1rem; margin-bottom: 0.9rem; }
.boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.box { border: 1px solid var(--line); border-radius: 8px; padding: 0.7rem 0.9rem; min-width: 0; }
.box.wide { grid-column: 1 / -1; }
.box dl { margin: 0; }
.box dd { overflow-wrap: anywhere; }
.dot { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--muted); margin-right: 0.45rem; }
.dot.on { background: #2e9e6b; }
.hint { margin: 0.5rem 0 0; }
.renew-after { margin: 0.4rem 0 0.2rem; }
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; flex-wrap: wrap; gap: 0.1rem 1rem; padding: 0.35rem 0; border-bottom: 1px solid var(--line); font-size: 0.93rem; }
.activity li:last-child { border-bottom: 0; }
.activity li span:first-child { min-width: 11rem; }
.inv-btns { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 0.5rem; }
@media (max-width: 36rem) {
  .boxes { grid-template-columns: 1fr; }
  .inv { grid-template-columns: 1fr; }
  .inv-btns { grid-column: 1; grid-row: auto; flex-wrap: wrap; margin-top: 0.3rem; }
  .title .key { margin-left: 0; width: 100%; }
  .activity li span:first-child { min-width: 0; width: 100%; }
}
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 3px; margin-bottom: 1rem; }
.tabs a { text-align: center; padding: 0.4rem; border-radius: 6px; color: var(--muted); font-weight: 600; text-decoration: none; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { background: var(--card); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }

/* a request and its messages */
h2.flat { margin: 0; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 24rem; }
.thread { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.6rem; }
.msg { border: 1px solid var(--line); border-radius: 8px; padding: 0.55rem 0.75rem; background: var(--card); }
.msg.you { margin-right: 2rem; }
.msg.us { margin-left: 2rem; border-color: var(--accent); }
.msg-head { margin-bottom: 0.2rem; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 36rem) { .msg.you { margin-right: 0.5rem; } .msg.us { margin-left: 0.5rem; } }

main a:not(.btn) { color: var(--accent); }

/* "Redeem a coupon" */
.coupon-row { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.4rem; }
.coupon-row input { flex: 1; min-width: 0; letter-spacing: 0.04em; }
.coupon-row .btn { flex: none; }
.coupon p.muted { margin: 0.2rem 0; }
.notice-ok { background: var(--badge-ok); color: var(--ok); border-radius: 6px; padding: 0.55rem 0.75rem; margin: 0.6rem 0 0; }
.notice-ok[hidden] { display: none; }
/* a reseller's customer: the reseller's contact details instead of "Renew and pay" */
.reseller-box { border: 2px dashed var(--line); border-radius: 8px; padding: 0.7rem 0.9rem; margin-top: 1rem; }
.reseller-box h4 { margin: 0 0 0.4rem; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.8rem; color: var(--muted); }
.reseller-box p { margin: 0.15rem 0; overflow-wrap: anywhere; }

/* files on a message */
.attach { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.4rem; }
.attach .err { flex-basis: 100%; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip { display: inline-flex; align-items: center; gap: 0.2rem; border: 1px solid var(--line); border-radius: 999px; padding: 0.1rem 0.2rem 0.1rem 0.7rem; font-size: 0.85rem; background: var(--card); max-width: 100%; overflow-wrap: anywhere; }
.chip-x { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0.15rem 0.45rem; }
.files { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.35rem; }
.att { display: inline-block; border: 1px solid var(--line); border-radius: 6px; padding: 0.1rem 0.55rem; font-size: 0.85rem; background: var(--bg); overflow-wrap: anywhere; }
