/* Consumer orders, conversations and account tools reuse theme.css tokens. */
.order-tabs { width:100%; min-width:0; max-width:100%; flex-wrap:wrap; overflow:visible; border:1px solid var(--line); border-radius:var(--radius-card); background:var(--white); }
.orders-list,.order-card,.order-card-header>div,.order-card-footer>div,.order-item-price { min-width:0; }
.order-card-header { flex-wrap:wrap; }
.order-item-info small,.order-item-price,.order-actions>* { overflow-wrap:anywhere; }
.order-actions>* { min-width:0; max-width:100%; white-space:normal; }
.order-tab { flex-shrink:0; min-height:52px; padding-inline:var(--space-4); color:var(--muted); font-size:var(--text-sm); }
.order-tab.selected { color:var(--brand-strong); }
.order-tab.selected:after { background:var(--brand); }
.order-tab b { background:var(--surface-subtle); color:var(--muted); }
.order-tab.selected b { background:var(--brand-soft); color:var(--brand-strong); }
.order-card-header,.order-card-footer { background:var(--surface-subtle); border-color:var(--line); padding:var(--space-4) var(--space-5); }
.order-card-header strong { font-size:var(--text-sm); overflow-wrap:anywhere; }
.order-card-header time,.order-card-footer span { color:var(--muted); font-size:var(--text-xs); }
.order-card-footer { flex-wrap:wrap; gap:var(--space-4); }
.order-card-footer>div:first-child { display:grid; gap:var(--space-1); }
.order-card-footer strong { font-size:24px; color:var(--brand-strong); }
.order-actions { display:flex; flex-wrap:wrap; gap:var(--space-2); align-items:center; }
.order-actions .primary-button,.order-actions .secondary-button { min-height:40px; font-size:var(--text-sm); }
.order-item-link { color:var(--color-text); text-decoration:none; border-radius:var(--radius-input); }
.order-item-link:hover { background:var(--surface-subtle); }
.order-item-info strong,.order-item-info span { white-space:normal; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.order-item-info strong { font-size:var(--text-base); color:var(--ink); }
.order-item-info span,.order-item-info small,.order-item-price small { color:var(--muted); font-size:var(--text-xs); }
.order-card-items { padding-inline:var(--space-5); }
.order-detail-section { padding:var(--space-5); border-top:1px solid var(--line); }
.order-detail-section h3 { margin:0 0 var(--space-3); font-size:var(--text-lg); }
.order-detail-section p { margin:var(--space-2) 0; overflow-wrap:anywhere; }
.order-detail-section small { font-size:var(--text-xs); }
.order-amounts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--space-3) var(--space-8); margin:0 0 var(--space-4); }
.order-amounts>div { display:flex; justify-content:space-between; gap:var(--space-3); }
.order-amounts dt { color:var(--muted); }
.order-amounts dd { margin:0; font-weight:var(--weight-semibold); text-align:right; overflow-wrap:anywhere; }
.order-timeline { list-style:none; padding:0 0 0 var(--space-4); margin:var(--space-4) 0; border-left:2px solid var(--brand-border); }
.order-timeline li { display:flex; justify-content:space-between; gap:var(--space-4); margin-bottom:var(--space-4); }
.order-timeline li time { color:var(--muted); font-size:var(--text-xs); flex-shrink:0; }
.order-payment { background:var(--brand-soft); padding:var(--space-5); border-color:var(--line); }
.order-payment p { color:var(--color-text); font-size:var(--text-sm); }
.payment-amount { color:var(--brand-strong); }
.payment-method-picker { display:flex; flex-wrap:wrap; gap:var(--space-3); align-items:center; }
.payment-method-picker select { min-height:var(--control-height); padding:var(--space-2); border:1px solid var(--line); border-radius:var(--radius-input); background:var(--white); }
.payment-qr img { width:220px; height:220px; max-width:100%; object-fit:contain; }
.payment-qr { max-width:100%; }
.payment-qr figcaption { color:var(--muted); font-size:var(--text-xs); }
.orders-feedback { color:var(--success); background:var(--success-soft); padding:var(--space-3); border-radius:var(--radius-input); }

