:root{
  --bg: #f8f9fa;
  --text: #2c3e50;
  --surface: #ffffff;
  --border: #e9ecef;
  --primary: #2b6cb0;
  --primary-hover: #2c5282;
  --secondary: #e2e8f0;
  --secondary-text: #4a5568;
  --heavy: #c53030;
  --medium: #dd6b20;
  --light: #38a169;
  --fragile: #805ad5;
  --font: system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
body { font-family: var(--font); margin: 0; background: var(--bg); color: var(--text); line-height: 1.6; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 1.5rem 0; }
.site-header .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.header-brand h1 { margin: 0; font-size: 1.5rem; color: var(--primary); }
.header-brand p { margin: 0; font-size: 0.9rem; color: var(--secondary-text); }
.site-header nav a { color: var(--secondary-text); text-decoration: none; margin-left: 1rem; font-weight: 500; }

/* Main Content */
.planner-section { margin: 2rem 0; background: var(--surface); padding: 2rem; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
.section-header h2 { margin-top: 0; }
.planner-grid { display: grid; grid-template-columns: 350px 1fr; gap: 2rem; margin-top: 1.5rem; }
@media (max-width: 800px) { .planner-grid { grid-template-columns: 1fr; } }

/* Controls */
.control-group { margin-bottom: 1.5rem; }
.control-group label { display: block; font-weight: bold; margin-bottom: 0.5rem; }
select, input[type="text"] { width: 100%; padding: 0.5rem; border: 1px solid var(--border); border-radius: 4px; font-family: var(--font); }
.item-list { list-style: none; padding: 0; margin: 0 0 1rem 0; max-height: 250px; overflow-y: auto; border: 1px solid var(--border); border-radius: 4px; }
.item-list li { padding: 0.5rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; }
.item-list li:last-child { border-bottom: none; }
.item-list .del-btn { background: none; border: none; color: #a0aec0; cursor: pointer; }
.add-item-form { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; align-items: center; }
.add-item-form input[type="text"] { grid-column: span 2; }
.checkbox-label { font-size: 0.9rem; display: flex; align-items: center; gap: 0.25rem; }
button { padding: 0.5rem 1rem; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; }
.btn-primary, button[type="submit"] { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--secondary); color: var(--text); }
.action-panel { margin-top: 1.5rem; display: flex; gap: 0.5rem; }

/* Canvas */
.planner-canvas { background: var(--bg); border: 2px dashed var(--border); border-radius: 8px; padding: 1.5rem; display: flex; justify-content: center; align-items: center; min-height: 400px; }
.bag-visualization { display: flex; flex-direction: column; width: 100%; max-width: 320px; border: 4px solid var(--secondary-text); border-radius: 12px; overflow: hidden; background: #fff; }
.bag-zone { padding: 1rem; min-height: 80px; border-bottom: 2px dashed var(--border); display: flex; flex-wrap: wrap; gap: 0.5rem; align-content: flex-start; }
.bag-zone:last-child { border-bottom: none; }
.bag-zone::before { content: attr(data-zone); width: 100%; font-size: 0.75rem; color: var(--secondary-text); font-weight: bold; text-transform: uppercase; margin-bottom: 0.5rem; }
.bag-item { padding: 0.25rem 0.5rem; font-size: 0.8rem; border-radius: 4px; color: #fff; white-space: nowrap; }
.item-w-heavy { background: var(--heavy); }
.item-w-medium { background: var(--medium); }
.item-w-light { background: var(--light); }
.item-f-true { border: 2px solid var(--fragile); }

/* Text */
.content-section { margin: 3rem 0; }
.content-section h2 { font-size: 1.5rem; color: var(--primary); border-bottom: 2px solid var(--border); padding-bottom: 0.5rem; }
.content-section h3 { margin-top: 1.5rem; }
.scenario-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 1.5rem; }
.scenario-card { background: var(--surface); padding: 1.5rem; border-radius: 8px; border: 1px solid var(--border); }
@media (max-width: 600px) { .scenario-grid { grid-template-columns: 1fr; } }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 2rem 0; text-align: center; color: var(--secondary-text); }
.site-footer a { color: var(--primary); text-decoration: none; margin: 0 0.5rem; }
.ecosystem-note { font-size: 0.85rem; margin-top: 1rem; }

@media print {
  body { background: #fff; }
  .site-header, .control-group, .inventory-manager, .action-panel, .content-section, .site-footer { display: none; }
  .planner-section { box-shadow: none; padding: 0; }
  .planner-canvas { border: none; }
}


/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
