
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts?f=inter&v=1") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts?f=mono&v=1") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #1a1b26;
  --bg-deep: #16161e;
  --bg-panel: #1f2335;
  --bg-hover: #292e42;
  --border: #292e42;
  --border-strong: #414868;
  --fg: #c0caf5;
  --fg-dim: #a9b1d6;
  --fg-mute: #7d859f;
  --blue: #7aa2f7;
  --cyan: #7dcfff;
  --green: #9ece6a;
  --teal: #73daca;
  --magenta: #bb9af7;
  --orange: #ff9e64;
  --red: #f7768e;
  --radius: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 0.94rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "calt" 1, "liga" 1, "cv05" 1;
  color: var(--fg);
  background:
    radial-gradient(1100px 520px at 85% -10%, rgba(122, 162, 247, 0.07), transparent 60%),
    radial-gradient(900px 460px at -10% 0%, rgba(187, 154, 247, 0.05), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- top bar ---- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(22, 22, 30, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 74rem;
  margin: 0 auto;
  padding: 0.5rem 1.25rem;
  display: flex;
  align-items: center;
  align-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: 0.75rem;
  text-decoration: none;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--blue), var(--magenta));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  position: relative;
  flex: none;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 6px;
  background-image: radial-gradient(circle, rgba(22, 22, 30, 0.9) 1.5px, transparent 1.6px);
  background-size: 5px 5px;
  background-position: center;
}

.brand-name {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--fg);
}

.brand-sub {
  color: var(--fg-mute);
  font-size: 0.8rem;
  margin-top: 0.1rem;
}

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

.nav-link {
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  color: var(--fg-dim);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.88rem;
  line-height: 1.35;
  border: 1px solid transparent;
}

.nav-link:hover {
  color: var(--fg);
  background: var(--bg-hover);
}

.nav-link.active {
  color: var(--blue);
  background: rgba(122, 162, 247, 0.12);
  border-color: rgba(122, 162, 247, 0.25);
}

.topbar form {
  margin-left: auto;
}

.topbar button {
  background: transparent;
  color: var(--fg-dim);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.topbar button:hover {
  color: var(--red);
  border-color: rgba(247, 118, 142, 0.5);
  background: rgba(247, 118, 142, 0.08);
}

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

main.container {
  width: 100%;
  max-width: 74rem;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
  flex: 1;
}

footer.site {
  border-top: 1px solid var(--border);
  color: var(--fg-mute);
  font-size: 0.8rem;
  text-align: center;
  padding: 1rem 1.25rem;
}

h1 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.3;
  margin: 0 0 1rem;
}

h2 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  margin: 0 0 0.75rem;
}

p {
  margin: 0 0 0.75rem;
}

/* page header: title + explainer left, primary action right */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}

.page-head h1 {
  margin-bottom: 0.15rem;
}

main section {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 0 0 1.5rem;
}

main section > h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

main section > h2::before {
  content: "";
  width: 3px;
  height: 1.05em;
  border-radius: 2px;
  background: linear-gradient(var(--blue), var(--magenta));
  flex: none;
}

main section.danger {
  border-color: rgba(247, 118, 142, 0.45);
  background: rgba(247, 118, 142, 0.05);
}

main section.danger > h2::before {
  background: var(--red);
}

/* last children never double the container's bottom padding */
main section > :last-child,
form > :last-child,
.frame-content > :last-child,
fieldset > *:last-child {
  margin-bottom: 0;
}

/* ---- cards: the frame the login page and problem pages land in ---- */

.frame-content {
  max-width: 28rem;
  margin: 7vh auto 0;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  padding: 1.75rem 1.75rem 1.5rem;
}

.frame-content button[type="submit"] {
  background: var(--blue);
  border-color: var(--blue);
  color: #10121c;
  font-weight: 600;
}

.frame-content button[type="submit"]:hover {
  background: #8fb4fa;
  border-color: #8fb4fa;
  color: #10121c;
}

