:root {
  color-scheme: light;
  --ink: #1b302c; --muted: #536861; --line: #d8e0d8; --green: #195848;
  --forest: #193e35; --paper: #f5f5ef; --tint: #edf4e9;
}
* { box-sizing: border-box }
body { margin: 0; color: var(--ink); background: var(--paper); font: 15px/1.5 Inter, "Segoe UI", sans-serif }
[hidden] { display: none !important }
.mobile-search-prompt { display: none }
.session-warning { position: fixed; z-index: 100; inset-inline: 1rem; bottom: 1rem; margin: 0 auto;
  max-width: 48rem; padding: .8rem 1rem; display: flex; align-items: center; justify-content: space-between;
  gap: .6rem; flex-wrap: wrap; border: 1px solid #ae8139; background: #fff7e4; color: #29231c; border-radius: .5rem; }
h1,h2,h3,p { margin: 0 }
h1,h2,h3 { line-height: 1.2; letter-spacing: -.035em }
h1 { font-size: clamp(1.8rem,3.5vw,2.5rem); font-weight: 650 }
h2 { font-size: 1.38rem; font-weight: 630 }
a { color: var(--green); text-underline-offset: .18em }
button,input,select,textarea { font: inherit }
button { cursor: pointer }
button:disabled { color: #68756d; background: #e6ebe4; border-color: #dae0d8; cursor: default }
:focus-visible { outline: 3px solid #178877; outline-offset: 2px }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 68px; padding: 0 clamp(18px,3vw,52px); background: var(--forest); color: white }
.brand { display: inline-flex; align-items: center; gap: 11px; color: white; text-decoration: none; font-size: 1.55rem; font-weight: 670; letter-spacing: -.065em }
.brand i { display: block; width: 19px; height: 23px; border: solid #c8ec9b; border-width: 0 0 5px 5px; transform: skewY(-12deg) }
.main-nav { display: flex; gap: 2px; align-self: stretch; margin-right: auto; align-items: center }
.main-nav a,.account button { color: #deebe2; background: transparent; text-decoration: none; border: 0; border-radius: 7px; padding: 9px 12px; font-weight: 520; white-space: nowrap }
.main-nav a[aria-current],.main-nav a:hover,.account button:hover { background: #31584c; color: white }
.account { display: flex; align-items: center; gap: 12px; min-width: 0 }
.account span { font-size: .86rem; color: #d4e1d7; max-width: 13ch; overflow: hidden; text-overflow: ellipsis }
.account button { border: 1px solid #577468; font-size: .85rem }
.page { max-width: 1320px; padding: clamp(20px,4vw,56px); margin: auto }
.page-head,.heading-line,.compose-foot,.chat-head,.pager { display: flex; justify-content: space-between; align-items: center; gap: 14px }
.page-head { flex-wrap: wrap; margin-bottom: 25px }
.page > a:first-child + .page-head { margin-top: 15px }
.page > .panel + .panel { margin-top: 16px }
.form-panel { max-width: 800px; overflow-wrap: anywhere }
.form-panel h2 { margin-bottom: 15px }
.phone-entry { display: grid; gap: 16px }
.phone-entry-fields { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,3fr); gap: 16px }
.phone-target-card { display: grid; gap: 3px; margin-top: 12px; padding: 12px 16px; border: 1px solid var(--line); border-inline-start: 4px solid var(--green); border-radius: 7px; background: var(--tint) }
.phone-target-number { font-size: 1.12rem; font-variant-numeric: tabular-nums }
.phone-entry .phone-confirm { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 0 }
.phone-confirm input { flex: none; accent-color: var(--green) }
.phone-entry [data-preview-note]:empty { display: none }
.actions,.tool-row,.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px }
.tool-row { justify-content: space-between; margin-bottom: 15px }
.inline-form,.inline-form > * { min-width: 0; max-width: 100% }
.form-panel form > p,.form-panel > p { margin: 12px 0 }
.form-panel label { margin-bottom: 5px }
.form-panel input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),.form-panel textarea,.form-panel select { width: 100% }
.form-panel form > button,.form-panel > button { margin-top: 12px }
.helptext { display: block; margin-top: 5px; font-size: .82rem; color: var(--muted) }
.delivery-content { display: grid; gap: 6px; overflow-wrap: anywhere }
.delivery-content p { white-space: pre-wrap }
.delivery-content figure { margin: 0 }
.delivery-content img { display: block; max-width: 100%; width: auto; height: auto; max-height: 240px; border-radius: 7px }
.delivery-content figcaption { font-size: .82rem; color: var(--muted) }
.delivery-content ul { padding-inline-start: 18px; margin: 0 }
.errorlist { color: #86341e; padding: 7px 10px 7px 27px; background: #fff0e7; border-radius: 6px }
.preserve-lines { white-space: pre-wrap; overflow-wrap: anywhere }
.settings-list { display: grid; grid-template-columns: minmax(150px,1fr) 2fr; gap: 0 20px }
.settings-list dt,.settings-list dd { margin: 0; padding-block: 10px; border-bottom: 1px solid var(--line) }
.settings-list dt { color: var(--muted) }
.notice,.flash { border: 1px solid #ccddc7; background: #f0f6eb; border-radius: 8px; padding: 10px 14px }
.flashes { padding: 10px clamp(16px,3vw,42px) 0; display: grid; gap: 6px }
.flash.error,.flash.warning { background: #fff0e7; color: #843c24; border-color: #efd3c2 }
@media (max-width: 530px) {
  .phone-entry-fields { grid-template-columns: minmax(0,1fr) }
  .page { min-width: 0 }
  .tool-row > form { width: 100% }
  .inline-form input:not([type="hidden"]) { flex: 1 1 8rem }
  .settings-list { display: block }
  .settings-list dt { border: 0; padding-bottom: 0 }
  .settings-list dd { padding-top: 2px }
}
.panel,.card { background: white; border: 1px solid var(--line); border-radius: 14px; padding: clamp(16px,2vw,28px) }
.btn,.primary,.secondary { display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none; font: inherit; font-size: .91rem; font-weight: 600; padding: 9px 16px; border: 1px solid transparent; border-radius: 8px; line-height: 1.4 }
.btn-primary,.primary { background: var(--green); color: white }
.btn-secondary,.secondary { border-color: var(--line); color: var(--green); background: white }
.btn:not(:disabled):hover,.primary:hover,.secondary:hover { filter: brightness(.94) }
.field,label { display: block }
label,.field { font-size: .9rem; font-weight: 560 }
input:not([type=checkbox]):not([type=radio]):not([type=hidden]),textarea,select { max-width: 100%; border: 1px solid #a9b7ad; padding: 9px 12px; border-radius: 7px; color: var(--ink); background: white }
.field input:not([type=checkbox]):not([type=radio]),.field select,.field textarea { width: 100% }
textarea { resize: vertical }
.table-scroll { max-width: 100%; overflow-x: auto }
.data-table { width: 100%; border-collapse: collapse }
.data-table th,.data-table td { text-align: start; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top }
.data-table th { background: #f4f7f1; font-size: .84rem; color: var(--muted) }
.muted,small { color: var(--muted) }
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px; font-size: .78rem; background: #eaf1e5; color: #345940; white-space: nowrap }
.badge.restricted,.error { color: #89351c; background: #fff0e5 }
.error { padding: 8px 12px; border-radius: 6px; margin-bottom: 8px }
.quiet { border: 0; background: transparent; padding: 3px; color: var(--green); font: inherit; text-decoration: none }
.quiet:hover,.contact-detail:hover { text-decoration: underline }
.desk { display: grid; grid-template-columns: minmax(290px,26%) minmax(0,1fr); max-width: 1680px; margin: 0 auto; height: calc(100dvh - 68px); min-height: 560px; border-inline: 1px solid var(--line); background: white }
.thread-list,.conversation { min-width: 0; min-height: 0; display: flex; flex-direction: column }
.thread-list { border-right: 1px solid var(--line) }
.list-head { padding: 24px clamp(14px,1.7vw,28px) 16px }
.list-head h1 { font-size: 1.85rem }
.new-chat { display: grid; place-items: center; border-radius: 8px; width: 36px; height: 36px; background: var(--tint); text-decoration: none; font-size: 1.6rem; line-height: 1 }
.search { display: flex; gap: 4px; align-items: stretch; margin: 17px 0 12px }
.search input { width: 100%; min-width: 0 }
.search button { background: #f1f4ee; color: var(--green); border: 1px solid var(--line); border-radius: 7px; padding-inline: 10px }
.filters { display: flex; flex-wrap: wrap; gap: 3px }
.filters a { color: var(--muted); text-decoration: none; font-size: .78rem; padding: 5px 8px; border-radius: 6px }
.filters a[aria-current] { color: #214d3c; background: #e1eedc; font-weight: 650 }
#contact-rows { overflow: auto; border-top: 1px solid var(--line) }
.thread-link { padding: 16px clamp(12px,1.5vw,24px); display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); border-bottom: 1px solid #e7ece5; border-left: 3px solid transparent }
.thread-link:hover { background: #f6f8f3 }
.thread-link.selected { background: #eef4e9; border-left-color: var(--green) }
.avatar { display: inline-grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 13px; background: #dbe8d5; color: #34593d; font-weight: 650 }
.thread-meta { display: grid; min-width: 0; gap: 2px }
.thread-meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.thread-meta span:not(.thread-name),.thread-aside,.contact-detail,.thread-tools { font-size: .82rem; color: var(--muted) }
.thread-link.unread .thread-name,.thread-link.unread .thread-snippet { font-weight: 700; color: var(--ink) }
.thread-aside { display: grid; justify-items: end; gap: 5px; margin-left: auto; align-self: center; font-variant-numeric: tabular-nums }
.unread-count { min-width: 1.6em; padding: 1px 6px; border-radius: 1em; background: var(--green); color: white; text-align: center; font-weight: 700 }
.list-empty,.pager { padding: 15px; color: var(--muted) }
.pager { justify-content: center; font-size: .85rem }
.chat-head,.thread-tools,.composer { padding-inline: clamp(16px,3vw,44px) }
.chat-head { padding-block: 18px; border-bottom: 1px solid var(--line) }
.chat-head h2 { overflow-wrap: anywhere }
.chat-head form { flex-shrink: 0 }
.contact-detail { text-decoration: none }
.thread-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-block: 8px; background: #fafbf8; border-bottom: 1px solid var(--line) }
#refresh { margin-left: auto }
#history { flex: 1; min-height: 140px; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 12px clamp(16px,3vw,46px); background: #f3f3eb }
.date-mark { width: fit-content; margin: 4px auto 15px; color: #58685d; font-size: .76rem; text-align: center }
.row { display: flex; margin-bottom: 10px }
.row.out { justify-content: flex-end }
.bubble { max-width: min(80%,640px); min-width: 0; padding: 9px 14px; background: white; border: 1px solid #dbe1d7; border-radius: 12px 12px 12px 2px }
.out .bubble { background: #e1efda; border-color: #cbdcc4; border-radius: 12px 12px 2px }
.bubble p { white-space: pre-wrap; overflow-wrap: anywhere }
.review-opt-out { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); font-size: .84rem }
.review-opt-out button { font-size: inherit }
.bubble footer { display: flex; justify-content: flex-end; gap: 8px; color: var(--muted); font-size: .72rem; margin-top: 4px }
.composer { padding-block: 14px; border-top: 1px solid var(--line) }
.composer textarea { width: 100%; min-height: 52px; max-height: 24vh; display: block }
.composer textarea[readonly] { background: var(--paper); color: var(--muted) }
.composer textarea:disabled { background: #e6ebe4; color: var(--muted); border-style: dashed; cursor: not-allowed }
.compose-foot { margin-top: 7px }
.template-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 8px; font-size: .82rem }
.template-heading { margin-top: 16px }
.template-picker { max-width: 780px }
.picker-form { display: flex; align-items: end; flex-wrap: wrap; gap: 12px }
.picker-form label { flex: 1; min-width: min(240px,100%) }
.picker-form select,.parameter-form input { display: block; margin-top: 6px }
.template-preview { padding: 16px 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); margin-block: 20px }
.template-preview h2 { font-size: 1rem }
.template-preview p { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 10px }
.parameter-form { display: grid; justify-items: start; gap: 12px }
.parameter-form label { width: 100% }
.template-form button { font-size: .8rem; padding: 6px 10px }
.empty { margin: auto; min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 9px; padding: 16px; color: var(--muted) }
.back { display: none }
.login { max-width: 420px; margin: clamp(35px,13vh,130px) auto; padding: 32px }
.login h1 { margin-bottom: 22px; font-size: 2rem }
.login label { margin: 14px 0 5px }
.login input,.login button { width: 100% }
.login button { margin-top: 22px }
@media (max-width: 960px) {
  .masthead { gap: 12px }
  .main-nav a { padding-inline: 8px }
  .account span { display: none }
}
@media (max-width: 760px) {
  .mobile-search-prompt { display: block; margin: .5rem 1rem; color: var(--muted) }
  .masthead { min-height: auto; flex-wrap: wrap; gap: 0; padding: 8px 12px 0 }
  .main-nav { order: 3; width: 100%; overflow-x: auto; padding: 4px 0; scrollbar-width: thin }
  .main-nav a { padding: 6px 10px; font-size: .85rem }
  .account { margin-left: auto }
  .account button { padding: 5px 11px }
  .desk { height: auto; min-height: 0; grid-template-columns: 1fr }
  .thread-list { border: 0; max-height: calc(100dvh - 92px) }
  .conversation { display: none }
  .desk:has(#conversation:target) .conversation,.desk.open-contact:not(:has(#inbox:target)) .conversation { display: flex; min-height: 490px; height: calc(100dvh - 92px) }
  .desk:has(#conversation:target) .thread-list,.desk.open-contact:not(:has(#inbox:target)) .thread-list { display: none }
  .back { display: inline-block; margin-bottom: 6px; font-size: .8rem }
  .chat-head,.composer { padding-block: 10px }
  .bubble { max-width: 92% }
  .login { margin-inline: auto; max-width: min(420px,calc(100% - 30px)) }
}
