@font-face {
  font-family: "ABBvoice";
  src: url("assets/fonts/ABBvoice_W_Rg.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "ABBvoice";
  src: url("assets/fonts/ABBvoice_W_Md.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "ABBvoice";
  src: url("assets/fonts/ABBvoice_W_Bd.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "ABBvoiceDisplay";
  src: url("assets/fonts/ABBvoiceDisplay_W_SBd.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --abb-red: #e00;
  --abb-red-dark: #b10303;
  --black: #000;
  --ink: #1f1f1f;
  --muted: #696969;
  --line: #d8d8d8;
  --soft: #f6f6f6;
  --soft-2: #ededed;
  --panel: #fff;
  --teal: #007a78;
  --amber: #b36b00;
  --danger: #a40000;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.08);
  --font-body: "ABBvoice", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: "ABBvoiceDisplay", "ABBvoice", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: #f4f4f4;
  font-family: var(--font-body);
  font-size: 16px;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.is-hidden {
  display: none !important;
}

.login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(340px, 0.9fr);
  background: var(--panel);
}

.brand-area {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(250, 250, 250, 0.94)),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.035) 0 1px, transparent 1px 64px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
  z-index: 1;
}

.abb-logo {
  display: block;
  width: 108px;
  height: auto;
  flex: 0 0 auto;
}

.abb-logo.small {
  width: 66px;
}

.brand-lockup p,
.side-brand span {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
}

.product-name {
  display: block;
  line-height: 1.1;
}

.brand-lockup .product-name {
  font-size: 1.25rem;
}

.product-name span,
.product-name small {
  display: block;
  margin-top: 4px;
  font-family: var(--font-body);
  font-size: 0.72em;
  font-weight: 500;
}

.side-brand .product-name {
  min-width: 0;
  font-size: 0.95rem;
}

.side-brand .product-name small {
  color: #f3f3f3;
  font-size: 0.7rem;
}

.plant-visual {
  position: relative;
  height: min(54vh, 520px);
  min-height: 360px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, transparent 0 68%, rgba(0, 0, 0, 0.055) 68% 100%),
    linear-gradient(90deg, rgba(238, 0, 0, 0.08), transparent 45%),
    var(--panel);
  box-shadow: var(--shadow);
}

.plant-visual span {
  position: absolute;
  display: block;
}

.rail {
  left: 9%;
  right: 8%;
  height: 10px;
  background: #0f0f0f;
}

.rail-a {
  bottom: 26%;
}

.rail-b {
  bottom: 20%;
  background: #555;
}

.cell {
  bottom: 31%;
  width: 86px;
  height: 86px;
  border: 5px solid #0f0f0f;
  background: #f4f4f4;
}

.cell-a {
  left: 18%;
}

.cell-b {
  left: 39%;
  border-color: var(--abb-red);
}

.cell-c {
  left: 60%;
}

.arm {
  right: 18%;
  bottom: 34%;
  width: 148px;
  height: 148px;
  border-top: 14px solid #0f0f0f;
  border-right: 14px solid #0f0f0f;
  transform: rotate(-22deg);
  transform-origin: bottom right;
}

.arm-joint {
  right: 16%;
  bottom: 31%;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 12px solid var(--abb-red);
  background: var(--panel);
}

.panel-light {
  right: 9%;
  top: 14%;
  width: 13px;
  height: 110px;
  background: var(--abb-red);
  box-shadow: 0 0 30px rgba(238, 0, 0, 0.42);
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 36px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 38%),
    #0f0f0f;
}

.login-form {
  width: min(100%, 430px);
  display: grid;
  gap: 18px;
  padding: 34px;
  background: var(--panel);
  border-top: 5px solid var(--abb-red);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--abb-red);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
}

h1 {
  font-size: 2rem;
}

.login-form label,
.quote-meta label,
.toolbar label {
  display: grid;
  gap: 8px;
  color: #333;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--panel);
}

select {
  overflow: hidden;
  text-overflow: ellipsis;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: 3px solid rgba(238, 0, 0, 0.18);
  outline-offset: 2px;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  border-radius: 2px;
  border: 1px solid transparent;
  padding: 10px 16px;
  font-weight: 700;
}

.primary-button {
  color: #fff;
  background: var(--abb-red);
}

.primary-button:hover {
  background: var(--abb-red-dark);
}

.secondary-button {
  color: var(--ink);
  background: var(--panel);
  border-color: var(--black);
}

