.ws-shell, .ws-dialog {
  --ws-ink: #252521;
  --ws-muted: #6a6a61;
  --ws-line: #e4e3dc;
  --ws-paper: #fff;
  --ws-canvas: #f8f7f4;
  --ws-accent: #b84128;
  --ws-accent-dark: #97351f;
  color: var(--ws-ink);
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}
.ws-shell *, .ws-dialog * { box-sizing: border-box; }
.ws-shell :is(button, input, textarea, select), .ws-dialog :is(button, input, textarea, select) { font: inherit; }
.ws-shell button, .ws-dialog button { cursor: pointer; }
.ws-shell button:disabled, .ws-dialog button:disabled { opacity: .6; cursor: wait; }
.ws-shell :focus-visible, .ws-dialog :focus-visible { outline: 3px solid #bc6543; outline-offset: 3px; }
.ws-shell [hidden] { display: none !important; }
.ws-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.ws-shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; background: var(--ws-paper); }
.ws-icon { flex: none; vertical-align: middle; }

.ws-sidebar { position: sticky; top: 0; display: flex; flex-direction: column; align-self: start; min-height: 490px; height: 100vh; height: 100dvh; padding: 0 18px; border-right: 1px solid var(--ws-line); background: var(--ws-canvas); overflow-y: auto; }
.ws-identity { display: flex; align-items: center; justify-content: space-between; padding: 0 8px; min-height: 88px; margin-bottom: 24px; }
.ws-identity .brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1.42rem; letter-spacing: -.07em; font-weight: 700; line-height: 1; }
.ws-identity .brand-mark { flex: none; width: 32px; height: 32px; }
.ws-identity [data-action='menu-close'], .ws-top-left [data-action='menu-open'], .ws-shade { display: none; }
.ws-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 14px; border: 1px solid transparent; border-radius: 7px; font-size: .9rem !important; font-weight: 600 !important; line-height: 1.3 !important; text-align: center; transition: color .15s, background .15s, border-color .15s; }
.ws-primary { color: #fff; background: var(--ws-accent); }
.ws-primary:hover { background: var(--ws-accent-dark); }
.ws-sidebar > .ws-primary { justify-content: flex-start; gap: 11px; min-height: 44px; margin: 0 4px 32px; padding-inline: 17px; }
.ws-quiet, .ws-logout { background: transparent; color: var(--ws-muted); }
.ws-quiet:hover, .ws-logout:hover { background: #f1f0ea; color: var(--ws-ink); }
.ws-outline { color: var(--ws-ink); background: #fff; border-color: #d9d9d1; }
.ws-outline:hover { background: var(--ws-canvas); border-color: #b7b7ab; }
.ws-danger { background: #a42e27; color: #fff; }
.ws-danger:hover { background: #85251d; }
.ws-danger-quiet { color: #a12d24; background: transparent; }
.ws-danger-quiet:hover { background: #fff0eb; }
.ws-square { width: 40px; padding: 0; }
.ws-section-label { margin: 0 15px 11px; color: var(--ws-muted); font-size: .8rem; font-weight: 650; }
.ws-nav { display: flex; flex-direction: column; gap: 2px; }
.ws-nav-item { display: flex; align-items: center; width: 100%; min-height: 43px; gap: 12px; padding: 8px 13px; border: 0; border-radius: 6px; background: transparent; color: #54554d; text-align: left; font-weight: 500 !important; font-size: .95rem !important; }
.ws-nav-item:hover { background: #efeee8; }
.ws-nav-item[aria-current] { color: #963a24; background: #f4e4dc; font-weight: 650 !important; }
.ws-badge { padding: 1px 7px; margin-left: auto; background: #fff7f1; color: #913419; font-size: .75rem; border-radius: 4px; }
.ws-side-footer { margin-top: auto; padding: 22px 2px 18px; }
.ws-account { width: 100%; display: flex; align-items: center; gap: 10px; padding: 16px 5px 8px; margin: 0; border: 0; border-top: 1px solid var(--ws-line); background: transparent; color: var(--ws-ink); text-align: left; }
.ws-account > span:nth-child(2), .ws-profile > span:last-child, .ws-table-person > span:last-child { display: grid; min-width: 0; }
.ws-account strong, .ws-account small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-account strong, .ws-table-person strong { font-weight: 650; font-size: .88rem; }
.ws-account small, .ws-table-person small, .ws-profile small { font-size: .8rem; color: var(--ws-muted); }
.ws-account > svg { margin-left: auto; color: var(--ws-muted); }
.ws-account:hover > svg { color: var(--ws-accent); }
.ws-logout { justify-content: flex-start; width: 100%; min-height: 37px; gap: 9px; padding: 6px 10px; margin-top: 4px; font-size: .81rem !important; }
.ws-logout svg { width: 16px; height: 16px; }
.ws-avatar { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 43px; height: 43px; border-radius: 50%; background: #eeeee8; color: #606053; font-size: .88rem; letter-spacing: .025em; font-weight: 650; line-height: 1; }
.ws-avatar-small { width: 35px; height: 35px; font-size: .76rem; }
.ws-account .ws-avatar { background: #e8e5da; color: #5f5748; }

.ws-content { min-width: 0; }
.ws-topbar { min-height: 69px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 clamp(24px,4vw,62px); border-bottom: 1px solid var(--ws-line); }
.ws-top-left { min-width: 0; display: flex; align-items: center; gap: 13px; font-size: .86rem; color: var(--ws-muted); }
.ws-top-left strong { color: var(--ws-ink); font-weight: 550; white-space: nowrap; }
.ws-slash { color: #b0afa4; }
.ws-domain { font-size: .8rem; color: var(--ws-muted); letter-spacing: -.01em; }
.ws-main { max-width: 1450px; margin: 0 auto; padding: clamp(31px,4.6vw,70px) clamp(24px,4vw,62px) 64px; }
.ws-title h1, .ws-letter h1 { margin: 0; color: var(--ws-ink); font-size: clamp(2rem,3.4vw,3rem); line-height: 1.12; font-weight: 550; letter-spacing: -.067em; }
.ws-title p { min-height: 21px; margin: 9px 0 0; font-size: .92rem; color: var(--ws-muted); }
.ws-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 0 16px; margin-top: 32px; border-bottom: 1px solid var(--ws-line); }
.ws-search { display: flex; align-items: center; gap: 9px; max-width: 370px; width: 100%; min-height: 40px; background: #fff; border: 1px solid #d9d9d1; border-radius: 7px; padding: 0 12px; color: var(--ws-muted); }
.ws-search:focus-within { outline: 2px solid #bc6543; outline-offset: 1px; }
.ws-search input { min-width: 0; width: 100%; min-height: 38px; border: none; background: transparent; color: var(--ws-ink); font-size: .9rem; outline: none; }
.ws-search input:focus-visible { outline: none; }
.ws-search input::placeholder, .ws-field input::placeholder, .ws-field textarea::placeholder { color: #73736a; opacity: 1; }
.ws-results { min-width: 0; }
.ws-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: clamp(280px,46vh,510px); padding: 34px 20px; text-align: center; }
.ws-empty-icon { display: grid; place-items: center; width: 66px; height: 66px; margin-bottom: 19px; border: 1px solid #e7dfd2; border-radius: 22px; color: #8d563f; background: #f8f3ec; }
.ws-empty h2 { margin: 0; font-size: 1.22rem; font-weight: 620; letter-spacing: -.04em; }
.ws-empty p { max-width: 410px; margin: 6px 0 0; font-size: .93rem; color: var(--ws-muted); overflow-wrap: anywhere; }
.ws-loading { margin: 28px 0; font-size: .93rem; color: var(--ws-muted); }
.ws-flash:empty, .ws-form-alert:empty, .ws-pager:empty { display: none; }
.ws-notice { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 20px; padding: 11px 13px; border: 1px solid #d7e1d2; border-radius: 7px; color: #3c5e37; background: #f5f8f1; font-size: .9rem; overflow-wrap: anywhere; }
.ws-notice svg { margin-top: 2px; }
.ws-notice-error { background: #fff3ee; color: #8e321d; border-color: #eed2c5; }
.ws-results > .ws-notice { margin-top: 20px; }
.ws-pager { padding: 22px 0; text-align: center; }

.ws-message-list { margin: 0; padding: 0; list-style: none; }
.ws-message-row { width: 100%; display: flex; align-items: flex-start; gap: 13px; padding: 17px 10px; border: 0; border-bottom: 1px solid var(--ws-line); background: transparent; color: var(--ws-ink); text-align: left; transition: background .15s; }
.ws-message-row:hover { background: var(--ws-canvas); }
.ws-message-row > .ws-avatar { margin-top: 3px; }
.ws-row-main { display: grid; min-width: 0; gap: 1px; }
.ws-row-main > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-from { color: #66665e; font-weight: 520; font-size: .88rem; }
.ws-unread .ws-from, .ws-unread .ws-row-main > strong { color: var(--ws-ink); font-weight: 700; }
.ws-dot { display: inline-block; width: 7px; height: 7px; margin: 0 7px 1px 0; border-radius: 50%; background: var(--ws-accent); }
.ws-row-main > strong { font-weight: 550; font-size: 1rem; }
.ws-preview { color: var(--ws-muted); font-size: .9rem; }
.ws-message-row time { flex: none; margin-left: auto; color: var(--ws-muted); font-size: .8rem; }
.ws-letter { padding-top: 24px; }
.ws-letter h1 { font-size: clamp(1.8rem, 3.2vw, 2.75rem); overflow-wrap: anywhere; }
.ws-letter-meta { display: flex; align-items: center; gap: 12px; padding: 24px 0; border-bottom: 1px solid var(--ws-line); }
.ws-address { display: grid; overflow-wrap: anywhere; min-width: 0; }
.ws-address strong { font-size: .97rem; font-weight: 650; }
.ws-address :is(small, span), .ws-letter-meta time { color: var(--ws-muted); font-size: .84rem; }
.ws-letter-meta time { margin-left: auto; text-align: right; }
.ws-letter > .ws-notice { margin: 20px 0 0; }
.ws-letter-body { padding: 28px 0; min-height: 100px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1rem; line-height: 1.65; }
.ws-letter-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 20px; border-top: 1px solid var(--ws-line); }
.ws-attachments { padding-bottom: 23px; }
.ws-attachments h2 { margin: 0 0 8px; font-size: .92rem; }
.ws-file { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; margin: 0 5px 5px 0; padding: 7px 11px; background: var(--ws-canvas); border: 1px solid var(--ws-line); border-radius: 6px; color: var(--ws-ink); text-decoration: none; font-size: .86rem; }
.ws-file span { overflow-wrap: anywhere; }
.ws-file small { color: var(--ws-muted); white-space: nowrap; }
.ws-file:hover { border-color: #b5b5a7; }

.ws-table-wrap { width: 100%; overflow-x: auto; }
.ws-accounts { width: 100%; min-width: 540px; border-collapse: collapse; text-align: left; font-size: .9rem; }
.ws-accounts th { padding: 13px 10px; border-bottom: 1px solid var(--ws-line); font-size: .8rem; color: var(--ws-muted); font-weight: 550; }
.ws-accounts td { padding: 12px 10px; border-bottom: 1px solid var(--ws-line); vertical-align: middle; }
.ws-accounts :is(td, th):first-child { padding-left: 3px; }
.ws-accounts td:last-child { text-align: right; padding-right: 2px; }
.ws-table-person, .ws-profile { display: flex; align-items: center; gap: 11px; }
.ws-table-person { overflow-wrap: anywhere; }
.ws-table-person small { color: var(--ws-muted); }
.ws-status { display: inline-block; padding: 3px 8px; border-radius: 5px; color: #5a5a54; background: #edede7; font-size: .78rem; font-weight: 600; }
.ws-status.ws-active { background: #edf2e8; color: #46603c; }

.ws-dialog { width: min(530px, calc(100% - 32px)); max-height: calc(100% - 32px); margin: auto; padding: 0; background: var(--ws-paper); border: 1px solid #e2e0d9; border-radius: 15px; box-shadow: 0 22px 75px #2221192b; }
.ws-dialog::backdrop { background: rgb(26 25 19 / .36); }
.ws-form { margin: 0; }
.ws-form > header { display: flex; align-items: center; justify-content: space-between; padding: 17px 22px 16px 26px; gap: 12px; border-bottom: 1px solid var(--ws-line); }
.ws-form h2 { margin: 0; font-size: 1.39rem; font-weight: 600; letter-spacing: -.045em; line-height: 1.25; }
.ws-form-alert { padding: 17px 25px 0; }
.ws-form-alert .ws-notice { margin: 0; }
.ws-fields { display: grid; gap: 16px; padding: 22px 26px 24px; }
.ws-field { display: grid; gap: 6px; min-width: 0; color: var(--ws-ink); font-size: .89rem; font-weight: 590; }
.ws-field > :is(input, textarea, select), .ws-address-field { box-sizing: border-box; width: 100%; min-width: 0; color: var(--ws-ink); background: #fff; border: 1px solid #cfcec4; border-radius: 6px; font-size: 1rem; font-weight: 400; }
.ws-field > :is(input, select, textarea) { min-height: 42px; padding: 9px 11px; }
.ws-field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #56564c 50%), linear-gradient(135deg, #56564c 50%, transparent 50%); background-repeat: no-repeat; background-size: 5px 5px; background-position: right 16px center, right 11px center; padding-right: 36px; }
.ws-field textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.ws-field input:disabled { color: var(--ws-muted); background: var(--ws-canvas); }
.ws-address-field { min-height: 42px; display: flex; align-items: stretch; overflow: hidden; }
.ws-address-field:focus-within { outline: 3px solid #bc6543; outline-offset: 3px; }
.ws-address-field input { flex: 1; min-width: 0; border: 0; padding: 9px 11px; background: transparent; outline: none; }
.ws-address-field input:focus-visible { outline: none; }
.ws-address-field > span { display: flex; align-items: center; padding: 0 10px; border-left: 1px solid var(--ws-line); background: var(--ws-canvas); color: var(--ws-muted); font-size: .9rem; }
.ws-fields p, .ws-fields h3 { margin: 0; }
.ws-fields h3 { font-weight: 620; font-size: 1.07rem; letter-spacing: -.025em; }
.ws-fields .ws-field-help { color: var(--ws-muted); font-size: .88rem; }
.ws-profile { padding-bottom: 15px; border-bottom: 1px solid var(--ws-line); overflow-wrap: anywhere; }
.ws-profile strong { font-weight: 620; }
.ws-form-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 15px 24px; border-top: 1px solid var(--ws-line); }

@media (min-width: 1450px) {
  .ws-shell { grid-template-columns: 276px minmax(0, 1fr); }
  .ws-sidebar { padding-inline: 25px; }
}
@media (max-width: 850px) {
  .ws-shell { grid-template-columns: 215px minmax(0, 1fr); }
  .ws-sidebar { padding-inline: 12px; }
  .ws-main, .ws-topbar { padding-inline: 22px; }
}
@media (max-width: 690px) {
  .ws-shell { display: block; }
  .ws-sidebar { position: fixed; inset: 0 auto 0 0; width: min(284px, 85vw); z-index: 4; min-height: 0; padding: 0 15px; visibility: hidden; transform: translateX(-102%); transition: transform .18s ease, visibility .18s; }
  .ws-menu-visible .ws-sidebar { visibility: visible; transform: translateX(0); }
  .ws-shade { position: fixed; inset: 0; z-index: 3; width: 100%; height: 100%; border: 0; background: #22211965; }
  .ws-menu-visible .ws-shade { display: block; }
  .ws-identity { min-height: 76px; margin-bottom: 14px; }
  .ws-identity [data-action='menu-close'], .ws-top-left [data-action='menu-open'] { display: inline-flex; }
  .ws-top-left { gap: 9px; }
  .ws-topbar { min-height: 57px; padding-inline: 10px 17px; }
  .ws-main { padding: 29px 18px 48px; }
  .ws-toolbar { margin-top: 24px; padding-bottom: 13px; }
  .ws-search { max-width: none; }
  .ws-message-row { padding: 14px 0; gap: 10px; }
  .ws-domain { display: none; }
  .ws-accounts { min-width: 0; }
  .ws-accounts th, .ws-accounts td { padding: 10px 5px; }
  .ws-accounts :is(td, th):first-child { padding-left: 0; }
  .ws-table-person { gap: 7px; }
  .ws-table-person .ws-avatar { display: none; }
  .ws-table-person small, .ws-accounts td { font-size: .78rem; }
  .ws-accounts td:last-child .ws-button { width: 33px; }
  .ws-letter-meta { align-items: flex-start; flex-wrap: wrap; gap: 9px; padding: 19px 0; }
  .ws-letter-meta time { flex-basis: 100%; text-align: left; }
  .ws-form > header { padding: 12px 14px 12px 19px; }
  .ws-fields { padding: 18px; }
  .ws-form-actions { padding: 12px 18px; }
  .ws-form-alert { padding: 15px 18px 0; }
}
@media (max-width: 380px) {
  .ws-main { padding-inline: 12px; }
  .ws-row-main + time { font-size: .75rem; }
  .ws-message-row > .ws-avatar { display: none; }
  .ws-accounts td:nth-child(2), .ws-accounts th:nth-child(2) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ws-sidebar, .ws-button, .ws-message-row { transition: none; }
}
