:root {
  color-scheme: light;
  --bg: #f4f5f2;
  --ink: #1b1f23;
  --muted: #65707a;
  --panel: #ffffff;
  --line: #d9ded8;
  --accent: #1f6f5b;
  --accent-strong: #175445;
  --danger: #8a2f2b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.topbar {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: 28px;
}

h2 {
  margin-bottom: 10px;
  font-size: 18px;
}

.topbar p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.35;
}

.panel,
.item,
.flash {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel {
  padding: 14px;
  margin-bottom: 16px;
}

.login-panel {
  margin-top: 18vh;
}

.stack,
.capture-form {
  display: grid;
  gap: 12px;
}

.field {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

.text {
  resize: vertical;
  min-height: 150px;
  line-height: 1.4;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.quick-grid label {
  display: block;
}

.quick-grid input {
  position: absolute;
  opacity: 0;
}

.quick-grid span {
  display: grid;
  min-height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f9faf8;
  color: var(--ink);
  font-size: 14px;
  text-align: center;
}

.quick-grid input:checked + span {
  border-color: var(--accent);
  background: #e4f0eb;
  color: var(--accent-strong);
  font-weight: 700;
}

.file-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  border: 1px dashed var(--line);
  border-radius: 7px;
  padding: 12px;
  background: #fbfcfa;
}

.select-row {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.select-field {
  min-height: 44px;
}

.submit-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
}

.primary,
.secondary,
.icon-button {
  border: 0;
  border-radius: 7px;
  min-height: 44px;
  padding: 0 16px;
  font: inherit;
  cursor: pointer;
}

.primary {
  width: 100%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.primary:active {
  background: var(--accent-strong);
}

.secondary {
  background: #dfe7e3;
  color: var(--accent-strong);
  font-weight: 700;
}

.small {
  min-height: 36px;
  padding: 0 12px;
  font-size: 14px;
}

.icon-button {
  background: #e8ece8;
  color: var(--ink);
}

.flash {
  padding: 10px 12px;
  margin-bottom: 12px;
  border-color: #dfc48c;
  background: #fff8e5;
}

.list {
  display: grid;
  gap: 10px;
}

.item {
  padding: 12px;
}

.item p {
  margin-bottom: 6px;
  white-space: pre-wrap;
}

.item-meta,
.attachment,
.empty {
  color: var(--muted);
  font-size: 13px;
}

.process-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.proposal {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.proposal summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 700;
}

.proposal-note {
  color: var(--muted);
  font-size: 13px;
}

.proposal pre {
  overflow-x: auto;
  padding: 10px;
  border-radius: 7px;
  background: #f0f3ef;
  font-size: 12px;
  line-height: 1.35;
}

.item-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.mini-select {
  width: auto;
  min-height: 36px;
  padding: 0 8px;
  font-size: 14px;
}

.ai-answer {
  margin-top: 10px;
  padding: 10px;
  border-radius: 7px;
  border: 1px solid #cdd8d0;
  background: #eef5f1;
}

.ai-answer p {
  margin-bottom: 0;
  white-space: pre-wrap;
}

.ai-error {
  border-color: #deb6b3;
  background: #fff0ef;
  color: var(--danger);
}

@media (max-width: 560px) {
  .shell {
    padding: 12px;
  }

  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    align-items: center;
  }

  .process-row {
    align-items: stretch;
    flex-direction: column;
  }

  .submit-grid {
    grid-template-columns: 1fr;
  }
}

