:root {
  color-scheme: light;
  --bg: #f3f5f1;
  --surface: #ffffff;
  --surface-2: #eef4ef;
  --surface-3: #f8faf7;
  --ink: #14211e;
  --muted: #67726e;
  --line: #dce4dd;
  --line-strong: #c8d3cb;
  --green: #0f3d35;
  --green-2: #16594d;
  --gold: #c89f2d;
  --blue: #2563eb;
  --red: #b42318;
  --amber: #9a6700;
  --shadow: 0 18px 50px rgba(20, 33, 30, 0.12);
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  letter-spacing: 0;
}

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

button {
  border: 0;
}

a.primary-btn,
a.text-btn,
a.ghost-btn {
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(270px, 320px) minmax(420px, 1fr) minmax(330px, 420px);
  min-height: 100vh;
}

.sidebar,
.chat-pane,
.ledger-pane {
  min-width: 0;
  border-right: 1px solid var(--line);
}

.sidebar {
  display: flex;
  flex-direction: column;
  background: #fbfcfb;
}

.chat-pane {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  background:
    linear-gradient(rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.88)),
    radial-gradient(circle at 12px 12px, rgba(15, 61, 53, 0.12) 1px, transparent 1px);
  background-size: auto, 28px 28px;
}

.ledger-pane {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  border-right: 0;
  background: #f8faf8;
}

.app-top,
.chat-header,
.ledger-header {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
}

.app-top {
  padding: 18px 18px 14px;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(200, 159, 45, 0.42);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #0f3d35, #1d7465);
  color: #fff7da;
  font-weight: 800;
}