/* frame (login/problem) card extras */
.frame-content .frame-hint {
  margin: 1rem 0 0;
  font-size: 0.8rem;
  color: var(--fg-mute);
  text-align: center;
}

.frame-content .frame-back {
  margin: 1.1rem 0 0;
  font-size: 0.85rem;
}

/* ---- dashboard ---- */

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin: 0 0 1.5rem;
}

.card-link {
  display: block;
  text-decoration: none;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.card-link:hover {
  border-color: rgba(122, 162, 247, 0.55);
  background: #232740;
  transform: translateY(-2px);
}

.card-link h2 {
  margin: 0 0 0.35rem;
}

.card-link .muted {
  font-size: 0.88rem;
}

.card-link .go {
  display: block;
  margin-top: 0.75rem;
  color: var(--blue);
  font-size: 0.84rem;
}

.t-blue { color: var(--blue); }
.t-magenta { color: var(--magenta); }
.t-orange { color: var(--orange); }

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

dl.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 1.5rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 0 0 1.5rem;
}

dl.facts dt {
  color: var(--fg-mute);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-top: 0.25rem;
}

dl.facts dd {
  margin: 0;
  min-width: 0;
}

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

.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  overflow-x: auto;
  margin: 0 0 1.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

thead th {
  text-align: left;
  padding: 0.6rem 0.9rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-mute);
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: rgba(122, 162, 247, 0.07);
}

tbody td a {
  color: var(--fg);
  font-weight: 500;
  text-decoration: none;
}

tbody td a:hover {
  color: var(--blue);
  text-decoration: underline;
}

/* first-column drill-down links get a subtle persistent underline */
tbody td:first-child a {
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
}

/* badges — published state on calendar rows */
.badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.05rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 6px;
  border: 1px solid;
  vertical-align: middle;
}

.badge-public {
  color: var(--cyan);
  border-color: rgba(125, 207, 255, 0.4);
  background: rgba(125, 207, 255, 0.08);
}

/* ---- action rows and cells ---- */

p.actions {
  margin: 0.75rem 0;
}

.actions > * + * {
  margin-left: 0.5rem;
}

/* a destructive affordance separated from the safe one beside it */
.actions .sep {
  margin-left: 1.5rem;
}

.actions form {
  display: inline-block;
  margin: 0;
}

.actions button,
.actions .btn {
  padding: 0.3rem 0.75rem;
  font-size: 0.84rem;
}

.actions a {
  font-size: 0.88rem;
}

/* table cells that hold action clusters */
td.actions {
  white-space: nowrap;
}

.page-actions {
  margin: 0 0 1.25rem;
}

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

button,
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.2;
  font-weight: 500;
  color: var(--fg);
  background: var(--bg-hover);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

button:hover,
.btn:hover {
  background: #343a51;
  border-color: var(--fg-mute);
  color: var(--fg);
}

button:active,
.btn:active {
  transform: translateY(1px);
}

button.primary,
.btn.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #10121c;
  font-weight: 600;
}

button.primary:hover,
.btn.primary:hover {
  background: #8fb4fa;
  border-color: #8fb4fa;
  color: #10121c;
}

button.danger {
  background: rgba(247, 118, 142, 0.1);
  border-color: rgba(247, 118, 142, 0.55);
  color: var(--red);
  font-weight: 600;
}

button.danger:hover {
  background: var(--red);
  border-color: var(--red);
  color: #1a1b26;
}

a.danger {
  color: var(--red);
  font-weight: 500;
  text-decoration: none;
}

a.danger:hover {
  text-decoration: underline;
}

/* danger links as buttons (delete-user entry, purge links) */
a.btn.danger {
  background: rgba(247, 118, 142, 0.1);
  border-color: rgba(247, 118, 142, 0.55);
  color: var(--red);
  font-weight: 600;
}

a.btn.danger:hover {
  background: var(--red);
  border-color: var(--red);
  color: #1a1b26;
  text-decoration: none;
}

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

label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--fg-dim);
}

form > div {
  margin-bottom: 1rem;
}

.field .muted,
.field > span {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  line-height: 1.45;
}

