:root {
  color-scheme: light;
  --bg: #f6f3ee;
  --panel: #fffdf9;
  --ink: #24211d;
  --muted: #6f675e;
  --line: #ded7cd;
  --accent: #2f6f73;
  --accent-2: #8d4e35;
  --soft: #e9f2ef;
  --warn: #fff2d1;
  --danger: #7e2f2f;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

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

button {
  min-height: 44px;
  border: 1px solid #24585b;
  border-radius: 7px;
  background: var(--accent);
  color: white;
  padding: 10px 14px;
  cursor: pointer;
}

button:hover {
  filter: brightness(0.95);
}

button.secondary {
  background: #fff;
  color: var(--accent);
}

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

textarea {
  min-height: 86px;
  resize: vertical;
}

a {
  color: var(--accent);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding: 28px clamp(16px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
  background: #fffaf2;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: 42px;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 21px;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.subtitle,
.muted {
  color: var(--muted);
}

.toplinks {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 18px;
  padding: 22px clamp(16px, 4vw, 44px) 34px;
}

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

.chat-panel,
.tech-panel {
  grid-column: span 1;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.status {
  border-radius: 999px;
  background: var(--soft);
  color: #214f51;
  padding: 7px 10px;
  font-size: 13px;
  white-space: nowrap;
}

.profile-row {
  display: grid;
  grid-template-columns: auto minmax(170px, 1fr) auto minmax(140px, 0.75fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.consent-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
}

.consent-row label {
  color: var(--ink);
}

.consent-row input {
  width: auto;
  min-height: auto;
}

.chat-log {
  min-height: 340px;
  max-height: 52vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.message {
  max-width: 78%;
  margin: 0 0 12px;
  padding: 11px 13px;
  border-radius: 8px;
  line-height: 1.45;
}

.message.user {
  margin-left: auto;
  background: #e7eef7;
}

.message.nina {
  background: #f5eadf;
}

.message.system {
  max-width: 100%;
  background: var(--warn);
  color: #5b4517;
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  margin-top: 12px;
}

.voice-row,
.inline-form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.profile-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  margin-bottom: 12px;
  line-height: 1.45;
}

.mini-list {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.5;
}

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

.event-log {
  margin-top: 12px;
  min-height: 100px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  color: var(--muted);
}

.shopping,
.report-form {
  display: grid;
  gap: 10px;
}

#shoppingList {
  margin: 0;
  padding-left: 22px;
}

.report-form {
  margin-top: 16px;
}

pre {
  white-space: pre-wrap;
  overflow: auto;
  max-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #171f22;
  color: #ecf6f3;
  padding: 12px;
  font-size: 13px;
}

summary {
  cursor: pointer;
  font-weight: 700;
  margin: 10px 0;
}

.footer {
  padding: 18px clamp(16px, 4vw, 44px) 28px;
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

@media (max-width: 680px) {
  .topbar,
  .section-head,
  .consent-row {
    display: block;
  }

  .profile-row,
  .composer,
  .voice-row,
  .inline-form,
  .button-grid {
    grid-template-columns: 1fr;
  }

  .message {
    max-width: 100%;
  }
}

@media print {
  body * {
    visibility: hidden;
  }

  #shoppingList,
  #shoppingList *,
  .print-title {
    visibility: visible;
  }

  #shoppingList {
    position: absolute;
    left: 24px;
    top: 64px;
    font-size: 20px;
  }
}