.secondary-button:hover {
  color: var(--abb-red);
  border-color: var(--abb-red);
}

.secondary-button.danger {
  color: var(--danger);
  border-color: rgba(164, 0, 0, 0.35);
}

.compact {
  min-height: 38px;
  padding: 8px 14px;
}

.full-width {
  width: 100%;
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-weight: 700;
}

.login-note {
  margin: 0;
  color: #676767;
  font-size: 0.88rem;
}

.app-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  min-width: 0;
  background: var(--soft);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 18px;
  color: #fff;
  background: #0f0f0f;
  min-width: 0;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}

.nav-list {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.nav-item {
  min-height: 44px;
  border: 0;
  border-left: 4px solid transparent;
  border-radius: 0;
  padding: 10px 12px;
  color: #e8e8e8;
  text-align: left;
  background: transparent;
  min-width: 0;
  font-weight: 500;
}

.nav-item:hover,
.nav-item.is-active {
  color: #fff;
  border-left-color: var(--abb-red);
  background: rgba(255, 255, 255, 0.08);
}

.user-box {
  margin-top: auto;
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
}

.user-box span {
  color: #bdbdbd;
  font-size: 0.86rem;
}

.main-area {
  min-width: 0;
  padding: 0 26px 26px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 -26px 18px;
  padding: 24px 26px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.topbar h2 {
  font-size: 2rem;
}

.topbar-actions,
.quote-actions,
.import-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.status-strip {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 22px;
  padding: 12px 14px;
  border-left: 5px solid var(--abb-red);
  background: var(--panel);
  color: var(--ink);
}

.content-section {
  display: none;
}

.content-section.is-active {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric-tile {
  display: grid;
  gap: 12px;
  min-height: 116px;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.metric-tile span {
  color: var(--muted);
  font-weight: 700;
}

.metric-tile strong {
  font-family: var(--font-display);
  font-size: 1.8rem;
}

.metric-tile.accent {
  color: #fff;
  border-color: #0f0f0f;
  background: #0f0f0f;
}

.dashboard-grid,
.import-layout,
.admin-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}

.panel {
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.family-bars {
  display: grid;
  gap: 12px;
}

.family-bar {
  display: grid;
  gap: 6px;
}

.family-bar div {
  height: 10px;
  background: #ebebeb;
}

.family-bar span {
  display: block;
  width: var(--width);
  height: 100%;
  background: var(--abb-red);
}

.recommendation-empty,
.import-status {
  color: var(--muted);
}

.recommendation-list {
  display: grid;
  gap: 10px;
}

.recommendation-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.activity-list,
.quote-list,
.approval-list,
.audit-list {
  display: grid;
  gap: 10px;
}

.activity-item,
.quote-list-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid transparent;
  background: var(--panel);
  text-align: left;
}

.activity-item:hover,
.quote-list-item:hover,
.quote-list-item.is-selected {
  border-left-color: var(--abb-red);
  background: var(--soft);
}

.activity-item span,
.quote-list-item span,
.quote-list-item small {
  color: var(--muted);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 260px);
  gap: 12px;
  margin-bottom: 16px;
}

.extended-toolbar {
  grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(150px, 230px));
}

.knowledge-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(420px, 1.18fr);
  gap: 20px;
  align-items: start;
}

.product-list {
  display: grid;
  gap: 8px;
}

.result-note {
  padding: 12px 2px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-weight: 700;
}

.product-card {
  min-height: 112px;
  padding: 16px 18px;
  border: 1px solid transparent;
  border-left: 3px solid var(--line);
  background: var(--panel);
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.product-card:hover,
.product-card.is-selected {
  border-left-color: var(--abb-red);
  border-top-color: var(--line);
  border-right-color: var(--line);
  border-bottom-color: var(--line);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.06);
  transform: translateX(2px);
}

.product-card__family {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.product-card h3 {
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 1.12rem;
  line-height: 1.1;
}

.product-card p,
.product-detail p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: var(--soft);
  font-size: 0.78rem;
  font-weight: 700;
}

.product-detail {
  position: sticky;
  top: 26px;
  display: grid;
  gap: 0;
  max-height: calc(100vh - 52px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0;
  border: 1px solid var(--line);
  border-top: 6px solid var(--abb-red);
  background: var(--panel);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.06);
  scrollbar-gutter: stable;
}

