/* AgeCheck: Appliance Age Decoder — Stylesheet */
:root {
  --c-primary: #C75B39;
  --c-primary-dark: #A34428;
  --c-primary-light: #F5E6DF;
  --c-sage: #6B8F71;
  --c-sage-light: #E8F0E9;
  --c-cream: #FDF8F4;
  --c-warm-gray: #5C5652;
  --c-text: #2D2926;
  --c-text-light: #7A736C;
  --c-border: #E0D5CD;
  --c-white: #FFFFFF;
  --c-error: #B91C1C;
  --c-error-light: #FEF2F2;
  --c-warning: #B45309;
  --c-warning-light: #FFFBEB;
  --c-success: #166534;
  --c-success-light: #F0FDF4;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.1), 0 2px 6px rgba(0,0,0,0.06);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --max-width: 1200px;
  --transition: 0.2s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--c-text);
  background: var(--c-cream);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* Header */
.site-header {
  background: var(--c-white);
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-text);
}
.logo:hover, .logo:focus { text-decoration: none; color: var(--c-primary); }
.main-nav { display: flex; gap: 24px; }
.main-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--c-warm-gray);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}
.main-nav a:hover, .main-nav a:focus {
  color: var(--c-primary);
  border-bottom-color: var(--c-primary);
  text-decoration: none;
}

/* Hero */
.hero-section {
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-dark) 100%);
  color: var(--c-white);
  padding: 48px 24px;
  text-align: center;
}
.hero-content { max-width: 640px; margin: 0 auto; }
.hero-section h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
}
.hero-sub {
  font-size: 1.05rem;
  opacity: 0.92;
  line-height: 1.5;
}

/* Dashboard Layout */
.dashboard {
  max-width: var(--max-width);
  margin: 32px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  align-items: start;
}

/* Inventory Panel */
.inventory-panel {
  background: var(--c-white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 80px;
}
.inventory-panel h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.panel-note {
  font-size: 0.8rem;
  color: var(--c-text-light);
  margin-bottom: 16px;
}
.inventory-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
}
.inventory-empty {
  font-size: 0.85rem;
  color: var(--c-text-light);
  font-style: italic;
  padding: 12px 0;
}
.inventory-item {
  background: var(--c-cream);
  border-radius: var(--radius-sm);
  padding: 12px;
  border: 1px solid var(--c-border);
}
.inventory-item-name {
  font-weight: 600;
  font-size: 0.9rem;
  display: block;
}
.inventory-item-detail {
  font-size: 0.8rem;
  color: var(--c-text-light);
  display: block;
  margin-top: 2px;
}
.inventory-item-age {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--c-primary);
  display: block;
  margin-top: 4px;
}
.inventory-item-remove {
  background: none;
  border: none;
  color: var(--c-text-light);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 4px 0;
  margin-top: 4px;
}
.inventory-item-remove:hover { color: var(--c-error); }

/* Decoder Panel */
.decoder-panel {
  background: var(--c-white);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}
.decoder-panel h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 24px;
}
.decoder-form { display: flex; flex-direction: column; gap: 20px; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--c-text);
}
.form-select, .form-input {
  font-family: var(--font);
  font-size: 1rem;
  padding: 12px 14px;
  border: 2px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-white);
  color: var(--c-text);
  transition: var(--transition);
  width: 100%;
}
.form-select:focus, .form-input:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(199, 91, 57, 0.15);
}
.form-hint {
  font-size: 0.8rem;
  color: var(--c-text-light);
}

/* Buttons */
.btn {
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-primary {
  background: var(--c-primary);
  color: var(--c-white);
  border-color: var(--c-primary);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--c-primary-dark);
  border-color: var(--c-primary-dark);
  color: var(--c-white);
  text-decoration: none;
}
.btn-secondary {
  background: var(--c-sage-light);
  color: var(--c-sage);
  border-color: var(--c-sage);
}
.btn-secondary:hover, .btn-secondary:focus {
  background: var(--c-sage);
  color: var(--c-white);
  text-decoration: none;
}
.btn-text {
  background: none;
  border: none;
  color: var(--c-primary);
  padding: 8px 12px;
  font-size: 0.85rem;
  text-decoration: underline;
}
.btn-text:hover, .btn-text:focus { color: var(--c-primary-dark); }
.btn-full { width: 100%; }

