/*
 * Global styles — design tokens, reset, and shared components.
 * Loaded on every page via the application layout.
 */

@font-face {
  font-family: "DM Serif Display";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/dm-serif-display-latin-ext-5e515044.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: "DM Serif Display";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/dm-serif-display-latin-3f6a6125.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "DM Serif Display";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/dm-serif-display-italic-latin-f19ca5e7.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/inter-400-1e94a563.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/inter-500-5949f5fc.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/inter-600-a957bd0d.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/inter-700-cbc762c0.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/jetbrains-mono-400-849c32ea.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/jetbrains-mono-500-9590a15c.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

:root {
  /* Fonts */
  --font-display: "DM Serif Display", Georgia, serif;
  --font-serif:   "DM Serif Display", Georgia, serif;
  --font-sans:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", "SF Mono", "Fira Code", monospace;

  /* Type scale */
  --text-xs:   0.6875rem;  /* 11px */
  --text-sm:   0.8125rem;  /* 13px */
  --text-base: 0.9375rem;  /* 15px */
  --text-md:   1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.375rem;
  --text-2xl:  1.75rem;
  --text-3xl:  2.25rem;
  --text-4xl:  3rem;
  --text-5xl:  4rem;
  --text-6xl:  5.5rem;

  /* Leading */
  --leading-tight:   1.1;
  --leading-snug:    1.3;
  --leading-normal:  1.5;
  --leading-relaxed: 1.7;

  /* Tracking */
  --tracking-tight:   -0.03em;
  --tracking-normal:  0;
  --tracking-wide:    0.04em;
  --tracking-widest:  0.10em;

  /* Motion */
  --ease-out:       cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out:    cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring:    cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-micro: 80ms;
  --duration-fast:  150ms;
  --duration-base:  220ms;
  --duration-slow:  400ms;
  --duration-page:  700ms;

  /* Radius */
  --radius-xs:   2px;
  --radius-sm:   4px;
  --radius-md:   6px;
  --radius-lg:   8px;
  --radius-xl:   10px;
  --radius-2xl:  14px;
  --radius-full: 9999px;

  /* Back-compat aliases */
  --radius: var(--radius-md);
  --font:   var(--font-sans);
  --max-w:  1100px;

  /* Dark theme fallback — used before theme_init runs */
  --color-bg:              #2b2c2e;
  --color-surface:         #343538;
  --color-surface-raised:  #414246;
  --color-surface-overlay: rgba(43,44,46,0.92);
  --color-border:          #5a5c61;
  --color-border-muted:    rgba(247,247,244,0.1);
  --color-text:            #f7f7f4;
  --color-muted:           #c7c9cb;
  --color-subtle:          #94979b;
  --color-accent:          #d8dde2;
  --color-accent-dim:      rgba(216,221,226,0.14);
  --color-accent-glow:     rgba(216,221,226,0.24);
  --color-accent-dark:     #aeb6bd;
  --btn-primary-bg:        #e1e5e9;
  --btn-primary-bg-hover:  #f2f4f6;
  --btn-primary-text:      #242528;
  --color-success:         #7dd3a7;
  --color-warning:         #f6c56f;
  --color-error:           #ff8a8a;
  --badge-unworn:          #7dd3fc;
  --badge-mint:            #86efac;
  --badge-excellent:       #d8dde2;
  --badge-good:            #93c5fd;
  --badge-fair:            #fbbf8b;
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.24);
  --shadow-md:  0 18px 44px rgba(0,0,0,0.24);
  --shadow-lg:  0 28px 80px rgba(0,0,0,0.32);
  --shadow-glow:0 0 0 1px rgba(216,221,226,0.24), 0 18px 44px rgba(216,221,226,0.1);
  --color-placeholder-bg: #414246;
  --color-placeholder-fg: #5a5c61;
  --focus-ring: 0 0 0 3px rgba(216,221,226,0.3);
}

