:root {
  --ink: #17211d;
  --ink-soft: #4f5d57;
  --ink-faint: #7c8782;
  --forest-950: #102019;
  --forest-900: #15251f;
  --forest-800: #20372d;
  --forest-700: #2c4c3d;
  --forest-600: #3e6753;
  --moss: #96b88a;
  --moss-soft: #dbe8d5;
  --lime: #cae6a8;
  --ivory: #f7f4eb;
  --ivory-deep: #eee9dd;
  --paper: #fffdf8;
  --white: #ffffff;
  --line: #dedbd1;
  --line-strong: #cbc8bd;
  --urgent: #a64231;
  --urgent-soft: #fae4df;
  --warning: #8c6519;
  --warning-soft: #f8edcd;
  --info: #385c77;
  --info-soft: #e2edf4;
  --success: #2f6b4d;
  --success-soft: #dcecdf;
  --shadow-sm: 0 1px 2px rgba(17, 31, 24, 0.06);
  --shadow-md: 0 14px 36px rgba(17, 31, 24, 0.12);
  --shadow-lg: 0 30px 80px rgba(10, 25, 18, 0.2);
  --topbar-height: 64px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --transition: 160ms ease;
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--ivory);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-size: 14px;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p,
dl,
dd,
ol,
ul {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

textarea {
  resize: vertical;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid rgba(80, 127, 102, 0.42);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  color: var(--white);
  background: var(--forest-700);
  box-shadow: var(--shadow-md);
  transform: translateY(-150%);
  transition: transform var(--transition);
}

.skip-link:focus {
  transform: translateY(0);
}

.eyebrow {
  color: var(--forest-600);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
}

.eyebrow--light {
  color: var(--lime);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 13px 13px 13px 4px;
  color: var(--forest-950);
  background: var(--lime);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.06em;
  box-shadow: 0 8px 22px rgba(9, 23, 15, 0.18);
}

.brand-mark--small {
  width: 34px;
  height: 34px;
  border-radius: 10px 10px 10px 3px;
  font-size: 16px;
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.15;
}

.brand-copy strong {
  font-size: 14px;
  font-weight: 760;
  letter-spacing: -0.015em;
}

.brand-copy span {
  margin-top: 3px;
  font-size: 11px;
  opacity: 0.62;
}

.brand--light {
  color: var(--white);
}

.brand--compact {
  gap: 9px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 15px;
  font-weight: 720;
  line-height: 1.1;
  text-decoration: none;
  transition:
    background-color var(--transition),
    border-color var(--transition),
    color var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
}

.button:not(:disabled):active {
  transform: translateY(1px);
}

.button--primary {
  color: var(--white);
  background: var(--forest-700);
  box-shadow: 0 8px 20px rgba(32, 72, 52, 0.17);
}

.button--primary:not(:disabled):hover {
  background: var(--forest-800);
  box-shadow: 0 10px 24px rgba(32, 72, 52, 0.23);
}

.button--secondary {
  border-color: var(--line-strong);
  color: var(--forest-800);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.button--secondary:not(:disabled):hover {
  border-color: var(--moss);
  background: #f8fbf5;
}

.button--ghost {
  border-color: var(--line);
  color: var(--forest-700);
  background: transparent;
}

.button--ghost:not(:disabled):hover {
  background: var(--ivory);
}

.button--small {
  min-height: 34px;
  border-radius: 8px;
  padding: 7px 11px;
  font-size: 12px;
}

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

.button--send {
  min-height: 38px;
  border-radius: 10px;
  padding: 9px 13px;
  color: var(--white);
  background: var(--forest-700);
}

.button--send:not(:disabled):hover {
  background: var(--forest-800);
}

#acknowledge-uncertain-button {
  align-self: flex-start;
  margin: 0 18px 8px;
}

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 20px;
  line-height: 1;
  transition:
    border-color var(--transition),
    background-color var(--transition),
    color var(--transition);
}

.icon-button:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.64);
}

