:root {
  --ryfie-navy: #061b3d;
  --ryfie-navy-deep: #041733;
  --ryfie-blue: #2858f6;
  --ryfie-blue-soft: #eef3ff;
  --ryfie-line: #e5e9f1;
  --ryfie-text: #0a1630;
  --ryfie-muted: #61708e;
}

/* OpenAI agent decisions routed through tenant commerce governance */
.action-center-controls{display:flex!important;align-items:center;gap:7px!important}.action-center-controls form{margin:0}.action-center-controls button{border:0;border-radius:8px;background:#111c33;color:#fff;padding:8px 10px;font:800 9px 'Urbanist',sans-serif;cursor:pointer;white-space:nowrap}.action-center-controls button:hover{background:#26385d}.action-center-controls button:disabled{opacity:.68;cursor:wait}.action-center-controls a{color:var(--hd-blue);font-size:9px;font-weight:750}.ai-action-outcome{display:grid;gap:8px;margin-top:12px;padding:12px;border:1px solid #d8def2;border-radius:11px;background:linear-gradient(145deg,#f8f9ff,#fff)}.ai-action-outcome>header{display:flex;align-items:center;gap:9px!important}.ai-action-outcome>header>span{width:27px!important;height:27px!important;border-radius:8px!important;background:#e9edff!important;color:#4257db!important}.ai-action-outcome header div{display:grid;gap:2px}.ai-action-outcome strong{color:#182239;font:800 10px 'Urbanist',sans-serif}.ai-action-outcome small{color:#788397;font-size:8px}.ai-action-outcome p{margin:0!important;color:#586579!important;font-size:9px!important;line-height:1.45}.ai-action-outcome>div{display:grid;gap:3px;padding:8px;border-radius:7px;background:#f0f3f8}.ai-action-outcome>div b{color:#59667a;font-size:7px;text-transform:uppercase}.ai-action-outcome>div span{color:#657287;font-size:8px;line-height:1.4}.ai-action-outcome>a{color:#4257db;font-size:8px;font-weight:800}.ai-action-outcome.completed{border-color:#ccebdc;background:#f5fcf8}.ai-action-outcome.completed>header>span{background:#dff6e9!important;color:#238158!important}.ai-action-outcome.blocked,.ai-action-outcome.failed{border-color:#f0d1cf;background:#fff8f7}.ai-action-outcome.blocked>header>span,.ai-action-outcome.failed>header>span{background:#f9e2e0!important;color:#ad413e!important}html[data-theme="dark"] .conversation-action-center h3,html[data-theme="dark"] .action-center-card h4,html[data-theme="dark"] .ai-action-outcome strong{color:#e7edf7}html[data-theme="dark"] .ai-action-outcome>div{background:#1d2b40}html[data-theme="dark"] .ai-action-outcome p,html[data-theme="dark"] .ai-action-outcome>div span{color:#9ba8bb!important}html[data-theme="dark"] .ai-action-outcome{background:#152136;border-color:#415273}html[data-theme="dark"] .ai-action-outcome.completed{background:#13261f;border-color:#285944}html[data-theme="dark"] .ai-action-outcome.blocked,html[data-theme="dark"] .ai-action-outcome.failed{background:#2a191c;border-color:#63383d}
.customer-timeline .event-timeline-item{align-items:flex-start;background:#fbfcff;border:1px solid #edf0f5;border-radius:9px;margin-bottom:6px;padding:9px}.customer-timeline .event-timeline-item>span{background:#e9edff;color:#4358db}.customer-timeline .event-timeline-item.automation>span{background:#e4f7ed;color:#237f58}.customer-timeline .event-timeline-item>div p{margin:3px 0 0;color:#778295;font-size:8px;line-height:1.4}html[data-theme="dark"] .customer-timeline .event-timeline-item{background:#172438;border-color:#2d3b51}html[data-theme="dark"] .customer-timeline .event-timeline-item>div p{color:#93a0b4}

/* Governed recommendations in every customer conversation */
.conversation-action-center{padding:16px;border-top:1px solid var(--ryfie-line);background:#fff}.conversation-action-center>header{display:flex;align-items:center;justify-content:space-between;gap:10px}.conversation-action-center>header>div{display:flex;align-items:center;gap:9px}.conversation-action-center>header>div>span{width:29px;height:29px;display:grid;place-items:center;border-radius:9px;background:linear-gradient(135deg,#4f5ff7,#7658e8);color:#fff;font-size:14px}.conversation-action-center h3{margin:0;color:#111a2d;font:800 13px 'Urbanist',sans-serif}.conversation-action-center>header p{margin:2px 0 0;color:#7c8799;font-size:9px}.conversation-action-center>header>a{color:var(--hd-blue);font-size:9px;font-weight:750}.action-center-list{display:grid;gap:8px;margin-top:12px}.action-center-card{padding:11px;border:1px solid #e3e7ee;border-radius:10px;background:#fff}.action-center-card.recommended{border-color:#cfd6ff;background:linear-gradient(145deg,#fff,#f8f9ff);box-shadow:0 8px 20px rgba(62,80,190,.07)}.action-center-card>header{display:flex;align-items:flex-start;gap:9px}.action-center-card>header>span{width:27px;height:27px;flex:0 0 auto;display:grid;place-items:center;border-radius:8px;background:#eef1ff;color:#4b5ddd;font-size:12px;font-weight:850}.action-center-card>header>div{min-width:0;flex:1}.action-center-card h4{margin:1px 0 3px;color:#192238;font:800 11px 'Urbanist',sans-serif}.action-center-card header p{margin:0;color:#768193;font-size:9px;line-height:1.4}.action-center-card header>b{padding:4px 6px;border-radius:999px;background:#e7f8ef;color:#21815a;font-size:7px;text-transform:uppercase}.action-reason{display:grid;grid-template-columns:auto 1fr;gap:7px;margin:9px 0;padding:8px;border-radius:7px;background:#f6f8fb}.action-reason strong{color:#536173;font-size:8px;text-transform:uppercase}.action-reason span{color:#687487;font-size:9px;line-height:1.4}.action-center-card>footer{display:flex;align-items:center;justify-content:space-between;gap:8px}.action-center-card footer form{margin:0}.action-center-card footer button{border:0;border-radius:7px;background:#eef1ff;color:#4357da;padding:7px 9px;font:800 9px 'Urbanist',sans-serif;cursor:pointer}.action-center-card footer button:hover{background:#e1e5ff}.action-center-card footer button:disabled{background:#f0f1f3;color:#999fa9;cursor:not-allowed}.action-policy{display:flex;align-items:center;gap:5px;color:#687487;font-size:8px;font-weight:750}.action-policy i{width:6px;height:6px;border-radius:50%;background:#7c8799}.action-policy.automatic{color:#21815a}.action-policy.automatic i{background:#2db77d}.action-policy.approval{color:#936b1b}.action-policy.approval i{background:#e0a83e}.action-policy.blocked{color:#a23f3d}.action-policy.blocked i{background:#d8524f}.action-policy.human{color:#4c5fd5}.action-policy.human i{background:#5368e8}.action-center-note{display:flex;align-items:flex-start;gap:6px;margin:10px 1px 0!important;color:#748092!important;font-size:8px!important;line-height:1.4}.action-center-note span{color:#27815d}
html[data-theme="dark"] .conversation-action-center{background:#0f1929;border-color:#2a374c}html[data-theme="dark"] .conversation-action-center h3,html[data-theme="dark"] .action-center-card h4{color:#e7edf7}html[data-theme="dark"] .action-center-card{background:#152136;border-color:#304059}html[data-theme="dark"] .action-center-card.recommended{background:linear-gradient(145deg,#152136,#192641);border-color:#465688}html[data-theme="dark"] .action-reason{background:#1d2b40}html[data-theme="dark"] .action-center-card header p,html[data-theme="dark"] .action-reason span{color:#9ba8bb}

.app-shell {
  background: #fff;
  color: var(--ryfie-text);
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 13px;
}

.helpdesk-sidebar {
  width: 202px;
  background: linear-gradient(180deg, #061b3d 0%, #031a39 100%);
  color: #fff;
  overflow: hidden;
}

.helpdesk-sidebar-head {
  height: 72px;
  padding: 0 20px;
  border-bottom: 0;
}

.helpdesk-product {
  gap: 10px;
  color: #fff;
}

.helpdesk-product .ryfie-mark {
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #dbe3f8;
  font-size: 35px;
  line-height: 1;
  transform: rotate(25deg);
}

.ryfie-word {
  display: grid;
  width: auto !important;
  height: auto !important;
  place-items: initial !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #fff !important;
  line-height: 1;
}

.ryfie-word b {
  font: 700 29px/1 "DM Sans", sans-serif;
  letter-spacing: .01em;
}

.ryfie-word small {
  margin-top: 4px;
  color: #c8d2e7;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .12em;
}

.helpdesk-nav {
  flex: 1;
  gap: 0;
  padding: 12px 10px 4px;
  overflow-y: auto;
}

.helpdesk-nav a {
  height: 34px;
  padding: 0 11px;
  border-radius: 7px;
  color: #e0e7f6;
  font-size: 13px;
  font-weight: 500;
  gap: 9px;
}

.helpdesk-nav a:hover,
.helpdesk-nav a.active {
  background: linear-gradient(135deg, #214ae9, #2e63ff);
  color: #fff;
}

.helpdesk-nav a.active {
  box-shadow: 0 8px 22px rgba(20, 65, 223, .28);
}

.helpdesk-nav .nav-glyph {
  width: 18px !important;
  height: 18px;
  display: grid;
  place-items: center;
  color: #d7e1f6;
  font-size: 15px !important;
  font-weight: 400;
}

.helpdesk-nav .live-dot {
  color: #39c97b;
  font-size: 13px !important;
}

.helpdesk-nav a em {
  margin-left: auto;
  min-width: 0;
  padding: 0;
  background: transparent;
  color: #dfe6f5;
  font-size: 11px;
  font-weight: 500;
}

.helpdesk-nav .nav-label {
  display: flex;
  justify-content: space-between;
  margin: 15px 10px 6px;
  color: #c7d1e4;
  font: 600 10px "DM Sans", sans-serif;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.nav-divider {
  height: 1px;
  margin: 5px 0 7px;
  background: rgba(255, 255, 255, .11);
}

.sidebar-usage {
  margin: 8px 10px 9px;
  padding: 13px 12px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 9px;
  background: rgba(255, 255, 255, .04);
}

.sidebar-usage small {
  color: #aebbd3;
  font-size: 10px;
}

.sidebar-usage div {
  display: flex;
  justify-content: space-between;
  margin: 8px 0;
  font-size: 10px;
}

.sidebar-usage strong span,
.sidebar-usage div b {
  color: #9facbf;
  font-weight: 500;
}

.sidebar-usage > i {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 20px;
  background: rgba(255, 255, 255, .12);
}

.sidebar-usage > i span {
  display: block;
  width: 24%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6486ff, #365dff);
}

.helpdesk-sidebar .sidebar-account {
  min-height: 61px;
  margin: 0 10px 10px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 9px;
  background: rgba(255, 255, 255, .04);
}

.helpdesk-sidebar .sidebar-account img {
  width: 29px;
  height: 29px;
  border-radius: 50%;
  object-fit: cover;
}

.helpdesk-sidebar .sidebar-account > div {
  display: grid;
  flex: 1;
}

.helpdesk-sidebar .sidebar-account strong {
  font-size: 12px;
}

.helpdesk-sidebar .sidebar-account small {
  color: #9eacc4;
  font-size: 9px;
}

.helpdesk-app-main {
  margin-left: 202px;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
  background: #fff;
}

.helpdesk-topbar {
  height: 72px;
  padding: 0 14px;
  justify-content: center;
  border-color: var(--ryfie-line);
  box-shadow: none;
}

.topbar-tenant {
  position: absolute;
  left: 14px;
  width: 270px;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  border: 1px solid var(--ryfie-line);
  border-radius: 9px;
  background: #fbfcfe;
}

.topbar-tenant strong {
  flex: 1;
  color: #111a2d;
  font-size: 12px;
  font-weight: 500;
  text-align: left;
}

.topbar-tenant button,
.profile-chevron {
  border: 0;
  background: transparent;
}

.global-search {
  width: min(414px, 31vw);
  height: 44px;
  border-color: var(--ryfie-line);
  background: #fff;
  color: #8490a6;
  font-size: 11px;
}

.global-search kbd {
  border: 0;
  background: transparent;
  color: #5f6b7f;
}

.helpdesk-topbar .topbar-actions {
  right: 17px;
  display: flex;
  align-items: center;
  gap: 13px;
}

.topbar-copilot {
  height: 45px;
  padding: 0 14px;
  border: 1px solid var(--ryfie-line);
  border-radius: 9px;
  background: #fff;
  color: #111a2d;
  font-size: 12px;
  font-weight: 600;
}

.topbar-copilot i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: #30bd75;
  box-shadow: 0 0 0 6px #e5f7ee;
}

.topbar-icon {
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  font-size: 15px;
}

.topbar-icon.notification i {
  top: -1px;
  right: -1px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  background: #2858f6;
  color: #fff;
  font: 700 8px "DM Sans";
}

.topbar-actions > img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  margin-left: 11px;
}

.topbar-actions > span {
  display: grid;
  min-width: 55px;
}

.topbar-actions > span strong {
  font-size: 11px;
}

.topbar-actions > span small {
  color: var(--ryfie-muted);
  font-size: 10px;
}

.helpdesk-inbox {
  height: calc(100vh - 72px);
  grid-template-columns: clamp(280px, 20vw, 308px) minmax(480px, 1fr) clamp(310px, 22.6vw, 347px) 52px;
  overflow: hidden;
  background: #fff;
}

.conversation-queue {
  background: #fff;
  border-color: var(--ryfie-line);
}

.queue-header {
  height: 72px;
  padding: 0 16px 0 24px;
  border-bottom: 1px solid var(--ryfie-line);
}

.queue-header h1 {
  margin: 0;
  font: 700 18px "DM Sans", sans-serif;
  letter-spacing: -.02em;
}

.queue-header > div {
  display: flex;
  gap: 9px;
}

.queue-header button {
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--ryfie-line);
  border-radius: 8px;
  background: #fff;
  color: #111a2d;
  font-size: 11px;
}

.queue-header button span {
  margin-left: 25px;
}

.queue-header .filter-button {
  width: 36px;
  padding: 0;
  font-size: 15px;
}

.queue-list {
  flex: 1;
}

.queue-item {
  min-height: 102px;
  padding: 16px 20px;
  gap: 12px;
  border-top: 0;
  border-bottom: 1px solid var(--ryfie-line);
  color: var(--ryfie-text);
}

.queue-item.active {
  background: linear-gradient(90deg, #e8f0ff 0%, #f7f9ff 100%);
  box-shadow: none;
}

img.queue-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.queue-copy {
  display: block;
  padding-top: 1px;
}

.queue-person strong {
  color: #111a2d;
  font-size: 12px;
}

.queue-person time {
  color: #78859b;
  font-size: 9px;
}

.queue-subject {
  display: block;
  margin: 6px 0 7px;
  color: #34415a;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-meta {
  margin: 0;
}

.queue-meta em {
  width: 28px;
  color: #1767ff;
  font-size: 13px;
}

.queue-meta i {
  padding: 4px 7px;
  border-radius: 5px;
  background: #eef1f7;
  color: #68748b;
  font-size: 9px;
}

.queue-item:nth-child(2) .queue-meta i,
.queue-item:nth-child(4) .queue-meta i {
  background: #e8f7ef;
  color: #15955a;
}

.queue-item:nth-child(3) .queue-meta i,
.queue-item:nth-child(6) .queue-meta i {
  background: #eaf3ff;
  color: #1463e6;
}

.queue-item:nth-child(5) .queue-meta i {
  background: #fff2d9;
  color: #bf7712;
}

.queue-unread {
  top: 52px;
  right: 18px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #315df4;
  color: #fff;
  font-size: 10px;
}

.sample-data-control {
  position: absolute;
  left: 11px;
  bottom: 9px;
  z-index: 2;
}

.sample-data-control button {
  border: 1px solid var(--ryfie-line);
  border-radius: 7px;
  background: rgba(255, 255, 255, .95);
  color: #66738a;
  padding: 6px 9px;
  font-size: 9px;
}

.ticket-workspace {
  border-right: 1px solid var(--ryfie-line);
  background: #fff;
}

.ticket-header {
  height: 86px;
  padding: 0 20px;
  border-color: var(--ryfie-line);
}

.ticket-header > div:first-child {
  display: block;
}

.ticket-header h2 {
  margin-bottom: 7px;
  color: #10192c;
  font: 700 18px "DM Sans", sans-serif;
}

.ticket-header p {
  display: flex;
  gap: 7px;
}

.ticket-header p span {
  padding: 4px 9px;
  border-radius: 20px;
  background: #f3f5f8;
  color: #5c6880;
  font-size: 9px;
}

.ticket-actions button {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #111a2d;
  font-size: 18px;
}

.ticket-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #fff;
}

.customer-message-card,
.ai-response-card,
.reply-composer {
  border: 1px solid var(--ryfie-line);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 31, 64, .02);
}

.customer-message-card {
  min-height: 129px;
  padding: 16px;
}

.customer-message-card header {
  display: flex;
  align-items: center;
}

.customer-message-card img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 10px;
}

.customer-message-card header > span {
  display: grid;
  flex: 1;
}

.customer-message-card strong {
  font-size: 11px;
}

.customer-message-card small,
.customer-message-card time {
  color: #748199;
  font-size: 9px;
}

.customer-message-card p {
  margin: 17px 0 0;
  color: #27344c;
  font-size: 11px;
  line-height: 1.65;
}

.ai-response-card {
  margin-top: 19px;
  padding: 15px 14px 12px;
  min-height: 378px;
}

.ai-response-card > header {
  display: flex;
  align-items: center;
  height: 31px;
  gap: 7px;
}

.ai-spark {
  color: #2b61ff;
  font-size: 24px;
}

.ai-response-card header strong {
  font-size: 12px;
}

.ai-response-card header small {
  color: #6f7b90;
  font-size: 11px;
}

.ai-response-copy {
  min-height: 279px;
  margin-top: 11px;
  padding: 12px;
  border: 1px solid #dfe4ed;
  border-radius: 6px;
  color: #27344c;
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.ai-response-card > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
}

.ai-confidence {
  padding: 6px 10px;
  border-radius: 20px;
  background: #f6f8fb;
  color: #728099;
  font-size: 9px;
}

.ai-response-card footer > div {
  display: flex;
  gap: 8px;
}

.ai-response-card footer form {
  margin: 0;
}

.regenerate-button,
.send-ai-button {
  height: 36px;
  border-radius: 8px;
  padding: 0 13px;
  font-size: 10px;
}

.regenerate-button {
  border: 1px solid var(--ryfie-line);
  background: #fff;
  color: #27344c;
}

.send-ai-button {
  border: 0;
  background: #2858f6;
  color: #fff;
  font-weight: 600;
}

.send-ai-button span {
  margin-left: 14px;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, .3);
}

.reply-composer {
  margin: 27px 0 0;
  min-height: 188px;
  box-shadow: none;
}

.composer-tabs {
  height: 42px;
  padding: 0 14px;
  gap: 20px;
}

.composer-tabs button {
  height: 42px;
  font-size: 10px;
}

.composer-tabs .context-action-pills {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.composer-tabs .context-action-pills::-webkit-scrollbar { display: none; }
.composer-tabs .context-action-pill {
  height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 0 10px;
  border: 1px solid #dce2ff;
  border-radius: 999px;
  background: #f5f7ff;
  color: #3449c8;
  font: 750 9px "Urbanist", sans-serif;
}
.composer-tabs .context-action-pill::after { display: none; }
.composer-tabs .context-action-pill span { color: #5b63ff; font-size: 11px; }
.composer-tabs .context-action-pill:hover { border-color: #9fabff; background: #ecefff; }
.composer-tabs .context-action-pill.analyze { border-style: dashed; background: #fff; color: #5f6b80; }
.composer-ai-outcome { margin: 12px 0 0; }

.action-explainer-dialog { place-items: center; padding: 0; }
.action-explainer-dialog > section { width: min(450px, calc(100vw - 32px)); }
.action-explainer-dialog section > header {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #e8ebf1;
}
.action-explainer-dialog section > header > div { display: flex; align-items: center; gap: 11px; }
.action-explainer-dialog section > header > div > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f5ff7, #7658e8);
  color: #fff;
  font-size: 15px;
}
.action-explainer-dialog header small { color: #6d7890; font-size: 8px; font-weight: 800; letter-spacing: .08em; }
.action-explainer-dialog header h3 { margin: 3px 0 0; color: #152039; font-size: 15px; }
.action-explainer-dialog header > button { border: 0; background: transparent; color: #67748b; font-size: 22px; cursor: pointer; }
.action-explainer-body { display: grid; gap: 12px; padding: 18px; }
.action-explainer-body > p { margin: 0; color: #3d4960; font-size: 12px; line-height: 1.5; }
.action-explainer-body > div { display: grid; gap: 5px; padding: 11px; border-radius: 9px; background: #f6f8fb; }
.action-explainer-body > div > strong { color: #617087; font-size: 9px; text-transform: uppercase; }
.action-explainer-body > div > span:not(.action-policy) { color: #313e55; font-size: 11px; line-height: 1.45; }
.action-explainer-body > small { color: #778399; font-size: 9px; line-height: 1.45; }
.action-explainer-dialog section > footer { min-height: 62px; display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 12px 18px; border-top: 1px solid #e8ebf1; }
.action-explainer-dialog footer form { margin: 0; }
.action-explainer-dialog footer button { min-height: 35px; padding: 0 13px; border: 1px solid #dfe4ed; border-radius: 8px; background: #fff; color: #536076; font: 750 10px "Urbanist", sans-serif; cursor: pointer; }
.action-explainer-dialog footer .button { border-color: #485bff; background: #485bff; color: #fff; }

html[data-theme="dark"] .composer-tabs .context-action-pill { border-color: #465688; background: #1d2942; color: #bac4ff; }
html[data-theme="dark"] .composer-tabs .context-action-pill.analyze { background: #152136; color: #aeb9cc; }
html[data-theme="dark"] .action-explainer-dialog > section { background: #111c2e; border-color: #33435d; }
html[data-theme="dark"] .action-explainer-dialog section > header,
html[data-theme="dark"] .action-explainer-dialog section > footer { border-color: #2d3b52; }
html[data-theme="dark"] .action-explainer-dialog header h3 { color: #edf2fb; }
html[data-theme="dark"] .action-explainer-body > p,
html[data-theme="dark"] .action-explainer-body > div > span:not(.action-policy) { color: #bdc8d9; }
html[data-theme="dark"] .action-explainer-body > div { background: #1a2940; }
html[data-theme="dark"] .action-explainer-dialog footer button { border-color: #40506a; background: #18263b; color: #c4cedd; }
html[data-theme="dark"] .action-explainer-dialog footer .button { border-color: #6170ff; background: #5363f5; color: #fff; }

.reply-composer > textarea {
  height: 101px;
  padding: 14px;
  color: #22304a;
  font-size: 11px;
}

.composer-footer {
  height: 44px;
  border-top: 0;
  padding: 0 11px;
}

.composer-footer button {
  min-width: 29px;
  color: #43516b;
}

.composer-footer .composer-send {
  min-width: 104px;
  border-radius: 7px;
  background: #f6f7f9;
  color: #8791a4;
  font-size: 10px;
}

.ticket-bottom-actions {
  display: flex;
  gap: 10px;
  margin-top: 27px;
  padding-bottom: 18px;
}

.ticket-bottom-actions form {
  margin: 0;
}

.ticket-bottom-actions button {
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--ryfie-line);
  border-radius: 8px;
  background: #fff;
  color: #26344d;
  font-size: 10px;
}

.customer-context {
  border-color: var(--ryfie-line);
  background: #fff;
  overflow-y: auto;
}

/* Connected Shopify customer and order workspace */
.shopify-customer-hub,
.shopify-panel-order,
.shopify-no-orders {
  margin: 0 14px 14px;
  border: 1px solid #dfe5ef;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 7px 24px rgba(20, 36, 66, .045);
}
.shopify-customer-hub { padding: 15px; }
.shopify-customer-hub > header {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.shopify-customer-hub > header img { width: 32px; height: 32px; object-fit: contain; }
.shopify-customer-hub > header div { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 2px 8px; }
.shopify-customer-hub > header small { grid-column: 1 / -1; color: #7b879a; font-size: 9px; font-weight: 800; letter-spacing: .09em; }
.shopify-customer-hub > header strong { color: #192337; font-size: 16px; }
.shopify-customer-hub > header a { min-width: 0; overflow: hidden; color: #1857f1; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.shopify-customer-hub > header > span { padding: 4px 7px; border-radius: 999px; background: #e8f8ef; color: #158a58; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.shopify-hub-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.shopify-hub-metrics p { display: grid; gap: 3px; margin: 0; padding: 10px; border-radius: 9px; background: #f6f8fb; }
.shopify-hub-metrics span,
.shopify-hub-note > span,
.shopify-hub-tags > span { color: #748095; font-size: 10.5px; font-weight: 650; }
.shopify-hub-metrics b { color: #172237; font-size: 15px; }
.shopify-hub-note,
.shopify-hub-tags { margin-top: 13px; }
.shopify-hub-note p { margin: 4px 0 0; color: #435068; font-size: 12px; line-height: 1.45; }
.shopify-hub-tags > div { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.shopify-hub-tags i { padding: 5px 7px; border-radius: 6px; background: #eef3ff; color: #2054d9; font-size: 10.5px; font-style: normal; font-weight: 700; }
.shopify-hub-tags button { border: 0; background: transparent; color: #6f7e96; font: 600 11px "DM Sans", sans-serif; }
.shopify-panel-orders { display: grid; }
.shopify-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid #e5e9f0; border-bottom: 0; border-radius: 12px 12px 0 0; background: #fff; }
.shopify-panel-heading span { display: inline-flex; align-items: center; gap: 7px; color: #111827; font-size: 13px; font-weight: 750; }
.shopify-panel-heading img { width: 20px; height: 20px; object-fit: contain; }
.shopify-panel-heading button { border: 0; background: transparent; color: #3457f1; font: inherit; font-size: 12px; font-weight: 750; cursor: pointer; }
.shopify-panel-heading + .shopify-panel-order { border-radius: 0; }
.shopify-panel-order { overflow: clip; }
.shopify-panel-order > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 14px; cursor: pointer; list-style: none; }
.shopify-panel-order > summary::-webkit-details-marker { display: none; }
.shopify-panel-order > summary > div:first-child { display: grid; gap: 3px; min-width: 0; }
.shopify-panel-order > summary strong { color: #1558f5; font-size: 15.5px; }
.shopify-panel-order > summary span { color: #7b8799; font-size: 10.5px; }
.shopify-panel-order > summary > div:last-child { display: flex; align-items: center; justify-content: flex-end; gap: 5px; flex-wrap: wrap; }
.shopify-panel-order > summary i { padding: 4px 7px; border-radius: 999px; font-size: 9px; font-style: normal; font-weight: 800; text-transform: uppercase; }
.shopify-panel-order > summary .payment { background: #dcf8ed; color: #13875b; }
.shopify-panel-order > summary .fulfillment { background: #edf0f4; color: #687486; }
.shopify-panel-order > summary b { margin-left: 3px; color: #8b96a7; transition: transform .2s ease; }
.shopify-panel-order[open] > summary b { transform: rotate(180deg); }
.shopify-order-inline { border-top: 1px solid #e8ecf2; }
.shopify-inline-actions { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid #dfe5ed; background: #f6f7f9; }
.shopify-inline-actions button { min-width: 0; min-height: 40px; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 7px 4px; border: 0; border-right: 1px solid #dfe5ed; background: transparent; color: #26334a; font: 650 11.5px "DM Sans", sans-serif; }
.shopify-inline-actions button:last-child { border-right: 0; }
.shopify-inline-actions button:hover { background: #edf2ff; color: #174fe1; }
.shopify-order-inline > dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; padding: 14px; color: #6b778c; font-size: 11.5px; }
.shopify-order-inline > dl dd { margin: 0; color: #1e2a40; font-weight: 650; text-align: right; }
.shopify-inline-items,
.shopify-inline-note,
.shopify-inline-address { padding: 14px; border-top: 1px dashed #dbe1ea; }
.shopify-inline-items > header,
.shopify-inline-note > header,
.shopify-inline-address > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.shopify-inline-items > header strong,
.shopify-inline-note > header strong,
.shopify-inline-address > header strong { color: #1d293e; font-size: 12.5px; }
.shopify-inline-items > header span { color: #7d899b; font-size: 10.5px; }
.shopify-inline-note header button,
.shopify-inline-address header button { border: 0; background: transparent; color: #1857ed; font: 700 11px "DM Sans", sans-serif; }
.shopify-inline-items article { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; align-items: center; margin-top: 10px; }
.shopify-inline-items article > img,
.shopify-inline-items article > span { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.shopify-inline-items article > span { display: grid; place-items: center; background: #eff3f8; color: #43516a; font-size: 10px; font-weight: 800; }
.shopify-inline-items article > div { display: grid; min-width: 0; }
.shopify-inline-items article strong { overflow: hidden; color: #202b3f; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.shopify-inline-items article small { overflow: hidden; margin-top: 2px; color: #7a8799; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.shopify-inline-items article em { margin-top: 3px; color: #5d6a7e; font-size: 10.5px; font-style: normal; }
.shopify-inline-note p,
.shopify-inline-address p { margin: 0; color: #6b778b; font-size: 11.5px; line-height: 1.5; }
.shopify-inline-address address { display: grid; gap: 3px; color: #536076; font-size: 11.5px; font-style: normal; line-height: 1.4; }
.shopify-inline-address address b { color: #1d293d; }
.shopify-inline-tracking { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 14px; border-top: 1px dashed #dbe1ea; color: #6c788c; font-size: 11px; }
.shopify-inline-tracking strong { color: #1857ed; font-size: 11px; text-align: right; }
.shopify-no-orders { display: grid; justify-items: center; gap: 6px; padding: 25px; text-align: center; }
.shopify-no-orders img { width: 36px; height: 36px; }
.shopify-no-orders strong { color: #1c273b; font-size: 14px; }
.shopify-no-orders p { margin: 0; color: #758197; font-size: 11.5px; }
.shopify-no-orders form { margin: 7px 0 0; }
.shopify-no-orders button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: #315cf4; color: #fff; font: 750 11.5px "DM Sans", sans-serif; }

.app-dialog.shopify-inline-dialog { place-items: center; padding: 18px; overflow-y: auto; }
.shopify-inline-dialog > section { width: min(530px, calc(100vw - 28px)); max-height: calc(100vh - 36px); overflow-y: auto; }
.shopify-inline-dialog section > header { display: flex; align-items: center; justify-content: space-between; padding: 17px 18px; border-bottom: 1px solid #e6eaf1; }
.shopify-inline-dialog section > header > div { display: flex; align-items: center; gap: 11px; }
.shopify-inline-dialog section > header img { width: 30px; height: 30px; }
.shopify-inline-dialog section > header span { display: grid; gap: 2px; }
.shopify-inline-dialog section > header small { color: #738096; font-size: 9px; font-weight: 800; letter-spacing: .09em; }
.shopify-inline-dialog section > header h3 { margin: 0; color: #172237; font-size: 18px; }
.shopify-inline-dialog section > header > button { border: 0; background: transparent; color: #6f7b8e; font-size: 23px; }
.shopify-inline-dialog form { display: grid; gap: 13px; padding: 18px; }
.shopify-inline-dialog label { display: grid; gap: 6px; color: #4d5a70; font-size: 11.5px; font-weight: 700; }
.shopify-inline-dialog input,
.shopify-inline-dialog textarea { width: 100%; padding: 10px 11px; border: 1px solid #d8deea; border-radius: 8px; background: #fff; color: #172237; font: 12.5px "DM Sans", sans-serif; outline: none; }
.shopify-inline-dialog textarea { min-height: 88px; resize: vertical; }
.shopify-inline-dialog input:focus,
.shopify-inline-dialog textarea:focus { border-color: #4e72f8; box-shadow: 0 0 0 3px #e9eeff; }
.shopify-inline-dialog form > p { margin: 0; color: #6b778b; font-size: 11px; line-height: 1.5; }
.shopify-inline-dialog .action-policy { margin-right: 5px; }
.inline-field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shopify-inline-dialog footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 3px; }
.shopify-inline-dialog footer button { min-height: 38px; padding: 0 13px; border: 1px solid #d9dfeb; border-radius: 8px; background: #fff; color: #334057; font: 700 11.5px "DM Sans", sans-serif; }
.shopify-inline-dialog footer .button { border-color: #315cf4; background: #315cf4; color: #fff; }
.shopify-inline-dialog footer .danger { border-color: #d94d5a; background: #d94d5a; }
.shopify-inline-dialog footer button:disabled { opacity: .46; cursor: not-allowed; }

html[data-theme="dark"] .shopify-customer-hub,
html[data-theme="dark"] .shopify-panel-order,
html[data-theme="dark"] .shopify-panel-heading,
html[data-theme="dark"] .shopify-no-orders,
html[data-theme="dark"] .shopify-inline-dialog > section { border-color: #2a374c; background: #111c2d; color: #e7edf7; }
html[data-theme="dark"] .shopify-customer-hub strong,
html[data-theme="dark"] .shopify-panel-order > summary strong,
html[data-theme="dark"] .shopify-order-inline dd,
html[data-theme="dark"] .shopify-inline-items strong,
html[data-theme="dark"] .shopify-inline-note strong,
html[data-theme="dark"] .shopify-inline-address strong,
html[data-theme="dark"] .shopify-inline-address address b,
html[data-theme="dark"] .shopify-no-orders strong,
html[data-theme="dark"] .shopify-inline-dialog h3 { color: #f2f6fc; }
html[data-theme="dark"] .shopify-hub-metrics p,
html[data-theme="dark"] .shopify-inline-actions { background: #172438; }
html[data-theme="dark"] .shopify-inline-actions button,
html[data-theme="dark"] .shopify-inline-dialog input,
html[data-theme="dark"] .shopify-inline-dialog textarea,
html[data-theme="dark"] .shopify-inline-dialog footer button { border-color: #344259; background: #152237; color: #e6edf8; }
html[data-theme="dark"] .shopify-order-inline,
html[data-theme="dark"] .shopify-inline-items,
html[data-theme="dark"] .shopify-inline-note,
html[data-theme="dark"] .shopify-inline-address,
html[data-theme="dark"] .shopify-inline-tracking,
html[data-theme="dark"] .shopify-inline-dialog header { border-color: #2a374c; }

.customer-summary {
  position: relative;
  padding: 24px 16px 15px;
  border: 0;
}

.customer-name {
  align-items: flex-start;
  gap: 12px;
}

.customer-name > img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
}

.customer-name h3 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 5px;
  color: #111a2d;
  font: 700 12px "DM Sans";
}

.customer-name h3 span {
  margin-left: 8px;
  padding: 4px 8px;
  border-radius: 20px;
  background: #fff2d9;
  color: #c37a10;
  font-size: 9px;
  font-weight: 500;
}

.customer-name p {
  margin: 0 0 4px;
  color: #65728a;
  font-size: 9px;
}

.customer-stats {
  margin-top: 20px;
  border-color: var(--ryfie-line);
  border-radius: 8px;
}

.customer-stats > div {
  padding: 13px 6px;
  text-align: center;
}

.customer-stats strong {
  order: -1;
  color: #111a2d;
  font-size: 14px;
}

.customer-stats span {
  color: #66738b;
  font-size: 9px;
}

.customer-timeline,
.context-tags,
.customer-notes {
  padding: 16px;
  border-top: 1px solid var(--ryfie-line);
}

.customer-timeline header,
.context-tags header,
.customer-notes header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.customer-timeline h3,
.context-tags h3,
.customer-notes h3,
.shopify-order-card h3 {
  margin: 0;
  color: #111a2d;
  font-size: 12px;
}

.customer-timeline a,
.context-tags header button,
.customer-notes header button {
  border: 0;
  background: transparent;
  color: #1558f6;
  font-size: 9px;
}

.customer-timeline ol {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.customer-timeline li {
  min-height: 49px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #33415a;
}

.customer-timeline li > span {
  width: 17px;
  color: #253654;
  font-size: 15px;
}

.customer-timeline li > div {
  display: grid;
  flex: 1;
}

.customer-timeline li strong {
  font-size: 10px;
  font-weight: 500;
}

.customer-timeline li small {
  margin-top: 4px;
  color: #73809a;
  font-size: 9px;
}

.customer-timeline li b {
  color: #1b2941;
  font-size: 10px;
  font-weight: 500;
}

.shopify-order-card {
  margin: 0 16px 12px;
  padding: 14px 12px;
  border: 1px solid var(--ryfie-line);
  border-radius: 8px;
}

.shopify-order-card > header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shopify-order-card header h3 {
  flex: 1;
}

.shopify-order-card header span {
  padding: 5px 10px;
  border-radius: 20px;
  background: #e7f7ee;
  color: #16945a;
  font-size: 9px;
}

.shopify-order-card header button {
  border: 0;
  background: transparent;
}

.shopify-order-card dl {
  display: grid;
  grid-template-columns: 85px 1fr;
  row-gap: 14px;
  margin: 16px 0 0;
  font-size: 9px;
}

.shopify-order-card dt {
  color: #526079;
}

.shopify-order-card dd {
  margin: 0;
  color: #1e2b42;
}

.shopify-order-card .order-product {
  padding: 0 0 15px;
  gap: 12px;
}

.shopify-order-card .order-product > span {
  width: 53px;
  height: 58px;
  background: #f5f6f8;
}

.shopify-order-card .order-product strong {
  font-size: 10px;
}

.shopify-order-card .order-product small {
  margin-top: 4px;
  color: #1e2b42;
  font-size: 9px;
}

.order-tracking {
  display: flex;
  justify-content: space-between;
  padding-top: 11px;
  border-top: 1px solid var(--ryfie-line);
  color: #53617a;
  font-size: 9px;
}

.order-tracking a {
  max-width: 180px;
  color: #165cff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-tags > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.context-tags > div span {
  padding: 5px 8px;
  border-radius: 5px;
  background: #f0eefb;
  color: #584e84;
  font-size: 9px;
}

.context-tags > div span:first-child {
  background: #fff1d8;
  color: #b86e0c;
}

.context-tags > div button {
  width: 24px;
  height: 24px;
  border: 1px solid var(--ryfie-line);
  border-radius: 50%;
  background: #fff;
}

.customer-notes p {
  margin: 11px 0 0;
  color: #69768e;
  font-size: 9px;
}

.integration-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 19px;
  padding-top: 20px;
  border-left: 1px solid var(--ryfie-line);
  background: #fff;
}

.integration-rail a,
.integration-rail button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #13213a;
  font-size: 15px;
}

.integration-rail .shopify {
  background: #78b84b;
  color: #fff;
  font-weight: 800;
}

.floating-ai {
  position: fixed;
  right: 18px;
  bottom: 17px;
  z-index: 40;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, #7542fa, #5229e9);
  color: #fff;
  font-size: 21px;
  box-shadow: 0 10px 25px rgba(89, 48, 231, .32);
}

.inbox-toast {
  top: 94px;
  background: #0b1f43;
}

.customer-name h3 > img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.customer-shopify-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 0 8px;
}
.customer-shopify-tags span {
  padding: 4px 7px;
  border-radius: 6px;
  background: #eef3ff;
  color: #2456d6;
  font-size: 10.5px;
  font-weight: 750;
}
.customer-shopify-tags button {
  padding: 4px 5px;
  color: #66748a;
  font-size: 10.5px;
  font-weight: 700;
}
.customer-summary .context-tag-menu { top: 50px; right: 14px; left: auto; width: 250px; }

.inbox-toast.error {
  background: #9f3434;
}

@media (max-width: 1250px) {
  .helpdesk-inbox {
    grid-template-columns: 280px minmax(480px, 1fr) 310px 48px;
  }
  .topbar-tenant {
    width: 235px;
  }
  .topbar-actions > span,
  .topbar-actions > img,
  .profile-chevron {
    display: none;
  }
}

@media (max-width: 1080px) {
  .customer-context,
  .integration-rail {
    display: none;
  }
  .helpdesk-inbox {
    grid-template-columns: 285px minmax(480px, 1fr);
  }
  .global-search {
    margin-left: 230px;
  }
}

@media (max-width: 760px) {
  .helpdesk-sidebar {
    display: none;
  }
  .helpdesk-app-main {
    margin-left: 0;
  }
  .helpdesk-topbar {
    justify-content: flex-start;
  }
  .topbar-tenant {
    position: static;
    width: 220px;
  }
  .topbar-actions,
  .global-search {
    display: none !important;
  }
  .helpdesk-inbox {
    display: block;
  }
  .conversation-queue {
    height: 100%;
  }
}

/* Readable scale pass */
.helpdesk-sidebar { width: 220px; }
.helpdesk-app-main { margin-left: 220px; }
.helpdesk-nav a { height: 37px; font-size: 14px; }
.helpdesk-nav .nav-label { font-size: 11px; }
.helpdesk-nav a em { font-size: 12px; }
.sidebar-usage small,
.sidebar-usage div { font-size: 11px; }
.helpdesk-sidebar .sidebar-account strong { font-size: 13px; }
.helpdesk-sidebar .sidebar-account small { font-size: 10px; }
.topbar-tenant strong,
.topbar-copilot { font-size: 13px; }
.global-search { font-size: 12.5px; }
.topbar-actions > span strong { font-size: 12px; }
.topbar-actions > span small { font-size: 11px; }
.helpdesk-inbox {
  grid-template-columns: clamp(305px, 21vw, 330px) minmax(500px, 1fr) clamp(335px, 23.5vw, 365px) 54px;
}
.queue-header h1 { font-size: 20px; }
.queue-header button { font-size: 12px; }
.queue-item { min-height: 112px; padding: 18px 20px; }
img.queue-avatar { width: 40px; height: 40px; }
.queue-person strong { font-size: 14px; }
.queue-person time { font-size: 11px; }
.queue-subject { margin: 7px 0 8px; font-size: 12.5px; }
.queue-meta em { font-size: 15px; }
.queue-meta i { font-size: 10.5px; }
.ticket-header h2 { font-size: 20px; }
.ticket-header p span { font-size: 10.5px; }
.customer-message-card strong { font-size: 13px; }
.customer-message-card small,
.customer-message-card time { font-size: 11px; }
.customer-message-card p { font-size: 13px; }
.ai-response-card header strong { font-size: 14px; }
.ai-response-card header small { font-size: 12px; }
.ai-response-copy { font-size: 13px; line-height: 1.65; }
.ai-confidence { font-size: 10.5px; }
.regenerate-button,
.send-ai-button { height: 39px; font-size: 12px; }
.composer-tabs button { font-size: 12px; }
.reply-composer > textarea { font-size: 13px; }
.composer-footer .composer-send,
.ticket-bottom-actions button { font-size: 11.5px; }
.customer-name h3,
.customer-timeline h3,
.context-tags h3,
.customer-notes h3,
.shopify-order-card h3 { font-size: 13.5px; }
.customer-name p,
.customer-name h3 span,
.customer-stats span,
.customer-timeline li small,
.shopify-order-card dl,
.order-tracking,
.context-tags > div span,
.customer-notes p { font-size: 10.5px; }
.customer-timeline li strong,
.customer-timeline li b,
.shopify-order-card .order-product strong { font-size: 11.5px; }
.integration-rail a,
.integration-rail button { width: 32px; height: 32px; font-size: 17px; }

/* Full helpdesk sections */
.helpdesk-section-page {
  height: calc(100vh - 72px);
  overflow-y: auto;
  padding: 34px 38px 70px;
  background: #f7f9fc;
  color: var(--ryfie-text);
}
.section-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  max-width: 1320px;
  margin: 0 auto 28px;
}
.section-page-head p {
  margin: 0 0 7px;
  color: #6e7b92;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .11em;
}
.section-page-head h1 {
  margin: 0 0 8px;
  color: #101a2e;
  font: 700 32px "DM Sans", sans-serif;
  letter-spacing: -.035em;
}
.section-page-head span {
  color: #68758b;
  font-size: 14px;
}
.section-page-head > a {
  padding: 12px 17px;
  border-radius: 8px;
  background: var(--ryfie-blue);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.section-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 1320px;
  margin: 0 auto 20px;
}
.section-metrics article {
  display: grid;
  gap: 6px;
  padding: 20px 22px;
  border: 1px solid var(--ryfie-line);
  border-radius: 11px;
  background: #fff;
}
.section-metrics span { color: #68758b; font-size: 12px; }
.section-metrics strong { color: #101a2e; font-size: 26px; }
.section-metrics small { color: #8590a3; font-size: 11px; }
.section-table-card,
.customer-directory,
.product-directory,
.automation-grid,
.knowledge-grid,
.settings-directory,
.analytics-hero {
  max-width: 1320px;
  margin: 0 auto;
}
.section-table-card {
  overflow: hidden;
  border: 1px solid var(--ryfie-line);
  border-radius: 11px;
  background: #fff;
}
.section-table-card > header {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--ryfie-line);
}
.section-table-card h2 { margin: 0; font-size: 17px; }
.section-table-card label {
  width: 280px;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--ryfie-line);
  border-radius: 8px;
  color: #7a879b;
}
.section-table-card input { width: 100%; border: 0; outline: 0; font-size: 12px; }
.section-table-head,
.section-table-row {
  display: grid;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
}
.section-orders .section-table-head,
.section-orders .section-table-row { grid-template-columns: .65fr 1.2fr 1.4fr .75fr .55fr 24px; }
.section-subscriptions .section-table-head,
.section-subscriptions .section-table-row { grid-template-columns: 1fr 1.4fr .55fr 1fr 24px; }
.section-table-head {
  height: 43px;
  background: #f7f9fc;
  color: #78859a;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.section-table-row {
  min-height: 68px;
  border-top: 1px solid #edf0f5;
  color: #344159;
  font-size: 13px;
}
.section-table-row:hover { background: #f8faff; }
.section-table-row > span { display: grid; }
.section-table-row small { margin-top: 3px; color: #8490a4; font-size: 10px; }
.section-table-row i,
.healthy-chip {
  width: max-content;
  padding: 5px 8px;
  border-radius: 20px;
  background: #e7f7ee;
  color: #168e58;
  font-size: 10px;
  font-style: normal;
}
.section-table-row b { color: #17233a; font-weight: 600; }
.section-table-row em { color: var(--ryfie-blue); font-size: 18px; font-style: normal; }
.customer-directory,
.product-directory { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.customer-directory > a,
.product-directory > article,
.automation-grid > article,
.knowledge-grid > article,
.settings-directory > a {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  border: 1px solid var(--ryfie-line);
  border-radius: 11px;
  background: #fff;
  color: #26334b;
}
.customer-directory > a > span,
.product-directory article > div,
.settings-directory i {
  width: 48px;
  height: 48px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eaf0ff;
  color: var(--ryfie-blue);
  font-size: 14px;
  font-style: normal;
  font-weight: 800;
}
.customer-directory div,
.settings-directory div { min-width: 0; flex: 1; }
.customer-directory h2,
.product-directory h2,
.automation-grid h2,
.knowledge-grid h2,
.settings-directory h2 { margin: 0 0 5px; font-size: 15px; }
.customer-directory p,
.product-directory p,
.automation-grid p,
.knowledge-grid p,
.settings-directory p { margin: 0; color: #6d7990; font-size: 12px; line-height: 1.5; }
.customer-directory small { display: block; margin-top: 5px; color: #8490a4; font-size: 11px; }
.customer-directory b,
.settings-directory b { margin-left: auto; color: var(--ryfie-blue); }
.product-directory article { align-items: flex-start; }
.product-directory article > div { border-radius: 10px; background: #eef3e9; color: #567544; }
.product-directory article > span { min-width: 0; flex: 1; }
.product-directory article small { color: #7d899c; font-size: 10px; letter-spacing: .09em; }
.product-directory article a { align-self: center; color: var(--ryfie-blue); font-size: 12px; font-weight: 700; }
.automation-grid,
.knowledge-grid,
.settings-directory { display: grid; gap: 12px; }
.automation-grid > article i { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 9px; background: #eaf0ff; color: var(--ryfie-blue); font-size: 18px; font-style: normal; }
.automation-grid > article div,
.knowledge-grid > article div { flex: 1; }
.automation-grid > article > span { color: #168e58; font-size: 11px; font-weight: 700; }
.knowledge-grid code { min-width: 75px; color: var(--ryfie-blue); font-size: 14px; font-weight: 800; }
.knowledge-grid > article > span { color: #78859a; font-size: 11px; }
.settings-directory { grid-template-columns: repeat(2, 1fr); }
.analytics-hero {
  display: grid;
  grid-template-columns: .7fr 1.3fr;
  gap: 30px;
  min-height: 260px;
  margin-bottom: 20px;
  padding: 30px;
  border-radius: 14px;
  background: #071e43;
  color: #fff;
}
.analytics-hero > div:first-child { display: grid; align-content: center; }
.analytics-hero p { margin: 0; color: #9fb0cc; font-size: 11px; letter-spacing: .1em; }
.analytics-hero strong { font-size: 66px; letter-spacing: -.05em; }
.analytics-hero span { color: #c0cce0; font-size: 13px; }
.bar-chart { display: flex; align-items: flex-end; gap: 14px; padding: 25px; }
.bar-chart i { flex: 1; min-height: 20px; border-radius: 7px 7px 2px 2px; background: linear-gradient(180deg, #5d83ff, #2858f6); }

@media (max-width: 1250px) {
  .helpdesk-sidebar { width: 210px; }
  .helpdesk-app-main { margin-left: 210px; }
  .helpdesk-inbox { grid-template-columns: 300px minmax(480px, 1fr) 335px 50px; }
}
@media (max-width: 1050px) {
  .section-metrics,
  .customer-directory,
  .product-directory,
  .settings-directory { grid-template-columns: 1fr; }
  .helpdesk-section-page { padding-inline: 22px; }
}
@media (max-width: 760px) {
  .helpdesk-app-main { margin-left: 0; }
  .section-page-head { align-items: flex-start; flex-direction: column; gap: 18px; }
  .section-metrics { grid-template-columns: 1fr; }
  .section-table-card { overflow-x: auto; }
  .section-table { min-width: 760px; }
}

@media (max-width: 1400px) and (min-width: 1201px) {
  .integration-rail { display: none; }
  .helpdesk-inbox { grid-template-columns: 300px minmax(480px, 1fr) 330px; }
}
@media (max-width: 1200px) {
  .customer-context,
  .integration-rail { display: none; }
  .helpdesk-inbox { grid-template-columns: 315px minmax(500px, 1fr); }
}

/* Interactive workspace shell */
[data-menu][hidden],
.app-dialog[hidden],
.app-feedback[hidden] { display: none !important; }
.menu-anchor { position: relative; }
.topbar-tenant-wrap { position: absolute; left: 14px; }
.topbar-tenant-wrap .topbar-tenant { position: static; left: auto; }
.menu-chevron { margin-left: auto; }
.topbar-menu,
.queue-menu,
.ticket-menu {
  position: absolute;
  z-index: 120;
  min-width: 220px;
  padding: 8px;
  border: 1px solid #dfe4ed;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 16px 42px rgba(15, 31, 64, .16);
  color: #18243a;
}
.topbar-menu { top: calc(100% + 10px); right: 0; }
.workspace-menu { left: 0; right: auto; width: 280px; }
.compact-menu { width: 280px; }
.profile-menu { width: 210px; }
.topbar-menu p,
.queue-menu p,
.ticket-menu p {
  margin: 3px 8px 7px;
  color: #7a879a;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.topbar-menu a,
.topbar-menu form > button,
.queue-menu a,
.queue-menu > button,
.ticket-menu a,
.ticket-menu form > button {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #26344c;
  font: 500 12px "DM Sans", sans-serif;
  text-align: left;
}
.topbar-menu a:hover,
.topbar-menu form > button:hover,
.queue-menu a:hover,
.queue-menu > button:hover,
.ticket-menu a:hover,
.ticket-menu form > button:hover { background: #f1f5ff; color: #174eea; }
.topbar-menu a > span,
.topbar-menu form button > span { display: grid; }
.topbar-menu a small,
.topbar-menu form button small { margin-top: 3px; color: #7c899e; font-size: 10px; font-weight: 400; }
.topbar-menu a b,
.topbar-menu form button b,
.queue-menu a b { margin-left: auto; color: #2858f6; font-size: 10px; }
.workspace-menu form { margin: 0; }
.workspace-menu .menu-avatar { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 8px; background: #e9efff; color: #2858f6; font-weight: 800; }
.profile-menu form { margin: 0; border-top: 1px solid #edf0f5; }

.queue-controls { position: relative; }
.queue-menu { top: calc(100% + 8px); right: 0; }
.queue-menu a { justify-content: space-between; }
.queue-filter-menu { width: 210px; }
.ticket-actions { display: flex; align-items: center; }
.ticket-actions form { margin: 0; }
.ticket-actions button.active { color: #f2a516; }
.ticket-header-menu { top: calc(100% + 7px); right: 0; }
.ticket-menu { left: 0; width: 220px; }
.ticket-menu.align-right { left: auto; right: 0; }
.ticket-bottom-actions .ticket-menu { top: auto; bottom: 44px; }
.ticket-menu form { margin: 0; }
.tag-menu > form:first-of-type,
.context-tag-menu form { display: flex; gap: 6px; padding: 7px; }
.tag-menu input,
.context-tag-menu input {
  min-width: 0;
  flex: 1;
  height: 34px;
  padding: 0 9px;
  border: 1px solid #dfe4ed;
  border-radius: 7px;
  outline: none;
  font: 11px "DM Sans", sans-serif;
}
.tag-menu > form:first-of-type button,
.context-tag-menu form button { width: auto; min-height: 34px; background: #2858f6; color: #fff; }
.context-tags { position: relative; }
.context-tag-menu { top: 42px; right: 14px; left: auto; width: 230px; }

.persistent-integration-rail {
  position: fixed;
  z-index: 70;
  top: 72px;
  right: 0;
  bottom: 0;
  width: 54px;
  display: flex;
}
.persistent-integration-rail a.active { background: #eaf0ff; color: #2858f6; }
.persistent-integration-rail .shopify.active { background: #78b84b; color: #fff; box-shadow: 0 0 0 3px #e6f2dc; }
.rail-menu { top: auto; right: 45px; bottom: 12px; width: 220px; }
.helpdesk-inbox { width: calc(100% - 54px); grid-template-columns: clamp(305px, 21vw, 350px) minmax(520px, 1fr) clamp(350px, 24vw, 390px); }
.helpdesk-section-page { width: calc(100% - 54px); }

.app-dialog {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: start center;
  padding-top: 10vh;
}
.dialog-backdrop { position: absolute; inset: 0; border: 0; background: rgba(5, 16, 38, .42); backdrop-filter: blur(3px); }
.app-dialog > section { position: relative; width: min(640px, calc(100vw - 32px)); overflow: hidden; border: 1px solid #dfe4ed; border-radius: 15px; background: #fff; box-shadow: 0 28px 80px rgba(8, 25, 58, .3); }
.command-dialog section > header { height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid #e8ebf1; color: #738099; font-size: 20px; }
.command-dialog input { flex: 1; border: 0; outline: 0; color: #1b2942; font: 15px "DM Sans", sans-serif; }
.command-dialog kbd { padding: 5px 7px; border: 1px solid #dfe4ed; border-radius: 5px; color: #7a879a; font-size: 9px; }
.command-results { padding: 10px; }
.command-results > p { margin: 7px 10px; color: #7c899d; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.command-results a { display: grid; grid-template-columns: 34px 1fr; gap: 2px 10px; align-items: center; padding: 11px 12px; border-radius: 9px; color: #233149; }
.command-results a:hover { background: #f0f4ff; }
.command-results a > span { grid-row: 1 / span 2; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: #eaf0ff; color: #2858f6; }
.command-results b { font-size: 13px; }
.command-results small { color: #7d899c; font-size: 10px; }
.copilot-dialog { place-items: stretch end; padding: 0; }
.copilot-dialog > section { width: min(410px, calc(100vw - 20px)); height: 100vh; border-radius: 0; }
.copilot-dialog section > header { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid #e6eaf1; }
.copilot-dialog header > div { display: flex; align-items: center; gap: 12px; }
.copilot-dialog header i { width: 10px; height: 10px; border-radius: 50%; background: #31bd76; box-shadow: 0 0 0 6px #e4f7ed; }
.copilot-dialog header span { display: grid; }
.copilot-dialog header strong { font-size: 15px; }
.copilot-dialog header small { margin-top: 3px; color: #728097; font-size: 10px; }
.copilot-dialog header button { border: 0; background: transparent; font-size: 24px; }
.copilot-body { display: grid; gap: 10px; padding: 22px 18px; }
.copilot-body p { margin: 0 0 5px; color: #6b7890; font-size: 12px; }
.copilot-body a,
.copilot-body button { min-height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 0 15px; border: 1px solid #dfe4ed; border-radius: 10px; background: #fff; color: #26344c; font: 600 12px "DM Sans", sans-serif; text-align: left; }
.copilot-body a:hover,
.copilot-body button:hover { border-color: #9fb4ff; background: #f4f7ff; }
.copilot-body b { color: #2858f6; }
.iq-chat{height:calc(100vh - 76px);display:grid;grid-template-rows:minmax(0,1fr) auto auto auto;background:#f7f9fc}.iq-chat-messages{display:flex;flex-direction:column;gap:13px;overflow:auto;padding:20px}.iq-chat-message{display:flex;align-items:flex-start;gap:9px}.iq-chat-message>span{flex:0 0 32px;width:32px;height:32px;display:grid;place-items:center;border-radius:10px;background:#e8ecff;color:#344edf;font-size:13px;font-weight:800}.iq-chat-message.user{flex-direction:row-reverse}.iq-chat-message.user>span{background:#15223a;color:#fff;font-size:9px}.iq-chat-message>div{max-width:calc(100% - 40px);padding:12px 13px;border:1px solid #e0e5ee;border-radius:4px 13px 13px;background:#fff}.iq-chat-message.user>div{border-color:#315ff0;background:#315ff0;color:#fff;border-radius:13px 4px 13px 13px}.iq-chat-message strong{font-size:10px}.iq-chat-message p{margin:5px 0 0;font-size:12px;line-height:1.55}.iq-chat-message em{display:block;margin-top:9px;color:#7a8494;font-size:8px;font-style:normal}.iq-chat-cards{display:grid;gap:6px;margin-top:10px}.iq-chat-cards a{display:grid;gap:2px;padding:9px;border:1px solid #e0e4ec;border-radius:8px;background:#f8f9fc;color:#27334a}.iq-chat-cards b{font-size:10px}.iq-chat-cards small{color:#738095;font-size:9px;line-height:1.35}.iq-chat-prompts{display:flex;gap:6px;overflow:auto;padding:8px 16px}.iq-chat-prompts button{flex:none;padding:7px 9px;border:1px solid #dbe1eb;border-radius:999px;background:#fff;color:#536078;font:700 9px 'Urbanist',sans-serif}.iq-chat>form{display:grid;grid-template-columns:minmax(0,1fr) 42px;gap:8px;margin:0 16px 12px;padding:8px;border:1px solid #d7deea;border-radius:13px;background:#fff;box-shadow:0 9px 28px rgba(28,43,74,.09)}.iq-chat textarea{resize:none;border:0;outline:0;padding:7px;color:#1f2b42;font:500 12px/1.45 'Urbanist',sans-serif}.iq-chat form button{width:40px;height:40px;align-self:end;border:0;border-radius:10px;background:#4f5ff7;color:#fff;font-size:16px}.iq-chat>footer{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:0 16px 14px;color:#7d8797;font-size:8px}.iq-chat>footer a{color:#4054db;font-weight:800}html[data-theme="dark"] .iq-chat{background:#0c1422}html[data-theme="dark"] .iq-chat-message>div,html[data-theme="dark"] .iq-chat-prompts button,html[data-theme="dark"] .iq-chat>form{background:#172235;border-color:#344157;color:#e7edf7}html[data-theme="dark"] .iq-chat textarea{background:transparent;color:#e7edf7}
.notes-dialog { place-items: center; padding: 0; }
.notes-dialog > section { width: min(520px, calc(100vw - 32px)); padding: 20px; }
.notes-dialog header { display: flex; align-items: center; justify-content: space-between; }
.notes-dialog h3 { margin: 0; font-size: 17px; }
.notes-dialog header button { border: 0; background: transparent; font-size: 22px; }
.notes-dialog textarea { width: 100%; height: 130px; margin-top: 17px; padding: 12px; border: 1px solid #dfe4ed; border-radius: 9px; resize: vertical; font: 13px/1.5 "DM Sans", sans-serif; }
.notes-dialog footer { display: flex; justify-content: flex-end; gap: 9px; margin-top: 14px; }
.notes-dialog footer button { height: 38px; padding: 0 14px; border: 1px solid #dfe4ed; border-radius: 8px; background: #fff; }
.notes-dialog footer button:last-child { border-color: #2858f6; background: #2858f6; color: #fff; }
.app-feedback { position: fixed; z-index: 400; right: 74px; bottom: 22px; max-width: 360px; padding: 12px 16px; border-radius: 9px; background: #0b1f43; color: #fff; font-size: 12px; box-shadow: 0 12px 30px rgba(8, 25, 58, .25); }

@media (min-width: 1600px) {
  .helpdesk-sidebar { width: 250px; }
  .helpdesk-app-main { margin-left: 250px; }
  .helpdesk-sidebar-head,
  .helpdesk-topbar { height: 82px; }
  .helpdesk-nav { padding: 15px 13px 6px; }
  .helpdesk-nav a { height: 40px; padding-inline: 13px; font-size: 15px; }
  .helpdesk-nav .nav-label { margin-top: 17px; font-size: 12px; }
  .helpdesk-nav a em { font-size: 13px; }
  .helpdesk-sidebar .sidebar-account { min-height: 68px; }
  .sidebar-usage small,
  .sidebar-usage div { font-size: 12px; }
  .helpdesk-sidebar .sidebar-account strong { font-size: 14px; }
  .helpdesk-sidebar .sidebar-account small { font-size: 11px; }
  .topbar-tenant-wrap { left: 20px; }
  .topbar-tenant { width: 300px; height: 52px; }
  .topbar-tenant strong,
  .topbar-copilot { font-size: 14px; }
  .global-search { width: min(500px, 32vw); height: 50px; font-size: 14px; }
  .topbar-copilot { height: 50px; }
  .topbar-actions > span strong { font-size: 13px; }
  .topbar-actions > span small { font-size: 12px; }
  .persistent-integration-rail { top: 82px; width: 64px; gap: 22px; padding-top: 24px; }
  .integration-rail a,
  .integration-rail button { width: 38px; height: 38px; font-size: 18px; }
  .helpdesk-inbox { height: calc(100vh - 82px); width: calc(100% - 64px); grid-template-columns: clamp(350px, 22vw, 390px) minmax(600px, 1fr) clamp(395px, 25vw, 445px); }
  .helpdesk-section-page { height: calc(100vh - 82px); width: calc(100% - 64px); padding: 42px 48px 80px; }
  .queue-header { height: 80px; padding-inline: 24px; }
  .queue-header h1 { font-size: 23px; }
  .queue-header button { height: 40px; font-size: 13px; }
  .queue-item { min-height: 122px; padding: 20px 22px; }
  img.queue-avatar { width: 44px; height: 44px; }
  .queue-person strong { font-size: 15px; }
  .queue-person time { font-size: 12px; }
  .queue-subject { font-size: 14px; }
  .queue-meta i { font-size: 11.5px; }
  .ticket-header { height: 96px; padding-inline: 26px; }
  .ticket-header h2 { font-size: 23px; }
  .ticket-header p span { font-size: 11.5px; }
  .ticket-scroll { padding: 22px; }
  .customer-message-card { padding: 19px; }
  .customer-message-card strong { font-size: 14px; }
  .customer-message-card small,
  .customer-message-card time { font-size: 12px; }
  .customer-message-card p,
  .ai-response-copy,
  .reply-composer > textarea { font-size: 14px; }
  .ai-response-card header strong { font-size: 15px; }
  .ai-response-card header small { font-size: 13px; }
  .composer-tabs button,
  .ticket-bottom-actions button { font-size: 13px; }
  .customer-summary { padding: 28px 20px 18px; }
  .customer-name h3,
  .customer-timeline h3,
  .context-tags h3,
  .customer-notes h3,
  .shopify-order-card h3 { font-size: 15px; }
  .customer-name p,
  .customer-name h3 span,
  .customer-stats span,
  .customer-timeline li small,
  .shopify-order-card dl,
  .order-tracking,
  .context-tags > div span,
  .customer-notes p { font-size: 12px; }
  .customer-timeline li strong,
  .customer-timeline li b,
  .shopify-order-card .order-product strong { font-size: 13px; }
  .section-page-head,
  .section-metrics,
  .section-table-card,
  .customer-directory,
  .product-directory,
  .automation-grid,
  .knowledge-grid,
  .settings-directory,
  .analytics-hero { max-width: 1500px; }
  .section-page-head h1 { font-size: 38px; }
  .section-page-head span { font-size: 16px; }
  .section-metrics article { padding: 24px 26px; }
  .section-metrics span { font-size: 14px; }
  .section-metrics strong { font-size: 31px; }
  .section-table-row { min-height: 76px; font-size: 15px; }
  .customer-directory h2,
  .product-directory h2,
  .automation-grid h2,
  .knowledge-grid h2,
  .settings-directory h2 { font-size: 17px; }
  .customer-directory p,
  .product-directory p,
  .automation-grid p,
  .knowledge-grid p,
  .settings-directory p { font-size: 14px; }
}

@media (max-width: 1400px) and (min-width: 761px) {
  .persistent-integration-rail { display: flex; }
  .helpdesk-inbox { width: calc(100% - 54px); }
  .helpdesk-section-page { width: calc(100% - 54px); }
}
@media (max-width: 1200px) and (min-width: 761px) {
  .persistent-integration-rail { display: flex; }
  .helpdesk-inbox { grid-template-columns: 315px minmax(500px, 1fr); }
}
@media (max-width: 760px) {
  .persistent-integration-rail { display: none; }
  .helpdesk-inbox,
  .helpdesk-section-page { width: 100%; }
}

/* Comfortable desktop typography begins at standard large-monitor widths. */
@media (min-width: 1440px) {
  .helpdesk-sidebar { width: 235px; }
  .helpdesk-app-main { margin-left: 235px; }
  .helpdesk-sidebar-head,
  .helpdesk-topbar { height: 78px; }
  .helpdesk-nav a { height: 39px; font-size: 15.5px; }
  .helpdesk-nav .nav-label { font-size: 12px; }
  .helpdesk-nav a em { font-size: 13px; }
  .sidebar-usage small,
  .sidebar-usage div { font-size: 12px; }
  .helpdesk-sidebar .sidebar-account strong { font-size: 14px; }
  .helpdesk-sidebar .sidebar-account small { font-size: 11px; }
  .topbar-tenant strong,
  .topbar-copilot { font-size: 14.5px; }
  .global-search { font-size: 14px; }
  .topbar-actions > span strong { font-size: 14px; }
  .topbar-actions > span small { font-size: 12px; }
  .persistent-integration-rail { top: 78px; }
  .helpdesk-inbox { height: calc(100vh - 78px); }
  .helpdesk-section-page { height: calc(100vh - 78px); }
  .queue-header h1 { font-size: 23px; }
  .queue-header button { font-size: 13.5px; }
  .queue-person strong { font-size: 16px; }
  .queue-person time { font-size: 12px; }
  .queue-subject { font-size: 14.5px; }
  .queue-meta i { font-size: 11.5px; }
  .ticket-header h2 { font-size: 23px; }
  .ticket-header p span { font-size: 11.5px; }
  .customer-message-card strong { font-size: 14.5px; }
  .customer-message-card small,
  .customer-message-card time { font-size: 12px; }
  .customer-message-card p,
  .ai-response-copy,
  .reply-composer > textarea { font-size: 14.5px; }
  .ai-response-card header strong { font-size: 15.5px; }
  .ai-response-card header small { font-size: 13px; }
  .ai-confidence { font-size: 11.5px; }
  .regenerate-button,
  .send-ai-button,
  .composer-tabs button,
  .composer-footer .composer-send,
  .ticket-bottom-actions button { font-size: 13px; }
  .customer-name h3,
  .customer-timeline h3,
  .context-tags h3,
  .customer-notes h3,
  .shopify-order-card h3 { font-size: 15.5px; }
  .customer-name p,
  .customer-name h3 span,
  .customer-stats span,
  .customer-timeline li small,
  .shopify-order-card dl,
  .order-tracking,
  .context-tags > div span,
  .customer-notes p { font-size: 12px; }
  .customer-timeline li strong,
  .customer-timeline li b,
  .shopify-order-card .order-product strong { font-size: 13px; }
  .topbar-menu a,
  .topbar-menu form > button,
  .queue-menu a,
  .queue-menu > button,
  .ticket-menu a,
  .ticket-menu form > button { font-size: 13.5px; }
  .section-page-head h1 { font-size: 38px; }
  .section-page-head span { font-size: 16px; }
  .section-metrics span { font-size: 14px; }
  .section-metrics strong { font-size: 31px; }
  .section-metrics small { font-size: 12px; }
  .section-table-head { font-size: 12px; }
  .section-table-row { font-size: 15px; }
  .customer-directory h2,
  .product-directory h2,
  .automation-grid h2,
  .knowledge-grid h2,
  .settings-directory h2 { font-size: 17px; }
  .customer-directory p,
  .product-directory p,
  .automation-grid p,
  .knowledge-grid p,
  .settings-directory p { font-size: 14px; }
}

@media (min-width: 1440px) and (max-width: 1599px) {
  .helpdesk-inbox { grid-template-columns: 330px minmax(470px, 1fr) 350px; }
}

@media (min-width: 1600px) {
  .helpdesk-sidebar { width: 260px; }
  .helpdesk-app-main { margin-left: 260px; }
  .helpdesk-nav a { font-size: 16px; }
  .queue-person strong { font-size: 16.5px; }
  .queue-subject,
  .customer-message-card p,
  .ai-response-copy,
  .reply-composer > textarea { font-size: 15px; }
  .customer-name h3,
  .customer-timeline h3,
  .context-tags h3,
  .customer-notes h3,
  .shopify-order-card h3 { font-size: 16px; }
}

/* Premium inbox refinement based on the approved four-panel mockup. */
.helpdesk-inbox { grid-template-rows: minmax(0, 1fr); background: #fbfcfe; }
.conversation-queue,
.ticket-workspace,
.customer-context { background: #fff; }
.queue-search {
  min-height: 44px;
  margin: 0 14px 12px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #dfe4ec;
  border-radius: 10px;
  background: #fbfcfe;
  color: #748096;
}
.queue-search span { font-size: 18px; }
.queue-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: #1c2940;
  font-size: 14px;
}
.queue-search kbd {
  padding: 4px 6px;
  border: 1px solid #e1e5ec;
  border-radius: 5px;
  background: #f1f3f6;
  color: #748096;
  font-size: 10px;
}
.queue-item { transition: background .16s ease, box-shadow .16s ease; }
.queue-item.active {
  margin: 0 7px;
  border: 1px solid #7567ff;
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(66, 69, 153, .08);
}
.ticket-workspace { min-width: 0; min-height: 0; height: 100%; overflow: hidden; }
.ticket-scroll { min-height: 0; background: #fcfdff; }
.customer-message-card { max-width: 76%; border-radius: 13px; }
.ai-response-card {
  max-width: 88%;
  margin-left: auto;
  border-color: #ded7ff;
  border-radius: 14px;
  background: linear-gradient(145deg, #fbf9ff, #f7fffb);
  box-shadow: 0 10px 26px rgba(79, 75, 164, .07);
}
.reply-composer { border-radius: 13px; box-shadow: 0 10px 28px rgba(26, 39, 69, .08); }
.ticket-workspace > .reply-composer {
  flex: 0 0 auto;
  margin: 0 20px 16px;
  background: #fff;
}
.ticket-workspace > .ai-guidance-card {
  flex: 0 0 auto;
  width: auto;
  max-width: none;
  min-height: 0;
  margin: 10px 20px;
  padding: 14px 16px 12px;
  border-radius: 13px;
}
.ai-guidance-card > header { height: auto; align-items: flex-start; }
.ai-guidance-card > header > span:last-child { display: grid; gap: 2px; }
.ai-guidance-card > header strong { color: #18233a; font-size: 15px; }
.ai-guidance-card > header small { color: #7e6c2c; font-size: 12px; }
.ai-guidance-card .ai-spark { color: #2858f6; }
.ai-guidance-card .ai-response-copy {
  min-height: 0;
  max-height: 88px;
  overflow: hidden;
  margin-top: 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 14.5px;
  line-height: 1.5;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}
.ai-response-preview {
  width: 100%;
  position: relative;
  display: block;
  margin: 0;
  padding: 0 0 30px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.ai-response-preview:hover .ai-response-view,
.ai-response-preview:focus-visible .ai-response-view { color: #244fe1; }
.ai-response-preview:focus-visible { outline: 3px solid rgba(40,88,246,.18); outline-offset: 4px; border-radius: 8px; }
.ai-response-view {
  position: absolute;
  right: 0;
  bottom: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #5e520f;
  font-size: 11px;
  transition: color .15s ease;
}
.ai-response-view i { color: #2858f6; font-size: 13px; font-style: normal; }
.ai-recommendation-dialog { place-items: center; padding: 18px; }
.ai-recommendation-dialog > section { width: min(680px, calc(100vw - 32px)); max-height: min(760px, calc(100vh - 36px)); overflow: hidden; }
.ai-recommendation-dialog section > header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  border-bottom: 1px solid #e8e4cf;
  background: #fffdf3;
}
.ai-recommendation-dialog section > header > div { display: flex; align-items: center; gap: 12px; }
.ai-recommendation-dialog section > header > div > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: #fff0a8; font-size: 20px; }
.ai-recommendation-dialog header small { color: #887119; font-size: 9px; font-weight: 850; letter-spacing: .09em; }
.ai-recommendation-dialog header h3 { margin: 3px 0 0; color: #272311; font-size: 18px; }
.ai-recommendation-dialog header > button { border: 0; background: transparent; color: #746e55; font-size: 24px; }
.ai-recommendation-body { max-height: calc(100vh - 220px); overflow: auto; padding: 22px; background: #fff; }
.ai-recommendation-body > p { margin: 0; color: #2c3545; font-size: 15.5px; line-height: 1.7; white-space: pre-wrap; }
.ai-recommendation-body > div { display: flex; justify-content: space-between; gap: 16px; margin-top: 20px; padding: 12px 14px; border: 1px solid #eadca4; border-radius: 10px; background: #fffaf0; color: #67571a; font-size: 11px; }
.ai-recommendation-body > small { display: block; margin-top: 14px; color: #7c8493; font-size: 11px; line-height: 1.5; }
.ai-recommendation-dialog section > footer { min-height: 66px; display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 12px 20px; border-top: 1px solid #e8e4cf; background: #fffdf8; }
.ai-recommendation-dialog footer form { margin: 0; }
.ai-recommendation-dialog footer button { min-height: 39px; padding: 0 14px; border: 1px solid #ded9c2; border-radius: 8px; background: #fff; color: #5e5a49; font: 750 11px "Urbanist",sans-serif; }
.ai-recommendation-dialog footer .button { border-color: #2858f6; background: #2858f6; color: #fff; }
html[data-theme="dark"] .ai-recommendation-dialog > section,
html[data-theme="dark"] .ai-recommendation-body { background: #141b27; color: #edf2fb; }
html[data-theme="dark"] .ai-recommendation-dialog section > header,
html[data-theme="dark"] .ai-recommendation-dialog section > footer { border-color: #665b24; background: #27230f; }
html[data-theme="dark"] .ai-recommendation-dialog header h3,
html[data-theme="dark"] .ai-recommendation-body > p { color: #f2eedc; }
html[data-theme="dark"] .ai-recommendation-body > div { border-color: #665b24; background: #27230f; color: #e5dba9; }
html[data-theme="dark"] .ai-recommendation-dialog footer button { border-color: #4c5260; background: #1c2533; color: #dbe3ee; }
.ai-guidance-card .ai-modify-button {
  height: 36px;
  padding: 0 13px;
  border: 1px solid #d6bd64;
  border-radius: 8px;
  background: #fffdf5;
  color: #614f15;
  font: 750 11px "Urbanist", sans-serif;
}
.composer-learning-state {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 15px;
  border-top: 1px solid #e8ebf0;
  background: #f8f9fc;
  color: #627087;
  font-size: 11.5px;
  font-weight: 700;
}
.composer-learning-state[hidden] { display: none; }
.composer-learning-state > span:first-child { color: #2858f6; }
.composer-tabs .ai-assist-tab { color: #7058df; }
.composer-tabs .context-action-pills { margin-left: auto; }
.composer-footer button { transition: background .15s ease, color .15s ease; }
.composer-footer button:hover { background: #f0f3f9; color: #1c2940; }
.composer-footer .composer-send { border-radius: 9px; }
.composer-tool-popover {
  position: absolute;
  left: 12px;
  bottom: 58px;
  z-index: 18;
  min-width: 220px;
  overflow: hidden;
  border: 1px solid #dfe4ec;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(19,32,58,.18);
}
.composer-tool-popover[hidden] { display: none; }
.composer-tool-popover > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; border-bottom: 1px solid #edf0f4; }
.composer-tool-popover > header strong { color: #243149; font-size: 12px; }
.composer-tool-popover > header small { color: #8791a1; font-size: 9px; }
.formatting-picker > div { display: grid; grid-template-columns:repeat(4,1fr); gap: 6px; padding: 9px; }
.formatting-picker button { min-height: 34px; border: 1px solid #e1e5ec; border-radius: 8px; background: #f8f9fc; color: #35435a; }
.emoji-picker { left: 96px; width: 245px; }
.emoji-picker > div { display: grid; grid-template-columns:repeat(6,1fr); gap: 4px; padding: 9px; }
.emoji-picker button { height: 36px; border: 0; border-radius: 7px; background: transparent; font-size: 19px; }
.emoji-picker button:hover { background: #f0f3f8; }
.knowledge-picker { left: 40px; width: min(500px, calc(100% - 80px)); max-height: 360px; }
.knowledge-picker > header > span { display: grid; gap: 2px; }
.knowledge-picker > header input { width: 185px; min-height: 34px; padding: 7px 9px; border: 1px solid #dfe4ec; border-radius: 8px; font: 500 11px "Urbanist",sans-serif; }
.knowledge-picker > div { max-height: 285px; overflow: auto; padding: 7px; }
.knowledge-picker [data-knowledge-option] { width: 100%; display: grid; grid-template-columns:minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 11px; border: 0; border-radius: 9px; background: transparent; text-align: left; }
.knowledge-picker [data-knowledge-option]:hover { background: #f5f7fb; }
.knowledge-picker [data-knowledge-option] > span { display: grid; gap: 3px; min-width: 0; }
.knowledge-picker [data-knowledge-option] strong { color: #29364c; font-size: 11px; }
.knowledge-picker [data-knowledge-option] small { overflow: hidden; color: #7b8698; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-picker [data-knowledge-option] em { color: #3654df; font-size: 9px; font-style: normal; font-weight: 800; }
.knowledge-picker > div > p { margin: 8px; color: #778295; font-size: 11px; }
.knowledge-picker > div > p a { color: #3654df; font-weight: 800; }
.delivery-picker { right: 12px; left: auto; width: 260px; }
.delivery-picker > button { width: 100%; display: grid; grid-template-columns:1fr 20px; align-items: center; gap: 10px; padding: 11px 13px; border: 0; border-bottom: 1px solid #edf0f4; background: #fff; text-align: left; }
.delivery-picker > button:last-child { border-bottom: 0; }
.delivery-picker > button:hover { background: #f6f8fb; }
.delivery-picker > button > span { display: grid; gap: 2px; }
.delivery-picker > button b { color: #29364b; font-size: 11px; }
.delivery-picker > button small { color: #828d9f; font-size: 9px; }
.delivery-picker > button i { color: #2858f6; font-style: normal; font-weight: 900; }
.composer-attachment-list { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 14px 10px; }
.composer-attachment-list[hidden] { display: none; }
.composer-attachment-list > span { display: inline-grid; grid-template-columns:auto auto 22px; align-items: center; gap: 6px; min-height: 30px; padding: 4px 5px 4px 9px; border: 1px solid #dce2eb; border-radius: 8px; background: #f7f9fc; }
.composer-attachment-list b { max-width: 180px; overflow: hidden; color: #40506a; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.composer-attachment-list small { color: #8a94a3; font-size: 8px; }
.composer-attachment-list button { width: 22px; height: 22px; border: 0; border-radius: 6px; background: #e9edf4; color: #5f6d82; }
.composer-send-group { display: flex; align-items: center; gap: 1px!important; margin-left: auto; }
.composer-footer .composer-send-group .composer-send { width: auto; min-width: 104px; border-radius: 9px 2px 2px 9px; }
.composer-footer .composer-send-options { min-width: 32px; border-radius: 2px 9px 9px 2px; background: #eef1f6; color: #5d697c; }
html[data-theme="dark"] .composer-tool-popover { border-color: #334158; background: #162235; }
html[data-theme="dark"] .composer-tool-popover > header { border-color: #2c394e; }
html[data-theme="dark"] .composer-tool-popover > header strong,
html[data-theme="dark"] .knowledge-picker [data-knowledge-option] strong,
html[data-theme="dark"] .delivery-picker > button b { color: #e7edf7; }
html[data-theme="dark"] .formatting-picker button,
html[data-theme="dark"] .knowledge-picker > header input,
html[data-theme="dark"] .delivery-picker > button { border-color: #334158; background: #1a2940; color: #dbe4f1; }
html[data-theme="dark"] .knowledge-picker [data-knowledge-option]:hover,
html[data-theme="dark"] .emoji-picker button:hover,
html[data-theme="dark"] .delivery-picker > button:hover { background: #20314a; }
html[data-theme="dark"] .composer-attachment-list > span { border-color: #334158; background: #19273b; }
.context-panel-title {
  min-height: 56px;
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 17px;
  border-bottom: 1px solid #e4e8ef;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px);
}
.context-panel-title strong { font-size: 15px; }
.context-panel-title > span { display: flex; gap: 5px; }
.context-panel-title a,
.context-panel-title button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #40506a;
  font-size: 17px;
}
.context-panel-title a:hover,
.context-panel-title button:hover { background: #f0f3f8; }
.customer-context > .customer-summary,
.customer-context > .shopify-customer-hub,
.customer-context > .customer-timeline,
.customer-context > .shopify-order-card,
.customer-context > .context-tags,
.customer-context > .ai-insights-card,
.customer-context > .customer-notes {
  margin: 12px;
  border: 1px solid #e1e5ec;
  border-radius: 13px;
  background: #fff;
  overflow: hidden;
}
.customer-context > .customer-summary,
.customer-context > .customer-timeline,
.customer-context > .context-tags,
.customer-context > .customer-notes { padding: 17px; }
.ai-insights-card { padding: 17px; }
.ai-insights-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.ai-insights-card h3 { margin: 0; font-size: 15px; }
.ai-insights-card h3 span { color: #7457e8; }
.ai-insights-card a { color: #405cf4; font-size: 12px; font-weight: 750; }
.ai-insights-card dl { display: grid; grid-template-columns: 1fr auto; gap: 15px 12px; margin: 0; }
.ai-insights-card dt { color: #657187; font-size: 12.5px; }
.ai-insights-card dd { margin: 0; color: #26354d; font-size: 12.5px; font-weight: 700; text-align: right; }
.ai-insights-card dd:first-of-type,
.ai-insights-card dd:last-of-type { color: #14966a; }
html[data-theme="dark"] .queue-search,
html[data-theme="dark"] .context-panel-title,
html[data-theme="dark"] .customer-context > :is(.customer-summary,.shopify-customer-hub,.customer-timeline,.shopify-order-card,.context-tags,.ai-insights-card,.customer-notes) {
  border-color: #2d3b51;
  background: #131f31;
  color: #e7edf7;
}

@media (min-width: 1201px) {
  .ticket-scroll { padding: 20px 22px 34px; }
  .queue-item { min-height: 108px; padding: 17px 18px; }
  img.queue-avatar { width: 42px; height: 42px; }
  .reply-composer { min-height: 262px; }
  .composer-footer { min-height: 64px; }
  .composer-footer button { width: 44px; min-width: 44px; height: 44px; font-size: 19px; }
  .composer-footer .composer-send { min-width: 132px; height: 44px; font-size: 14px; }
}

/* Desktop readability pass: comfortable at 100% browser zoom. */
@media (min-width: 1201px) {
  .queue-header h1 { font-size: 23px; }
  .queue-header button { min-height: 40px; font-size: 13px; }
  .queue-person strong { font-size: 16px; }
  .queue-person time { font-size: 12.5px; }
  .queue-subject { font-size: 14.5px; line-height: 1.42; }
  .queue-meta i { font-size: 12px; }
  .queue-meta em { font-size: 17px; }
  .ticket-header h2 { font-size: 24px; }
  .ticket-header p span,
  .ticket-order-chip { font-size: 12px; }
  .customer-message-card { padding: 20px; }
  .customer-message-card img { width: 40px; height: 40px; }
  .customer-message-card strong { font-size: 15px; }
  .customer-message-card small,
  .customer-message-card time { font-size: 12.5px; }
  .customer-message-card p,
  .ai-response-copy { font-size: 15.5px; line-height: 1.68; }
  .ai-response-card { padding: 18px 17px 15px; }
  .ai-response-card header strong { font-size: 16px; }
  .ai-response-card header small { font-size: 13.5px; }
  .ai-confidence { font-size: 12px; }
  .regenerate-button,
  .send-ai-button { height: 42px; font-size: 13.5px; }
  .reply-composer { min-height: 262px; }
  .composer-tabs { min-height: 52px; height: auto; padding: 5px 16px 0; gap: 18px; }
  .composer-tabs > button { height: 46px; font-size: 14px; }
  .composer-tabs .context-action-pill { height: 34px; padding: 0 12px; font-size: 11.5px; }
  .composer-tabs .context-action-pill span { font-size: 14px; }
  .reply-composer > textarea { height: 142px; padding: 17px 18px; font-size: 15.5px; line-height: 1.6; }
  .composer-footer { min-height: 64px; height: auto; padding: 7px 12px; }
  .composer-footer > div { gap: 2px; }
  .composer-footer button { width: 44px; min-width: 44px; height: 44px; font-size: 19px; }
  .composer-footer .write-ai { font-size: 17px; }
  .composer-footer .composer-send { width: auto; min-width: 132px; height: 44px; font-size: 14px; }
  .ticket-bottom-actions button { min-height: 40px; font-size: 13px; }
  .customer-name h3,
  .customer-timeline h3,
  .context-tags h3,
  .customer-notes h3 { font-size: 16px; }
  .customer-name p,
  .customer-name h3 span,
  .customer-stats span,
  .customer-timeline li small,
  .context-tags > div span,
  .customer-notes p { font-size: 12.5px; }
  .customer-timeline li strong,
  .customer-timeline li b { font-size: 13.5px; }
  .shopify-customer-hub > header a { font-size: 14px; }
  .shopify-hub-metrics span,
  .shopify-hub-note > span,
  .shopify-hub-tags > span { font-size: 11.5px; }
  .shopify-hub-note p,
  .shopify-order-inline > dl,
  .shopify-inline-address address,
  .shopify-inline-note p { font-size: 12.5px; }
  .shopify-inline-actions button { min-height: 44px; font-size: 12.5px; }
  .shopify-inline-items article strong { font-size: 13px; }
  .shopify-inline-items article small,
  .shopify-inline-items article em { font-size: 11.5px; }
}

@media (min-width: 1600px) {
  .queue-person strong { font-size: 17px; }
  .queue-subject { font-size: 15.5px; }
  .customer-message-card p,
  .ai-response-copy,
  .reply-composer > textarea { font-size: 16px; }
  .composer-footer button { width: 46px; min-width: 46px; height: 46px; font-size: 20px; }
}

/* Commerce provenance and editable Shopify address state. */
.ticket-order-chip,
.shopify-order-number {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.ticket-order-chip img,
.shopify-order-number img {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  object-fit: contain;
}
.order-detail-dialog .shopify-order-number img { width: 23px; height: 23px; }
.shopify-inline-dialog form > .shopify-address-load-status {
  position: relative;
  padding: 10px 12px 10px 34px;
  border: 1px solid #cfe8d8;
  border-radius: 9px;
  background: #f1faf4;
  color: #28734b;
  font-size: 11.5px;
  font-weight: 700;
}
.shopify-address-load-status::before {
  content: "✓";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
}
.is-loading-address .shopify-address-load-status::before {
  content: "";
  width: 11px;
  height: 11px;
  border: 2px solid #b8d6c4;
  border-top-color: #25865a;
  border-radius: 50%;
  animation: shopify-address-spin .7s linear infinite;
}
.shopify-inline-dialog form > .shopify-address-load-status.is-empty,
.shopify-inline-dialog form > .shopify-address-load-status.is-error,
.shopify-inline-dialog form > .shopify-address-load-status.is-fallback {
  border-color: #eadca8;
  background: #fff9df;
  color: #725d17;
}
.shopify-address-load-status.is-empty::before,
.shopify-address-load-status.is-error::before,
.shopify-address-load-status.is-fallback::before { content: "!"; }
@keyframes shopify-address-spin { to { transform: translateY(-50%) rotate(360deg); } }

/* AI-authored content uses a warm yellow surface so it is unmistakable at a glance. */
.ai-response-card {
  border-color: #ead589;
  background: linear-gradient(145deg, #fff8d8, #fffdf0);
  box-shadow: 0 10px 26px rgba(109, 88, 20, .08);
}
.ai-response-copy { border-color: #ead99d; background: #fffef7; }
.composer-tabs .context-action-pill,
.composer-tabs .context-action-pill.analyze {
  border-color: #ead680;
  background: #fff7cf;
  color: #6f5810;
}
.composer-tabs .context-action-pill span { color: #ad7f00; }
.composer-tabs .context-action-pill:hover,
.composer-tabs .context-action-pill.analyze:hover { border-color: #d6b43e; background: #ffefad; }
.composer-ai-outcome { border-color: #ead99d; background: #fffbed; }

/* Conversation history: humans are blue, AI is yellow, customers stay neutral. */
.conversation-reply-card {
  width: min(78%, 760px);
  margin: 18px 0 0 auto;
  padding: 18px;
  border: 1px solid #c9daf7;
  border-radius: 14px 14px 5px 14px;
  background: #edf6ff;
  box-shadow: 0 7px 20px rgba(35, 85, 151, .07);
}
.conversation-reply-card > header { display: flex; align-items: center; gap: 10px; }
.conversation-reply-card > header > span:nth-child(2) { display: grid; flex: 1; gap: 2px; }
.conversation-reply-card header strong { color: #1e3e68; font-size: 15px; }
.conversation-reply-card header small,
.conversation-reply-card header time { color: #6681a6; font-size: 12px; }
.conversation-reply-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #d6eaff;
  color: #2762aa;
  font-size: 14px;
  font-weight: 800;
}
.conversation-reply-card > p {
  margin: 15px 0 0;
  color: #263f60;
  font-size: 15.5px;
  line-height: 1.68;
  white-space: pre-wrap;
}
.conversation-reply-card.ai-authored {
  border-color: #ead589;
  background: #fff8d8;
  box-shadow: 0 7px 20px rgba(109, 88, 20, .07);
}
.conversation-reply-card.ai-authored .conversation-reply-avatar { background: #ffedaa; color: #9a7100; }
.conversation-reply-card.ai-authored header strong,
.conversation-reply-card.ai-authored > p { color: #514311; }
.conversation-reply-card.ai-authored header small,
.conversation-reply-card.ai-authored header time { color: #89772f; }
.conversation-reply-card.internal-note { border-color: #e6d8a3; background: #fff9e5; }
.conversation-reply-state {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 14px -18px -18px;
  padding: 10px 18px;
  border-top: 1px solid #ead589;
  color: #24744f;
  font-size: 11.5px;
  font-weight: 800;
}
.conversation-reply-state span {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #dff5e8;
}
.ai-response-card > footer { flex-wrap: wrap; gap: 9px; }
.ai-draft-state {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
}
.ai-draft-state i {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-style: normal;
}
.ai-draft-state.approval { background: #fff1b8; color: #75580b; }
.ai-draft-state.approval i { background: #f5d76d; }
.ai-draft-state.resolved { background: #e2f7ea; color: #21764d; }
.ai-draft-state.resolved i { background: #bce9cf; }
.ai-response-card > footer > div { margin-left: auto; }
.ai-guidance-card { border-color: #ead589; background: linear-gradient(145deg, #fff8d8, #fffdf0); }
html[data-theme="dark"] .ai-guidance-card { border-color: #76672f; background: #27230f; }
html[data-theme="dark"] .ai-guidance-card > header strong { color: #f5f0dc; }
html[data-theme="dark"] .ai-guidance-card .ai-response-copy { border: 0; background: transparent; color: #eee7c8; }
html[data-theme="dark"] .ai-guidance-card .ai-modify-button { border-color: #75662f; background: #2b2717; color: #eadfae; }
html[data-theme="dark"] .composer-learning-state { border-color: #2c3b52; background: #152136; color: #b8c4d5; }
.customer-message-card + .customer-message-card,
.conversation-reply-card + .customer-message-card { margin-top: 18px; }
.iq-chat-prompts { flex-wrap: wrap; overflow: visible; }
