* { box-sizing: border-box; }
body { margin: 0; background: var(--avan-canvas); color: var(--avan-ink); font: 1rem/1.5 var(--avan-font); }
.product-header { display: flex; gap: 1rem; align-items: center; padding: 1rem clamp(1rem, 4vw, 3rem); background: var(--avan-brand); color: #fff; }
.product-header[data-theme="ocean"] { background: #163b63; }
.product-header[data-theme="forest"] { background: #1d4739; }
.product-header img { object-fit: contain; }
.product-header strong { letter-spacing: .12em; }
.product-header span { color: #cadce9; }
main { max-width: 82rem; margin: auto; padding: 1.5rem clamp(1rem, 4vw, 3rem); }
h1 { font-size: 1.65rem; margin: 0 0 1rem; }
h2 { font-size: 1.12rem; margin: 0 0 .75rem; }
.access { display: flex; align-items: end; gap: .8rem; flex-wrap: wrap; }
label { display: grid; gap: .25rem; font-size: .88rem; font-weight: 600; }
input, select, textarea, button { font: inherit; }
input, textarea, select { width: 100%; padding: .5rem .65rem; color: inherit; background: #fff; border: 1px solid #788da0; border-radius: .35rem; }
input, select, textarea { min-width: 0; }
textarea { min-height: 4.5rem; resize: vertical; }
button { min-height: 2.5rem; padding: .4rem .75rem; border: 1px solid #1f547a; border-radius: .35rem; background: var(--avan-accent); color: white; cursor: pointer; }
button:disabled { opacity: .65; cursor: default; }
a:focus-visible, #thread-title:focus, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--avan-focus); outline-offset: 2px; }
.company { max-width: 22rem; margin: 0 0 .8rem; }
.layout { display: grid; grid-template-columns: minmax(10rem, 1fr) minmax(0, 2.5fr) minmax(12rem, 1fr); background: white; border: 1px solid var(--avan-border); border-radius: var(--avan-radius); }
.layout > * { padding: 1rem; min-width: 0; }
.layout > * + * { border-left: 1px solid var(--avan-border); }
ul, ol { padding: 0; list-style: none; }
.inbox-pane button { margin-bottom: .35rem; width: 100%; text-align: left; color: var(--avan-ink); background: white; }
.inbox-pane button[aria-pressed=true] { background: var(--avan-highlight); }
.messages { display: grid; gap: .65rem; min-height: 6rem; max-height: 35rem; overflow: auto; }
.messages li { width: fit-content; max-width: 90%; padding: .5rem .75rem; border-radius: .55rem; background: #e9eff5; white-space: pre-wrap; overflow-wrap: anywhere; }
.messages li.outgoing { justify-self: end; background: #d6e8f3; }
.messages span { display: block; font-size: .78rem; color: #37556b; }
dl { font-size: .9rem; margin-bottom: 1rem; }
dt { font-weight: 700; }
dd { margin: 0 0 .6rem; overflow-wrap: anywhere; }
form button, #resolve { margin-top: .45rem; }
.visitor { max-width: 42rem; }
[hidden] { display: none; }
@media (max-width: 850px) {
  .layout { grid-template-columns: minmax(9rem, 1fr) minmax(0, 2fr); }
  aside { grid-column: 1 / -1; border-top: 1px solid var(--avan-border); }
  .layout > aside { border-left: 0; }
}
@media (max-width: 580px) {
  .layout { display: block; }
  .layout > * + * { border-left: 0; border-top: 1px solid var(--avan-border); }
}

.product-area { border-inline-start: 1px solid #7994ad; padding-inline-start: 1rem; }
.product-footer { max-width: 82rem; margin: auto; padding: 0 clamp(1rem, 4vw, 3rem) 1.5rem; color: var(--avan-muted); font-size: .85rem; }
.skip-link { position: absolute; inset-inline-start: 1rem; transform: translateY(-200%); padding: .5rem 1rem; background: var(--avan-surface); color: var(--avan-brand); }
.skip-link:focus { top: .75rem; transform: none; z-index: 1; }
.organization, .desk-header { display: flex; align-items: end; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; }
.desk-header { justify-content: space-between; border-bottom: 1px solid var(--avan-border); padding-bottom: .75rem; }
.desk-header .company { margin: 0; flex: 0 1 18rem; min-width: 0; }
.desk-links { display: flex; flex-wrap: wrap; gap: .25rem .5rem; }
.desk-links a { color: var(--avan-brand); font-weight: 600; padding: .5rem; border-radius: .375rem; text-underline-offset: .2em; }
.desk-links a:hover { background: var(--avan-highlight); }
#inbox-title:focus, #customer-title:focus { outline: 3px solid var(--avan-focus); outline-offset: 2px; }

.queue-admin { margin-bottom: 1rem; padding: 1rem; border: 1px solid var(--avan-border); border-radius: var(--avan-radius); background: var(--avan-surface); }
.queue-admin fieldset { display: grid; gap: .35rem; max-width: 35rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.queue-admin legend { margin-bottom: .5rem; color: var(--avan-muted); }
.queue-admin button { justify-self: start; }
#queue-admin-title:focus { outline: 3px solid var(--avan-focus); outline-offset: 2px; }

.hub-setting { border-top: 1px solid var(--border, #354052); padding-block: 1rem; display: grid; gap: .75rem; }
#hub-result { white-space: pre-wrap; overflow-wrap: anywhere; }

#customer-timeline li, .hub-setting p { overflow-wrap: anywhere; }
.hub-setting { min-width: 0; }
.hub-setting input[type=checkbox] { width: auto; justify-self: start; }