.icon-button--dark {
  border-color: rgba(255, 255, 255, 0.13);
  color: rgba(255, 255, 255, 0.84);
}

.icon-button--dark:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.topbar__logout {
  border-color: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.84);
  background: transparent;
}

.topbar__logout:not(:disabled):hover {
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label {
  color: var(--ink);
  font-size: 12px;
  font-weight: 720;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  color: var(--ink);
  background: var(--white);
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    background-color var(--transition);
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: #aaa99f;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--forest-600);
  box-shadow: 0 0 0 3px rgba(74, 112, 91, 0.13);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #969c98;
}

.field--compact {
  gap: 5px;
}

.field--compact input,
.field--compact select {
  min-height: 39px;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

/* Login */

.login-page {
  min-height: 100vh;
  color: var(--ink);
  background: var(--ivory);
}

.login-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(360px, 0.92fr) minmax(440px, 1.08fr);
}

.login-story {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(30px, 5vw, 68px);
  color: var(--white);
  background:
    radial-gradient(circle at 10% 90%, rgba(166, 203, 134, 0.22), transparent 38%),
    radial-gradient(circle at 86% 10%, rgba(103, 153, 128, 0.22), transparent 30%),
    var(--forest-900);
}

.login-story::before,
.login-story::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.login-story::before {
  right: -165px;
  bottom: -150px;
  width: 430px;
  height: 430px;
  border: 1px solid rgba(202, 230, 168, 0.18);
  border-radius: 50%;
  box-shadow:
    0 0 0 54px rgba(202, 230, 168, 0.035),
    0 0 0 110px rgba(202, 230, 168, 0.025);
}

.login-story::after {
  top: 34%;
  left: 0;
  width: 42%;
  height: 1px;
  background: linear-gradient(90deg, rgba(202, 230, 168, 0.45), transparent);
}

.login-story > * {
  position: relative;
  z-index: 1;
}

.login-story__content {
  max-width: 590px;
  padding: 80px 0;
}

.login-story__content h1 {
  max-width: 560px;
  margin-top: 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(40px, 5.2vw, 72px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.99;
}

.login-story__content > p:last-child {
  max-width: 490px;
  margin-top: 25px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 17px;
  line-height: 1.65;
}

.login-story__signal {
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 12px;
  font-weight: 620;
  letter-spacing: 0.02em;
}

.signal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(202, 230, 168, 0.1);
}

.login-form-panel {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 44px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.3)),
    var(--ivory);
}

.login-card {
  width: min(100%, 410px);
  padding: 34px;
  border: 1px solid rgba(203, 200, 189, 0.86);
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: 0 24px 70px rgba(39, 54, 45, 0.1);
}

.login-card__heading h2 {
  margin-top: 9px;
  font-size: 29px;
  font-weight: 760;
  letter-spacing: -0.04em;
}

.login-card__heading > p:last-child {
  margin-top: 8px;
  color: var(--ink-soft);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 17px;
  margin-top: 28px;
}

.login-form .button {
  margin-top: 5px;
}

.form-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
  border: 1px solid #ecc9c2;
  border-radius: 10px;
  padding: 11px 12px;
  color: #7f3326;
  background: var(--urgent-soft);
  font-size: 12px;
  font-weight: 620;
}

.form-alert__mark {
  display: inline-grid;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: var(--urgent);
  font-size: 11px;
  font-weight: 900;
}

.login-card__footer {
  margin-top: 23px;
  padding-top: 19px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 11px;
  text-align: center;
}

/* Portal frame */

.portal-page {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  color: var(--ink);
  background: var(--ivory);
}

.topbar {
  position: relative;
  z-index: 40;
  display: flex;
  height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  color: var(--white);
  background: var(--forest-900);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.07);
}

.topbar::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(202, 230, 168, 0.35), transparent);
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.connection-state {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-right: 5px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 11px;
  font-weight: 650;
}

