/* Dark "liquid glass" theme over a fixed photo. The logo is white, so the
   page is always dark. Background: Nik Shuliahin, Unsplash License. */
:root {
  color-scheme: dark;
  --text: #f5f0ea;
  --muted: rgba(240, 230, 218, 0.66);
  --line: rgba(255, 255, 255, 0.14);
  --glass: rgba(22, 17, 12, 0.42);
  --glass-strong: rgba(16, 12, 9, 0.8);
  --field: rgba(0, 0, 0, 0.3);
  --accent: #e3b778;
  --accent-ink: #2a1a08;
  --ok: #6fe0a0;
  --warn: #f0c060;
  --bad: #ff8b82;
  --radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: #0a0806; }
body {
  margin: 0;
  min-height: 100vh;
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: transparent;
}
/* A fixed layer instead of background-attachment: fixed, which iOS ignores. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background: #0a0806 url('/img/background.jpg') center / cover no-repeat;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  /* A vignette: the crown in the middle stays visible, the edges and the header get darker. */
  background:
    linear-gradient(180deg, rgba(8, 6, 4, 0.6) 0%, rgba(8, 6, 4, 0) 28%),
    radial-gradient(ellipse at 50% 55%, rgba(8, 6, 4, 0.38) 0%, rgba(8, 6, 4, 0.78) 75%);
}
@media (max-width: 800px) {
  body::before { background-position: 50% center; }
  body::after { background: rgba(8, 6, 4, 0.66); }
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
  padding-top: max(20px, env(safe-area-inset-top));
  padding-bottom: max(32px, env(safe-area-inset-bottom));
}
h1 { font-size: 1.3rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 26px 0 10px; letter-spacing: 0.01em; }
h3 { margin-top: 0; }
a { color: var(--accent); }

.brand { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.brand .logo { height: 34px; width: auto; display: block; }
.brand .divider { width: 1px; height: 26px; background: var(--line); }
#login .brand { justify-content: center; margin: 12vh 0 20px; }
#login .brand .logo { height: 56px; }
#login .brand .divider { height: 40px; }
#login-form { max-width: 380px; margin: 0 auto; }

header { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
nav {
  display: flex; gap: 2px; flex-wrap: wrap; padding: 3px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}
nav button { background: transparent; color: var(--muted); border: none; border-radius: 999px; padding: 6px 14px; font-weight: 500; }
nav button:hover { color: var(--text); }
nav button.active { background: rgba(255, 255, 255, 0.14); color: var(--text); }
.who { color: var(--muted); font-size: 0.9rem; }

/* Glass surfaces */
.card, .banner, table, dialog {
  background-color: var(--glass);
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0) 45%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 10px 30px rgba(0, 0, 0, 0.28);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}
.card { padding: 14px 16px; }
.banner { padding: 10px 14px; margin: 8px 0; }
.banner.bad { border-color: rgba(255, 139, 130, 0.5); color: var(--bad); }
.banner.ok { border-color: rgba(111, 224, 160, 0.5); color: var(--ok); }

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.end { justify-content: flex-end; }
.muted { color: var(--muted); }
.error { color: var(--bad); }

button {
  font: inherit; cursor: pointer; border-radius: 10px; padding: 7px 14px;
  border: 1px solid transparent; background: var(--accent); color: var(--accent-ink); font-weight: 600;
}
button:hover { filter: brightness(1.08); }
button.secondary {
  background: rgba(255, 255, 255, 0.06); color: var(--text); border-color: var(--line); font-weight: 500;
}
button.link { border: none; background: none; color: var(--accent); padding: 0; font-weight: 500; }
button:disabled { opacity: 0.5; cursor: default; }

label { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; font-size: 0.9rem; color: var(--muted); }
label.check { flex-direction: row; align-items: center; color: var(--text); }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--field);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(227, 183, 120, 0.55); outline-offset: 0; }
input[type="checkbox"] { accent-color: var(--accent); }
/* Native dropdown lists ignore transparency; give them a solid dark surface. */
option { background: #1a140e; color: var(--text); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 12px; }

dialog {
  background-color: var(--glass-strong);
  color: var(--text);
  width: min(620px, calc(100vw - 32px));
  padding: 18px 20px;
}
dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.list { display: flex; flex-direction: column; gap: 10px; }
.item { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.item .title { font-weight: 600; }
.item.empty { border-style: dashed; background-color: rgba(22, 17, 12, 0.25); }
.pill { display: inline-block; font-size: 0.8rem; padding: 2px 9px; border-radius: 999px; border: 1px solid currentColor; background: rgba(0, 0, 0, 0.2); }
.pill.ok { color: var(--ok); }
.pill.warn { color: var(--warn); }
.pill.bad { color: var(--bad); }
.pill.idle { color: var(--muted); }

table { width: 100%; border-collapse: separate; border-spacing: 0; overflow: hidden; }
th, td { text-align: left; padding: 7px 12px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 0.9rem; }
tr:last-child td { border-bottom: none; }
td:first-child { white-space: nowrap; color: var(--muted); }
tr.error td:last-child { color: var(--bad); }
tr.warn td:last-child { color: var(--warn); }
section[data-panel="activity"] { overflow-x: auto; }

.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin: 4px 0 8px; background: var(--field); }
.segmented button { border: none; border-radius: 0; background: transparent; color: var(--muted); padding: 8px 22px; font-weight: 500; }
.segmented button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.segmented.disabled { opacity: 0.4; pointer-events: none; }
.note { background: rgba(240, 192, 96, 0.08); border-left: 3px solid var(--warn); padding: 8px 10px; border-radius: 6px; font-size: 0.9rem; }

/* Browsers without backdrop-filter: make the glass opaque enough to read. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card, .banner, table, nav { background-color: rgba(16, 12, 9, 0.85); }
}
