/* WaggPanel: one style sheet for every page. No inline styles anywhere (the content security
   policy forbids them), so every look is a class here. Fonts are served by the panel itself. */

@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap;
  src: url("/static/ibm-plex-sans-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap;
  src: url("/static/ibm-plex-sans-latin-ext-400.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap;
  src: url("/static/ibm-plex-sans-latin-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap;
  src: url("/static/ibm-plex-sans-latin-ext-500.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap;
  src: url("/static/ibm-plex-sans-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap;
  src: url("/static/ibm-plex-sans-latin-ext-600.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap;
  src: url("/static/ibm-plex-mono-latin-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap;
  src: url("/static/ibm-plex-mono-latin-500.woff2") format("woff2"); }

:root {
  --teal: #0E7466;
  --teal-dark: #0A5248;
  --teal-soft: #DDF1EC;
  --bg: #F4F5F2;
  --card: #FFFFFF;
  --ink: #16221D;
  --muted: #55645D;
  --line: #DCE1DB;
  --field-line: #8A9A92;
  --ok-bg: #DDF3E4;  --ok-ink: #0B6137;
  --bad-bg: #FBE3E3; --bad-ink: #9B2222;
  --warn-bg: #FFF1D6; --warn-ink: #6B4500;
  --dark: #10201B;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.5 var(--sans); }
h1, h2, p, ul, ol, dl { margin: 0; }
h1 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
h2 { font-size: 1.0625rem; font-weight: 600; line-height: 1.3; }
a { color: var(--teal); }
a:hover { color: var(--teal-dark); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Top bar */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding: 8px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.top.admin { background: var(--dark); color: #DCE8E3; border-bottom-color: #234038; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; color: inherit; }
.logo { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 7px; background: var(--teal); color: #fff; font-weight: 600; }
.brand-name { font-weight: 600; font-size: 1.0625rem; }
.badge-admin { margin-left: 4px; padding: 2px 10px; border-radius: 999px; background: #1B3A31; color: #BFE6DB; font-size: 0.8125rem; }
.brand { order: 1; }
/* Phone: the brand and the user share the first row, the tabs and the search get a row each */
.top-nav { display: flex; gap: 4px; order: 3; flex-basis: 100%; overflow-x: auto; }
.top-nav a { flex: none; }
.top-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; color: inherit; text-decoration: none; }
.top-nav a:hover { background: var(--teal-soft); color: var(--teal-dark); }
.top.admin .top-nav a:hover { background: #1B3A31; color: #fff; }
.top-nav a[aria-current="page"] { font-weight: 500; box-shadow: inset 0 -3px 0 var(--teal); }
.top.admin .top-nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 #5CC4B0; }
.search { position: relative; flex: 1 1 100%; max-width: 560px; order: 4; }
.top.admin .search input { background: #14231E; border-color: #2F5247; color: #DCE8E3; }
.search input { width: 100%; min-height: 44px; padding: 0 16px 0 42px; border: 1px solid var(--field-line); border-radius: 22px; background: var(--bg); color: var(--ink); font: inherit; }
.search-icon { position: absolute; left: 14px; top: 13px; color: var(--muted); pointer-events: none; }
.who { display: flex; align-items: center; gap: 10px; margin-left: auto; order: 2; }
.who form { margin: 0; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--teal-soft); color: var(--teal-dark); font-weight: 600; }
.who-name { font-weight: 500; overflow-wrap: anywhere; }
.link-button { min-height: 44px; padding: 0 8px; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }
.top:not(.admin) .link-button { color: var(--teal-dark); }

/* Page frames */
.page { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; display: flex; flex-direction: column; gap: 20px; }
.narrow-page { max-width: 640px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; font-size: 0.875rem; color: var(--muted); }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; }
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.two-col { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.two-col > section { flex: 1 1 340px; min-width: 0; }
.two-col > section:first-child { flex-grow: 2; }
.center { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 24px 16px; }
.login-brand { display: flex; align-items: center; gap: 10px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.card > h2 { margin-bottom: 16px; }
.narrow { width: 100%; max-width: 440px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.step { font-size: 0.875rem; color: var(--muted); }

/* Forms and buttons */
.field { display: flex; flex-direction: column; gap: 6px; }
label { font-size: 0.875rem; font-weight: 500; }
:where(input:not([type="checkbox"]):not([type="hidden"]), select) { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--field-line); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; }
.mono-input { font-family: var(--mono); font-size: 0.9375rem; }
textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--field-line); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; resize: vertical; overflow-wrap: anywhere; }
.code-input { min-height: 52px; font-family: var(--mono); font-size: 1.375rem; letter-spacing: 0.15em; border: 2px solid var(--teal); }
.hint { font-size: 0.8125rem; color: var(--muted); }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; font-weight: 400; font-size: 1rem; }
.check input { width: 22px; height: 22px; accent-color: var(--teal); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--teal); border-radius: 8px; background: var(--teal); color: #fff; font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; }
.btn.secondary { background: #fff; border-color: var(--field-line); color: var(--ink); }
.btn.secondary:hover { background: var(--teal-soft); color: var(--teal-dark); }
.btn.danger { background: var(--bad-ink); border-color: var(--bad-ink); }
.btn.danger:hover { background: #7A1A1A; border-color: #7A1A1A; }
summary.btn { list-style: none; }
summary.btn::-webkit-details-marker { display: none; }

/* Notices and badges */
.notice { padding: 12px 16px; border-radius: 10px; border: 1px solid transparent; }
.notice ul { margin: 6px 0 0; padding-left: 20px; }
.notice-ok { background: var(--ok-bg); color: var(--ok-ink); border-color: #B5E0C4; }
.notice-error { background: var(--bad-bg); color: var(--bad-ink); border-color: #F0BCBC; }
.notice-warn { background: var(--warn-bg); color: var(--warn-ink); border-color: #EBD08E; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--line); color: var(--ink); font-size: 0.8125rem; font-weight: 500; }
.badge-ok { background: var(--ok-bg); color: var(--ok-ink); }

/* Lists of sites and accounts */
.rows { list-style: none; padding: 0; display: flex; flex-direction: column; }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; padding-top: 0; }
.row-main { display: flex; flex-direction: column; min-width: 0; }
.domain { font-weight: 500; overflow-wrap: anywhere; }
.confirm { flex: 0 1 auto; }
.confirm[open] { flex-basis: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.confirm[open] summary { margin-bottom: 12px; }
.confirm form { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.empty { padding: 24px 0; color: var(--muted); }

/* Home: groups of tiles, and the column on the right */
.layout { display: flex; flex-wrap: wrap; gap: 24px; padding: 20px 16px 48px; align-items: flex-start; max-width: 1360px; margin: 0 auto; }
.layout-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.layout-main #groups { display: flex; flex-direction: column; gap: 24px; }
.layout-side { flex: 1 1 300px; max-width: 360px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.group-title { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 1rem; }
.rule { flex: 1; height: 1px; background: var(--line); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 10px; min-height: 104px; padding: 16px 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); font-size: 0.875rem; font-weight: 500; text-align: center; text-decoration: none; overflow-wrap: anywhere; }
a.tile:hover { border-color: var(--teal); color: var(--ink); box-shadow: 0 1px 6px rgba(14, 116, 102, 0.18); }
.tile small { font-weight: 400; font-size: 0.75rem; color: var(--muted); }
.tile.soon { background: transparent; border-style: dashed; color: var(--muted); cursor: default; }
.tile-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; }
.cat-files .tile-icon { background: #E3EEFA; color: #1D5FA8; }
.cat-domains .tile-icon { background: #ECE6F8; color: #5B3FA3; }
.cat-apps .tile-icon { background: #E5F2DD; color: #2E6B1F; }
.cat-db .tile-icon { background: var(--teal-soft); color: var(--teal); }
.cat-security .tile-icon { background: var(--bad-bg); color: var(--bad-ink); }
.cat-metrics .tile-icon { background: var(--warn-bg); color: var(--warn-ink); }
.cat-advanced .tile-icon { background: #E7ECE6; color: #3F4A45; }
.facts { display: flex; flex-direction: column; gap: 12px; font-size: 0.875rem; }
.facts > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.meter-row + .meter-row { margin-top: 16px; }
.meter-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 0.875rem; }
.meter-head label { font-weight: 400; }
meter { display: block; width: 100%; height: 8px; }

/* Two-factor setup */
.steps { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.qr { align-self: center; width: min(240px, 100%); padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.qr svg { display: block; width: 100%; height: auto; }
.secret { padding: 10px 12px; border-radius: 8px; background: var(--bg); letter-spacing: 0.08em; overflow-wrap: anywhere; }
.codes { list-style: none; padding: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 16px; border: 1px dashed var(--field-line); border-radius: 10px; background: var(--bg); font-size: 1.0625rem; }

/* Wider screens: the bar gets more room */
@media (min-width: 760px) {
  .top { padding: 12px 32px; }
  .page { padding: 32px 32px 56px; }
  .layout { padding: 28px 32px 56px; }
  .brand, .top-nav, .search, .who { order: 0; }
  .top-nav { flex-basis: auto; overflow-x: visible; }
  .search { flex: 1 1 260px; }
}

/* Phone: three tiles to a row, the side column under the content */
@media (max-width: 560px) {
  .tiles { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .tile { min-height: 96px; padding: 12px 4px 8px; font-size: 0.8125rem; }
  .layout-side { max-width: none; flex-basis: 100%; }
  .who-name, .badge-admin { display: none; }
  .card { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