.connection-state__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d9ad51;
  box-shadow: 0 0 0 3px rgba(217, 173, 81, 0.13);
}

.connection-state.is-online .connection-state__dot {
  background: #9ed28f;
  box-shadow: 0 0 0 3px rgba(158, 210, 143, 0.13);
}

.connection-state.is-offline .connection-state__dot {
  background: #d77b69;
  box-shadow: 0 0 0 3px rgba(215, 123, 105, 0.13);
}

.operator {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
  padding-left: 13px;
  border-left: 1px solid rgba(255, 255, 255, 0.13);
}

.operator__avatar {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  color: var(--forest-950);
  background: var(--lime);
  font-size: 12px;
  font-weight: 850;
}

.operator__copy {
  display: flex;
  flex-direction: column;
  max-width: 150px;
  line-height: 1.12;
}

.operator__copy span {
  color: rgba(255, 255, 255, 0.53);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.operator__copy strong {
  overflow: hidden;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.refresh-icon {
  display: block;
  font-size: 20px;
  transform-origin: center;
}

.is-refreshing .refresh-icon {
  animation: spin 0.75s linear infinite;
}

.global-banner {
  position: fixed;
  z-index: 90;
  top: calc(var(--topbar-height) + 10px);
  left: 50%;
  display: flex;
  max-width: min(92vw, 620px);
  align-items: center;
  gap: 16px;
  border: 1px solid #dfb6ac;
  border-radius: 11px;
  padding: 10px 11px 10px 14px;
  color: #743127;
  background: #fff2ee;
  box-shadow: var(--shadow-md);
  font-size: 12px;
  font-weight: 650;
  transform: translateX(-50%);
}

.global-banner.is-success {
  border-color: #b8d5bd;
  color: #27583f;
  background: #eff8ef;
}

.global-banner button {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  color: currentColor;
  background: transparent;
  font-size: 18px;
}

.global-banner button:hover {
  background: rgba(0, 0, 0, 0.05);
}

.portal-shell {
  display: grid;
  height: calc(100vh - var(--topbar-height));
  height: calc(100dvh - var(--topbar-height));
  grid-template-columns: minmax(280px, 330px) minmax(390px, 1fr) minmax(272px, 310px);
  overflow: hidden;
}

.inbox-pane,
.thread-pane,
.details-pane {
  min-width: 0;
  min-height: 0;
}

/* Inbox list */

.inbox-pane {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--paper);
}

.pane-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 18px 13px;
}

.pane-heading__title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 4px;
}

.pane-heading h1 {
  font-size: 22px;
  font-weight: 760;
  letter-spacing: -0.035em;
}

.count-pill {
  display: inline-grid;
  min-width: 25px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  padding: 0 7px;
  color: var(--forest-700);
  background: var(--moss-soft);
  font-size: 10px;
  font-weight: 800;
}

.search-form {
  position: relative;
  margin: 0 14px;
}

.search-form input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 37px;
  outline: none;
  color: var(--ink);
  background: #f7f6f1;
  font-size: 12px;
  transition:
    border-color var(--transition),
    background-color var(--transition),
    box-shadow var(--transition);
}

.search-form input:hover {
  border-color: var(--line-strong);
  background: var(--white);
}

.search-form input:focus {
  border-color: var(--forest-600);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(74, 112, 91, 0.1);
}

.search-form input::placeholder {
  color: #8a928e;
}

.search-form__icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 14px;
  width: 13px;
  height: 13px;
  border: 1.7px solid #74817b;
  border-radius: 50%;
  pointer-events: none;
  transform: translateY(-55%);
}

.search-form__icon::after {
  position: absolute;
  right: -4px;
  bottom: -3px;
  width: 6px;
  height: 1.7px;
  border-radius: 2px;
  content: "";
  background: #74817b;
  transform: rotate(45deg);
}

.search-form button {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  color: var(--ink-faint);
  background: transparent;
  font-size: 16px;
  transform: translateY(-50%);
}

