/* This is served as a static stylesheet so proxies cannot cache Vite's
   JavaScript and CSS representations of the same development URL. */
:root {
  color-scheme: dark;
  --ink: #3b2115;
  --ink-soft: #684531;
  --wine: #6f241b;
  --wine-dark: #3f130f;
  --gold: #d9ad63;
  --paper-light: #f0d596;
  --night: #1b0c09;
  --display: Georgia, 'Times New Roman', serif;
  --script: 'URW Chancery L', 'Apple Chancery', 'Segoe Script', cursive;
  --body: Georgia, 'Times New Roman', serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  font-family: var(--body);
  background:
    radial-gradient(circle at 50% -20%, rgba(179, 83, 38, 0.65), transparent 42rem),
    repeating-linear-gradient(125deg, transparent 0 8px, rgba(255, 255, 255, 0.012) 9px 10px),
    linear-gradient(145deg, #39150f, #190906 60%, #2a0e09);
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.site-frame {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  overflow: hidden;
}

.site-frame::before {
  position: fixed;
  z-index: -3;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(10, 3, 2, 0.66) 100%);
  content: '';
  pointer-events: none;
}

.site-frame__sun {
  position: absolute;
  z-index: -2;
  top: 6rem;
  right: max(3vw, calc((100vw - 1180px) / 2));
  width: 18rem;
  aspect-ratio: 1;
  border: 1px solid rgba(218, 162, 89, 0.22);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(205, 123, 50, 0.2), transparent 66%);
  box-shadow: 0 0 80px rgba(187, 74, 29, 0.15);
}

