/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f8f7f4;
  --surface: #ffffff;
  --surface-alt: #f0eeea;
  --text: #1a1a1a;
  --text-secondary: #555;
  --text-muted: #888;
  --accent: #2d6a4f;
  --accent-light: #40916c;
  --accent-bg: #d8f3dc;
  --warn: #e76f51;
  --warn-bg: #fce4d6;
  --danger: #d62828;
  --danger-bg: #fde8e8;
  --ok: #2d6a4f;
  --ok-bg: #d8f3dc;
  --border: #ddd;
  --radius: 10px;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-width: 960px;
}
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.6; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.25rem; }
.skip-link { position: absolute; top: -100%; left: 1rem; background: var(--accent); color: #fff; padding: 0.5rem 1rem; border-radius: 0 0 var(--radius) var(--radius); z-index: 100; text-decoration: none; }
.skip-link:focus { top: 0; }

/* ===== Header ===== */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 0; gap: 1rem; }
.logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.1rem; color: var(--accent); text-decoration: none; }
.logo-icon { flex-shrink: 0; }
.site-nav { display: flex; gap: 1.25rem; }
.site-nav a { color: var(--text-secondary); text-decoration: none; font-size: 0.9rem; font-weight: 500; transition: color 0.15s; }
.site-nav a:hover, .site-nav a:focus { color: var(--accent); }

/* ===== Hero ===== */
.hero-section { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%); color: #fff; padding: 3.5rem 0 3rem; }
.hero-content { max-width: 640px; }
.hero-content h1 { font-size: 2.2rem; line-height: 1.2; margin-bottom: 0.75rem; }
.hero-sub { font-size: 1.1rem; opacity: 0.9; margin-bottom: 2rem; }
.hero-stats { display: flex; gap: 2rem; }
.stat { display: flex; flex-direction: column; }
.stat strong { font-size: 1.6rem; line-height: 1.2; }
.stat span { font-size: 0.8rem; opacity: 0.8; }

/* ===== Sections ===== */
section { padding: 2.5rem 0; }
section h2 { font-size: 1.4rem; margin-bottom: 0.4rem; }
.section-desc { color: var(--text-secondary); margin-bottom: 1.5rem; font-size: 0.95rem; }

