/* Owner: [panel]. Served at /assets/panel.css */

:root {
  color-scheme: light dark;
  --bg: #f5f6f8;
  --bg-soft: #eceef2;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --text: #15181d;
  --text-muted: #5a6270;
  --border: #dfe3ea;
  --border-strong: #c7cdd8;
  --accent: #2f5fe0;
  --accent-soft: #e8eeff;
  --accent-text: #ffffff;
  --ok: #10794b;
  --ok-soft: #e2f5ec;
  --warn: #8a5a00;
  --warn-soft: #fdf1dc;
  --err: #b62828;
  --err-soft: #fdeaea;
  --code-bg: #14161b;
  --code-text: #e7e9ee;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 6px 20px rgb(16 24 40 / 6%);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1014;
    --bg-soft: #151920;
    --surface: #171b21;
    --surface-2: #1d222a;
    --text: #e8eaee;
    --text-muted: #9aa3b2;
    --border: #2a303a;
    --border-strong: #3a424f;
    --accent: #6f9bff;
    --accent-soft: #1b2640;
    --accent-text: #0b0d11;
    --ok: #5cd39b;
    --ok-soft: #10281f;
    --warn: #e6b45c;
    --warn-soft: #2a2213;
    --err: #ff8b8b;
    --err-soft: #2c1618;
    --code-bg: #0a0c10;
    --code-text: #dfe3ea;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 30%);
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}

a:hover {
  text-decoration: none;
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0 0 0.4em;
  font-weight: 650;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 1.85rem;
}

h2 {
  font-size: 1.2rem;
}

h3 {
  font-size: 1rem;
}