.site-frame__mountains {
  position: fixed;
  z-index: -2;
  right: -5vw;
  bottom: -8rem;
  left: -5vw;
  height: 24rem;
  opacity: 0.24;
  background:
    linear-gradient(145deg, transparent 41%, #040201 42% 55%, transparent 56%) 0 0 / 34rem 100%,
    linear-gradient(35deg, transparent 42%, #050201 43% 57%, transparent 58%) 14rem 4rem / 42rem 100%;
}

.site-header {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto minmax(230px, 1fr);
  align-items: center;
  gap: 2rem;
  width: min(1180px, calc(100% - 3rem));
  margin: 0 auto;
  padding: 1.2rem 0;
  color: #f1d89d;
  border-bottom: 1px solid rgba(218, 174, 98, 0.22);
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  width: fit-content;
  color: inherit;
  text-decoration: none;
}

.site-brand__mark {
  display: grid;
  width: 2.8rem;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(234, 194, 121, 0.65);
  border-radius: 50%;
  color: #2a0d08;
  font-size: 1.35rem;
  font-weight: 700;
  background: radial-gradient(circle at 35% 30%, #edcf89, #9d6129 72%);
  box-shadow: 0 0 0 3px rgba(100, 46, 21, 0.8), 0 0 0 4px rgba(218, 176, 98, 0.35);
}

.site-brand strong,
.site-brand small {
  display: block;
}

.site-brand strong {
  font-family: var(--script);
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  line-height: 1;
}

.site-brand small {
  margin-top: 0.3rem;
  color: #b99566;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
}

.site-nav a {
  position: relative;
  color: #d7b77d;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-decoration: none;
  text-transform: uppercase;
}

.site-nav a::after {
  position: absolute;
  right: 50%;
  bottom: -0.55rem;
  left: 50%;
  height: 1px;
  background: var(--gold);
  content: '';
  transition: inset 160ms ease;
}

.site-nav a:hover::after {
  right: 0;
  left: 0;
}

.site-header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.8rem;
  min-width: 0;
}

.site-header__user {
  overflow: hidden;
  max-width: 12rem;
  color: #b99566;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-header__motto {
  color: #b99566;
  font-family: var(--script);
}

.site-main {
  width: min(1120px, calc(100% - 3rem));
  min-height: calc(100vh - 10rem);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5rem) 0 4rem;
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  padding: 1.5rem;
  color: #987552;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.testing-plaque {
  position: absolute;
  z-index: 5;
  top: 6.2rem;
  right: max(1rem, calc((100vw - 1240px) / 2));
  display: flex;
  min-width: 11.5rem;
  align-items: center;
  padding: 0.65rem 1rem 0.65rem 2.65rem;
  border: 3px double #714023;
  border-radius: 2px 5px 3px 4px;
  color: var(--wine-dark);
  background:
    repeating-linear-gradient(8deg, transparent 0 9px, rgba(91, 45, 23, 0.04) 10px 11px),
    linear-gradient(105deg, #bd8b4e, #ecd294 18%, #d7ac68 100%);
  box-shadow:
    0 8px 20px rgba(8, 2, 1, 0.42),
    inset 0 0 12px rgba(91, 45, 23, 0.22);
  pointer-events: none;
  transform: rotate(1.5deg);
}

.testing-plaque::before,
.testing-plaque::after {
  position: absolute;
  top: -0.32rem;
  width: 0.42rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f2d190, #754224 72%);
  box-shadow: 0 1px 2px rgba(42, 13, 8, 0.7);
  content: '';
}

.testing-plaque::before {
  left: 0.45rem;
}

.testing-plaque::after {
  right: 0.45rem;
}

.testing-plaque__seal {
  position: absolute;
  left: -1.15rem;
  display: grid;
  width: 3.25rem;
  aspect-ratio: 1;
  place-items: center;
  border: 4px double #b86545;
  border-radius: 50%;
  color: #edcc88;
  font-family: var(--display);
  font-size: 1.8rem;
  font-style: italic;
  font-weight: 700;
  line-height: 1;
  background: radial-gradient(circle at 35% 28%, #a84432, #681c16 68%, #3c0d0a);
  box-shadow:
    0 4px 8px rgba(42, 13, 8, 0.55),
    inset 0 0 0 2px rgba(61, 13, 10, 0.7),
    inset 0 0 10px rgba(44, 7, 5, 0.75);
  transform: rotate(-8deg);
}

.testing-plaque__copy {
  display: block;
  text-align: center;
}

.testing-plaque__copy strong,
.testing-plaque__copy small {
  display: block;
}

.testing-plaque__copy strong {
  font-family: var(--script);
  font-size: 1.15rem;
  line-height: 1;
}

.testing-plaque__copy small {
  margin-top: 0.35rem;
  color: var(--ink-soft);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.parchment-panel {
  position: relative;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 15%, rgba(93, 45, 20, 0.16) 0 1px, transparent 2px),
    radial-gradient(circle at 82% 72%, rgba(104, 57, 27, 0.12) 0 1px, transparent 2px),
    repeating-linear-gradient(7deg, transparent 0 12px, rgba(102, 52, 21, 0.025) 13px 14px),
    linear-gradient(105deg, #b88449, var(--paper-light) 8%, #e6c985 50%, #c28e50 100%);
  background-size: 31px 29px, 37px 41px, auto, auto;
  border: 1px solid #7c4928;
  border-radius: 3px 6px 4px 2px;
  box-shadow:
    0 24px 60px rgba(8, 2, 1, 0.48),
    inset 0 0 40px rgba(99, 48, 21, 0.23),
    inset 0 0 0 1px rgba(255, 230, 166, 0.32);
}

.parchment-panel::before,
.parchment-panel::after {
  position: absolute;
  z-index: -1;
  right: 1.2rem;
  left: 1.2rem;
  height: 1.8rem;
  border: 1px solid #714023;
  border-radius: 50%;
  background: linear-gradient(#c79555, #805029 48%, #452719 52%, #aa7440);
  box-shadow: 0 8px 14px rgba(20, 7, 3, 0.5);
  content: '';
}

.parchment-panel::before {
  top: -0.65rem;
}

.parchment-panel::after {
  bottom: -0.65rem;
  transform: rotate(180deg);
}

.parchment-panel__content {
  position: relative;
  z-index: 1;
  padding: clamp(2.5rem, 5vw, 4.5rem);
}

.parchment-panel--compact .parchment-panel__content {
  padding: clamp(2.25rem, 4vw, 3.25rem);
}

.parchment-panel__pin {
  position: absolute;
  z-index: 2;
  top: -0.25rem;
  width: 1.25rem;
  height: 1.05rem;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, #d8a466, #714122 70%);
  box-shadow: 0 2px 5px rgba(44, 20, 8, 0.8);
}

.parchment-panel__pin--left {
  left: 0.8rem;
}

.parchment-panel__pin--right {
  right: 0.8rem;
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--wine);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--wine-dark);
  font-family: var(--display);
}

h1 {
  margin-bottom: 1rem;
  font-size: clamp(2.5rem, 7vw, 5.4rem);
  font-style: italic;
  line-height: 0.96;
  text-shadow: 0 1px rgba(255, 235, 181, 0.55);
}

h2 {
  margin-bottom: 1.25rem;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-style: italic;
}

h3 {
  margin-top: 2rem;
  font-size: 1.45rem;
}

p {
  line-height: 1.65;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  padding: 0.75rem 1.35rem;
  border: 1px solid #42120d;
  border-radius: 2px;
  color: #f3d999;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  background: linear-gradient(#873024, #5d1b15 55%, #46100d);
  box-shadow: inset 0 0 0 1px rgba(230, 174, 97, 0.24), 0 3px 0 #35100d, 0 7px 12px rgba(47, 18, 8, 0.25);
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}

.button:hover:not(:disabled) {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  box-shadow: inset 0 0 0 1px rgba(230, 174, 97, 0.24), 0 1px 0 #35100d;
  transform: translateY(2px);
}

.button:focus-visible,
.site-nav a:focus-visible,
.site-brand:focus-visible {
  outline: 3px solid #e2b768;
  outline-offset: 3px;
}

.button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.button--small {
  min-height: 2.15rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.72rem;
}

.button--wide {
  width: 100%;
}

.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: min(19rem, 100%);
  margin: 1.3rem auto;
  color: var(--wine);
}

.ornament span {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, currentColor);
}

.ornament span:last-child {
  background: linear-gradient(90deg, currentColor, transparent);
}

.ornament b {
  font-size: 0.65rem;
}

.hero-panel__copy {
  max-width: 42rem;
}

.hero-panel .parchment-panel__content {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(210px, 0.7fr);
  align-items: center;
  gap: 3rem;
  min-height: 31rem;
}

.hero-panel .ornament {
  margin-right: auto;
  margin-left: 0;
}

.hero-panel__lead {
  max-width: 38rem;
  margin-bottom: 2rem;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-style: italic;
  line-height: 1.7;
}

.hero-emblem {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(96, 47, 23, 0.48);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(100, 42, 21, 0.06) 52%, rgba(103, 48, 23, 0.17) 53% 56%, transparent 57%);
  transform: rotate(-5deg);
}