.consult-workspace { position:relative; display:grid; grid-template-columns:minmax(200px,18%) minmax(0,1fr) minmax(220px,23%); height:clamp(440px,calc(100dvh - var(--shell-stack-height,140px) - 130px),760px); min-width:0; min-height:0; overflow:hidden; background:var(--white); }
.consult-workspace>* { min-width:0; min-height:0; }
.consult-heading>* { min-width:0; overflow-wrap:anywhere; }
.thread-back { display:none; }
.thread-sidebar { min-width:0; min-height:0; max-height:none; background:var(--surface-subtle); border-color:var(--line); }
.sidebar-heading { flex-shrink:0; padding:var(--space-4); }
.sidebar-heading h2 { font-size:var(--text-base); color:var(--ink); }
.thread-search { display:block; padding:0 var(--space-3) var(--space-3); }
.thread-search input { width:100%; min-width:0; min-height:40px; padding:var(--space-2); font-size:var(--text-xs); border:1px solid var(--line); border-radius:var(--radius-input); background:var(--white); }
.thread-list { display:block; min-height:0; overflow:auto; padding:var(--space-2); }
.thread-item { min-height:100px; border-radius:var(--radius-input); padding:var(--space-3); margin-bottom:var(--space-2); }
.thread-item.active { border-color:var(--brand-border); background:var(--brand-soft); }
.thread-item:hover { background:var(--white); }
.thread-item-title { color:var(--ink); font-size:var(--text-sm); }
.thread-item-preview,.thread-item-time { font-size:var(--text-xs); color:var(--muted); }
.thread-placeholder { color:var(--muted); font-size:var(--text-sm); }
.conversation-panel { min-height:0; height:100%; overflow:hidden; }
.conversation-active { display:grid; grid-template-rows:auto minmax(0,1fr) auto; height:100%; min-width:0; min-height:0; overflow:hidden; }
.conversation-heading { padding:var(--space-4); gap:var(--space-3); border-color:var(--line); }
.conversation-heading>div:first-of-type { min-width:0; flex:1; }
.conversation-heading h2 { font-size:var(--text-base); overflow-wrap:anywhere; }
.conversation-heading-actions { display:flex; gap:var(--space-2); align-items:center; flex-shrink:0; }
.conversation-heading-actions>button { min-height:36px; padding:var(--space-2); color:var(--ink); border:1px solid var(--line); border-radius:var(--radius-input); background:var(--white); font-size:var(--text-xs); }
.message-list { min-height:0; height:auto; overflow-y:auto; padding:var(--space-4); }
.message-bubble { background:var(--surface-subtle); color:var(--color-text); font-size:var(--text-sm); max-width:88%; }
.customer .message-bubble { background:var(--brand-soft); color:var(--ink); }
.message-meta,.message-receipt { color:var(--muted); font-size:var(--text-xs); }
.message-receipt { margin-top:var(--space-1); }
.messages-empty,.conversation-empty p { color:var(--muted); font-size:var(--text-sm); }
.message-form { padding:var(--space-3) var(--space-4); min-height:0; background:var(--white); border-color:var(--line); }
.message-form textarea { min-height:72px; max-height:100px; resize:none; font-size:var(--text-sm); line-height:1.5; }
.composer-bottom { margin-top:var(--space-2); gap:var(--space-2); flex-wrap:wrap; }
.composer-bottom .primary-button { min-height:40px; white-space:nowrap; }
.send-status { max-height:64px; overflow:auto; margin:var(--space-2) 0 0; font-size:var(--text-xs); }
.composer-tools { display:flex; flex-wrap:wrap; align-items:center; min-width:0; gap:var(--space-2); color:var(--muted); font-size:var(--text-xs); }
.image-picker { position:relative; overflow:hidden; color:var(--brand-strong); border:1px solid var(--line); border-radius:var(--radius-input); padding:var(--space-1) var(--space-2); cursor:pointer; }
.image-picker input { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.message-image-preview-box { display:flex; gap:var(--space-2); align-items:center; padding-top:var(--space-2); min-width:0; }
.message-image-preview-box img { width:48px; height:48px; object-fit:contain; }
.message-image-preview-box span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:var(--text-xs); }
.message-image-preview-box button { flex-shrink:0; }
.message-attachment { display:block; max-width:88%; margin-top:var(--space-2); }
.message-attachment img { max-width:100%; width:auto; max-height:220px; object-fit:contain; border:1px solid var(--line); border-radius:var(--radius-input); }
.conversation-context { min-width:0; min-height:0; overflow-y:auto; overflow-wrap:anywhere; padding:var(--space-4); border-left:1px solid var(--line); background:var(--white); }
.context-heading { display:flex; justify-content:space-between; align-items:center; gap:var(--space-2); }
.context-heading h2,.conversation-context h3 { font-size:var(--text-base); margin:0 0 var(--space-3); }
#context-toggle,#context-close { display:none; }
.conversation-context .conversation-product { padding:var(--space-3); display:grid; grid-template-columns:64px minmax(0,1fr); gap:var(--space-3); border:1px solid var(--line); border-radius:var(--radius-card); background:var(--surface-subtle); }
.conversation-product img { width:64px; height:64px; background:var(--white); }
.conversation-product-info strong { color:var(--ink); font-size:var(--text-sm); }
.conversation-product-info small,.conversation-product-price small { color:var(--muted); font-size:var(--text-xs); text-align:left; white-space:normal; }
.conversation-context .conversation-product-price { grid-column:1/-1; color:var(--brand-strong); font-size:var(--text-lg); white-space:normal; }
.conversation-context .text-link { grid-column:1/-1; color:var(--brand-strong); }
.conversation-specs { margin-top:var(--space-5); }
.conversation-specs p { white-space:pre-wrap; overflow-wrap:anywhere; font-size:var(--text-sm); }
.conversation-orders { margin-top:var(--space-5); }
.context-order { display:grid; gap:var(--space-1); padding:var(--space-3); border:1px solid var(--line); border-radius:var(--radius-input); color:var(--ink); text-decoration:none; margin-top:var(--space-2); overflow-wrap:anywhere; }
.context-order:hover { background:var(--brand-soft); }
.context-order strong,.context-order small { font-size:var(--text-xs); }
.context-note,.conversation-context>.muted,.conversation-orders>.muted { font-size:var(--text-xs); color:var(--muted); line-height:var(--line-body); }
.context-note { border-top:1px solid var(--line); padding-top:var(--space-4); margin-top:var(--space-5); }

