:root {
  color-scheme: light;
  --bg: #f3f1ea;
  --panel: #fffdf7;
  --line: #ddd4c6;
  --text: #1f1a14;
  --muted: #6f6354;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --shadow: 0 18px 48px rgba(49, 39, 25, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 28%),
    linear-gradient(180deg, #f7f4ed 0%, var(--bg) 100%);
}

button,
input {
  font: inherit;
}

.shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.topbar,
.columns {
  display: grid;
  gap: 18px;
}

.topbar {
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  align-items: start;
  margin-bottom: 18px;
}

.columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel {
  background: color-mix(in srgb, var(--panel) 94%, white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.eyebrow,
.meta,
label {
  color: var(--muted);
  font-size: 0.92rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin: 0 0 8px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 3vw, 3.25rem);
  line-height: 0.98;
  margin-bottom: 10px;
}

h2 {
  font-size: 1rem;
}

.meta {
  min-height: 1.2rem;
}

.list-picker,
.add-form {
  display: grid;
  gap: 10px;
}

.back-link {
  align-self: start;
  justify-self: end;
  color: var(--accent-strong);
  text-decoration: none;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.72);
}

.back-link:hover {
  background: white;
}

.inline-row {
  display: flex;
  gap: 10px;
}

input {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
}

input:focus {
  outline: 2px solid rgba(15, 118, 110, 0.18);
  border-color: var(--accent);
}

button {
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  padding: 11px 14px;
  cursor: pointer;
  white-space: nowrap;
}

button:hover {
  background: var(--accent-strong);
}

button.secondary {
  background: transparent;
  color: var(--accent-strong);
  border: 1px solid rgba(15, 118, 110, 0.22);
}

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

.count-chip {
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent-strong);
  padding: 4px 10px;
  font-size: 0.88rem;
}

.item-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.directory-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.directory-link {
  display: block;
  border: 1px solid rgba(31, 26, 20, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.directory-link:hover {
  border-color: rgba(15, 118, 110, 0.3);
  background: white;
}

.item-card {
  border: 1px solid rgba(31, 26, 20, 0.08);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.item-head,
.item-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.item-head {
  align-items: baseline;
  margin-bottom: 10px;
}

.item-name {
  font-weight: 600;
}

.item-qty {
  color: var(--muted);
  white-space: nowrap;
}

.item-actions {
  align-items: center;
}

.item-body {
  display: grid;
  gap: 10px;
}

.item-actions form {
  display: flex;
  gap: 8px;
  width: 100%;
}

.item-actions input {
  max-width: 84px;
}

.item-note {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.35;
}

.note-form {
  display: flex;
  gap: 8px;
}

.note-form input {
  flex: 1;
}

.empty-state {
  color: var(--muted);
  font-size: 0.95rem;
  padding: 8px 0;
}

@media (max-width: 920px) {
  .topbar,
  .columns {
    grid-template-columns: 1fr;
  }

  .shell {
    padding: 18px;
  }
}