.hero-emblem__ring {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  width: 72%;
  aspect-ratio: 1;
  border: 3px double rgba(104, 47, 23, 0.62);
  border-radius: 50%;
  color: rgba(89, 35, 19, 0.72);
  text-align: center;
}

.hero-emblem__ring span,
.hero-emblem__ring small {
  font-size: clamp(0.55rem, 1.2vw, 0.75rem);
  font-weight: 700;
  letter-spacing: 0.19em;
}

.hero-emblem__ring strong {
  margin: 0.25rem 0;
  font-size: clamp(3rem, 7vw, 5.5rem);
  line-height: 1;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(250px, 0.78fr);
  gap: 2rem;
  margin-top: 3rem;
}

.story-panel p {
  font-size: 1.04rem;
}

.drop-cap::first-letter {
  float: left;
  margin: 0.05em 0.11em 0 0;
  color: var(--wine);
  font-size: 4.4rem;
  font-weight: 700;
  line-height: 0.8;
}

blockquote {
  margin: 2rem 0;
  padding: 1.4rem 1.6rem;
  border: 1px solid rgba(102, 45, 22, 0.48);
  border-right: 0;
  border-left: 0;
  color: var(--wine-dark);
  font-size: 1.16rem;
  font-style: italic;
  line-height: 1.55;
  text-align: center;
}