.account-main { grid-template-columns:minmax(240px,400px) minmax(320px,460px); justify-content:center; gap:var(--space-10); min-height:0; }
.account-story { padding:var(--space-4); }
.account-story h1 { font-size:34px; }
.account-story img { width:180px; height:150px; }
.account-main.is-authenticated { display:block; }
.is-authenticated .account-story { display:none; }
.is-authenticated .account-card { max-width:none; padding:0; background:none; border:0; box-shadow:none; }
.is-authenticated .account-footer-note { display:none; }
.account-overview { display:flex; align-items:center; justify-content:space-between; gap:var(--space-5); padding:var(--space-5); border:1px solid var(--line); border-radius:var(--radius-card); background:var(--white); }
.account-overview .signed-in-card { display:flex; flex-direction:row; align-items:center; gap:var(--space-4); padding:0; margin:0; background:none; }
.signed-in-card strong,.signed-in-card small { display:block; }
.signed-in-card strong { color:var(--ink); }
.signed-in-card span,.signed-in-card small { color:var(--muted); font-size:var(--text-sm); }
.account-overview .profile-avatar { width:64px; height:64px; flex-shrink:0; background:var(--brand-soft); color:var(--brand-strong); }
.account-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:var(--space-3); margin-top:var(--space-4); }
.account-summary a { display:grid; gap:var(--space-1); text-align:center; padding:var(--space-4); border:1px solid var(--line); border-radius:var(--radius-card); background:var(--white); color:var(--ink); text-decoration:none; }
.account-summary strong { font-size:26px; }
.account-summary span { color:var(--muted); font-size:var(--text-sm); }
.account-shortcuts { display:flex; flex-wrap:wrap; justify-content:flex-start; gap:var(--space-3); margin:var(--space-4) 0; }
.account-shortcuts a { padding:var(--space-2) var(--space-3); border:1px solid var(--line); border-radius:var(--radius-input); background:var(--white); color:var(--ink); font-size:var(--text-sm); text-decoration:none; }
.personal-center { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; gap:var(--space-5); margin-top:var(--space-5); }
.personal-panel { min-width:0; padding:var(--space-5); }
.personal-panel h3 { font-size:var(--text-lg); }
.profile-field { font-size:var(--text-sm); color:var(--ink); }
.profile-field input,.profile-field textarea { font-size:var(--text-sm); min-height:var(--control-height); border-color:var(--line); border-radius:var(--radius-input); background:var(--white); }
.profile-avatar-row small,.address-note,.address-detail,.personal-message { font-size:var(--text-xs); color:var(--muted); }
.profile-avatar-row { gap:var(--space-4); }
.avatar-picker { font-size:var(--text-sm); color:var(--brand-strong); }
.address-list { max-height:500px; overflow-y:auto; }
.address-card { border-color:var(--line); border-radius:var(--radius-input); background:var(--white); padding:var(--space-3); }
.address-card.is-default { background:var(--brand-soft); border-color:var(--brand-border); }
.address-line { font-size:var(--text-sm); color:var(--color-text); }
.address-actions button { min-height:36px; padding-inline:var(--space-2); font-size:var(--text-sm); color:var(--brand-strong); }
.security-panel { grid-column:1/-1; }
.security-panel p { font-size:var(--text-sm); }
.security-details { display:flex; flex-wrap:wrap; gap:var(--space-4) var(--space-10); }
.security-details>div { display:flex; gap:var(--space-4); }
.security-details dt { color:var(--muted); }
.security-details dd { margin:0; font-weight:var(--weight-medium); }
.address-dialog { border:1px solid var(--line); border-radius:var(--radius-dialog); background:var(--white); }
@media(max-width:1100px) {
  .consult-workspace { grid-template-columns:minmax(180px,28%) minmax(0,1fr); }
  #context-toggle,#context-close { display:inline-flex; }
  .conversation-context { display:none; position:absolute; inset:0 0 0 auto; width:min(320px,100%); z-index:6; box-shadow:var(--shadow-dialog); }
  .context-open .conversation-context { display:block; }
}
@media(max-width:760px) {
  .order-tabs { margin-inline:0; }
  .order-card-footer { align-items:flex-start; }
  .order-card-footer .order-actions { width:100%; }
  .order-amounts { grid-template-columns:1fr; }
  .order-timeline li { flex-direction:column; gap:var(--space-1); }
  .order-card-item { grid-template-columns:72px minmax(0,1fr); }
  .order-item-image { width:72px; height:72px; }
  .order-item-price { grid-column:2; display:flex; gap:var(--space-3); justify-content:space-between; }
  .personal-center { grid-template-columns:1fr; }
  .account-overview { flex-wrap:wrap; }
  .account-summary { gap:var(--space-2); }
  .account-summary a { padding:var(--space-3) var(--space-1); }
  .account-summary span { font-size:var(--text-xs); }
  .account-main { display:block; }
  .account-main .account-story { display:none; }
  .account-card { justify-self:auto; margin-inline:auto; }
  .security-details { flex-direction:column; gap:var(--space-3); }
}
@media(max-width:680px) {
  .consult-heading { flex-direction:column; align-items:flex-start; margin-bottom:var(--space-3); gap:var(--space-1); }
  .consult-heading h1 { font-size:26px; margin:var(--space-1) 0; }
  .consult-heading>p { max-width:100%; margin:0; font-size:var(--text-xs); line-height:1.5; }
  .consult-workspace { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr); height:calc(100dvh - var(--shell-stack-height,180px) - 150px); min-height:400px; max-height:900px; }
  .thread-sidebar { max-height:none; border-bottom:1px solid var(--line); }
  .consult-workspace.thread-open .thread-sidebar { display:none; }
  .consult-workspace:not(.thread-open) .conversation-panel { display:none; }
  .thread-back { display:inline-flex; flex-shrink:0; align-self:flex-start; min-height:36px; padding:var(--space-2); border:1px solid var(--line); border-radius:var(--radius-input); background:var(--white); color:var(--ink); font-size:var(--text-xs); }
  .sidebar-heading { padding:var(--space-2) var(--space-3); }
  .thread-search { padding-bottom:var(--space-1); }
  .thread-search input { min-height:32px; }
  .thread-list { display:block; overflow:auto; min-height:0; padding:var(--space-2); }
  .thread-item { width:100%; min-height:90px; padding:var(--space-3); margin:0 0 var(--space-2); }
  .thread-item-time { margin-top:var(--space-1); }
  .thread-item-preview { margin-top:var(--space-1); }
  .conversation-panel { height:100%; }
  .conversation-heading { display:grid; grid-template-columns:auto minmax(0,1fr); padding:var(--space-3); gap:var(--space-2); align-items:flex-start; }
  .conversation-heading h2 { font-size:var(--text-sm); }
  .conversation-heading p { font-size:var(--text-xs); }
  .conversation-heading-actions { grid-column:1/-1; justify-content:flex-end; gap:var(--space-1); flex-wrap:wrap; max-width:100%; }
  .conversation-heading-actions>button { font-size:var(--text-xs); min-height:36px; }
  .message-form,.message-list { padding:var(--space-3); }
  .composer-bottom>span { font-size:10px; }
  .composer-tools { flex:1; }
  .composer-shortcut { display:none; }
  .image-picker { display:inline-flex; align-items:center; min-height:36px; }
}