/* Result Area */
.result-area { margin-top: 28px; }
.result-card {
  background: var(--c-cream);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--c-border);
}
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.result-header h3 { font-size: 1.1rem; font-weight: 700; }
.result-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
}
.badge-good { background: var(--c-success-light); color: var(--c-success); }
.badge-warning { background: var(--c-warning-light); color: var(--c-warning); }
.badge-danger { background: var(--c-error-light); color: var(--c-error); }
.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.result-item dt {
  font-size: 0.8rem;
  color: var(--c-text-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.result-item dd {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--c-text);
}
.result-status {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 20px;
}
.status-good { background: var(--c-success-light); color: var(--c-success); }
.status-warning { background: var(--c-warning-light); color: var(--c-warning); }
.status-danger { background: var(--c-error-light); color: var(--c-error); }
.result-tips { margin-bottom: 20px; }
.result-tips h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.result-tips ul {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.result-tips li { font-size: 0.9rem; color: var(--c-warm-gray); }
.result-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

/* Error Area */
.error-area { margin-top: 28px; }
.error-card {
  background: var(--c-error-light);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid #FECACA;
}
.error-card h3 { color: var(--c-error); font-size: 1.1rem; margin-bottom: 8px; }
.error-card p { margin-bottom: 16px; font-size: 0.95rem; }
.error-help h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 8px; }
.error-help ul { padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.error-help li { font-size: 0.85rem; color: var(--c-warm-gray); }

/* Lifespan Table */
.lifespan-section {
  max-width: var(--max-width);
  margin: 48px auto;
  padding: 0 24px;
}
.lifespan-section h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.section-intro {
  color: var(--c-text-light);
  font-size: 0.95rem;
  margin-bottom: 24px;
}
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.lifespan-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--c-white);
  font-size: 0.9rem;
}
.lifespan-table th {
  background: var(--c-primary);
  color: var(--c-white);
  padding: 14px 18px;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.lifespan-table td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--c-border);
}
.lifespan-table tr:last-child td { border-bottom: none; }
.lifespan-table tr:hover td { background: var(--c-cream); }

/* Troubleshoot Section */
.troubleshoot-section {
  max-width: var(--max-width);
  margin: 48px auto;
  padding: 0 24px;
}
.troubleshoot-section h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 24px;
}
.mistake-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.mistake-card {
  background: var(--c-white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--c-primary);
}
.mistake-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.mistake-card p {
  font-size: 0.85rem;
  color: var(--c-warm-gray);
  line-height: 1.5;
}
.format-examples {
  background: var(--c-white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.format-examples h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 16px;
}
.format-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 20px;
  font-size: 0.9rem;
}
.format-list dt {
  font-weight: 700;
  color: var(--c-primary);
  white-space: nowrap;
}
.format-list dd {
  color: var(--c-warm-gray);
}

/* Scenario Section */
.scenario-section {
  max-width: var(--max-width);
  margin: 48px auto;
  padding: 0 24px;
}
.scenario-section h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 24px;
}
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.scenario-card {
  background: var(--c-white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--c-sage);
}
.scenario-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.scenario-card p {
  font-size: 0.9rem;
  color: var(--c-warm-gray);
  line-height: 1.6;
}

/* Footer */
.site-footer {
  background: var(--c-text);
  color: rgba(255,255,255,0.7);
  margin-top: auto;
  padding: 32px 24px;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.footer-brand { display: flex; flex-direction: column; gap: 2px; }
.footer-brand strong { color: var(--c-white); font-size: 1rem; }
.footer-brand span { font-size: 0.8rem; }
.footer-nav { display: flex; gap: 20px; }
.footer-nav a { color: rgba(255,255,255,0.7); font-size: 0.85rem; }
.footer-nav a:hover, .footer-nav a:focus { color: var(--c-white); }
.footer-note { font-size: 0.75rem; width: 100%; text-align: center; margin-top: 8px; }

/* Responsive */
@media (max-width: 900px) {
  .dashboard {
    grid-template-columns: 1fr;
  }
  .inventory-panel {
    position: static;
    order: 2;
  }
  .decoder-panel { order: 1; }
}
@media (max-width: 600px) {
  .header-inner { padding: 0 16px; }
  .main-nav { gap: 14px; }
  .main-nav a { font-size: 0.8rem; }
  .hero-section { padding: 32px 16px; }
  .dashboard { padding: 0 16px; margin: 20px auto; }
  .decoder-panel { padding: 20px; }
  .result-grid { grid-template-columns: 1fr; }
  .result-actions { flex-direction: column; align-items: stretch; }
  .lifespan-section, .troubleshoot-section, .scenario-section { padding: 0 16px; }
  .format-list { grid-template-columns: 1fr; gap: 4px 0; }
  .format-list dt { margin-top: 12px; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-nav { flex-wrap: wrap; justify-content: center; }
}

/* Print */
@media print {
  .site-header, .site-footer, .inventory-panel, .result-actions, .btn { display: none !important; }
  .dashboard { display: block; }
  .result-card { border: 2px solid #333; }
}

/* Focus visible */
:focus-visible {
  outline: 3px solid var(--c-primary);
  outline-offset: 2px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--c-text);
  color: var(--c-white);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  animation: toastIn 0.3s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}



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