.side-column {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.side-column h2 {
  font-size: 1.65rem;
}

.side-column strong {
  overflow-wrap: anywhere;
}

.small-copy {
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.inscription-card {
  padding: 2.2rem 1.5rem;
  border: 1px solid rgba(211, 169, 96, 0.34);
  color: #d8b879;
  text-align: center;
  background: linear-gradient(145deg, rgba(92, 38, 22, 0.72), rgba(29, 10, 7, 0.85));
  box-shadow: 0 18px 40px rgba(8, 2, 1, 0.35), inset 0 0 30px rgba(0, 0, 0, 0.25);
}

.inscription-card__symbol {
  display: block;
  color: #d5a65b;
  font-size: 3.5rem;
}

.inscription-card p {
  margin: 0.6rem 0;
  font-family: var(--script);
  font-size: 1.3rem;
}

.inscription-card small {
  color: #977657;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.auth-page,
.empty-state {
  width: min(560px, 100%);
  margin: clamp(2rem, 7vh, 5rem) auto;
}

.auth-panel,
.empty-state {
  text-align: center;
}

.auth-panel h1,
.empty-state h1 {
  font-size: clamp(2.1rem, 8vw, 3.4rem);
}

.auth-panel__intro {
  max-width: 25rem;
  margin: 0 auto 1.8rem;
  color: var(--ink-soft);
}

.auth-panel__note {
  margin: 1.25rem 0 0;
  color: #7a5a40;
  font-size: 0.74rem;
  font-style: italic;
}

.auth-seal {
  display: grid;
  width: 4rem;
  margin: -5.2rem auto 2rem;
  aspect-ratio: 1;
  place-items: center;
  border: 3px double #a34a35;
  border-radius: 50%;
  color: #e5b873;
  font-size: 1.65rem;
  font-weight: 700;
  background: radial-gradient(circle at 35% 25%, #9f3a2e, #581611 72%);
  box-shadow: 0 5px 12px rgba(49, 14, 8, 0.45), inset 0 0 10px rgba(49, 5, 2, 0.5);
}

.form-error {
  margin: 1.2rem 0 0;
  padding: 0.8rem;
  border: 1px solid rgba(112, 32, 23, 0.35);
  color: #671c16;
  background: rgba(126, 37, 26, 0.08);
}

.loading-rune {
  color: var(--wine);
  font-size: 2rem;
  animation: rune-pulse 1.5s ease-in-out infinite;
}

@keyframes rune-pulse {
  50% {
    opacity: 0.35;
    transform: rotate(45deg) scale(0.75);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 860px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .site-nav {
    display: none;
  }

  .hero-panel .parchment-panel__content {
    grid-template-columns: 1fr;
  }

  .hero-emblem {
    width: min(16rem, 70%);
    margin: 0 auto;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 580px) {
  .site-header,
  .site-main {
    width: min(100% - 1.5rem, 1120px);
  }

  .site-header {
    gap: 0.75rem;
  }

  .site-brand small,
  .site-header__user,
  .site-header__motto {
    display: none;
  }

  .site-brand__mark {
    width: 2.35rem;
  }

  .site-brand strong {
    font-size: 1.05rem;
  }

  .site-main {
    padding-top: 2.5rem;
  }

  .parchment-panel__content,
  .parchment-panel--compact .parchment-panel__content {
    padding: 2.35rem 1.3rem;
  }

  .hero-panel .parchment-panel__content {
    min-height: 0;
  }

  .hero-emblem {
    width: min(13rem, 78%);
  }

  .auth-seal {
    margin-top: -4.4rem;
  }

  .site-footer {
    font-size: 0.58rem;
  }

  .testing-plaque {
    top: 4.8rem;
    right: 0.7rem;
    min-width: 9.5rem;
    padding: 0.55rem 0.75rem 0.55rem 2.25rem;
    transform: rotate(1.5deg) scale(0.82);
    transform-origin: top right;
  }
}

/* Access and invitation management */
.role-badge {
  padding: 0.28rem 0.52rem;
  border: 1px solid rgba(231, 188, 108, 0.55);
  border-radius: 999px;
  color: #f1d89d;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  background: rgba(111, 36, 27, 0.62);
  text-transform: uppercase;
}

.invitation-page {
  width: min(820px, 100%);
  margin: 0 auto;
}

.access-panel {
  width: min(590px, 100%);
  margin: clamp(2rem, 7vh, 5rem) auto;
  text-align: center;
}

.access-panel h1 {
  font-size: clamp(2rem, 7vw, 3.5rem);
}

.invitation-form-panel h1 {
  max-width: 35rem;
  margin-bottom: 0;
  font-size: clamp(2.25rem, 6vw, 4.25rem);
}

.form-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.form-heading__seal {
  display: grid;
  flex: 0 0 auto;
  width: 5rem;
  aspect-ratio: 1;
  place-items: center;
  border: 4px double #a34a35;
  border-radius: 50%;
  color: #e5b873;
  font-size: 2rem;
  font-weight: 700;
  background: radial-gradient(circle at 35% 25%, #9f3a2e, #581611 72%);
  box-shadow: 0 5px 12px rgba(49, 14, 8, 0.35), inset 0 0 10px rgba(49, 5, 2, 0.5);
  transform: rotate(5deg);
}

.invitation-intro {
  max-width: 39rem;
  margin: 1.5rem 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.invitation-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.form-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.45rem;
}

.form-field--wide {
  grid-column: 1 / -1;
}

.form-field > span {
  color: var(--wine-dark);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.form-field > small {
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.form-field input {
  width: 100%;
  min-height: 3rem;
  padding: 0.72rem 0.85rem;
  border: 1px solid rgba(91, 45, 23, 0.58);
  border-radius: 2px;
  outline: none;
  color: var(--ink);
  font: inherit;
  background: rgba(255, 236, 184, 0.38);
  box-shadow: inset 0 1px 5px rgba(77, 35, 16, 0.12);
  color-scheme: light;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.form-field select {
  width: 100%;
  min-height: 3rem;
  padding: 0.72rem 0.85rem;
  border: 1px solid rgba(91, 45, 23, 0.58);
  border-radius: 2px;
  outline: none;
  color: var(--ink);
  font: inherit;
  background: rgba(255, 236, 184, 0.56);
  box-shadow: inset 0 1px 5px rgba(77, 35, 16, 0.12);
  color-scheme: light;
}

.form-field input::placeholder {
  color: #8c6a4c;
}

.form-field input:focus {
  border-color: var(--wine);
  box-shadow: 0 0 0 3px rgba(111, 36, 27, 0.14), inset 0 1px 5px rgba(77, 35, 16, 0.12);
}

.form-field select:focus {
  border-color: var(--wine);
  box-shadow: 0 0 0 3px rgba(111, 36, 27, 0.14), inset 0 1px 5px rgba(77, 35, 16, 0.12);
}

.search-select {
  position: relative;
}

.search-select__control {
  position: relative;
}

.form-field .search-select__control input {
  padding-right: 2.8rem;
}

.search-select__toggle {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  width: 2.8rem;
  height: 100%;
  padding: 0;
  place-items: center;
  border: 0;
  color: var(--wine-dark);
  font: inherit;
  font-size: 1.25rem;
  background: transparent;
  cursor: pointer;
}

.search-select__toggle:disabled,
.search-select--disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.search-select__menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.25rem);
  right: 0;
  left: 0;
  overflow-y: auto;
  max-height: 15rem;
  padding: 0.3rem;
  border: 1px solid rgba(91, 45, 23, 0.64);
  background: #f5dfaa;
  box-shadow: 0 0.7rem 1.5rem rgba(49, 14, 8, 0.24);
}

.search-select__option {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.65rem 0.7rem;
  border: 0;
  color: var(--ink);
  font: inherit;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.search-select__option small {
  flex: 0 0 auto;
  color: var(--ink-soft);
  font-size: 0.74rem;
}

.search-select__option:hover,
.search-select__option.active {
  color: #f4dda5;
  background: var(--wine);
}

.search-select__option:hover small,
.search-select__option.active small {
  color: #f4dda5;
}

.search-select__option.selected span::after {
  margin-left: 0.45rem;
  content: '✓';
}

.search-select__empty {
  margin: 0;
  padding: 0.75rem;
  color: var(--ink-soft);
  font-style: italic;
}

.role-lock {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(91, 45, 23, 0.35);
  color: var(--wine-dark);
  background: rgba(111, 36, 27, 0.07);
}

.role-lock__icon {
  color: var(--wine);
  font-size: 1.8rem;
}

.role-lock strong,
.role-lock small {
  display: block;
}

.role-lock small {
  margin-top: 0.2rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.invitation-result {
  width: min(680px, calc(100% - 2rem));
  margin: 3rem auto 0;
  text-align: center;
}

.invitation-result h2 {
  font-size: clamp(1.65rem, 4vw, 2.3rem);
}

.invitation-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.invitation-details div {
  padding: 1rem;
  border: 1px solid rgba(91, 45, 23, 0.28);
  background: rgba(255, 235, 180, 0.22);
}

.invitation-details dt {
  margin-bottom: 0.35rem;
  color: var(--ink-soft);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.invitation-details dd {
  margin: 0;
  color: var(--wine-dark);
  overflow-wrap: anywhere;
  font-size: 1.2rem;
  font-weight: 700;
}

.invitation-link {
  margin-bottom: 1rem;
  text-align: left;
}

@media (max-width: 580px) {
  .role-badge {
    display: none;
  }

  .form-heading__seal {
    width: 3.8rem;
  }

  .invitation-form,
  .invitation-details {
    grid-template-columns: 1fr;
  }

  .form-field--wide {
    grid-column: auto;
  }

  .invitation-result {
    width: 100%;
  }
}

/* Car management */
.admin-page {
  width: min(1080px, 100%);
  margin: 0 auto;
}

.admin-shell h1 {
  margin-bottom: 0;
  font-size: clamp(2.2rem, 6vw, 4.5rem);
}

.admin-intro {
  max-width: 46rem;
  margin: 1.4rem 0;
  color: var(--ink-soft);
  font-size: 1.04rem;
}

.admin-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 2rem 0;
  padding: 0.45rem;
  border: 1px solid rgba(91, 45, 23, 0.3);
  background: rgba(91, 45, 23, 0.08);
}

.admin-tabs button {
  min-height: 2.7rem;
  padding: 0.55rem;
  border: 1px solid transparent;
  color: var(--wine-dark);
  font-weight: 700;
  background: transparent;
  cursor: pointer;
}

.admin-tabs button:hover,
.admin-tabs button.active {
  border-color: rgba(91, 45, 23, 0.42);
  color: #f4dda5;
  background: var(--wine);
}

.form-success {
  margin: 1rem 0;
  padding: 0.8rem;
  border: 1px solid rgba(42, 93, 46, 0.35);
  color: #284d29;
  background: rgba(57, 111, 59, 0.1);
}

.admin-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  min-height: 14rem;
  color: var(--ink-soft);
  font-style: italic;
}

.admin-workspace {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.7fr);
  align-items: start;
  gap: 1.5rem;
}

.admin-records,
.admin-editor {
  border: 1px solid rgba(91, 45, 23, 0.32);
  background: rgba(255, 239, 195, 0.2);
}

.admin-records {
  position: sticky;
  top: 1rem;
  overflow: auto;
  max-height: 70vh;
  padding: 1rem;
}

.admin-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.admin-section-heading h2,
.admin-section-heading h3 {
  margin: 0;
}

.admin-record {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.6rem;
  padding: 0.8rem;
  border: 1px solid rgba(91, 45, 23, 0.2);
  color: var(--ink);
  text-align: left;
  background: rgba(255, 238, 190, 0.28);
  cursor: pointer;
}

.admin-record:hover,
.admin-record.active {
  border-color: var(--wine);
  background: rgba(111, 36, 27, 0.1);
}

.admin-record small,
.admin-history small {
  display: block;
  margin-top: 0.2rem;
  color: var(--ink-soft);
  line-height: 1.35;
}

.admin-editor-stack {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1.25rem;
}

.admin-editor {
  display: grid;
  gap: 1rem;
  padding: 1.4rem;
}

.admin-editor h2,
.admin-editor h3 {
  margin: 0;
}

.admin-editor--sub {
  background: rgba(255, 239, 195, 0.14);
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.admin-readonly {
  margin: 0;
  padding: 0.75rem;
  border-left: 3px solid rgba(111, 36, 27, 0.4);
  color: var(--ink-soft);
  background: rgba(111, 36, 27, 0.06);
  overflow-wrap: anywhere;
}

.admin-history {
  display: grid;
  gap: 0.55rem;
}

.admin-history__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem;
  border-bottom: 1px dotted rgba(91, 45, 23, 0.34);
}

.text-button,
.admin-chip {
  border: 0;
  color: var(--wine);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  background: transparent;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}

.admin-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-chip {
  padding: 0.42rem 0.7rem;
  border: 1px solid rgba(91, 45, 23, 0.32);
  border-radius: 999px;
  text-decoration: none;
  background: rgba(111, 36, 27, 0.06);
}

.admin-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--wine-dark);
  font-size: 0.88rem;
  font-weight: 700;
}

.admin-check input {
  width: 1.1rem;
  height: 1.1rem;
}

@media (max-width: 820px) {
  .admin-tabs {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-workspace {
    grid-template-columns: 1fr;
  }

  .admin-records {
    position: static;
    max-height: 17rem;
  }
}

@media (max-width: 580px) {
  .admin-tabs,
  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  .admin-history__row {
    align-items: flex-start;
    flex-direction: column;
  }
}