html[data-theme="dark"] {
  --color-bg:              #2b2c2e;
  --color-surface:         #343538;
  --color-surface-raised:  #414246;
  --color-surface-overlay: rgba(43,44,46,0.92);
  --color-border:          #5a5c61;
  --color-border-muted:    rgba(247,247,244,0.1);
  --color-text:            #f7f7f4;
  --color-muted:           #c7c9cb;
  --color-subtle:          #94979b;
  --color-accent:          #d8dde2;
  --color-accent-dim:      rgba(216,221,226,0.14);
  --color-accent-glow:     rgba(216,221,226,0.24);
  --color-accent-dark:     #aeb6bd;
  --btn-primary-bg:        #e1e5e9;
  --btn-primary-bg-hover:  #f2f4f6;
  --btn-primary-text:      #242528;
  --color-success:         #7dd3a7;
  --color-warning:         #f6c56f;
  --color-error:           #ff8a8a;
  --badge-unworn:          #7dd3fc;
  --badge-mint:            #86efac;
  --badge-excellent:       #d8dde2;
  --badge-good:            #93c5fd;
  --badge-fair:            #fbbf8b;
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.24);
  --shadow-md:  0 18px 44px rgba(0,0,0,0.24);
  --shadow-lg:  0 28px 80px rgba(0,0,0,0.32);
  --shadow-glow:0 0 0 1px rgba(216,221,226,0.24), 0 18px 44px rgba(216,221,226,0.1);
  --color-placeholder-bg: #414246;
  --color-placeholder-fg: #5a5c61;
  --focus-ring: 0 0 0 3px rgba(216,221,226,0.3);
}

html[data-theme="light"] {
  --color-bg:              #f8fafc;
  --color-surface:         #ffffff;
  --color-surface-raised:  #f1f5f9;
  --color-surface-overlay: rgba(248,250,252,0.92);
  --color-border:          #d7dee8;
  --color-border-muted:    rgba(15,23,42,0.08);
  --color-text:            #0f172a;
  --color-muted:           #64748b;
  --color-subtle:          #94a3b8;
  --color-accent:          #64748b;
  --color-accent-dim:      rgba(100,116,139,0.1);
  --color-accent-glow:     rgba(100,116,139,0.18);
  --color-accent-dark:     #475569;
  --btn-primary-bg:        #0f172a;
  --btn-primary-bg-hover:  #1e293b;
  --btn-primary-text:      #f8fafc;
  --color-success:         #2e7d52;
  --color-warning:         #9a6a20;
  --color-error:           #b84040;
  --badge-unworn:          #0d7870;
  --badge-mint:            #1a6b42;
  --badge-excellent:       #68727c;
  --badge-good:            #445566;
  --badge-fair:            #9a4420;
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.09), 0 2px 6px rgba(0,0,0,0.05);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.07);
  --shadow-glow:0 0 24px rgba(100,116,139,0.16), 0 0 6px rgba(100,116,139,0.10);
  --color-placeholder-bg:  #e2e8f0;
  --color-placeholder-fg:  #cbd5e1;
  --focus-ring: 0 0 0 3px rgba(100,116,139,0.25);
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}

/* Top nav */

.app-nav__bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.5rem;
  height: 64px;
  border-bottom: 1px solid var(--color-border-muted);
  background: var(--color-bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-nav__logo {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  text-decoration: none;
}

.app-nav__logo::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 0.7rem;
  vertical-align: -4px;
  border: 1px solid var(--color-accent);
  border-radius: 50%;
  background: radial-gradient(circle, var(--color-accent) 0 2px, transparent 3px);
}

.app-nav__logo:hover { color: var(--color-text); }
.app-nav__logo:hover::before {
  border-color: var(--color-text);
  background: radial-gradient(circle, var(--color-text) 0 2px, transparent 3px);
}

.app-nav__bar-end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.app-nav__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 200;
}

.app-nav__drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 260px;
  background: var(--color-bg);
  border-right: 1px solid var(--color-border);
  z-index: 300;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.app-nav__drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
}

.app-nav__drawer-title {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.app-nav__drawer-links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem;
  flex: 1;
}

.app-nav__drawer-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--color-border);
}

.app-nav__drawer-footer form {
  margin: 0;
}

.app-nav__link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-muted);
  text-decoration: none;
  padding: 0.48rem 0.65rem;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}

.app-nav__link-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-nav__link-label {
  min-width: 0;
}

.app-nav__link:hover {
  color: var(--color-text);
  background: var(--color-surface);
}

.app-nav__link--active {
  color: var(--color-text);
  background: var(--color-surface);
  font-weight: 600;
}

.app-nav__link--active:hover {
  background: var(--color-surface-raised);
}

.app-nav__sign-out {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
}

/* Buttons */

.btn {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}