.brand h1,
.chat-title h2,
.ledger-title h2 {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  font-weight: 760;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand p,
.chat-title p,
.ledger-title p {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  max-width: 128px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.status-pill.firebase {
  border-color: rgba(15, 61, 53, 0.22);
  color: var(--green);
}

.status-pill.demo {
  border-color: rgba(154, 103, 0, 0.22);
  color: var(--amber);
}

.toolbar,
.chat-actions,
.ledger-actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar {
  margin-top: 16px;
}

.icon-btn,
.text-btn,
.primary-btn,
.ghost-btn,
.danger-btn {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
  padding: 0 12px;
  cursor: pointer;
  line-height: 1;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.icon-btn {
  width: 36px;
  flex: 0 0 36px;
  padding: 0;
}

.icon-btn svg,
.text-btn svg,
.primary-btn svg,
.ghost-btn svg,
.danger-btn svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.primary-btn {
  background: var(--green);
  color: white;
}

.primary-btn:hover {
  background: var(--green-2);
}

.text-btn,
.ghost-btn,
.icon-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.text-btn:hover,
.ghost-btn:hover,
.icon-btn:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.danger-btn {
  border: 1px solid rgba(180, 35, 24, 0.2);
  background: #fff5f4;
  color: var(--red);
}

.danger-btn:hover {
  background: #ffe9e7;
}

.primary-btn:active,
.text-btn:active,
.ghost-btn:active,
.danger-btn:active,
.icon-btn:active {
  transform: translateY(1px);
}

.metric-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.metric {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.metric strong {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric.negative strong,
.amount.negative {
  color: var(--red);
}

.metric.positive strong,
.amount.positive {
  color: var(--green);
}

.search-wrap {
  position: relative;
  margin: 14px 18px 10px;
}

.search-wrap svg {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  transform: translateY(-50%);
}

.search-wrap input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: 0;
  padding: 0 12px 0 36px;
}

.search-wrap input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(15, 61, 53, 0.52);
  box-shadow: 0 0 0 3px rgba(15, 61, 53, 0.1);
}

.customer-list {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow-y: auto;
  padding: 0 10px 18px;
}

.customer-item {
  display: grid;
  width: 100%;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 10px 8px;
  text-align: left;
}

.customer-item:hover,
.customer-item.active {
  border-color: var(--line);
  background: #fff;
}

.avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: var(--radius);
  background: #e5eee9;
  color: var(--green);
  font-weight: 800;
}

.customer-copy {
  min-width: 0;
}

.customer-line {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.customer-line strong {
  overflow: hidden;
  font-size: 14px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.balance-chip,
.state-chip {
  display: inline-flex;
  max-width: 120px;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.balance-chip.receivable,
.state-chip.open,
.state-chip.partial {
  background: rgba(15, 61, 53, 0.1);
  color: var(--green);
}

.balance-chip.liability,
.state-chip.cancelled,
.state-chip.overdue {
  background: rgba(180, 35, 24, 0.1);
  color: var(--red);
}

.balance-chip.clear,
.state-chip.paid,
.state-chip.accepted {
  background: rgba(37, 99, 235, 0.1);
  color: var(--blue);
}

.state-chip.expired {
  background: rgba(154, 103, 0, 0.12);
  color: var(--amber);
}

.customer-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.customer-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-header,
.ledger-header {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
}

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

.chat-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chat-body {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.message-list {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 18px;
}

.message-row {
  display: flex;
}

.message-row.shop {
  justify-content: flex-end;
}

.message-row.customer {
  justify-content: flex-start;
}

.message-row.system {
  justify-content: center;
}

.bubble {
  max-width: min(560px, 82%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 20px rgba(20, 33, 30, 0.06);
  overflow: hidden;
}

.message-row.shop .bubble {
  border-color: rgba(15, 61, 53, 0.18);
  background: #eaf5ef;
}

.message-row.customer .bubble {
  background: #fff;
}

.message-row.system .bubble {
  max-width: 460px;
  border-style: dashed;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: none;
}

.bubble-copy {
  padding: 10px 12px;
}

.bubble-copy p {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
  white-space: pre-wrap;
}

.bubble-time {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  text-align: right;
}

.deal-card {
  display: grid;
  gap: 8px;
  min-width: 260px;
  padding: 12px;
}

.deal-card header {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.deal-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
}

.deal-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.deal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.deal-grid div {
  min-width: 0;
  border: 1px solid rgba(15, 61, 53, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
  padding: 8px;
}

.deal-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.15;
}

.deal-grid strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  padding: 12px 18px;
}

.composer-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
}

.composer-form.voice-enabled {
  grid-template-columns: minmax(110px, 150px) minmax(0, 1fr) 42px 42px;
}

.composer-form select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: 0;
  padding: 0 8px;
}

.composer-form textarea {
  width: 100%;
  min-height: 42px;
  max-height: 120px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
  padding: 10px 12px;
}

.voice-btn.recording {
  border-color: rgba(180, 35, 24, 0.28);
  background: #fff5f4;
  color: var(--red);
}

.recording-strip,
.composer-lock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-3);
  color: var(--muted);
  padding: 8px 10px;
}

.composer-lock {
  margin-top: 0;
  justify-content: flex-start;
}

.recording-strip svg,
.composer-lock svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.voice-card audio {
  width: 100%;
  min-width: 240px;
}

.ledger-scroll {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 0 16px;
}

.tab-btn {
  min-height: 42px;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0 10px;
  white-space: nowrap;
}

.tab-btn.active {
  border-color: var(--green);
  color: var(--green);
  font-weight: 700;
}

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

.summary-cell,
.list-card,
.inventory-row {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.summary-cell {
  padding: 12px;
}

.summary-cell span,
.list-card span,
.inventory-row span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.summary-cell strong {
  display: block;
  margin-top: 8px;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 0 10px;
}

.section-title h3 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.2;
}

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

.list-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.list-card header {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.list-card h4 {
  margin: 0;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.list-meta div {
  min-width: 0;
}

.list-meta strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.empty-state strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.2;
}

.empty-state span {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.35;
}

.inventory-grid {
  display: grid;
  gap: 8px;
}

.inventory-card {
  gap: 12px;
}

.inventory-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
}

.inventory-row strong {
  display: block;
  overflow: hidden;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.inventory-lot-list {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.lot-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(15, 61, 53, 0.08);
  border-radius: var(--radius);
  background: var(--surface-3);
  padding: 9px 10px;
}

.lot-row strong,
.lot-row span {
  display: block;
}

.lot-row strong {
  overflow: hidden;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lot-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.lot-price {
  min-width: 126px;
  text-align: right;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.portal-app {
  min-height: 100vh;
  background: var(--bg);
}

.portal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 16px clamp(16px, 4vw, 34px);
}

.portal-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
  gap: 18px;
  align-items: stretch;
  background: linear-gradient(135deg, #0f3d35, #1d6c5f);
  color: #fff;
  padding: clamp(22px, 5vw, 42px) clamp(16px, 4vw, 34px);
}

.portal-kicker {
  display: block;
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  font-weight: 700;
}

.portal-hero h2 {
  margin: 8px 0 8px;
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1.08;
}

.portal-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

.portal-balance {
  display: grid;
  align-content: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  padding: 18px;
}

.portal-balance span,
.portal-balance small {
  color: rgba(255, 255, 255, 0.78);
}

.portal-balance strong {
  display: block;
  margin: 8px 0;
  font-size: 28px;
  line-height: 1.1;
}

.portal-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px clamp(16px, 4vw, 34px);
}

.portal-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(360px, 1.08fr);
  gap: 18px;
  align-items: start;
  padding: 0 clamp(16px, 4vw, 34px) 34px;
}

.portal-chat,
.portal-ledger {
  min-width: 0;
}

.portal-chat {
  display: flex;
  min-height: 680px;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.88)),
    radial-gradient(circle at 12px 12px, rgba(15, 61, 53, 0.12) 1px, transparent 1px);
  background-size: auto, 28px 28px;
}