.detail-hero {
  display: grid;
  gap: 18px;
  padding: 28px 28px 22px;
  background: #fff;
}

.detail-hero h3 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.2vw, 2.15rem);
  line-height: 1.05;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.detail-stat {
  min-height: 92px;
  padding: 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.detail-stat span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.detail-section {
  display: grid;
  gap: 8px;
}

.detail-section > strong,
.detail-block h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.detail-section ul {
  margin: 0;
  padding-left: 18px;
}

.detail-section li {
  margin-bottom: 5px;
}

.source-link {
  color: var(--abb-red);
  font-weight: 800;
  text-decoration: none;
}

.source-link:hover {
  text-decoration: underline;
}

.source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.detail-block {
  display: grid;
  gap: 16px;
  padding: 24px 28px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.detail-block:nth-of-type(even) {
  background: #fbfbfb;
}

.detail-block__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.knowledge-count {
  white-space: nowrap;
  color: var(--muted);
  font-weight: 800;
}

.context-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.document-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.document-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.38fr) minmax(200px, 1fr) minmax(118px, auto);
  gap: 12px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
}

.document-row span,
.mini-section span,
.muted-text,
.error-text {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.document-row code {
  color: var(--muted);
  overflow-wrap: anywhere;
  text-align: right;
}

.mini-section {
  display: grid;
  gap: 10px;
}

.mini-section ul {
  margin-left: 18px;
}

.fact-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.fact-list div {
  display: grid;
  gap: 4px;
  padding: 12px 14px 12px 0;
  border-bottom: 1px solid var(--line);
}

.fact-list span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.fact-list strong {
  font-weight: 600;
  line-height: 1.35;
}

.related-product-list {
  display: grid;
  gap: 8px;
}

.related-product-link {
  display: grid;
  grid-template-columns: minmax(118px, 0.32fr) minmax(130px, 0.3fr) minmax(220px, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--black);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.related-product-link:hover {
  border-left-color: var(--abb-red);
  background: var(--soft);
}

.related-product-link span,
.related-product-link small {
  color: var(--muted);
  font-weight: 700;
}

.related-product-link small {
  font-weight: 500;
  line-height: 1.35;
}

.error-text {
  color: var(--abb-red);
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 300px;
  gap: 16px;
}

.chat-window,
.prompt-panel {
  border: 1px solid var(--line);
  background: var(--panel);
}

.chat-window {
  display: grid;
  grid-template-rows: auto minmax(300px, 50vh) auto;
}

.structured-intake {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.chat-messages {
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
}

.message {
  max-width: 78%;
  padding: 12px 14px;
  border-radius: 2px;
  line-height: 1.45;
}

.message.user {
  justify-self: end;
  color: #fff;
  background: #0f0f0f;
}

.message.agent {
  justify-self: start;
  background: #ebebeb;
}

.agent-answer {
  margin-top: 10px;
  padding: 12px;
  border-left: 4px solid var(--abb-red);
  background: var(--panel);
  color: var(--ink);
  line-height: 1.45;
}

.message strong {
  display: block;
  margin-bottom: 6px;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.prompt-panel {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
}

.scenario-chip {
  min-height: 48px;
  border: 1px solid var(--line);
  border-left: 4px solid #0f0f0f;
  padding: 10px;
  background: var(--panel);
  text-align: left;
}

.scenario-chip:hover {
  border-left-color: var(--abb-red);
}

.match-list {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.match-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.match-card span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
}

.follow-up {
  margin: 10px 0;
  padding: 10px;
  border-left: 4px solid var(--amber);
  background: #fff7e6;
}

.quote-shell {
  display: grid;
  gap: 16px;
}

.quote-page-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.quote-list-panel {
  position: sticky;
  top: 26px;
}

.status-bar {
  padding: 12px 14px;
  border-left: 5px solid var(--abb-red);
  background: var(--panel);
  font-weight: 700;
}

.quote-meta {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 1fr 1fr 140px;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.quote-actions {
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.quote-actions select {
  width: min(100%, 380px);
}

.guardrail-panel,
.export-links {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.guardrail-panel ul {
  margin: 0;
  padding-left: 18px;
}

.warning-text {
  color: var(--amber);
  font-weight: 700;
}

.success-text {
  color: var(--teal);
  font-weight: 800;
}

.quote-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--panel);
}

.quote-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.quote-table th,
.quote-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.quote-table th {
  color: #fff;
  background: #0f0f0f;
}

.muted-code {
  display: inline-block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.quote-table input {
  width: 76px;
  min-height: 36px;
}

.remove-row {
  min-width: 34px;
  min-height: 34px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--danger);
  font-weight: 900;
}

.totals {
  justify-self: end;
  width: min(100%, 420px);
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.totals div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.grand-total {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 2px solid #0f0f0f;
  font-size: 1.25rem;
}

.schema-box {
  display: block;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--soft);
  white-space: normal;
}

.approval-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.approval-item span,
.approval-item p,
.audit-item span {
  display: block;
  color: var(--muted);
}

.approval-actions {
  display: flex;
  gap: 8px;
  align-items: start;
}

.governance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.governance-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

.import-actions.vertical {
  display: grid;
  align-items: stretch;
}

.audit-item {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.audit-item code {
  overflow-wrap: anywhere;
  color: var(--muted);
  white-space: normal;
}

.empty-state {
  color: var(--muted);
  padding: 10px 0;
}

/* Hamburger button – hidden on desktop */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.hamburger-btn span {
  display: block;
  height: 2px;
  width: 100%;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.hamburger-btn[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger-btn[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.hamburger-btn[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

/* Sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}
.sidebar-overlay.is-open {
  display: block;
}

@media (max-width: 1020px) {
  .login-layout,
  .app-layout,
  .dashboard-grid,
  .knowledge-layout,
  .chat-layout,
  .import-layout,
  .admin-grid,
  .quote-page-grid,
  .extended-toolbar,
  .structured-intake,
  .detail-grid,
  .context-grid,
  .fact-list,
  .governance-grid {
    grid-template-columns: 1fr;
  }

  .hamburger-btn {
    display: flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    overflow-y: auto;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .nav-list {
    grid-template-columns: 1fr;
  }

  .product-detail,
  .quote-list-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .detail-stat {
    min-height: auto;
    border-right: 0;
  }

  .related-product-link {
    grid-template-columns: minmax(120px, 0.35fr) minmax(130px, 0.35fr) minmax(200px, 1fr);
  }

  .brand-area {
    min-height: 420px;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 15px;
  }

  .brand-area,
  .main-area,
  .login-panel {
    padding: 18px;
  }

  .plant-visual {
    min-height: 280px;
  }

  .metric-grid,
  .toolbar,
  .quote-meta {
    grid-template-columns: 1fr;
  }

  .topbar,
  .status-strip,
  .chat-form {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
    margin: 0 -18px 18px;
    padding: 18px;
  }

  .message {
    max-width: 100%;
  }

  .document-row {
    grid-template-columns: 1fr;
  }

  .document-row code {
    text-align: left;
  }

  .detail-hero,
  .detail-block {
    padding: 20px 18px;
  }

  .detail-block__header,
  .related-product-link {
    grid-template-columns: 1fr;
  }

  .detail-block__header {
    display: grid;
  }

  .quote-table {
    min-width: 0;
  }

  .quote-table thead {
    display: none;
  }

  .quote-table,
  .quote-table tbody,
  .quote-table tr,
  .quote-table td {
    display: block;
    width: 100%;
  }

  .quote-table tr {
    display: grid;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
  }

  .quote-table td {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 10px;
    padding: 0;
    border-bottom: 0;
  }

  .quote-table td::before {
    color: var(--muted);
    font-weight: 700;
  }

  .quote-table td:nth-child(1)::before {
    content: "Line item";
  }

  .quote-table td:nth-child(2)::before {
    content: "Reason";
  }

  .quote-table td:nth-child(3)::before {
    content: "Quantity";
  }

  .quote-table td:nth-child(4)::before {
    content: "Unit price";
  }

  .quote-table td:nth-child(5)::before {
    content: "Total";
  }

  .quote-table td:nth-child(6) {
    grid-template-columns: 1fr;
  }

  .quote-table td:nth-child(6)::before {
    content: "";
  }

  .quote-table input {
    width: 100%;
  }

  .remove-row {
    justify-self: end;
  }
}

@media print {
  .sidebar,
  .topbar-actions,
  .status-strip,
  .quote-actions,
  .nav-list,
  #overview,
  #knowledge,
  #chat,
  #import {
    display: none !important;
  }

  .app-layout {
    display: block;
  }

  .main-area {
    padding: 0;
  }

  #quote {
    display: block !important;
  }
}