input,
select {
  font: inherit;
  font-size: 0.94rem;
  line-height: 1.35;
  color: var(--fg);
  background: var(--bg-deep);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  width: 100%;
  max-width: 30rem;
}

input::placeholder {
  color: var(--fg-mute);
}

input:hover,
select:hover {
  border-color: var(--fg-mute);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(122, 162, 247, 0.22);
}

fieldset {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem 1rem;
  margin: 0 0 1rem;
}

fieldset legend {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--fg-dim);
  padding: 0 0.5rem;
}

fieldset.danger {
  border-color: rgba(247, 118, 142, 0.45);
  background: rgba(247, 118, 142, 0.05);
}

fieldset.danger legend {
  color: var(--red);
}

/* ---- text, messages, states ---- */

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

strong {
  color: var(--fg);
  font-weight: 600;
}

code {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--cyan);
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1em 0.4em;
  word-break: break-all;
}

code.url {
  display: inline-block;
  padding: 0.4rem 0.6rem;
  font-size: 0.85em;
}

.muted {
  color: var(--fg-mute);
}

p.muted {
  font-size: 0.88rem;
}

.empty {
  color: var(--fg-mute);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: rgba(22, 22, 30, 0.4);
  text-align: center;
  padding: 1.5rem;
  margin: 0 0 1.5rem;
}

.flash {
  padding: 0.75rem 1rem;
  margin: 0 0 1.25rem;
  border-radius: 8px;
  border: 1px solid;
  border-left-width: 3px;
  font-size: 0.88rem;
}

.flash-notice {
  border-color: rgba(115, 218, 202, 0.3);
  border-left-color: var(--teal);
  background: rgba(115, 218, 202, 0.07);
}

.flash-error {
  border-color: rgba(247, 118, 142, 0.35);
  border-left-color: var(--red);
  background: rgba(247, 118, 142, 0.07);
}

/* flash and boxed errors carry a shape glyph, not color alone */
.flash-notice::before {
  content: "✓";
  margin-right: 0.55rem;
  font-weight: 700;
  color: var(--teal);
}

.flash-error::before {
  content: "✕";
  margin-right: 0.55rem;
  font-weight: 700;
  color: var(--red);
}

.error {
  color: var(--red);
  font-size: 0.88rem;
  font-weight: 500;
}

p.error {
  margin: 0 0 0.75rem;
}

.error-box,
.frame-content > p.error {
  padding: 0.6rem 0.85rem;
  border: 1px solid rgba(247, 118, 142, 0.35);
  border-left-width: 3px;
  border-radius: 8px;
  background: rgba(247, 118, 142, 0.07);
}

.sharee-list {
  font-size: 0.84rem;
  margin-top: 0.35rem;
}

.sharee-list > div {
  padding: 0.15rem 0;
}

.swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 5px;
  background: var(--swatch, #9aa5b1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  vertical-align: middle;
}

ul {
  margin: 0.5rem 0 1rem;
  padding-left: 1.3rem;
}

li {
  margin: 0.2rem 0;
}

/* per-row inline forms (share removal rows) */
li > form {
  display: inline-block;
  margin: 0 0 0 0.6rem;
}

li > form button {
  padding: 0.2rem 0.55rem;
  font-size: 0.8rem;
}

/* ---- focus, selection, scrollbars, motion ---- */

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

input:focus-visible,
select:focus-visible {
  outline: none;
}

::selection {
  background: rgba(122, 162, 247, 0.35);
}

* {
  scrollbar-color: var(--border-strong) transparent;
}

::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* ---- small screens ---- */

@media (max-width: 720px) {
  main.container {
    padding: 1.25rem 0.9rem 2.5rem;
  }

  h1 {
    font-size: 1.28rem;
  }

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

  dl.facts dt {
    padding: 0.55rem 0 0;
  }

  input,
  select {
    max-width: none;
  }

  .frame-content {
    margin-top: 4vh;
    padding: 1.35rem 1.15rem 1.15rem;
  }
}

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