.search-form button:hover {
  color: var(--ink);
  background: var(--ivory-deep);
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 14px 12px;
  border-bottom: 1px solid var(--line);
}

.filter-row label {
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.filter-row select {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: none;
  color: var(--forest-700);
  background: transparent;
  font-size: 11px;
  font-weight: 720;
}

.list-status {
  min-height: 0;
  padding: 0 14px;
  color: var(--ink-faint);
  font-size: 10px;
}

.conversation-list {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #c9c9c1 transparent;
  scrollbar-width: thin;
}

.conversation-list li {
  border-bottom: 1px solid #e8e5dc;
}

.conversation-card {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 102px;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  border: 0;
  border-left: 3px solid transparent;
  padding: 14px 13px 13px 12px;
  text-align: left;
  background: transparent;
  transition:
    background-color var(--transition),
    border-color var(--transition);
}

.conversation-card:hover {
  background: #f7f8f3;
}

.conversation-card.is-selected {
  border-left-color: var(--forest-600);
  background: #eff4eb;
}

.conversation-card.is-unread::after {
  position: absolute;
  top: 18px;
  right: 11px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  content: "";
  background: var(--forest-600);
  box-shadow: 0 0 0 3px #e1ebdc;
}

.contact-avatar {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #d5d8ca;
  border-radius: 13px 13px 13px 5px;
  color: var(--forest-700);
  background: #e8efe0;
  font-size: 13px;
  font-weight: 830;
  letter-spacing: -0.03em;
}

.conversation-card:nth-child(4n + 2) .contact-avatar {
  color: #5f5128;
  background: #f1e9cc;
}

.conversation-card:nth-child(4n + 3) .contact-avatar {
  color: #4e5577;
  background: #e6e8f2;
}

.conversation-card:nth-child(4n + 4) .contact-avatar {
  color: #755047;
  background: #f1e3df;
}

.conversation-card__body {
  min-width: 0;
}

.conversation-card__top,
.conversation-card__meta {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.conversation-card__name {
  overflow: hidden;
  padding-right: 10px;
  font-size: 13px;
  font-weight: 760;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-card__time {
  flex: 0 0 auto;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 620;
}

.conversation-card.is-unread .conversation-card__time {
  padding-right: 13px;
  color: var(--forest-600);
  font-weight: 780;
}

.conversation-card__preview {
  display: -webkit-box;
  overflow: hidden;
  min-height: 32px;
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.conversation-card__meta {
  justify-content: flex-start;
  margin-top: 7px;
}

.mini-badge {
  display: inline-flex;
  min-height: 18px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--ink-soft);
  background: #eeece5;
  font-size: 8px;
  font-weight: 790;
  letter-spacing: 0.035em;
  line-height: 1;
  text-transform: uppercase;
}

.mini-badge--new,
.status-badge--new {
  color: #2d5f47;
  background: #dcecdf;
}

.mini-badge--open,
.status-badge--open {
  color: #315c70;
  background: #deebf0;
}

.mini-badge--in_progress,
.status-badge--in_progress {
  color: #665426;
  background: #eee8cf;
}

.mini-badge--waiting,
.status-badge--waiting {
  color: #7a5527;
  background: #f5e4cd;
}

.mini-badge--resolved,
.status-badge--resolved {
  color: #59625d;
  background: #e5e8e6;
}

.mini-badge--snoozed,
.status-badge--snoozed {
  color: #5e5273;
  background: #eae5f0;
}

.mini-badge--urgent {
  color: #8a3327;
  background: var(--urgent-soft);
}

.conversation-card__indicator {
  margin-left: auto;
  color: var(--ink-faint);
  font-size: 9px;
  white-space: nowrap;
}

.conversation-loading {
  display: flex;
  flex-direction: column;
}

.conversation-skeleton {
  display: grid;
  min-height: 100px;
  grid-template-columns: 40px 1fr;
  grid-template-rows: 14px 11px 11px;
  gap: 9px 11px;
  padding: 15px;
  border-bottom: 1px solid #e8e5dc;
}

.conversation-skeleton span {
  display: block;
  overflow: hidden;
  border-radius: 6px;
  background: #e9e7df;
}

.conversation-skeleton span::after,
.thread-loading .spinner::after {
  display: block;
  width: 100%;
  height: 100%;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.68), transparent);
  animation: shimmer 1.25s ease-in-out infinite;
}

.conversation-skeleton span:first-child {
  grid-row: 1 / 4;
  width: 40px;
  height: 40px;
  border-radius: 13px 13px 13px 5px;
}

.conversation-skeleton span:nth-child(2) {
  width: 55%;
}

.conversation-skeleton span:nth-child(3) {
  width: 92%;
}

.conversation-skeleton span:nth-child(4) {
  width: 73%;
}

.pane-state {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 35px 28px;
  text-align: center;
}

.pane-state__art {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid #d4dfce;
  border-radius: 16px 16px 16px 6px;
  color: var(--forest-600);
  background: var(--moss-soft);
  font-size: 20px;
  font-weight: 800;
}

.pane-state h2 {
  margin-top: 13px;
  font-size: 15px;
}

.pane-state p {
  max-width: 215px;
  margin-top: 5px;
  color: var(--ink-faint);
  font-size: 11px;
}

.pane-state .button {
  margin-top: 16px;
}

.pane-state--error .pane-state__art {
  border-color: #e8c5bd;
  color: var(--urgent);
  background: var(--urgent-soft);
}

/* Thread */

.thread-pane {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  background: #ecebe4;
}

.thread-placeholder {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 40px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 255, 255, 0.88), transparent 32%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.25), transparent),
    #eeece5;
}

