:root {
  --bg: #f5efe4;
  --surface: #ffffff;
  --surface-alt: #faf5ec;
  --text: #1a1a1a;
  --muted: #8a8378;
  --accent: #b87333;
  --accent-soft: #f4e4cf;
  --accent-strong: #a35d1f;
  --star: #d99a2b;
  --star-empty: #e7d9c2;
  --border: #ece3d2;
  --danger: #b04a3a;
  --shadow: 0 2px 12px rgba(120, 90, 50, 0.08);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  z-index: 10;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brand-icon {
  font-size: 28px;
  line-height: 1;
}

.brand-name {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: 28px;
  color: var(--accent);
  letter-spacing: 0.2px;
}

.topnav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pill:hover {
  background: var(--surface-alt);
  color: var(--accent-strong);
}

.pill-active {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  color: var(--accent-strong);
}

.content {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 22px 120px;
}

.count {
  margin: 0 0 16px;
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--muted);
  text-transform: uppercase;
}

.bean-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bean-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}

.bean-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(120, 90, 50, 0.12);
}

.bean-info {
  min-width: 0;
}

.bean-name {
  margin: 0 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bean-roaster {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--muted);
  text-transform: uppercase;
}

.bean-added-by {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

.bean-card-readonly {
  cursor: default;
}

.bean-card-readonly:hover {
  transform: none;
  box-shadow: var(--shadow);
}

.collection-label {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
}

.auth-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 600;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-gate {
  background: var(--surface);
  padding: 22px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.bean-stars {
  font-size: 22px;
  color: var(--star);
  white-space: nowrap;
  letter-spacing: 1px;
}

.bean-stars .star-empty {
  color: var(--star-empty);
}

.empty {
  text-align: center;
  color: var(--muted);
  margin-top: 60px;
}

.fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 300;
  box-shadow: 0 6px 18px rgba(184, 115, 51, 0.45);
  border: none;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease;
}

.fab:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.page-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  margin: 0 0 22px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: var(--surface);
  padding: 22px;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input[type="text"],
.field textarea,
.field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-alt);
  font-size: 16px;
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.field input[type="text"]:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}

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

.rating-input {
  display: inline-flex;
  gap: 4px;
}

.star-btn {
  background: none;
  border: none;
  font-size: 32px;
  color: var(--star-empty);
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
  transition: color 0.1s ease, transform 0.1s ease;
}

.star-btn:hover {
  transform: scale(1.1);
}

.star-btn.active {
  color: var(--star);
}

.checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.btn-secondary {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--surface-alt);
  color: var(--accent-strong);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 110px;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

@media (max-width: 480px) {
  .topbar {
    padding: 14px 16px;
  }
  .brand-name {
    font-size: 24px;
  }
  .pill {
    padding: 6px 14px;
    font-size: 14px;
  }
  .content {
    padding: 22px 16px 120px;
  }
  .bean-name {
    font-size: 20px;
  }
  .fab {
    width: 56px;
    height: 56px;
    font-size: 28px;
    bottom: 22px;
    right: 22px;
  }
}