.btn--ghost {
  color: var(--color-text);
  border-color: var(--color-border);
  background: transparent;
}

.btn--ghost:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.btn--primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border-color: var(--btn-primary-bg);
  font-weight: 600;
}

.btn--primary:hover {
  background: var(--btn-primary-bg-hover);
  border-color: var(--btn-primary-bg-hover);
}

[data-theme="dark"] .btn--primary {
  background: linear-gradient(135deg, #eef2f6, #c7d2dc);
  border-color: #d8dde2;
}

.btn--lg {
  padding: 0.85rem 2rem;
  font-size: 1rem;
}

.btn--sm {
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
}

.btn--icon {
  padding: 0.35rem 0.6rem;
  font-size: 1rem;
  line-height: 1;
}

.btn--danger {
  color: var(--color-error);
  border-color: color-mix(in srgb, var(--color-error) 40%, transparent);
  background: transparent;
}

.btn--danger:hover {
  background: color-mix(in srgb, var(--color-error) 12%, transparent);
  border-color: var(--color-error);
}

/* Focus states */

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn:focus-visible {
  box-shadow: var(--focus-ring);
}

/* Flash messages */

.notice, .alert {
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.notice {
  background: color-mix(in srgb, var(--color-accent) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-accent) 40%, transparent);
  color: var(--color-accent);
}

.alert {
  background: color-mix(in srgb, var(--color-error) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-error) 40%, transparent);
  color: var(--color-error);
}

.notice:empty, .alert:empty { display: none; }

.notice--success, .flash--success {
  background: color-mix(in srgb, var(--color-success) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-success) 30%, transparent);
  color: var(--color-success);
}

.notice--warning, .flash--warning {
  background: color-mix(in srgb, var(--color-warning) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-warning) 30%, transparent);
  color: var(--color-warning);
}

.watch-limit-banner {
  margin: 0 0 1rem;
}

/* Admin */

.admin-page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.admin-page__header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-page__header--stacked {
  align-items: start;
}

.admin-page__eyebrow {
  color: var(--color-accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-page__title {
  font-size: 1.75rem;
  line-height: 1.15;
}

.admin-page__subtitle {
  color: var(--color-muted);
  margin-top: 0.35rem;
}

.admin-filters,
.admin-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) * 1.5);
  padding: 1rem;
}

.admin-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.admin-filters__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-filters__field label {
  font-size: 0.8rem;
  color: var(--color-muted);
}

.admin-filters__field input,
.admin-filters__field select {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  color: var(--color-text);
  padding: 0.7rem 0.85rem;
}

.admin-filters__actions {
  display: flex;
  align-items: end;
  gap: 0.5rem;
}

.admin-section {
  margin-top: 1rem;
}

.admin-section--danger {
  border-color: color-mix(in srgb, var(--color-error) 40%, var(--color-border));
}

.admin-section__title {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

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

.admin-table th {
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.admin-table__link {
  color: var(--color-text);
  font-weight: 600;
  text-decoration: none;
}

.admin-table__link:hover {
  color: var(--color-accent);
}

.admin-badge {
  display: inline-flex;
  margin-left: 0.45rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  color: var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-accent) 35%, transparent);
}

.admin-badge--danger {
  color: var(--color-error);
  background: color-mix(in srgb, var(--color-error) 12%, transparent);
  border-color: color-mix(in srgb, var(--color-error) 35%, transparent);
}

.admin-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.admin-pagination__status,
.admin-empty-copy {
  color: var(--color-muted);
}

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

.admin-metadata dt {
  color: var(--color-muted);
  font-size: 0.8rem;
}

.admin-metadata dd {
  font-weight: 500;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.admin-actions form,
.admin-danger-form {
  display: inline-block;
}

.admin-danger-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 420px;
  margin-top: 1rem;
}

@media (max-width: 720px) {
  .admin-page__header {
    align-items: start;
    flex-direction: column;
  }

  .admin-filters__actions {
    align-items: start;
  }
}

/* Settings page */

.settings-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.settings-page__header {
  margin-bottom: 2rem;
}

.settings-page__title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.settings-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) * 1.5);
  overflow: hidden;
}

.settings-section__title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 1.25rem;
}

.settings-row__label {
  font-size: 0.95rem;
  font-weight: 500;
}

.settings-row__hint {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-top: 0.15rem;
}

