:root {
  --ink: #252525;
  --muted: #6b6b6b;
  --line: #ece7df;
  --surface: #ffffff;
  --soft: #fff7ef;
  --brand: #f28c22;
  --brand-dark: #c96b0d;
  --accent: #2f6f73;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background: var(--surface);
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

.brand {
  color: var(--brand-dark);
  font-size: 1.45rem;
  font-weight: 800;
  text-decoration: none;
}

.public-header,
.public-footer {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 18px clamp(16px, 4vw, 48px);
}

.top-link,
.public-footer a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.assistant-shell {
  margin: 0 auto;
  max-width: 1180px;
  padding: clamp(14px, 3vw, 30px) 16px 86px;
}

.assistant-intro {
  text-align: center;
}

.eyebrow {
  color: var(--brand-dark);
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 8px;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.04;
  margin: 0;
}

.assistant-intro h1 {
  font-size: clamp(1.55rem, 3vw, 2.35rem);
}

.assistant-intro p:last-child {
  color: var(--muted);
  font-size: 1rem;
  margin: 10px auto 0;
  max-width: 620px;
}

.quick-actions {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, 1fr);
  margin: 20px auto 16px;
  max-width: 880px;
}

.quick-actions button,
.filter-row button {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  min-height: 78px;
  padding: 14px;
}

.quick-actions button {
  display: grid;
  gap: 5px;
  text-align: left;
}

.quick-actions button span {
  color: var(--muted);
  font-size: .88rem;
  font-weight: 600;
}

.quick-actions button.active {
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(242, 140, 34, .14);
}

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

.chat-placeholder input {
  border: 0;
  min-width: 0;
  outline: 0;
  padding: 12px;
}

.chat-placeholder button,
.button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  padding: 11px 16px;
  text-decoration: none;
}

.assistant-workspace {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
  margin-top: 20px;
}

.chat-panel,
.cart-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.chat-log {
  display: grid;
  gap: 12px;
  max-height: 660px;
  min-height: 500px;
  overflow: auto;
  padding: 16px;
}

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

.chat-toolbar h2 {
  font-size: 1.15rem;
  margin: 2px 0 0;
}

.history-toggle {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent);
  cursor: pointer;
  font-weight: 800;
  padding: 9px 11px;
}

.history-panel {
  background: #faf9f6;
  border-top: 1px solid var(--line);
  padding: 14px 16px;
}

.history-panel h3 {
  font-size: .95rem;
  margin: 0 0 10px;
}

.history-log {
  display: grid;
  gap: 12px;
  max-height: 260px;
  overflow: auto;
}

.history-turn {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
  padding-bottom: 12px;
}

.history-turn:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.history-log .bubble,
.history-log .assistant-cards {
  opacity: .72;
}

