/* Storm Damage Timestamp Logger */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-alt: #eef2f7;
  --border: #d8e0ea;
  --text: #1a2332;
  --text-muted: #5a6b7f;
  --accent: #1e3a5f;
  --accent-light: #2c5282;
  --warning: #f0b429;
  --danger: #c0392b;
  --success: #2e7d32;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(26, 35, 50, 0.08), 0 4px 12px rgba(26, 35, 50, 0.04);
  --shadow-lg: 0 4px 16px rgba(26, 35, 50, 0.1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

h1, h2, h3 {
  margin: 0 0 0.5em;
  line-height: 1.3;
  color: var(--accent);
}

h1 { font-size: 1.4rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

p { margin: 0 0 0.75em; }
a { color: var(--accent-light); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* Header */
.site-header {
  background: var(--accent);
  color: #fff;
  padding: 1rem 0;
  box-shadow: var(--shadow);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand h1 { color: #fff; margin: 0; }
.brand .tagline { color: rgba(255,255,255,0.8); font-size: 0.85rem; margin: 0; }

.site-nav {
  display: flex;
  gap: 1.25rem;
}

.site-nav a {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.site-nav a:hover { color: #fff; text-decoration: underline; }

/* Main */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

section { margin-bottom: 3rem; }

.section-intro {
  color: var(--text-muted);
  max-width: 700px;
  margin-bottom: 1.5rem;
}

/* Logger grid */
.logger-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 2rem;
  align-items: start;
}

.entry-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 1rem;
}

.panel-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.entry-panel label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0.75rem 0 0.25rem;
  color: var(--text);
}

.entry-panel input,
.entry-panel select,
.entry-panel textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}

.entry-panel input:focus,
.entry-panel select:focus,
.entry-panel textarea:focus {
  outline: 2px solid var(--accent-light);
  outline-offset: 1px;
  border-color: var(--accent-light);
}

.field-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0;
}

.btn-primary {
  display: block;
  width: 100%;
  margin-top: 1.25rem;
  padding: 0.75rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover { background: var(--accent-light); }
.btn-primary:focus { outline: 3px solid var(--warning); outline-offset: 2px; }

.feedback {
  font-size: 0.85rem;
  margin: 0.5rem 0 0;
  min-height: 1.2em;
}
.feedback.success { color: var(--success); }
.feedback.error { color: var(--danger); }

/* Log panel */
.log-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.log-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-ghost {
  padding: 0.5rem 0.9rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text);
  transition: background 0.15s;
}

.btn-ghost:hover { background: #dde5ef; }

.btn-danger {
  padding: 0.5rem 0.9rem;
  background: #fff;
  border: 1px solid var(--danger);
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--danger);
  transition: background 0.15s;
}

.btn-danger:hover { background: #fdecea; }

.log-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-state p { margin: 0.5rem 0; }
.empty-sub { font-size: 0.85rem; }

.log-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.log-entry {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--surface-alt);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
}

.log-entry-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.log-entry-type {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.95rem;
}

.log-entry-severity {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.severity-Minor { background: #fef3c7; color: #92400e; }
.severity-Moderate { background: #fed7aa; color: #9a3412; }
.severity-Severe { background: #fecaca; color: #991b1b; }

.log-entry-time {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.log-entry-location {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.25rem 0;
}

.log-entry-notes {
  font-size: 0.9rem;
  margin: 0.5rem 0;
  white-space: pre-wrap;
}

.log-entry-photo {
  max-width: 100%;
  max-height: 200px;
  border-radius: 6px;
  margin-top: 0.5rem;
  display: block;
}

.log-entry-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-end;
}

.log-entry-actions button {
  font-size: 0.78rem;
  padding: 0.3rem 0.6rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-muted);
}

.log-entry-actions button:hover { color: var(--danger); border-color: var(--danger); }

/* Tips section */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.tip-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  position: relative;
}

.tip-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.tip-card h3 { font-size: 1rem; }
.tip-card p { font-size: 0.9rem; color: var(--text-muted); margin: 0; }

/* Mistakes section */
.mistakes-section { margin-top: 3rem; }

.mistake-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mistake-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--warning);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
}

.mistake-list h3 { font-size: 1rem; margin-bottom: 0.25rem; }
.mistake-list p { font-size: 0.9rem; color: var(--text-muted); margin: 0; }

.edge-cases {
  margin-top: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.edge-cases h3 { font-size: 1rem; }
.edge-cases p { font-size: 0.9rem; color: var(--text-muted); margin: 0; }

/* Footer */
.site-footer {
  background: var(--accent);
  color: rgba(255,255,255,0.85);
  padding: 2rem 1.5rem;
  margin-top: 3rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  font-size: 0.85rem;
}

.footer-inner nav {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin: 0.75rem 0;
  flex-wrap: wrap;
}

.footer-inner a { color: rgba(255,255,255,0.9); text-decoration: none; }
.footer-inner a:hover { text-decoration: underline; }
.last-updated { font-size: 0.78rem; opacity: 0.7; margin-top: 0.5rem; }

/* Print */
@media print {
  .site-header, .site-footer, .entry-panel, .log-actions, .log-entry-actions,
  .tips-section, .mistakes-section, .site-nav { display: none !important; }
  body { background: #fff; }
  .log-panel { border: none; box-shadow: none; padding: 0; }
  .log-entry { break-inside: avoid; border: 1px solid #ccc; }
  .logger-grid { display: block; }
}

/* Responsive */
@media (max-width: 860px) {
  .logger-grid { grid-template-columns: 1fr; }
  .entry-panel { position: static; }
  .header-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  main { padding: 1rem; }
  .log-meta { flex-direction: column; gap: 0.25rem; }
  .log-header { 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;
}