.settings-row--column {
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}

.settings-row--column .auth__field { margin-bottom: 0; }

.settings-form__actions {
  display: flex;
  justify-content: flex-end;
}

/* Contact form */

.contact-form__section {
  overflow: hidden;
}

.contact-form__body {
  min-height: clamp(30rem, 70vh, 42rem);
}

.contact-form__field {
  margin-bottom: 0;
}

.contact-form__field label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.contact-form__required {
  color: var(--color-error);
  font-size: 0.95rem;
  line-height: 1;
}

.contact-form__required-text {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-error);
}

.contact-form__control {
  display: block;
  width: 100%;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) * 1.1);
  color: var(--color-text);
  font-size: 1rem;
  font-family: inherit;
  padding: 0.8rem 0.95rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.contact-form__control:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 18%, transparent);
}

.contact-form__control--select {
  appearance: none;
  background-image:
    linear-gradient(135deg, transparent 50%, var(--color-accent) 50%),
    linear-gradient(45deg, var(--color-accent) 50%, transparent 50%);
  background-position:
    calc(100% - 1.1rem) calc(50% - 0.12rem),
    calc(100% - 0.8rem) calc(50% - 0.12rem);
  background-size: 0.35rem 0.35rem, 0.35rem 0.35rem;
  background-repeat: no-repeat;
  padding-right: 2.3rem;
}

.contact-form__control--message {
  resize: none;
  min-height: 16rem;
  height: 100%;
}

.contact-form__field--message {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.contact-form__field--message .contact-form__control--message {
  flex: 1 1 auto;
}

/* Danger zone */

.danger-zone {
  border: 1px solid var(--color-error);
  border-radius: calc(var(--radius) * 1.5);
  background: color-mix(in srgb, var(--color-error) 5%, transparent);
  overflow: hidden;
}

.danger-zone .settings-section__title { color: var(--color-error); }

@media (max-width: 600px) {
  .settings-page { padding: 1.25rem 1rem; }
  .contact-form__body { min-height: 0; }
  .contact-form__control--message {
    min-height: 14rem;
  }
}

/* Photo placeholder */

.photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-placeholder-bg);
  color: var(--color-placeholder-fg);
  border-radius: var(--radius);
  width: 100%;
  height: 100%;
}

.photo-placeholder--card {
  aspect-ratio: 1 / 1;
  min-height: 80px;
}

.photo-placeholder--row {
  width: 84px;
  height: 84px;
  min-width: 84px;
  border-radius: var(--radius-sm);
}

.photo-placeholder--detail {
  aspect-ratio: 4 / 3;
  max-height: 420px;
  border-radius: var(--radius-lg);
}

.photo-placeholder--dashboard {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border-radius: var(--radius-sm);
}

.photo-placeholder__icon {
  width: 36%;
  height: 36%;
  opacity: 0.5;
}

/* Site footer */

.site-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  font-size: 0.8rem;
  color: var(--color-muted);
  border-top: 1px solid var(--color-border);
  margin-top: auto;
}

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

.site-footer a:hover { color: var(--color-accent); }

/* Privacy notice */

.privacy-notice {
  position: fixed;
  left: 1.25rem;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 500;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.15rem 1.25rem;
  background: var(--color-surface-overlay);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
}

.privacy-notice[hidden] {
  display: none;
}

.privacy-notice__copy {
  min-width: 0;
}

.privacy-notice__copy p {
  margin: 0;
  color: var(--color-text);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.privacy-notice__link {
  display: inline-block;
  margin-top: 0.55rem;
  color: var(--color-accent);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}

.privacy-notice__link:hover {
  color: var(--color-text);
}

.privacy-notice__button {
  flex: 0 0 auto;
}

/* Legal pages */

.page-prose {
  max-width: 680px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.page-prose__header {
  margin-bottom: 2.5rem;
}

.page-prose__title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.page-prose__updated {
  font-size: 0.85rem;
  color: var(--color-muted);
}

.page-prose h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 2rem 0 0.5rem;
}

.page-prose p {
  font-size: 0.95rem;
  color: var(--color-muted);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

@media (max-width: 600px) {
  .page-prose { padding: 1.5rem 1rem 3rem; }
  .page-prose__title { font-size: 1.4rem; }

  .privacy-notice {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1rem;
  }

  .privacy-notice__button {
    width: 100%;
  }
}