.history-log .assistant-cards {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.bubble {
  border-radius: 8px;
  line-height: 1.4;
  max-width: 78%;
  padding: 11px 13px;
}

.bubble.assistant {
  background: var(--soft);
  justify-self: start;
}

.bubble.user {
  background: var(--accent);
  color: #fff;
  justify-self: end;
}

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

.chat-form input {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 12px;
}

.chat-form button,
.assistant-card button {
  background: var(--brand);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  padding: 11px 14px;
}

.assistant-cards {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.assistant-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.assistant-card img {
  aspect-ratio: 1;
  display: block;
  object-fit: cover;
  width: 100%;
}

.image-button {
  background: transparent;
  border: 0;
  cursor: zoom-in;
  display: block;
  padding: 0;
  width: 100%;
}

.assistant-card div {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.assistant-card h3 {
  font-size: 1rem;
  margin: 0;
}

.assistant-card p {
  color: var(--muted);
  font-size: .92rem;
  margin: 0;
}

.cart-panel {
  align-self: start;
  display: block;
  max-height: calc(100vh - 120px);
  overflow: auto;
  padding: 16px;
  position: sticky;
  top: 16px;
}

.cart-panel h2 {
  font-size: 1.15rem;
  margin: 0 0 12px;
}

.cart-items {
  display: grid;
  gap: 10px;
}

.cart-row {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
  padding-bottom: 10px;
}

.cart-row span {
  color: var(--muted);
  display: block;
  font-size: .88rem;
}

.cart-row button {
  background: transparent;
  border: 0;
  color: var(--danger);
  cursor: pointer;
  font-weight: 800;
}

.cart-total {
  align-items: center;
  border-top: 2px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 14px;
}

.checkout-button {
  margin-top: 14px;
  width: 100%;
}

.checkout-button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.cart-help {
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.35;
  margin: 10px 0 0;
}

.proposal-form {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 9px;
  margin-top: 14px;
  padding-top: 14px;
}

.proposal-form label {
  display: grid;
  gap: 5px;
  font-size: .9rem;
  font-weight: 700;
}

.proposal-form input {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  width: 100%;
}

.proposal-result {
  color: var(--accent);
  font-size: .9rem;
  line-height: 1.35;
  margin: 0;
}

.proposal-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  margin-top: 24px;
  padding: 18px;
}

.button.primary,
.chat-placeholder button {
  background: var(--brand);
  color: #fff;
}

.button.secondary {
  background: var(--soft);
  color: var(--ink);
}

.button.danger {
  background: #fff0ed;
  color: var(--danger);
}

.action-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.action-row form {
  margin: 0;
}

.panel-page {
  background: #faf9f6;
}

.panel-layout {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}

.panel-sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 24px 18px;
}

.panel-sidebar nav {
  display: grid;
  gap: 6px;
  margin-top: 28px;
}

.panel-sidebar nav a {
  border-radius: 8px;
  color: var(--ink);
  font-weight: 700;
  padding: 11px 12px;
  text-decoration: none;
}

.panel-sidebar nav a:hover {
  background: var(--soft);
}

.panel-main {
  min-width: 0;
}

.panel-topbar {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 16px 22px;
}

.panel-topbar span {
  color: var(--muted);
  display: block;
  font-size: .9rem;
}

.panel-section {
  padding: 26px;
}

.panel-section.narrow {
  max-width: 760px;
}

.section-heading {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-heading h1 {
  font-size: 1.8rem;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.empty-state,
.status-list,
.table-wrap,
.auth-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}

.empty-state h2 {
  font-size: 1.2rem;
  margin: 0 0 8px;
}

.empty-state p {
  color: var(--muted);
  margin: 0;
}

.form-grid,
.form-stack {
  display: grid;
  gap: 14px;
}

.stacked-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 14px;
  padding: 22px;
}

.form-grid {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 22px;
}

.form-grid div,
.form-stack div,
.form-stack label {
  display: grid;
  gap: 6px;
}

.form-grid input,
.form-grid textarea,
.form-stack input {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 10px;
  width: 100%;
}

.form-grid textarea {
  min-height: 86px;
}

.form-grid .button {
  justify-self: start;
}

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

.status-item {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
}

.status-item:last-child {
  border-bottom: 0;
}

.subtle {
  color: var(--muted);
  display: block;
  font-size: .86rem;
  margin-top: 3px;
}

.pill {
  background: var(--soft);
  border-radius: 999px;
  display: inline-block;
  font-size: .82rem;
  font-weight: 800;
  padding: 5px 9px;
}

.pill.ok {
  background: #e8f5e9;
  color: #1b5e20;
}

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

.item-cell {
  align-items: center;
  display: flex;
  gap: 12px;
}

.thumb {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 54px;
  object-fit: cover;
  width: 54px;
}

.image-layer {
  align-items: center;
  background: rgba(0, 0, 0, .72);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 50;
}

.image-layer-inner {
  background: #fff;
  border-radius: 8px;
  max-width: min(760px, 94vw);
  padding: 12px;
}

.image-layer-inner img {
  display: block;
  max-height: 74vh;
  max-width: 100%;
  object-fit: contain;
}

.image-layer-inner p {
  font-weight: 800;
  margin: 10px 0 0;
}

.image-layer-close {
  background: var(--soft);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  float: right;
  font-weight: 800;
  margin-bottom: 8px;
  padding: 8px 10px;
}

table {
  border-collapse: collapse;
  width: 100%;
}

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

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
}

.auth-card {
  max-width: 420px;
  width: 100%;
}

.auth-card h1 {
  font-size: 1.8rem;
  margin: 18px 0;
}

.message {
  border-radius: 8px;
  margin: 0 0 12px;
  padding: 10px 12px;
}

.message.success {
  background: #e8f5e9;
}

.message.error {
  background: #fff0ed;
  color: var(--danger);
}

@media (max-width: 760px) {
  .quick-actions,
  .panel-layout,
  .form-grid,
  .assistant-workspace {
    grid-template-columns: 1fr;
  }

  .cart-panel {
    max-height: none;
    position: static;
  }

  .bubble {
    max-width: 92%;
  }

  .chat-log {
    min-height: 380px;
  }

  .chat-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-sidebar {
    border-bottom: 1px solid var(--line);
    border-right: 0;
  }

  .panel-sidebar nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .public-header,
  .public-footer,
  .panel-topbar,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}