.thread-placeholder__art {
  position: relative;
  display: grid;
  width: 88px;
  height: 72px;
  place-items: center;
  margin-bottom: 24px;
  border: 1px solid #cfd7ca;
  border-radius: 28px 28px 28px 9px;
  background: #dfe9da;
  box-shadow: 16px 14px 0 -4px #f8f4ea;
}

.thread-placeholder__art::before,
.thread-placeholder__art::after,
.thread-placeholder__art span {
  display: block;
  width: 40px;
  height: 4px;
  border-radius: 999px;
  content: "";
  background: #91aa88;
}

.thread-placeholder__art::before {
  position: absolute;
  top: 23px;
}

.thread-placeholder__art::after {
  position: absolute;
  top: 33px;
  width: 29px;
}

.thread-placeholder__art span {
  display: none;
}

.thread-placeholder h2 {
  margin-top: 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.thread-placeholder > p:last-child {
  max-width: 340px;
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 12px;
}

.thread-view {
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
}

.thread-header {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 70px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 10px 16px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: var(--shadow-sm);
}

.contact-avatar--thread {
  width: 39px;
  height: 39px;
}

.thread-header__identity {
  min-width: 0;
  flex: 1;
}

.thread-header__title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.thread-header h2 {
  overflow: hidden;
  min-width: 0;
  font-size: 14px;
  font-weight: 780;
  letter-spacing: -0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-header__identity > p {
  overflow: hidden;
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-badge {
  display: inline-flex;
  min-height: 20px;
  flex: 0 0 auto;
  align-items: center;
  border-radius: 999px;
  padding: 3px 7px;
  color: #2d5f47;
  background: #dcecdf;
  font-size: 8px;
  font-weight: 790;
  letter-spacing: 0.035em;
  line-height: 1;
  text-transform: uppercase;
}

.mobile-back {
  display: none;
}

.thread-details-button {
  display: none;
}

.thread-body {
  position: relative;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(circle at 12px 12px, rgba(35, 68, 50, 0.035) 1.2px, transparent 1.3px)
      0 0 / 24px 24px,
    linear-gradient(rgba(244, 242, 234, 0.94), rgba(244, 242, 234, 0.94));
  scrollbar-color: #bbbdb6 transparent;
  scrollbar-width: thin;
}

.thread-loading {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.92);
  box-shadow: var(--shadow-sm);
  font-size: 11px;
  transform: translate(-50%, -50%);
}

.spinner {
  display: block;
  width: 14px;
  height: 14px;
  overflow: hidden;
  border: 2px solid #d5d9d3;
  border-top-color: var(--forest-600);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.thread-error,
.thread-empty-messages {
  display: flex;
  min-height: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 35px;
  text-align: center;
}

.thread-error > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px 14px 14px 5px;
  color: var(--urgent);
  background: var(--urgent-soft);
  font-size: 18px;
  font-weight: 850;
}

.thread-error h3,
.thread-empty-messages h3 {
  margin-top: 12px;
  font-size: 14px;
}

.thread-error p,
.thread-empty-messages p {
  margin-top: 5px;
  color: var(--ink-faint);
  font-size: 11px;
}

.thread-error .button {
  margin-top: 15px;
}

.message-timeline {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  padding: 28px clamp(18px, 4vw, 58px) 26px;
}

.timeline-date {
  align-self: center;
  margin: 12px 0;
  border: 1px solid rgba(193, 193, 184, 0.76);
  border-radius: 999px;
  padding: 4px 9px;
  color: #727a76;
  background: rgba(255, 253, 248, 0.86);
  box-shadow: var(--shadow-sm);
  font-size: 8px;
  font-weight: 740;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.message-row {
  display: flex;
  width: 100%;
}

.message-row--outbound {
  justify-content: flex-end;
}

.message-row--system {
  justify-content: center;
}

.message-bubble {
  position: relative;
  max-width: min(76%, 620px);
  border: 1px solid rgba(203, 200, 189, 0.8);
  border-radius: 7px 15px 15px 15px;
  padding: 10px 11px 7px;
  background: var(--white);
  box-shadow: 0 2px 4px rgba(23, 33, 29, 0.055);
}

.message-row--outbound .message-bubble {
  border-color: #bed4b4;
  border-radius: 15px 7px 15px 15px;
  background: #dff0d5;
}

.message-row--system .message-bubble {
  max-width: 86%;
  border: 0;
  border-radius: 999px;
  padding: 6px 11px;
  color: var(--ink-faint);
  background: rgba(255, 253, 248, 0.78);
  box-shadow: none;
  font-size: 10px;
  text-align: center;
}

.message-bubble__body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.52;
}

.message-media {
  display: flex;
  min-width: min(260px, 58vw);
  flex-direction: column;
  gap: 7px;
  margin: -3px -4px 7px;
}

.message-media__image {
  display: block;
  width: auto;
  max-width: min(420px, 100%);
  max-height: 360px;
  border-radius: 10px;
  object-fit: contain;
  background: rgba(18, 32, 24, 0.06);
}

.message-media__label {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.message-media__audio {
  width: min(330px, 100%);
  min-height: 42px;
}

.message-bubble__attachment {
  display: flex;
  min-width: 190px;
  align-items: center;
  gap: 9px;
  margin-bottom: 7px;
  border: 1px solid rgba(72, 99, 83, 0.14);
  border-radius: 9px;
  padding: 9px;
  color: var(--forest-700);
  background: rgba(255, 255, 255, 0.48);
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
}

a.message-bubble__attachment:hover {
  border-color: rgba(72, 99, 83, 0.3);
  background: rgba(255, 255, 255, 0.72);
}

.message-bubble__attachment-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  color: var(--forest-700);
  background: var(--moss-soft);
  font-size: 13px;
}

.message-bubble__meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 4px;
  color: #76807b;
  font-size: 8px;
  line-height: 1;
}

.message-status {
  color: var(--success);
  font-weight: 800;
}

.message-status--unknown {
  color: var(--urgent);
}

.composer {
  position: relative;
  z-index: 3;
  border-top: 1px solid var(--line);
  padding: 10px 13px 12px;
  background: var(--paper);
  box-shadow: 0 -5px 22px rgba(23, 33, 29, 0.035);
}

.composer form {
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--white);
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

.composer form:focus-within {
  border-color: var(--forest-600);
  box-shadow: 0 0 0 3px rgba(74, 112, 91, 0.1);
}

.composer textarea {
  display: block;
  width: 100%;
  min-height: 46px;
  max-height: 150px;
  resize: none;
  overflow-y: auto;
  border: 0;
  outline: none;
  padding: 12px 13px 4px;
  background: transparent;
  font-size: 12px;
  line-height: 1.5;
}

.composer textarea::placeholder {
  color: #919894;
}

.composer__footer {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 6px 6px 13px;
}

.composer__hint,
.composer__actions > span {
  color: var(--ink-faint);
  font-size: 9px;
}

.composer__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.composer__notice {
  margin-bottom: 7px;
  border: 1px solid #b9d7c0;
  border-radius: 8px;
  padding: 7px 10px;
  color: #285d42;
  background: #edf7ef;
  font-size: 10px;
  font-weight: 650;
}

.composer__notice.is-error {
  border-color: #e7bfb6;
  color: #84372a;
  background: #fff0ed;
}

.composer__notice.is-warning {
  border-color: #e4ca91;
  color: #795820;
  background: #fff8e8;
}

/* Details */

.details-pane {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: var(--paper);
}

.details-header {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
}

.details-header h2 {
  margin-top: 4px;
  font-size: 17px;
  letter-spacing: -0.025em;
}

.details-close {
  display: none;
}

.details-scroll {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #c9c9c1 transparent;
  scrollbar-width: thin;
}

.detail-section {
  padding: 17px 16px;
  border-bottom: 1px solid var(--line);
}

.detail-section h3 {
  font-size: 13px;
  font-weight: 770;
  letter-spacing: -0.015em;
}

.contact-card__top {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.contact-card__top > div {
  min-width: 0;
}

.contact-card__top h3,
.contact-card__top p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-card__top p {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 10px;
}

.contact-facts {
  display: grid;
  gap: 9px;
  margin-top: 15px;
}

.contact-facts > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.contact-facts dt {
  color: var(--ink-faint);
  font-size: 10px;
}

.contact-facts dd {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 680;
  text-align: right;
}

.channel-mark {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 6px;
  color: #285d42;
  background: var(--moss-soft);
  font-size: 8px;
  font-weight: 900;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 14px;
  color: var(--forest-600);
  font-size: 10px;
  font-weight: 750;
  text-decoration: none;
}

.text-link:hover {
  color: var(--forest-800);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.section-heading h3 {
  margin-top: 4px;
}

.save-state {
  min-height: 15px;
  color: var(--success);
  font-size: 9px;
  font-weight: 700;
}

.save-state.is-error {
  color: var(--urgent);
}

.workflow-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px 9px;
}

.workflow-form .field:nth-child(3),
.workflow-form .field:nth-child(4),
.workflow-form .button {
  grid-column: 1 / -1;
}

.note-form {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8f7f2;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

.note-form:focus-within {
  border-color: var(--forest-600);
  box-shadow: 0 0 0 3px rgba(74, 112, 91, 0.1);
}

.note-form textarea {
  display: block;
  width: 100%;
  min-height: 70px;
  resize: vertical;
  border: 0;
  outline: 0;
  padding: 10px;
  background: transparent;
  font-size: 11px;
  line-height: 1.5;
}

.note-form__footer {
  display: flex;
  min-height: 39px;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 4px 5px 5px 9px;
  border-top: 1px solid #e5e2d9;
}

.note-form__footer > span {
  flex: 1;
  color: var(--ink-faint);
  font-size: 9px;
}

.note-form__footer > span.is-error {
  color: var(--urgent);
}

.note-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 13px;
}

.note-item {
  border-left: 2px solid var(--moss);
  border-radius: 0 8px 8px 0;
  padding: 8px 9px;
  background: #f4f3ed;
}

.note-item__body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.5;
}

.note-item__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  color: var(--ink-faint);
  font-size: 8px;
}

