/* Warm concierge direction. State, API and local CJK font stay intact.
   Keep this after style.css: the final compatibility rules preserve v4 fixes. */
:root {
  --bg: #f4f0e7;
  --surface: #fffdf8;
  --text: #2c332d;
  --text-muted: #716e62;
  --border: #ded8cb;
  --accent: #73572d;
  --accent-fg: #fffdf8;
  --accent-soft: #ede6d5;
  --primary-action: #293e34;
  --primary-action-fg: #fff9eb;
  --subtle: #f1ece2;
  --success: #41674e;
  --warning: #8b571d;
  --danger: #a74336;
  --art-bg: #2b3d33;
  --art-line: #c5af7e;
  --art-sun: #ad8a4d;
  --overlay: rgb(24 32 27 / 65%);
  --radius: 5px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, SputnikCJK, "Sputnik CJK Full", sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --gold: #c7ad78;
}
body { background: var(--bg); }
::selection { background: #dfcfa8; color: #24382e; }
h1 { font-family: var(--serif); font-weight: 400; letter-spacing: -1.2px; }
.eyebrow { font-size: 9px; letter-spacing: 1.8px; color: var(--accent); }
.layout { grid-template-columns: 232px minmax(0, 1fr); }
.sidebar {
  background: #29352f; color: #eee7d7; border: 0; padding: 36px 16px 25px;
  --text-muted: #b9bcb0; --border: #465047; --text: #eee7d7; --accent: #d6bd87; --subtle: #36463a;
}
.brand { font-family: var(--serif); font-size: 32px; font-weight: 400; gap: 9px; }
.brand > .icon { width: 30px; height: 30px; stroke-width: 1.25; }
.brand-dot { color: var(--gold); }
.trip-label { padding: 48px 12px 30px; gap: 10px; }
.trip-label .eyebrow { color: #c5b58d; font-size: 8px; }
.trip-label > strong { font-family: var(--serif); font-size: 30px; font-weight: 400; }
.trip-label .chinese { font-size: 22px; color: #b8b59e; }
.trip-label > .muted { font-size: 11px; letter-spacing: .5px; }
.trip-label .demo-tag { font-size: 8px; padding: 4px 6px; }
.main-nav { gap: 6px; }
.nav-item { padding: 14px 12px; font-size: 12px; border-radius: 3px; }
.nav-item.selected { color: #ead8b0; background: #3e4b3e; box-shadow: inset 2px 0 #c7ad78; }
.nav-item .icon { stroke-width: 1.4; width: 17px; height: 17px; }
.install-link { font-size: 10px; padding: 15px 10px; }
.install-link > .icon:first-child { color: #c7ad78; width: 16px; }
.timezone { font-size: 10px; padding: 24px 10px; }
.timezone .icon { width: 16px; }
.timezone small { font-size: 9px; }
.session-link { font-size: 9px; }
.topbar { height: 82px; padding: 0 40px; background: #faf7f0; }
.top-label { color: var(--accent); font-size: 8px; letter-spacing: 2px; }
.top-title { font-size: 12px; font-weight: 400; }
.mobile-brand { display: none; }
.demo-pill { border-radius: 20px; padding: 4px 9px; font-size: 9px; background: #f1ebdd; }
.role-switch { font-size: 11px; gap: 8px; }
.role-switch .icon { color: var(--accent); }
.demo-banner { padding: 9px 40px; background: #eeeadf; font-size: 9px; color: #6f6b5c; }
.workspace { padding: 37px 40px 28px; }
.delegate-workspace { gap: 30px; grid-template-columns: minmax(0, 1fr) 230px; }
.page-heading { margin-bottom: 27px; }
.page-heading .eyebrow { margin-bottom: 13px; }
.page-heading h1 { font-size: 38px; line-height: 1.12; max-width: 560px; }
.page-heading > p:last-child:not(.eyebrow) { font-size: 11px; margin-top: 14px; line-height: 1.8; }
.chat-panel, .inbox { box-shadow: 0 9px 32px rgb(52 47 29 / 4%); }
.chat-panel { min-height: 510px; height: calc(100dvh - 312px); }
.chat-header { padding: 20px 23px; min-height: 85px; background: #fcfaf4; }
.chat-person { gap: 12px; }
.chat-person h2 { font-family: var(--serif); font-weight: 400; font-size: 19px; letter-spacing: -.3px; }
.chat-person p { font-size: 9px; margin-top: 5px; }
.avatar { background: #e8e1d1; color: #705d38; width: 38px; height: 38px; font-size: 11px; }
.assistant-avatar { background: #2d4336; color: #dbc38b; border: 1px solid #3e5546; }
.assistant-avatar .icon { stroke-width: 1.2; }
.status-label { font-size: 8px; background: #f2ead9; padding: 6px 8px; border-radius: 20px; }
.status-label.active, .status-label.resolved { background: #e9ede1; }
.messages { padding: 25px; gap: 16px; scrollbar-width: thin; scrollbar-color: #d2c7b2 transparent; }
.chat-empty { padding: 22px 0; }
.empty-icon { background: transparent; color: #8c7548; border: 1px solid #d4c3a0; width: 58px; height: 58px; margin-bottom: 21px; }
.empty-icon .icon { width: 27px; height: 27px; stroke-width: 1.2; }
.chat-empty h3 { font-family: var(--serif); font-size: 27px; font-weight: 400; }
.chat-empty p { font-size: 11px; line-height: 1.9; max-width: 310px; }
.suggestions { gap: 8px; margin-top: 25px; }
.suggestion { font-size: 10px; padding: 11px 12px; background: #fbf8f0; border-color: #e2d8c4; }
.suggestion .icon { color: #8e7749; }
.composer { margin: 0 18px; background: #faf7ef; border-color: #dcd2bf; padding: 13px; }
.composer:focus-within { box-shadow: 0 0 0 2px rgb(149 121 63 / 12%); }
.compose-row textarea { font-size: 12px; color: var(--text); }
.compose-row textarea::placeholder { color: #777464; opacity: 1; }
.send-button { width: 44px; height: 44px; min-width: 44px; border-radius: 50%; }
.send-button .icon { width: 16px; height: 16px; color: #ead6a9; }
.composer-meta { font-size: 9px; margin-top: 10px; }
.urgent-toggle { gap: 7px; }
.urgent-toggle input { width: 20px; height: 20px; }
.chat-foot { font-size: 8px; padding: 14px 21px; }
.date-divider { font-size: 9px; letter-spacing: .7px; }
.date-divider::before, .date-divider::after { content: "—"; margin: 0 10px; color: #b5a88e; }
.message { max-width: 84%; padding: 14px 16px; border-radius: 2px 11px 11px 11px; border: 1px solid #e5ddcd; background: #f7f2e7; }
.message.mine { background: #304638; color: #fff9ee; border-color: #304638; border-radius: 11px 2px 11px 11px; }
.message-body { font-size: 13px; line-height: 1.75; }
.message-meta { font-size: 8px; color: #79715f; }
.message.mine .message-meta { color: #d0d2bd; }
.message.mine .message-meta .icon { color: #d8c086; }
.context-column { padding-top: 0; }
.beijing-art { height: 284px; padding-top: 26px; border-radius: 100px 100px 4px 4px; background: var(--art-bg); }
.art-caption { display: block; text-align: center; padding: 0; color: #dac793; letter-spacing: 4px; font-size: 12px; }
.beijing-art > svg { height: 205px; margin-top: 2px; padding: 0 8px; }
.beijing-art svg path { stroke-width: .85; }
.beijing-art svg circle { opacity: .7; }
.art-bottom { padding: 0 22px; font-size: 10px; color: #dccda5; }
.context-card { padding: 25px 2px; }
.context-card .eyebrow { font-size: 8px; letter-spacing: 1.2px; }
.context-card h3 { font-family: var(--serif); font-size: 23px; font-weight: 400; line-height: 1.4; margin-top: 14px; }
.context-card p:not(.eyebrow) { line-height: 1.8; font-size: 11px; }
.compact-card h3 { font-family: var(--font); font-size: 12px; margin: 0; }
.compact-card p:not(.eyebrow), .compact-card a { font-size: 10px; }
.primary, .secondary { padding: 12px 16px; border-radius: 4px; font-size: 11px; }
.secondary { background: #fcfaf4; border-color: #d8cdb8; }
.text-button { color: #795c2d; }
.info-page { padding-top: 0; max-width: 850px; }
.info-page h1 { font-size: 40px; }
.info-callout { background: #ece7d9; border: 0; border-left: 2px solid #ad9463; }
.address-card, .contact-card, .coordinator-card { background: var(--surface); }
.address-card h2 { font-family: var(--serif); font-size: 28px; font-weight: 400; }
.phrase-card { border: 1px solid #d9c9a8; background: #eee6d2; }
.timeline-marker { background: var(--surface); border-color: #d4c3a0; color: #8f7444; }
.contact-number { font-family: var(--serif); font-weight: 400; font-size: 36px; }
.operator-layout { grid-template-columns: 216px minmax(0, 1fr); }
.operator-layout .workspace { padding: 32px 34px 24px; }
.operator-page .page-heading { margin-bottom: 20px; }
.operator-page .page-heading h1 { font-size: 37px; max-width: 680px; }
.operator-stats { gap: 28px; padding: 0 0 24px; }
.operator-stats > div { gap: 10px; padding-right: 28px; border-right: 1px solid #d9d0bf; }
.operator-stats strong { font-family: var(--serif); font-size: 30px; font-weight: 400; color: #354d3d; }
.operator-stats > div:first-child strong { color: #997439; }
.operator-stats > div span { font-size: 10px; }
.operator-stats > .connection { font-size: 9px; }
.inbox { grid-template-columns: 295px minmax(0, 1fr); height: calc(100dvh - 318px); min-height: 470px; }
.inbox-list { background: #faf7f0; }
.inbox-tools { padding: 21px 18px 15px; }
.inbox-tools h2 { font-family: var(--serif); font-size: 22px; font-weight: 400; margin-bottom: 17px; }
.inbox-tools h2 span { font-family: var(--font); border: 1px solid #daceb8; padding: 2px 6px; border-radius: 20px; font-size: 9px; vertical-align: middle; }
.search { padding: 10px; background: #fffdf8; border-color: #ddd4c2; }
.search input { color: var(--text); font-size: 11px; }
.filters { gap: 4px; margin-top: 13px; }
.filters button { padding: 7px 7px; font-size: 10px; border-radius: 3px; }
.filters button.selected { background: #3b503f; color: #fff8e8; }
.conversation { padding: 20px 17px; gap: 11px; border-left: 2px solid transparent; }
.conversation.selected { background: #ece5d4; border-left-color: #aa8b4e; }
.conversation .avatar { width: 32px; height: 32px; border: 1px solid #d4c7aa; background: transparent; font-size: 10px; }
.conversation.selected .avatar { background: #d9cbad; }
.conversation-top strong { font-size: 12px; }
.conversation-top time { font-size: 9px; }
.conversation-content > p { font-size: 11px; margin: 7px 0 10px; }
.status-text { font-size: 9px; }
.unread { background: #816735; color: #fffdf8; }
.operator-chat .chat-header { padding: 18px 22px; min-height: 90px; }
.operator-chat .messages { padding: 24px; }
.operator-chat .composer { margin: 0 18px; }
.operator-chat .chat-foot { min-height: 36px; }
.compact { padding: 6px 9px; font-size: 9px; }
.no-selection h2 { font-family: var(--serif); font-size: 28px; font-weight: 400; }
.no-selection p { font-size: 12px; line-height: 1.9; }
dialog { border: 1px solid #d6c5a3; border-radius: 7px; padding: 40px; box-shadow: 0 30px 100px rgb(0 0 0 / 20%); }
dialog::backdrop { background: var(--overlay); }
dialog h1 { font-size: 37px; margin: 20px 0; }
dialog h2 { font-family: var(--serif); font-weight: 400; font-size: 30px; }
.dialog-logo { background: #2e4537; color: #d7bd83; border-radius: 50%; width: 52px; height: 52px; margin-bottom: 29px; }
dialog input { background: #f7f2e8; border-color: #d9ceb8; color: var(--text); padding: 14px; }
dialog .primary { padding: 14px; }
.demo-note { font-size: 10px; }
@media (min-width: 1600px) {
  .delegate-workspace { grid-template-columns: minmax(0, 1fr) 280px; gap: 45px; }
  .page-heading h1 { font-size: 46px; }
  .beijing-art { height: 330px; border-radius: 130px 130px 4px 4px; }
  .beijing-art > svg { height: 250px; }
}
@media (min-width: 701px) and (max-width: 1200px) {
  .layout { grid-template-columns: 205px minmax(0, 1fr); }
  .workspace, .operator-layout .workspace { padding: 28px 25px; }
  .topbar { padding: 0 25px; }
  .demo-banner { padding-left: 25px; padding-right: 25px; }
  .delegate-workspace { grid-template-columns: minmax(0, 1fr) 200px; gap: 22px; }
  .page-heading h1 { font-size: 33px; }
  .inbox { grid-template-columns: 270px minmax(0, 1fr); }
  .operator-stats { gap: 16px; }
  .operator-stats > div { padding-right: 16px; }
}
@media (min-width: 701px) and (max-width: 1000px) {
  .operator-layout { grid-template-columns: 1fr; }
  .delegate-workspace { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  body { background: #f5f0e5; }
  .layout, .operator-layout { grid-template-columns: 1fr; }
  .topbar { height: 80px; padding: 0 22px; background: #29352f; color: #f6efdf; border: 0; }
  .mobile-brand { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-size: 27px; letter-spacing: -.8px; text-decoration: none; }
  .mobile-brand .icon { color: #d2b980; width: 23px; height: 23px; stroke-width: 1.2; }
  .topbar .top-label, .topbar .top-title { display: none; }
  .top-actions { gap: 12px; }
  .role-switch { font-size: 10px; color: #dfddce; gap: 5px; }
  .role-switch .icon { color: #c4af80; }
  .demo-pill { font-size: 8px; padding: 3px 6px; background: transparent; color: #d3c9b0; border-color: #64705d; }
  .demo-banner { padding: 10px 22px; background: #344138; border-color: #4a5548; color: #d0d2c3; font-size: 8px; line-height: 1.7; }
  .workspace { padding: 0 0 65px; }
  .delegate-workspace { display: block; }
  .chat-column > .page-heading { padding: 22px 24px 24px; margin: 0; background: #29352f; color: #f9f0dd; }
  .page-heading .eyebrow { font-size: 8px; letter-spacing: 1.5px; }
  .chat-column > .page-heading .eyebrow { color: #cab482; margin-bottom: 12px; }
  .page-heading h1 { font-size: 32px; line-height: 1.12; letter-spacing: -.8px; max-width: 320px; }
  .chat-column > .page-heading > p:last-child:not(.eyebrow) { color: #c6cbbd; font-size: 10px; max-width: 300px; line-height: 1.7; margin-top: 11px; }
  .chat-panel { margin: 0; border: 0; border-radius: 0; box-shadow: none; min-height: 438px; height: calc(100dvh - 368px); max-height: none; }
  .chat-header { padding: 18px 20px; min-height: 84px; gap: 8px; }
  .chat-person { gap: 10px; }
  .chat-person h2 { font-size: 18px; }
  .chat-person p { font-size: 8px; max-width: 180px; line-height: 1.6; }
  .avatar { width: 35px; height: 35px; }
  .chat-header .status-label { font-size: 8px; padding: 5px 6px; }
  .messages { min-height: 210px; padding: 18px 20px; gap: 15px; }
  .chat-empty { padding: 0; }
  .empty-icon { width: 46px; height: 46px; margin-bottom: 14px; }
  .chat-empty h3 { font-size: 25px; }
  .chat-empty p { font-size: 10px; margin-top: 6px; line-height: 1.8; }
  .suggestions { margin-top: 18px; gap: 7px; }
  .suggestion { padding: 9px; font-size: 9px; }
  .composer { margin: 0 16px; padding: 11px; flex-shrink: 0; }
  .compose-row textarea { font-size: 16px; min-height: 38px; }
  .compose-row textarea::placeholder { font-size: 12px; }
  .composer-meta { font-size: 8px; gap: 8px; }
  .urgent-toggle input { width: 20px; height: 20px; }
  .send-button { width: 44px; height: 44px; }
  .chat-foot { padding: 12px 19px 16px; font-size: 8px; }
  .message { max-width: 89%; padding: 12px 14px; }
  .message-body { font-size: 13px; }
  .message-meta { font-size: 8px; }
  .sidebar { background: #f7f3e9; color: #3d483a; padding: 0 8px env(safe-area-inset-bottom); border-top: 1px solid #ded4bf; box-shadow: 0 -4px 18px rgb(44 49 32 / 4%); }
  .main-nav { gap: 0; }
  .nav-item { font-size: 11px; padding: 13px 0 11px; gap: 6px; color: #736e5d; }
  .nav-item .icon { width: 20px; height: 20px; }
  .nav-item.selected { background: transparent; color: #3c573e; box-shadow: inset 0 2px #967b42; }
  .nav-item:hover { background: #eee8da; }
  .context-column { display: none; }
  .info-page { padding: 28px 21px; }
  .info-page h1 { font-size: 34px; }
  .info-page .page-heading > p:last-child:not(.eyebrow) { font-size: 11px; }
  .contacts-grid { margin-top: 25px; }
  .address-card h2 { font-size: 25px; }
  .chinese-phrase { font-size: 22px; }
  .primary, .secondary { font-size: 11px; }
  .operator-layout .workspace { padding: 27px 16px; }
  .operator-page .page-heading h1 { font-size: 31px; }
  .operator-stats { gap: 15px; padding: 0 0 20px; }
  .operator-stats > div { gap: 6px; padding-right: 14px; }
  .operator-stats > div span { font-size: 8px; }
  .operator-stats strong { font-size: 25px; }
  .operator-stats > .connection { font-size: 9px; }
  .inbox { display: block; height: calc(100dvh - 338px); min-height: 470px; }
  .inbox-list { height: 100%; }
  .inbox-tools { padding: 20px 17px 14px; }
  .search input { font-size: 16px; }
  .filters { justify-content: space-between; }
  .filters button { font-size: 10px; padding: 8px 10px; }
  .conversation { padding: 21px 16px; }
  .conversation-top strong { font-size: 12px; }
  .conversation-content > p { font-size: 11px; }
  .mobile-back { background: #eee8d9; padding: 12px; font-size: 11px; }
  .operator-chat .chat-header { padding: 15px 13px; }
  .operator-chat .chat-person h2 { font-size: 17px; }
  .operator-chat .chat-person p { font-size: 8px; }
  .operator-chat .messages { padding: 18px 14px; }
  .operator-chat .composer { margin: 0 12px; }
  .compact { font-size: 8px; padding: 6px; }
  dialog { padding: 29px; }
  dialog h1 { font-size: 33px; }
  dialog input { font-size: 16px; }
  dialog .eyebrow { font-size: 8px; }
}

/* Accessibility and new controls added after the original visual prototype. */
.urgent-toggle { font-size: 12px; min-height: 40px; }
.attach-button { min-width: 44px; min-height: 44px; color: var(--accent); }
.mobile-install { color: inherit; }
.filters { flex-wrap: wrap; }
.new-message-jump { border-color: var(--border); background: var(--accent-soft); color: var(--accent); }
.message a { text-underline-offset: 3px; }
.message.mine .urgent-flag { color: var(--gold); }
.chat-header-right { flex-shrink: 0; }
@media (max-width: 700px) {
  /* Fit the conversation above the fixed nav, including the v4 emergency note.
     Let message history shrink instead of hiding the urgency row below it. */
  .layout:not(.operator-layout) main:has(.delegate-workspace) {
    height: 100dvh; display: flex; flex-direction: column;
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }
  main:has(.delegate-workspace) > .topbar,
  main:has(.delegate-workspace) > .demo-banner { flex-shrink: 0; }
  .workspace:has(.delegate-workspace) {
    flex: 1; min-height: 0; display: flex; flex-direction: column;
    width: 100%; padding: 0;
  }
  .delegate-workspace, .chat-column { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .chat-column > .page-heading { flex-shrink: 0; padding: 16px 22px; }
  .chat-column > .page-heading h1 { font-size: 28px; }
  .chat-column > .emergency-note { margin: 0; padding: 14px 22px; background: var(--surface); }
  .chat-panel { flex: 1; min-height: 0; height: auto; }
  .chat-header { flex-shrink: 0; min-height: 68px; padding: 12px 20px; }
  .messages { min-height: 60px; }
  .chat-foot { flex-shrink: 0; padding-block: 8px; }
  .mobile-install { min-width: 32px; min-height: 44px; }
  .top-actions { gap: 8px; }
  .topbar { padding-inline: 16px; }
  .composer-meta { font-size: 10px; }
  .filters { justify-content: flex-start; }
  .compact { font-size: 10px; min-height: 36px; }
}
@media (max-width: 700px) and (max-height: 760px) {
  .chat-column > .page-heading .eyebrow,
  .chat-column > .page-heading > p:last-child:not(.eyebrow) { display: none; }
  .chat-column > .page-heading h1 { font-size: 25px; }
  .chat-column > .emergency-note { padding-block: 8px; }
}
@media (max-width: 700px) and (max-height: 600px) {
  .chat-column > .page-heading { display: none; }
  .chat-column > .emergency-note { font-size: 10px; }
}
