/* CostumeVault styles */
:root {
  --bg: #faf6f1;
  --surface: #ffffff;
  --surface-alt: #f5ede3;
  --text: #2d2520;
  --text-muted: #6b5d52;
  --border: #e0d4c6;
  --primary: #b5402a;
  --primary-dark: #93331f;
  --primary-light: #f7e8e3;
  --accent: #d4842b;
  --success: #4a7c3f;
  --warning: #c49a2a;
  --danger: #b5402a;
  --shadow: 0 2px 8px rgba(45, 37, 32, 0.08);
  --shadow-lg: 0 8px 24px rgba(45, 37, 32, 0.12);
  --radius: 10px;
  --radius-sm: 6px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0 0 1em; }

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-icon { color: var(--primary); }
.site-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.95rem;
}
.site-nav a { color: var(--text-muted); font-weight: 500; }
.site-nav a:hover { color: var(--primary); text-decoration: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  font-family: inherit;
}
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; color: white; }
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { background: var(--surface-alt); text-decoration: none; }
.btn-danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}
.btn-danger:hover { background: #f7e8e3; text-decoration: none; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.85rem; }

.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
}
.hero-text h1 { color: var(--text); }
.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 540px;
}
.hero-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; flex-wrap: wrap; }
.hero-stats {
  display: flex;
  gap: 1rem;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  text-align: center;
  min-width: 90px;
  box-shadow: var(--shadow);
}
.stat span {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
}
.stat label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.workspace {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.workspace-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.5rem;
  align-items: start;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.panel h2 { margin-bottom: 1rem; }

.field { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.9rem; }
.field span { font-size: 0.85rem; font-weight: 500; color: var(--text-muted); }
.field input, .field select, .field textarea {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--primary-light);
  border-color: var(--primary);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.form-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }

.presets { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.presets h3 { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.6rem; }
.preset-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.preset-chip {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  transition: all 0.15s;
}
.preset-chip:hover { background: var(--primary-light); border-color: var(--primary); }

.inventory-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.toolbar-controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.toolbar-controls input, .toolbar-controls select {
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}
.toolbar-controls input { min-width: 160px; }

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  min-height: 200px;
}
.item-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.item-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.item-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: var(--surface);
}
.item-card .placeholder-img {
  width: 100%;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--border);
  font-size: 2.5rem;
}
.item-card-body { padding: 0.75rem; }
.item-card-body h4 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 600;
}
.item-meta {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}
.tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.tag.status-available { background: #e8f5e6; border-color: #b7d9ae; color: var(--success); }
.tag.status-in-use { background: #fef3e0; border-color: #e8d49a; color: var(--accent); }
.tag.status-repair { background: #f7e8e3; border-color: #e0b8aa; color: var(--danger); }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  display: none;
}
.empty-state.visible { display: block; }
.empty-state svg { margin-bottom: 0.75rem; opacity: 0.5; }

.inventory-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.walkthrough {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
.section-intro { color: var(--text-muted); font-size: 1.05rem; max-width: 700px; }
.scenario-steps {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  gap: 1.25rem;
  counter-reset: step;
}
.scenario-steps li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem 1.25rem 3.5rem;
  position: relative;
  counter-increment: step;
}
.scenario-steps li::before {
  content: counter(step);
  position: absolute;
  left: 1rem;
  top: 1.25rem;
  width: 1.8rem;
  height: 1.8rem;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}
.scenario-steps h3 { margin-bottom: 0.3rem; }
.scenario-steps p { margin: 0; color: var(--text-muted); }

.tips {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
.tip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}
.tip-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.tip-card h3 { font-size: 1rem; margin-bottom: 0.4rem; }
.tip-card p { margin: 0; font-size: 0.9rem; color: var(--text-muted); }
.storage-note {
  margin-top: 1.5rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.storage-note h3 { margin-bottom: 0.4rem; }
.storage-note p { margin: 0; color: var(--text-muted); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(45, 37, 32, 0.5);
}
.modal-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 500px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-item-img {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  background: var(--surface-alt);
}
.modal-details dt {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}
.modal-details dd { margin: 0.15rem 0 0; }
.modal-actions { display: flex; gap: 0.5rem; margin-top: 1.25rem; flex-wrap: wrap; }

.label-print { padding: 1rem; }
.label-print .label-page { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.label-print .label-item {
  border: 1px dashed var(--border);
  padding: 1rem;
  border-radius: var(--radius-sm);
  text-align: center;
}
.label-print .label-item h4 { margin: 0 0 0.25rem; font-size: 1rem; }
.label-print .label-item p { margin: 0; font-size: 0.8rem; color: var(--text-muted); }

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding: 2rem 1.5rem;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.footer-inner nav {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  margin: 0.75rem 0;
  flex-wrap: wrap;
}
.footer-inner nav a { color: var(--text-muted); }
.footer-inner nav a:hover { color: var(--primary); }
.footer-meta { font-size: 0.8rem; margin-top: 0.5rem; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-stats { justify-content: flex-start; }
  .workspace-grid { grid-template-columns: 1fr; }
  .inventory-panel { order: -1; }
  .field-row { grid-template-columns: 1fr; }
  .toolbar-controls { width: 100%; }
  .toolbar-controls input { flex: 1; min-width: 0; }
  .site-nav { gap: 0.75rem; font-size: 0.85rem; }
  .header-inner { padding: 0.6rem 1rem; }
}

@media (max-width: 480px) {
  .hero-stats { flex-direction: column; }
  .stat { min-width: auto; }
  .inventory-actions { flex-direction: column; }
  .inventory-actions .btn { width: 100%; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
}

@media print {
  .site-header, .site-footer, .add-panel, .inventory-actions, .hero, .walkthrough, .tips { display: none; }
  .workspace { padding: 0; }
  .inventory-panel { box-shadow: none; border: none; }
  .inventory-grid { grid-template-columns: repeat(3, 1fr); }
  .item-card { break-inside: avoid; }
}



/* 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;
}