.note-item__meta strong {
  overflow: hidden;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-empty {
  margin-top: 12px;
  color: var(--ink-faint);
  font-size: 10px;
  text-align: center;
}

.mobile-scrim {
  position: fixed;
  z-index: 49;
  inset: var(--topbar-height) 0 0;
  width: 100%;
  height: calc(100dvh - var(--topbar-height));
  border: 0;
  padding: 0;
  background: rgba(12, 25, 18, 0.38);
  backdrop-filter: blur(1px);
}

.noscript-message {
  position: fixed;
  z-index: 200;
  inset: auto 18px 18px;
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--white);
  background: var(--urgent);
  box-shadow: var(--shadow-md);
  text-align: center;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

@media (max-width: 1100px) {
  .portal-shell {
    grid-template-columns: minmax(280px, 330px) minmax(390px, 1fr);
  }

  .thread-details-button {
    display: inline-flex;
  }

  .details-pane {
    position: fixed;
    z-index: 50;
    top: var(--topbar-height);
    right: 0;
    bottom: 0;
    width: min(92vw, 330px);
    border-left: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    transform: translateX(105%);
    transition: transform 220ms ease;
  }

  .details-pane.is-open {
    transform: translateX(0);
  }

  .details-close {
    display: inline-grid;
  }
}

@media (max-width: 760px) {
  :root {
    --topbar-height: 58px;
  }

  .topbar {
    padding: 0 12px;
  }

  .brand-copy span,
  .connection-state,
  .operator__copy,
  .composer__hint {
    display: none;
  }

  .topbar__actions {
    gap: 6px;
  }

  .operator {
    margin-left: 0;
    padding-left: 8px;
  }

  .portal-shell {
    position: relative;
    display: block;
  }

  .inbox-pane,
  .thread-pane {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .thread-pane {
    display: none;
  }

  .portal-shell.mobile-thread-open .inbox-pane {
    display: none;
  }

  .portal-shell.mobile-thread-open .thread-pane {
    display: flex;
  }

  .pane-heading {
    padding-top: 17px;
  }

  .conversation-card {
    min-height: 96px;
    padding-right: 16px;
  }

  .mobile-back {
    display: inline-grid;
  }

  .thread-header {
    min-height: 64px;
    padding: 8px 10px;
  }

  .message-timeline {
    padding: 20px 12px;
  }

  .message-bubble {
    max-width: 88%;
  }

  .composer {
    padding: 8px;
  }

  .composer__footer {
    padding-left: 9px;
  }

  .button--send span:first-child {
    display: none;
  }

  .button--send {
    width: 37px;
    min-width: 37px;
    padding: 8px;
    border-radius: 50%;
  }
}

@media (max-width: 700px) {
  .login-shell {
    display: block;
  }

  .login-story {
    min-height: 290px;
    padding: 28px;
  }

  .login-story__content {
    padding: 45px 0 28px;
  }

  .login-story__content h1 {
    max-width: 430px;
    font-size: clamp(35px, 10vw, 52px);
  }

  .login-story__content > p:last-child {
    margin-top: 17px;
    font-size: 14px;
  }

  .login-form-panel {
    min-height: auto;
    padding: 26px 18px 40px;
  }

  .login-card {
    margin-top: -18px;
    padding: 25px 21px;
  }
}

@media (max-width: 420px) {
  .topbar .brand-copy strong {
    font-size: 12px;
  }

  .topbar .brand-mark--small {
    width: 31px;
    height: 31px;
  }

  .operator__avatar {
    width: 29px;
    height: 29px;
  }

  .workflow-form {
    display: flex;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .brand-mark,
  .contact-avatar,
  .status-badge,
  .mini-badge,
  .channel-mark {
    border: 1px solid currentColor;
  }

  .conversation-card.is-selected {
    border-left-width: 5px;
  }
}