.portal-chat .section-title,
.portal-ledger .section-title {
  margin: 0;
  padding: 14px 16px;
}

.portal-chat .message-list {
  min-height: 0;
}

.portal-ledger {
  display: grid;
  gap: 12px;
}

.portal-empty {
  display: grid;
  min-height: 100vh;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
}

.portal-empty h1,
.portal-empty p {
  margin: 0;
}

.login-box {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  padding: 24px;
}

.login-box h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.login-box p {
  margin: 8px 0 20px;
  color: var(--muted);
  line-height: 1.45;
}

.modal {
  width: min(640px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  padding: 0;
}

.modal::backdrop {
  background: rgba(20, 33, 30, 0.34);
}

.modal-shell {
  display: grid;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
}

.modal-head h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.modal-body {
  padding: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: 0;
  padding: 9px 10px;
}

.field textarea {
  min-height: 84px;
  resize: vertical;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.segmented label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented label:has(input:checked) {
  border-color: rgba(15, 61, 53, 0.44);
  background: #eaf5ef;
  color: var(--green);
}

.computed-total {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-3);
  padding: 10px;
}

.computed-total span {
  color: var(--muted);
  font-size: 12px;
}

.computed-total strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding: 14px 18px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  max-width: 360px;
  border: 1px solid rgba(15, 61, 53, 0.18);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--ink);
  opacity: 0;
  padding: 12px 14px;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.error-box {
  border: 1px solid rgba(180, 35, 24, 0.2);
  border-radius: var(--radius);
  background: #fff5f4;
  color: var(--red);
  padding: 10px 12px;
}

.hidden {
  display: none !important;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: minmax(250px, 300px) minmax(390px, 1fr);
  }

  .ledger-pane {
    grid-column: 1 / -1;
    min-height: auto;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .portal-top,
  .portal-hero {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .portal-top {
    flex-direction: column;
  }

  .portal-metrics,
  .portal-layout {
    grid-template-columns: 1fr;
  }

  .portal-chat {
    min-height: 620px;
  }

  .sidebar,
  .chat-pane,
  .ledger-pane {
    min-height: auto;
    border-right: 0;
  }

  .chat-pane {
    min-height: 640px;
  }

  .chat-header,
  .ledger-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .chat-actions,
  .ledger-actions {
    justify-content: flex-start;
  }

  .bubble {
    max-width: 94%;
  }

  .form-grid,
  .summary-grid,
  .list-meta {
    grid-template-columns: 1fr;
  }

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

  .lot-price {
    min-width: 0;
    text-align: left;
  }

  .toolbar {
    flex-wrap: wrap;
  }

  .composer-form.voice-enabled {
    grid-template-columns: 1fr 42px 42px;
  }

  .composer-form.voice-enabled select {
    grid-column: 1 / -1;
  }
}
