/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
  --paper: #F0EEE9;
  --paper-soft: #F8F6F1;
  --tar: #080A09;
  --ink: #1A1C1B;
  --ink-soft: #5E615D;
  --muted: #747770;
  --line: #D2D0CA;
  --line-strong: #B8B8B0;
  --chiral: #C9A34E;
  --chiral-dark: #8A6B2E;
  --sea-glass: #718783;
  --field: #FCFBF7;
  --shadow: 0 24px 70px rgb(8 10 9 / 10%);
  --display-font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --text-font: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono-font: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text-font);
  font-size: 16px;
  line-height: 1.5;
}

body.public-page {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

:focus-visible {
  outline: 3px solid rgb(201 163 78 / 48%);
  outline-offset: 4px;
}

::selection {
  background: rgb(201 163 78 / 34%);
  color: var(--tar);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.site-shell {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--tar);
  isolation: isolate;
  -webkit-user-select: none;
  user-select: none;
}

.membrane-underlayer,
.membrane-surface {
  position: fixed;
  inset: 0;
}

.membrane-underlayer {
  z-index: 0;
  background:
    radial-gradient(ellipse at 52% 46%, rgb(48 55 52 / 18%), transparent 58%),
    linear-gradient(145deg, #101311 0%, #090b0a 52%, #040605 100%);
}

.membrane-surface {
  z-index: 2;
  display: grid;
  overflow: hidden;
  padding: 48px;
  background: var(--paper);
  place-items: center;
  will-change: clip-path;
}

.membrane-tendril-canvas {
  position: fixed;
  z-index: 3;
  inset: 0;
  display: block;
  pointer-events: none;
}

.amoeba-canvas {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 0;
  display: block;
  opacity: 0;
  pointer-events: none;
  transition: opacity 500ms ease;
  will-change: transform;
}

.amoeba-canvas.is-ready {
  opacity: 1;
}

.amoeba-trigger {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  display: block;
  width: 88px;
  height: 88px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  will-change: transform;
}

.amoeba-trigger:disabled {
  cursor: default;
}

.contact-composer {
  position: fixed;
  z-index: 1;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 700ms ease;
}

.is-contact-ready .contact-composer {
  opacity: 1;
  pointer-events: auto;
}

.contact-stream,
.contact-composer__status {
  position: absolute;
  width: min(58vw, 900px);
  margin: 0;
  color: var(--paper);
  font-family: var(--mono-font);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.65;
  transform: none;
}

[data-contact-side="left"] .contact-stream,
[data-contact-side="left"] .contact-composer__status {
  left: 32px;
  width: min(calc(var(--membrane-contact-depth, 58vw) - 32px - 2.2ch), 900px);
  text-align: left;
}

[data-contact-side="right"] .contact-stream,
[data-contact-side="right"] .contact-composer__status {
  right: 32px;
  width: min(calc(var(--membrane-contact-depth, 58vw) - 32px - 2.2ch), 900px);
  text-align: right;
}

.contact-stream {
  --contact-history-cursor-gap: 0.82em;
  --contact-history-inner-fade: 2.15em;

  display: flex;
  min-height: 0;
  gap: var(--contact-history-cursor-gap);
  overflow: hidden;
  pointer-events: auto;
}

.contact-stream[data-flow="down"] {
  flex-direction: column;
}

.contact-stream[data-flow="up"] {
  flex-direction: column-reverse;
}

.contact-composer__field {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  min-height: 1.65em;
  overflow: hidden;
  margin: 0;
  color: var(--paper);
  pointer-events: auto;
}

.contact-history {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overflow-anchor: none;
  overscroll-behavior: contain;
  scrollbar-width: none;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.contact-history::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.contact-stream[data-flow="down"] .contact-history {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, rgb(0 0 0 / 24%) 0.42em, rgb(0 0 0 / 68%) 1.18em, #000 var(--contact-history-inner-fade), #000 58%, rgb(0 0 0 / 78%) 74%, rgb(0 0 0 / 34%) 88%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, rgb(0 0 0 / 24%) 0.42em, rgb(0 0 0 / 68%) 1.18em, #000 var(--contact-history-inner-fade), #000 58%, rgb(0 0 0 / 78%) 74%, rgb(0 0 0 / 34%) 88%, transparent 100%);
}

.contact-stream[data-flow="up"] .contact-history {
  -webkit-mask-image: linear-gradient(to top, transparent 0, rgb(0 0 0 / 24%) 0.42em, rgb(0 0 0 / 68%) 1.18em, #000 var(--contact-history-inner-fade), #000 58%, rgb(0 0 0 / 78%) 74%, rgb(0 0 0 / 34%) 88%, transparent 100%);
  mask-image: linear-gradient(to top, transparent 0, rgb(0 0 0 / 24%) 0.42em, rgb(0 0 0 / 68%) 1.18em, #000 var(--contact-history-inner-fade), #000 58%, rgb(0 0 0 / 78%) 74%, rgb(0 0 0 / 34%) 88%, transparent 100%);
}

.contact-history__messages {
  box-sizing: border-box;
  display: flex;
  min-height: 100%;
  flex-direction: column;
  gap: 0.66em;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-stream[data-flow="down"] .contact-history__messages {
  padding-top: var(--contact-history-inner-fade);
}

.contact-stream[data-flow="up"] .contact-history__messages {
  justify-content: flex-end;
  padding-bottom: var(--contact-history-inner-fade);
}

.contact-message {
  display: -webkit-box;
  flex: 0 0 auto;
  overflow: hidden;
  margin: 0;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-word;
}

.contact-message--admin {
  color: var(--chiral);
}

.contact-stream::after {
  position: absolute;
  z-index: 5;
  right: -8%;
  left: -8%;
  height: 4.5em;
  background: radial-gradient(ellipse at center, rgb(248 246 241 / 14%) 0%, rgb(248 246 241 / 6%) 30%, transparent 72%);
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: scaleX(0.72) scaleY(0.54);
}

.contact-stream[data-flow="down"]::after {
  top: 0;
}

.contact-stream[data-flow="up"]::after {
  bottom: 0;
}

.contact-stream:has(.contact-history.has-unseen-activity)::after {
  animation: contact-activity-glow 2.8s ease-in-out infinite;
}

.contact-history__activity {
  display: none;
}

.contact-composer textarea,
.contact-composer__mirror {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  text-align: inherit;
  white-space: pre-wrap;
  overflow-wrap: normal;
  word-break: normal;
}

.contact-composer textarea {
  z-index: 1;
  caret-color: transparent;
  color: transparent;
  outline: none;
  resize: none;
  -webkit-user-select: text;
  user-select: text;
  -webkit-text-fill-color: transparent;
}

.contact-composer textarea:focus-visible {
  outline: none;
}

.contact-composer__mirror {
  z-index: 2;
  pointer-events: none;
}

.contact-composer__placeholder {
  position: absolute;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  color: rgb(240 238 233 / 38%);
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  pointer-events: none;
  padding-left: 0.55ch;
  text-align: inherit;
  transition: opacity 160ms ease;
}

[data-contact-side="left"] .contact-composer__placeholder {
  padding-left: 0.55ch;
}

[data-contact-side="right"] .contact-composer__placeholder {
  padding-left: 0;
  padding-right: 0.55ch;
}

.contact-composer__field:not(.has-placeholder) .contact-composer__placeholder {
  opacity: 0;
  visibility: hidden;
}

.contact-composer__word {
  white-space: nowrap;
}

.contact-composer__word--breakable {
  white-space: normal;
}

.contact-composer__marker {
  display: inline;
}

.contact-composer__caret {
  position: absolute;
  z-index: 3;
  top: 0.12em;
  left: 0;
  width: 2px;
  height: 1.28em;
  background: currentColor;
  box-shadow: 0 0 7px rgb(248 246 241 / 38%);
  pointer-events: none;
  transform-origin: top left;
  animation: contact-caret-blink 3.4s steps(1, end) infinite;
  will-change: opacity, transform;
}

.contact-remote-draft {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  min-height: 1.65em;
  max-height: 4.95em;
  overflow: hidden;
  color: var(--chiral);
  opacity: 0;
  pointer-events: none;
  white-space: normal;
}

.contact-remote-draft.is-online {
  opacity: 1;
}

.contact-remote-draft__text {
  display: block;
  min-height: 1.65em;
  white-space: pre-wrap;
}

.contact-remote-draft__marker {
  display: inline;
}

.contact-remote-draft__caret {
  position: absolute;
  z-index: 3;
  top: 0.12em;
  left: 0;
  width: 2px;
  height: 1.28em;
  background: #E2C66D;
  box-shadow: 0 0 10px rgb(226 198 109 / 52%);
  pointer-events: none;
  transform-origin: top left;
  animation: contact-caret-blink 3.4s steps(1, end) infinite;
  will-change: opacity, transform;
}

.contact-composer__status {
  top: var(--membrane-contact-axis, 50%);
  min-height: 4.95em;
  opacity: 0;
  pointer-events: none;
}

.is-contact-sending .contact-composer__field {
  opacity: 0.46;
}

.is-contact-sending .contact-composer__caret {
  animation-duration: 620ms;
}

.is-contact-error .contact-composer__field {
  opacity: 0;
}

.is-contact-error .contact-composer__status {
  opacity: 1;
}

.contact-composer__field.is-at-limit .contact-composer__mirror {
  animation: contact-optical-limit 380ms cubic-bezier(0.22, 0.72, 0.26, 1);
}

@keyframes contact-caret-blink {
  0%,
  72%,
  86%,
  100% {
    opacity: 1;
  }

  76%,
  82% {
    opacity: 0.28;
  }
}

@keyframes contact-optical-limit {
  0%,
  100% {
    filter: blur(0);
    opacity: 1;
    text-shadow: 0 0 0 transparent;
  }

  46% {
    filter: blur(0.72px);
    opacity: 0.82;
    text-shadow: 0 0 5px currentColor;
  }
}

@keyframes contact-activity-glow {
  0%,
  100% {
    opacity: 0.08;
    transform: scaleX(0.72) scaleY(0.54);
  }

  42% {
    opacity: 0.55;
    transform: scaleX(1) scaleY(0.82);
  }
}

.site-shell.is-amoeba-hovered .amoeba-canvas {
  filter: brightness(1.06) contrast(1.02);
}

.profile-intro {
  position: relative;
  width: min(980px, 100%);
  font-size: 4rem;
  text-align: center;
  transform: translateY(-15vh);
  transform: translateY(-15dvh);
  will-change: transform;
}

.profile-intro-credit {
  margin: 0;
  color: var(--ink);
  font-family: var(--display-font);
  font-size: 0.5em;
  font-weight: 200;
  letter-spacing: 0.18em;
  line-height: 1.15;
  text-indent: 0.18em;
  text-wrap: balance;
  will-change: transform;
}

.profile-intro h1 {
  margin: 0.84em 0 0;
  color: var(--ink);
  font-family: var(--display-font);
  font-size: 1em;
  font-weight: 300;
  letter-spacing: 0.18em;
  line-height: 1.15;
  overflow-wrap: anywhere;
  text-indent: 0.18em;
  text-transform: uppercase;
  text-wrap: balance;
  will-change: transform;
}

.profile-intro-description {
  max-width: 620px;
  margin: 104px auto 0;
  color: var(--ink);
  font-family: var(--display-font);
  font-size: 1.0625rem;
  font-weight: 300;
  letter-spacing: 0.035em;
  line-height: 1.72;
  text-wrap: pretty;
  will-change: transform;
}

.profile-intro-specialty {
  max-width: 620px;
  margin: 28px auto 0;
  color: var(--ink);
  font-family: var(--display-font);
  font-size: 0.9375rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-align: center;
  will-change: transform;
}

.admin-link,
.admin-submit {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}

.admin-page {
  background:
    linear-gradient(90deg, rgb(216 209 196 / 42%) 1px, transparent 1px),
    linear-gradient(rgb(216 209 196 / 42%) 1px, transparent 1px),
    var(--paper);
  background-size: 42px 42px;
}

.admin-shell {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 48px 28px 80px;
}

.admin-header {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
}

.admin-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.admin-kicker {
  margin: 0 0 6px;
  color: var(--chiral-dark);
  font-family: var(--mono-font);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.admin-header h1 {
  margin: 0;
  font-family: var(--display-font);
  font-size: 3rem;
  font-weight: 300;
  letter-spacing: 0;
  line-height: 1;
}

.admin-link {
  flex: 0 0 auto;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  background: var(--paper-soft);
}

.admin-link.is-current {
  border-color: var(--tar);
  background: var(--tar);
  color: var(--paper-soft);
}

.admin-form,
.admin-notice,
.admin-errors {
  border: 1px solid var(--line);
  background: rgb(250 248 242 / 84%);
  box-shadow: 0 18px 60px rgb(36 34 31 / 8%);
}

.admin-form {
  padding: 30px;
}

.admin-notice,
.admin-errors {
  margin: 0 0 18px;
  padding: 14px 16px;
}

.admin-notice {
  color: var(--chiral-dark);
  font-weight: 600;
}

.admin-errors {
  color: #7C302A;
}

.admin-errors p {
  margin: 0 0 8px;
  font-weight: 700;
}

.admin-errors ul {
  margin: 0;
  padding-left: 20px;
}

.admin-section {
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.admin-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.admin-section h2 {
  margin: 0 0 18px;
  color: var(--ink);
  font-size: 1rem;
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field + .field {
  margin-top: 18px;
}

.field label {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--field);
  color: var(--ink);
}

.field-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.8125rem;
}

.field input {
  min-height: 46px;
  padding: 0 12px;
}

.field textarea {
  min-height: 132px;
  padding: 12px;
  resize: vertical;
}

.admin-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 12px;
}

.admin-actions-split {
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.admin-submit {
  min-width: 150px;
  border: 0;
  padding: 0 22px;
  background: var(--tar);
  color: var(--paper-soft);
  cursor: pointer;
}

.admin-submit:hover {
  background: var(--sea-glass);
}

.admin-shell-wide {
  width: min(1240px, 100%);
}

.admin-toolbar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.admin-toolbar p {
  margin: 0;
  color: var(--muted);
}

.admin-table-wrap,
.admin-message,
.admin-empty {
  border: 1px solid var(--line);
  background: rgb(250 248 242 / 88%);
  box-shadow: 0 18px 60px rgb(36 34 31 / 8%);
}

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

.admin-table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
  font-size: 0.875rem;
  table-layout: fixed;
}

.admin-table-date-column {
  width: 145px;
}

.admin-table-name-column {
  width: 130px;
}

.admin-table-contact-column {
  width: 180px;
}

.admin-table-actions-column {
  width: 170px;
}

.admin-table th,
.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

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

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

.admin-table-body {
  overflow-wrap: anywhere;
  white-space: normal;
}

.admin-table time {
  white-space: nowrap;
}

.admin-table-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  white-space: nowrap;
}

.admin-table-actions form {
  margin: 0;
}

.admin-danger-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: #7C302A;
  cursor: pointer;
  text-decoration: underline;
}

.admin-empty {
  margin: 0;
  padding: 28px;
  color: var(--muted);
}

.admin-message {
  padding: 30px;
}

.admin-message-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 0 0 30px;
}

.admin-message-meta div {
  min-width: 0;
}

.admin-message-meta dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-message-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.admin-message-body {
  min-height: 132px;
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 24px 0;
  font-size: 1.0625rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.admin-dashboard-shell {
  width: min(1180px, 100%);
}

.admin-dashboard-intro {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  padding: 12px 14px;
  background: rgb(250 248 242 / 88%);
}

.admin-dashboard-intro p {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono-font);
  font-size: 0.75rem;
}

.admin-dashboard-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.admin-dashboard-card,
.admin-dashboard-chart {
  border: 1px solid var(--line);
  background: rgb(250 248 242 / 88%);
  box-shadow: 0 18px 60px rgb(36 34 31 / 8%);
}

.admin-dashboard-card {
  min-height: 168px;
  padding: 18px;
}

.admin-dashboard-card p,
.admin-dashboard-card span {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono-font);
  font-size: 0.72rem;
}

.admin-dashboard-card strong {
  display: block;
  margin: 22px 0 6px;
  color: var(--ink);
  font-family: var(--display-font);
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-weight: 300;
  letter-spacing: -0.045em;
  line-height: 0.9;
}

.admin-dashboard-chart {
  padding: 22px;
}

.admin-dashboard-chart > header {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.admin-dashboard-chart h2 {
  margin: 0;
  font-family: var(--display-font);
  font-size: 2rem;
  font-weight: 300;
}

.admin-dashboard-chart > header > p {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono-font);
  font-size: 0.75rem;
}

.admin-dashboard-chart__plot {
  display: grid;
  min-height: 280px;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  padding-top: 36px;
}

.admin-dashboard-chart__day {
  display: grid;
  min-width: 0;
  min-height: 238px;
  grid-template-rows: 25px 1fr 18px;
  gap: 8px;
  align-items: end;
}

.admin-dashboard-chart__day i {
  display: block;
  width: 100%;
  min-height: 1px;
  align-self: end;
  background: linear-gradient(180deg, var(--chiral), var(--chiral-dark));
  box-shadow: 0 0 16px rgb(201 163 78 / 18%);
}

.admin-dashboard-chart__value,
.admin-dashboard-chart time {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono-font);
  font-size: 0.61rem;
  line-height: 1.2;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-dashboard-chart__value {
  color: var(--ink);
}

.admin-chat-shell {
  width: min(1600px, 100%);
  margin: 0 auto;
  padding: 28px 24px 48px;
}

.admin-chat-shell .admin-header {
  margin-bottom: 20px;
}

.admin-chat-toolbar {
  display: flex;
  min-height: 52px;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  padding: 10px 14px;
  background: rgb(250 248 242 / 88%);
}

.admin-chat-toolbar p {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono-font);
  font-size: 0.75rem;
}

.admin-presence-toggle,
.admin-chat-mode {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  font-family: var(--mono-font);
  font-size: 0.78rem;
  user-select: none;
}

.admin-presence-toggle input,
.admin-chat-mode input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.admin-presence-toggle__signal,
.admin-chat-mode::before {
  width: 9px;
  height: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  content: "";
  transition: background 180ms ease, box-shadow 180ms ease;
}

.admin-presence-toggle:has(input:checked) .admin-presence-toggle__signal,
.admin-chat-mode:has(input:checked)::before {
  border-color: var(--chiral);
  background: var(--chiral);
  box-shadow: 0 0 12px rgb(201 163 78 / 42%);
}

.admin-presence-toggle:has(input:focus-visible),
.admin-chat-mode:has(input:focus-visible) {
  outline: 3px solid rgb(201 163 78 / 48%);
  outline-offset: 4px;
}

.admin-chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: stretch;
}