/* ===== Add Form ===== */
.add-section { background: var(--surface); border-bottom: 1px solid var(--border); }
.add-form { margin-bottom: 1.25rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field label { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }
.field input { padding: 0.6rem 0.75rem; border: 1.5px solid var(--border); border-radius: var(--radius); font-size: 0.95rem; background: var(--bg); transition: border-color 0.15s, box-shadow 0.15s; }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(45,106,79,0.15); }
.field-submit { justify-content: flex-end; }
.presets { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.presets-label { font-size: 0.82rem; color: var(--text-muted); font-weight: 600; }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.6rem 1.25rem; border-radius: var(--radius); font-size: 0.9rem; font-weight: 600; cursor: pointer; border: 1.5px solid transparent; transition: all 0.15s; text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-light); border-color: var(--accent-light); }
.btn-outline { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-outline:hover { background: var(--accent-bg); }
.btn-preset { background: var(--surface-alt); color: var(--text-secondary); border-color: var(--border); padding: 0.4rem 0.85rem; font-size: 0.82rem; }
.btn-preset:hover { background: var(--accent-bg); border-color: var(--accent-light); color: var(--accent); }
.btn-danger { background: transparent; color: var(--danger); border-color: transparent; padding: 0.3rem 0.6rem; font-size: 0.8rem; }
.btn-danger:hover { background: var(--danger-bg); }

/* ===== Timeline ===== */
.timeline-view { display: flex; flex-direction: column; gap: 0.5rem; }
.timeline-bar-group { display: flex; align-items: center; gap: 1rem; }
.timeline-label { min-width: 160px; font-size: 0.85rem; font-weight: 500; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline-bar-wrap { flex: 1; background: var(--surface-alt); border-radius: 99px; height: 28px; position: relative; overflow: hidden; }
.timeline-bar { height: 100%; border-radius: 99px; display: flex; align-items: center; padding: 0 0.75rem; font-size: 0.75rem; font-weight: 600; color: #fff; min-width: fit-content; transition: width 0.3s; white-space: nowrap; }
.timeline-bar.safe { background: var(--ok); }
.timeline-bar.warning { background: #e9c46a; color: #333; }
.timeline-bar.danger { background: var(--warn); }
.timeline-bar.expired { background: var(--danger); }

/* ===== Bulletin ===== */
.bulletin-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.bulletin-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.bulletin-list { display: flex; flex-direction: column; gap: 0.75rem; }

/* ===== Item Cards ===== */
.item-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; box-shadow: var(--shadow); transition: box-shadow 0.15s; }
.item-card:hover { box-shadow: var(--shadow-lg); }
.item-card .item-info { flex: 1; min-width: 0; }
.item-card .item-name { font-weight: 600; font-size: 1rem; margin-bottom: 0.2rem; }
.item-card .item-meta { font-size: 0.82rem; color: var(--text-secondary); display: flex; flex-wrap: wrap; gap: 0.75rem; }
.item-card .item-badge { font-size: 0.75rem; font-weight: 700; padding: 0.2rem 0.6rem; border-radius: 99px; text-transform: uppercase; letter-spacing: 0.03em; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.item-card .item-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }

/* ===== All Items ===== */
.all-items-list { display: flex; flex-direction: column; gap: 0.5rem; }

/* ===== Tips ===== */
.tips-section { background: var(--surface); }
.tips-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.tip-card { background: var(--bg); border-radius: var(--radius); padding: 1.25rem; border: 1px solid var(--border); }
.tip-card h3 { font-size: 1rem; margin-bottom: 0.4rem; color: var(--accent); }
.tip-card p { font-size: 0.9rem; color: var(--text-secondary); }

/* ===== FAQ ===== */
.faq-list { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.faq-list details { border-bottom: 1px solid var(--border); }
.faq-list details:last-child { border-bottom: none; }
.faq-list summary { padding: 1rem 1.25rem; font-weight: 600; cursor: pointer; font-size: 0.95rem; background: var(--surface); }
.faq-list summary:hover { background: var(--surface-alt); }
.faq-list details[open] summary { background: var(--surface-alt); }
.faq-list details p { padding: 0 1.25rem 1rem; font-size: 0.9rem; color: var(--text-secondary); }

/* ===== Empty State ===== */
.empty-state { text-align: center; padding: 2rem; color: var(--text-muted); font-size: 0.95rem; }
.empty-state svg { margin-bottom: 0.75rem; opacity: 0.4; }

/* ===== Toast ===== */
.toast { position: fixed; bottom: 1.5rem; right: 1.5rem; background: var(--text); color: #fff; padding: 0.75rem 1.25rem; border-radius: var(--radius); font-size: 0.9rem; opacity: 0; transform: translateY(10px); transition: opacity 0.2s, transform 0.2s; pointer-events: none; z-index: 100; }
.toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* ===== Footer ===== */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 1.5rem 0; margin-top: 2rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.75rem; font-size: 0.85rem; color: var(--text-secondary); }
.footer-inner a { color: var(--accent); text-decoration: none; }
.footer-inner a:hover { text-decoration: underline; }
.footer-nav { display: flex; gap: 1rem; }

/* ===== Print ===== */
@media print {
  .site-header, .site-footer, .add-section, .bulletin-actions, .tips-section, .faq-section, .item-actions, .btn { display: none !important; }
  body { background: #fff; color: #000; }
  .item-card { break-inside: avoid; border: 1px solid #ccc; }
}

/* ===== Responsive ===== */
@media (max-width: 700px) {
  .hero-content h1 { font-size: 1.6rem; }
  .hero-stats { gap: 1rem; }
  .stat strong { font-size: 1.2rem; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .field-submit { grid-column: 1 / -1; }
  .timeline-label { min-width: 100px; font-size: 0.78rem; }
  .bulletin-header { flex-direction: column; }
  .item-card { flex-direction: column; align-items: flex-start; }
  .header-inner { flex-wrap: wrap; }
  .site-nav { gap: 0.75rem; }
}
@media (max-width: 480px) {
  .form-grid { grid-template-columns: 1fr; }
  .hero-section { padding: 2rem 0; }
  .hero-content h1 { font-size: 1.35rem; }
  .presets { flex-direction: column; align-items: flex-start; }
}



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