* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #F5F1E8;
  --surface: #FFFFFF;
  --surface-alt: #EDE6D3;
  --border: #D8D4C7;
  --border-strong: #B8B1A0;
  --text: #2C3B24;
  --text-muted: #5F4A2E;
  --text-dim: #8A7A5E;
  --leaf-deep: #3B6D11;
  --leaf-mid: #639922;
  --leaf-bright: #97C459;
  --leaf-soft: #EAF3DE;
  --harvest: #BA7517;
  --harvest-soft: #FAEEDA;
  --harvest-text: #633806;
  --danger: #A32D2D;
  --danger-soft: #FCEBEB;
  --success: #3B6D11;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}
.brand-mark { display: flex; align-items: center; gap: 10px; }
.brand-logo {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--leaf-deep);
  display: flex; align-items: center; justify-content: center;
  color: var(--leaf-soft);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.5px;
}
.brand-name { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name .small {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--harvest);
  text-transform: uppercase;
  font-weight: 600;
}
.brand-name .big { font-size: 16px; color: var(--text); font-weight: 600; }

.btn {
  background: var(--leaf-deep);
  color: var(--leaf-soft);
  border: none;
  padding: 9px 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.btn:hover { background: var(--leaf-mid); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text-muted); padding: 6px 10px; }
.btn-ghost:hover { background: var(--surface-alt); color: var(--text); }
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface-alt); border-color: var(--border-strong); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.85; }

input, select, textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--leaf-mid);
  box-shadow: 0 0 0 2px var(--leaf-soft);
}
textarea { resize: vertical; min-height: 80px; }
label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
}

.section-title { font-size: 20px; font-weight: 600; margin-bottom: 4px; color: var(--text); }
.section-subtitle { font-size: 14px; color: var(--text-muted); margin-bottom: 18px; }

.pill {
  display: inline-block;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 500;
}
.pill-green { background: var(--leaf-soft); color: var(--leaf-deep); }
.pill-harvest { background: var(--harvest-soft); color: var(--harvest-text); }
.pill-live { background: var(--leaf-mid); color: white; }
.pill-dim { background: var(--surface-alt); color: var(--text-muted); }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
  font-size: 14px;
}

.hidden { display: none !important; }

.notice {
  background: var(--harvest-soft);
  border-left: 3px solid var(--harvest);
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--harvest-text);
  margin-bottom: 16px;
}
.notice-info {
  background: var(--leaf-soft);
  border-left-color: var(--leaf-mid);
  color: var(--leaf-deep);
}

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(44, 59, 36, 0.6);
  z-index: 1000;
  overflow-y: auto;
  padding: 20px;
}
.modal-backdrop.active { display: block; }
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.95);
  border: none;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  z-index: 3;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  font-family: inherit;
}
.modal-close:hover { background: white; transform: scale(1.05); }

.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--leaf-mid);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.code-display {
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
  background: var(--harvest-soft);
  color: var(--harvest-text);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