.admin-chat-conversation {
  min-width: 0;
}

.admin-chat-pane {
  display: flex;
  min-width: 0;
  height: min(68vh, 670px);
  min-height: 500px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgb(240 238 233 / 13%);
  background:
    radial-gradient(ellipse at 50% 42%, rgb(47 54 51 / 18%), transparent 64%),
    #0A0D0B;
  box-shadow: 0 18px 48px rgb(8 10 9 / 12%);
  color: var(--paper);
}

.admin-chat-pane--empty {
  align-items: center;
  justify-content: center;
  border-style: dashed;
  border-color: var(--line-strong);
  background: rgb(250 248 242 / 42%);
  box-shadow: none;
  color: var(--muted);
  font-family: var(--mono-font);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.admin-chat-pane__header {
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgb(240 238 233 / 10%);
  padding: 11px 13px;
}

.admin-chat-pane__identity {
  min-width: 0;
}

.admin-chat-pane__actions {
  display: flex;
  min-width: 0;
  flex: 0 1 auto;
  flex-wrap: wrap;
  gap: 8px 11px;
  align-items: center;
  justify-content: flex-end;
}

.admin-chat-pane__header h2 {
  margin: 0 0 2px;
  color: var(--paper);
  font-family: var(--mono-font);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.admin-chat-pane__header time {
  display: block;
  color: rgb(240 238 233 / 42%);
  font-family: var(--mono-font);
  font-size: 0.65rem;
}

.admin-chat-mode {
  color: rgb(240 238 233 / 58%);
}

.admin-chat-visitor-state {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: rgb(240 238 233 / 36%);
  font-family: var(--mono-font);
  font-size: 0.67rem;
  white-space: nowrap;
}

.admin-chat-visitor-state i {
  width: 8px;
  height: 8px;
  border: 1px solid rgb(240 238 233 / 42%);
  border-radius: 50%;
}

.admin-chat-visitor-state.is-online {
  color: #8BC7F0;
}

.admin-chat-visitor-state.is-online i {
  border-color: #8BC7F0;
  background: #6BB8EC;
  box-shadow: 0 0 10px rgb(107 184 236 / 60%);
}

.admin-presence-toggle--pane {
  color: rgb(240 238 233 / 72%);
}

.admin-chat-mode:has(input:disabled) {
  cursor: default;
  opacity: 0.32;
}

.admin-chat-delete {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  color: rgb(240 238 233 / 34%);
  cursor: pointer;
  font: 400 1rem/1 var(--mono-font);
  transition: color 160ms ease, background 160ms ease, opacity 160ms ease;
}

.admin-chat-delete:hover,
.admin-chat-delete:focus-visible {
  background: rgb(155 62 54 / 16%);
  color: #E39A91;
  outline: none;
}

.admin-chat-delete:disabled {
  cursor: wait;
  opacity: 0.28;
}

.admin-chat-pane.is-error {
  animation: admin-chat-pane-error 420ms ease;
}

.admin-chat-log {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 13px;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 9%, #000 91%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 9%, #000 91%, transparent);
  outline: none;
  scrollbar-width: none;
}

.admin-chat-log::-webkit-scrollbar {
  display: none;
}

.admin-chat-message {
  margin: 0 0 9px;
  font-family: var(--mono-font);
  font-size: 0.76rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.admin-chat-message--visitor {
  color: var(--paper);
}

.admin-chat-message--admin {
  color: var(--chiral);
}

.admin-chat-visitor-draft {
  position: relative;
  flex: 0 0 auto;
  min-height: 30px;
  max-height: 74px;
  overflow: hidden;
  border-top: 1px solid rgb(240 238 233 / 9%);
  padding: 7px 13px;
  color: rgb(240 238 233 / 68%);
  font-family: var(--mono-font);
  font-size: 0.7rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.admin-chat-visitor-draft::before {
  content: "draft · ";
  color: rgb(201 163 78 / 72%);
}

.admin-chat-visitor-draft:not(.has-text) {
  opacity: 0.28;
}

.admin-chat-visitor-caret {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1.35em;
  background: var(--paper);
  animation: contact-caret-blink 2.8s steps(1, end) infinite;
  pointer-events: none;
}

.admin-chat-pane:not(.is-visitor-typing) .admin-chat-visitor-caret {
  opacity: 0;
}

.admin-chat-visitor-marker {
  display: inline;
}

.admin-chat-reply {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: minmax(0, 1fr) 42px;
  border-top: 1px solid rgb(240 238 233 / 11%);
}

.admin-chat-reply textarea {
  width: 100%;
  height: 5.2em;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  padding: 9px 10px;
  background: rgb(255 255 255 / 3%);
  color: var(--chiral);
  caret-color: #E2C66D;
  font-family: var(--mono-font);
  font-size: 0.72rem;
  line-height: 1.45;
  outline: 0;
  resize: none;
}

.admin-chat-reply textarea::placeholder {
  color: rgb(240 238 233 / 26%);
}

.admin-chat-reply textarea.is-at-limit {
  animation: admin-chat-optical-limit 380ms ease;
}

.admin-chat-reply button {
  border: 0;
  border-left: 1px solid rgb(240 238 233 / 10%);
  background: transparent;
  color: var(--chiral);
  cursor: pointer;
  font-size: 1.15rem;
}

.admin-chat-reply.is-error {
  box-shadow: inset 0 0 22px rgb(124 48 42 / 32%);
}

.admin-chat-queue {
  display: flex;
  height: min(68vh, 670px);
  min-height: 500px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgb(250 248 242 / 88%);
}

.admin-chat-queue > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 12px 13px;
}

.admin-chat-queue h2 {
  margin: 0;
  font-family: var(--mono-font);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-chat-queue header span {
  color: var(--muted);
  font-family: var(--mono-font);
  font-size: 0.7rem;
}

.admin-chat-queue__items {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}

.admin-chat-queue__items::-webkit-scrollbar {
  display: none;
}

.admin-chat-queue__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  min-height: 69px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono-font);
  font-size: 0.7rem;
  transition: background 160ms ease, color 160ms ease;
}

.admin-chat-queue__item:last-child {
  border-bottom: 0;
}

.admin-chat-queue__select {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 9px;
  align-items: center;
  border: 0;
  padding: 10px 0 10px 12px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.admin-chat-queue__select:focus-visible {
  outline: 2px solid var(--chiral);
  outline-offset: -2px;
}

.admin-chat-queue__copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.admin-chat-queue__title,
.admin-chat-queue__preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-chat-queue__title {
  color: var(--ink);
  font-size: 0.71rem;
  font-weight: 600;
  letter-spacing: 0.015em;
}

.admin-chat-queue__preview {
  color: var(--muted);
  font-size: 0.63rem;
}

.admin-chat-queue__preview.is-draft {
  color: #96752e;
}

.admin-chat-queue__item time {
  align-self: start;
  padding-top: 2px;
  color: var(--muted);
  font-size: 0.64rem;
  white-space: nowrap;
}

.admin-chat-queue__meta {
  display: inline-flex;
  min-width: 14px;
  justify-content: flex-end;
  align-items: center;
}

.admin-chat-queue__meta i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
}

.admin-chat-queue__meta i.is-online {
  border-color: #6BB8EC;
  background: #6BB8EC;
  box-shadow: 0 0 8px rgb(107 184 236 / 48%);
}

.admin-chat-queue__meta b {
  display: none;
  min-width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 999px;
  background: var(--sea-glass);
  color: #062422;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1;
}

.admin-chat-queue__meta b.is-visible {
  display: grid;
}

.admin-chat-queue__delete {
  width: 100%;
  height: 100%;
  border: 0;
  border-left: 1px solid transparent;
  padding: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: 400 1rem/1 var(--mono-font);
  opacity: 0.55;
  transition: color 160ms ease, background 160ms ease, opacity 160ms ease;
}

.admin-chat-queue__item:hover .admin-chat-queue__delete,
.admin-chat-queue__item:focus-within .admin-chat-queue__delete {
  opacity: 1;
}

.admin-chat-queue__delete:hover,
.admin-chat-queue__delete:focus-visible {
  background: rgb(155 62 54 / 10%);
  color: #A7463D;
  outline: none;
}

.admin-chat-queue__item.is-selected {
  background: #0A0D0B;
  color: var(--paper);
}

.admin-chat-queue__item.is-selected .admin-chat-queue__title {
  color: var(--paper);
}

.admin-chat-queue__item.is-selected .admin-chat-queue__preview,
.admin-chat-queue__item.is-selected time,
.admin-chat-queue__item.is-selected .admin-chat-queue__delete {
  color: rgb(240 238 233 / 54%);
}

.admin-chat-queue__item.is-selected .admin-chat-queue__preview.is-draft {
  color: #E2C66D;
}

.admin-chat-queue__item.is-error {
  animation: admin-chat-queue-error 420ms ease;
}

@keyframes admin-chat-optical-limit {
  50% {
    filter: blur(0.65px);
    opacity: 0.78;
    text-shadow: 0 0 5px currentColor;
  }
}

@keyframes admin-chat-pane-error {
  50% {
    box-shadow: 0 0 0 1px rgb(227 154 145 / 42%), inset 0 0 24px rgb(124 48 42 / 20%);
  }
}

@keyframes admin-chat-queue-error {
  50% {
    box-shadow: inset 0 0 0 1px rgb(167 70 61 / 55%);
  }
}

@media (max-width: 1120px) {
  .admin-dashboard-chart__plot {
    gap: 5px;
  }
}

@media (max-width: 980px) {
  .admin-chat-layout {
    grid-template-columns: 1fr;
  }

  .admin-chat-queue {
    height: auto;
    min-height: 0;
  }

  .admin-chat-queue__items {
    max-height: 270px;
  }
}

@media (max-width: 860px) {
  .membrane-surface {
    padding: 28px;
  }

  .profile-intro {
    font-size: 3.25rem;
  }

  .contact-stream,
  .contact-composer__status {
    font-size: 0.8125rem;
  }

  .admin-chat-pane {
    height: 500px;
    min-height: 410px;
  }
}

@media (max-width: 640px) {
  .admin-dashboard-intro,
  .admin-dashboard-chart > header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .admin-dashboard-chart {
    padding: 16px 12px;
  }

  .admin-dashboard-chart__plot {
    min-height: 220px;
    gap: 3px;
    padding-top: 22px;
  }

  .admin-dashboard-chart__day {
    min-height: 184px;
    grid-template-rows: 16px 1fr 16px;
    gap: 5px;
  }

  .admin-dashboard-chart__value,
  .admin-dashboard-chart time {
    font-size: 0.48rem;
  }

  .contact-stream {
    --contact-history-cursor-gap: 0.66em;
    --contact-history-inner-fade: 1.65em;
  }

  .membrane-surface {
    padding: 22px;
  }

  .profile-intro {
    font-size: 2.25rem;
  }

  .profile-intro h1 {
    letter-spacing: 0.14em;
    line-height: 1.25;
    text-indent: 0.14em;
  }

  .profile-intro-description {
    margin-top: 72px;
    font-size: 1rem;
    line-height: 1.65;
  }

  .profile-intro-specialty {
    margin-top: 20px;
    font-size: 0.875rem;
  }

  .contact-stream,
  .contact-composer__status {
    right: 16px !important;
    left: 16px !important;
    width: auto;
    font-size: 0.6875rem;
    letter-spacing: 0.02em;
    text-align: left !important;
    transform: none;
  }

  .contact-composer textarea {
    /* iOS zooms focused editable fields whose computed font size is below 16px.
       The visible text is drawn by the mirror, so retain its compact visual scale. */
    font-size: 16px;
    line-height: 1.134375;
  }

  [data-contact-side="top"] .contact-composer__status {
    top: 28px;
    bottom: auto;
  }

  [data-contact-side="bottom"] .contact-composer__status {
    top: calc(var(--membrane-contact-edge, 73dvh) + 28px);
    bottom: auto;
  }

  .contact-remote-draft {
    max-height: 3.3em;
  }

  .contact-message {
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .admin-shell {
    padding: 30px 16px 56px;
  }

  .admin-chat-shell {
    padding: 22px 12px 40px;
  }

  .admin-chat-toolbar {
    align-items: flex-start;
  }

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

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

  .admin-header-actions {
    justify-content: flex-start;
  }

  .admin-header h1 {
    font-size: 2.5rem;
  }

  .admin-form {
    padding: 20px;
  }

  .admin-message {
    padding: 20px;
  }

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

@media (max-height: 620px) {
  .contact-stream {
    --contact-history-cursor-gap: 0.66em;
    --contact-history-inner-fade: 1.65em;
  }
}

@media (max-width: 380px) {
  .contact-stream,
  .contact-composer__status {
    right: 14px !important;
    left: 14px !important;
    font-size: 0.625rem;
  }

  .profile-intro {
    font-size: 1.9rem;
  }
}

@media (max-width: 340px) {
  .contact-stream,
  .contact-composer__status {
    font-size: 0.5625rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .contact-composer,
  .admin-presence-toggle__signal,
  .admin-chat-mode::before {
    transition-duration: 1ms;
  }

  .contact-composer__caret,
  .contact-remote-draft__caret,
  .admin-chat-visitor-caret,
  .admin-chat-queue__item.is-error {
    animation: none;
  }

  .contact-stream:has(.contact-history.has-unseen-activity)::after {
    animation: none;
    opacity: 0.42;
  }

  .contact-composer__field.is-at-limit .contact-composer__mirror,
  .admin-chat-reply textarea.is-at-limit {
    animation-duration: 120ms;
  }
}