p {
  margin: 0 0 1em;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  padding: 0.6rem 1rem;
  z-index: 10;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* ---------------------------------------------------------------- topbar */

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0.7rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 7px;
  background: var(--accent);
  color: var(--accent-text);
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 800;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.nav a,
.nav .nav-user {
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.93rem;
  text-decoration: none;
  color: var(--text-muted);
}

.nav a:hover {
  background: var(--bg-soft);
  color: var(--text);
}

.nav a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

/* buttons inside the nav keep their own colours */
.nav a.btn {
  color: var(--text);
}

.nav a.btn-primary,
.nav a.btn-primary:hover {
  color: var(--accent-text);
  background: var(--accent);
}

.nav-user {
  color: var(--text-muted);
  font-size: 0.88rem;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav form {
  display: inline;
}

/* ------------------------------------------------------------------ page */

.page {
  max-width: 1060px;
  width: 100%;
  margin: 0 auto;
  padding: 1.6rem 1.1rem 3rem;
  flex: 1 0 auto;
}

.page-narrow {
  max-width: 560px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}

.page-header .page-actions {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.page-sub {
  color: var(--text-muted);
  margin: 0;
}

.breadcrumb {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.2rem;
  margin-bottom: 1.1rem;
}

.card > :last-child {
  margin-bottom: 0;
}

.card-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.card-head h2 {
  margin: 0;
}

.card-head .card-note {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 0;
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.muted {
  color: var(--text-muted);
}

.small {
  font-size: 0.88rem;
}

.empty {
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 1.1rem;
  text-align: center;
}

/* ----------------------------------------------------------------- usage */

.usage {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.usage-value {
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.meter {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  overflow: hidden;
  margin: 0.7rem 0 0.5rem;
}

.meter-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

.meter-fill.is-warn {
  background: var(--warn);
}

.meter-fill.is-full {
  background: var(--err);
}

.stat-row {
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}

.stat {
  min-width: 5.5rem;
}

.stat-value {
  font-size: 1.15rem;
  font-weight: 650;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ----------------------------------------------------------------- lists */

.site-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.8rem;
}

.site-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  background: var(--surface-2);
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.site-item h3 {
  margin: 0 0 0.15rem;
}

.site-item .site-meta {
  color: var(--text-muted);
  font-size: 0.86rem;
}

.site-item .site-go {
  margin-left: auto;
}

/* ------------------------------------------------------------------ code */

code,
kbd,
samp {
  font-family: var(--mono);
  font-size: 0.88em;
}

.key {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.86rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
  user-select: all;
  word-break: break-all;
}

pre.code {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.5;
  margin: 0 0 0.9rem;
  border: 1px solid var(--border);
}

details.snippet {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.8rem;
  margin-bottom: 0.7rem;
  background: var(--surface-2);
}

details.snippet > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.93rem;
}

details.snippet[open] > summary {
  margin-bottom: 0.7rem;
}

details.snippet pre.code {
  margin-bottom: 0;
}

/* ----------------------------------------------------------------- forms */

form {
  margin: 0;
}

fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem 1rem;
  margin: 0 0 1rem;
}

legend {
  font-weight: 650;
  font-size: 0.95rem;
  padding: 0 0.35rem;
}

.field {
  margin-bottom: 0.9rem;
}

.field > label,
.field-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.hint {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin: 0.25rem 0 0;
}

input[type="text"],
input[type="email"],
input[type="number"],
select,
textarea {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
}

textarea {
  min-height: 6rem;
  font-family: var(--mono);
  font-size: 0.86rem;
  resize: vertical;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

input[type="text"].code-input {
  font-family: var(--mono);
  font-size: 1.6rem;
  letter-spacing: 0.4em;
  text-align: center;
  padding: 0.6rem;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-bottom: 0.7rem;
}

.check input {
  margin-top: 0.25rem;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--accent);
  flex: none;
}

.check label {
  font-weight: 600;
  font-size: 0.93rem;
}

.field-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.form-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 0.4rem;
}

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font: inherit;
  font-size: 0.93rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  background: var(--bg-soft);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.btn-primary:hover {
  filter: brightness(1.07);
  background: var(--accent);
}

.btn-danger {
  color: var(--err);
  border-color: var(--err);
  background: transparent;
}

.btn-danger:hover {
  background: var(--err-soft);
}

.btn-danger-solid {
  background: var(--err);
  border-color: var(--err);
  color: #fff;
}

.btn-link {
  border: none;
  background: none;
  color: var(--accent);
  padding: 0.35rem 0;
  text-decoration: underline;
}

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.86rem;
}

.btn-block {
  width: 100%;
}

/* ---------------------------------------------------------------- alerts */

.alert {
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  margin-bottom: 1rem;
  font-size: 0.93rem;
}

.alert > :last-child {
  margin-bottom: 0;
}

.alert-ok {
  background: var(--ok-soft);
  border-left-color: var(--ok);
}

.alert-error {
  background: var(--err-soft);
  border-left-color: var(--err);
}

.alert-warn {
  background: var(--warn-soft);
  border-left-color: var(--warn);
}

.alert-info {
  background: var(--accent-soft);
  border-left-color: var(--accent);
}

.alert ul {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
}

/* --------------------------------------------------------------- badges */

.badge {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.badge-ok {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: transparent;
}

.badge-bad {
  background: var(--err-soft);
  color: var(--err);
  border-color: transparent;
}

.badge-warn {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: transparent;
}

.badge-level {
  font-family: var(--mono);
}

/* --------------------------------------------------------------- tables */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

table.table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.88rem;
  min-width: 46rem;
}

table.table th,
table.table td {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

table.table th {
  background: var(--surface-2);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
}

table.table tr:last-child td {
  border-bottom: none;
}

table.table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

table.table td.nowrap {
  white-space: nowrap;
}

.reasons {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.15rem;
  min-width: 14rem;
}

.reasons li {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.reason-impact {
  font-family: var(--mono);
  font-size: 0.78rem;
}

.reason-impact.neg {
  color: var(--err);
}

.reason-impact.pos {
  color: var(--ok);
}

dl.kv {
  display: grid;
  grid-template-columns: minmax(9rem, auto) 1fr;
  gap: 0.4rem 1rem;
  margin: 0;
  font-size: 0.92rem;
}

dl.kv dt {
  color: var(--text-muted);
}

dl.kv dd {
  margin: 0;
}

/* ---------------------------------------------------------------- hero */

.hero {
  padding: 2.4rem 0 1.4rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 2.9rem);
  max-width: 20ch;
}

.hero p.lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 60ch;
}

.hero-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-top: 1.2rem;
}

.level-card h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.level-card p {
  color: var(--text-muted);
  font-size: 0.93rem;
  margin-bottom: 0;
}

/* --------------------------------------------------------------- footer */

.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.86rem;
  flex: none;
}

.footer-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 1.1rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.footer a {
  color: var(--text-muted);
}

.footer .footer-links {
  margin-left: auto;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------- widget */

.antybot {
  margin: 0.9rem 0;
  min-height: 74px;
}

@media (max-width: 600px) {
  .page {
    padding: 1.1rem 0.85rem 2.4rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  .card {
    padding: 1rem 0.9rem;
  }

  .usage-value {
    font-size: 1.7rem;
  }

  .site-item .site-go {
    margin-left: 0;
    width: 100%;
  }

  dl.kv {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }

  dl.kv dt {
    margin-top: 0.6rem;
    font-size: 0.85rem;
  }
}

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

/* --- Accounts: password inputs on /rejestracja, /logowanie and /reset-hasla --- */

input[type="password"] {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
  letter-spacing: 0.06em;
}

/* Help form: a message is prose, not a key list, so it keeps the reading font. */
#f-message {
  font-family: inherit;
  font-size: 0.95rem;
}
