:root {
  --ink: #1b2430;
  --bg: #e9eef0;
  --card: #ffffff;
  --line: #d7dce0;
  --muted: #5b6570;
  --brand: #0d5c56;
  --brand-dark: #0a4a45;
  --amber: #a67c2e;
  --amber-bg: #f6eedd;
  --alert: #b5502e;
  --alert-bg: #f7e6e1;
  --success: #3f7d5c;
  --success-bg: #e9f2ec;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.wrap { max-width: 780px; margin: 0 auto; padding: 28px 18px 80px; }

/* Language switch */
.topbar { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.lang-switch {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.lang-switch:hover { border-color: var(--brand); color: var(--brand); }

header { text-align: center; margin-bottom: 28px; }
.brand {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand);
  font-family: 'IBM Plex Mono', monospace;
}
.brand svg { width: 18px; height: 18px; }
h1 {
  font-family: 'Fraunces', Georgia, serif; font-size: 30px; line-height: 1.2;
  margin: 18px auto 12px; font-weight: 600; max-width: 580px;
}
.tagline { color: var(--muted); font-size: 16px; max-width: 520px; margin: 0 auto; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 18px; }

/* Feed rows */
.feed { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 14px; background: #fbfcfc; }
.feed-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.feed-name {
  flex: 1; min-width: 150px; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; font-size: 14px; font-family: inherit; background: #fff; color: var(--ink);
}
.feed-remove {
  background: transparent; border: none; color: var(--muted); font-size: 13px; cursor: pointer;
  padding: 6px 8px; border-radius: 6px;
}
.feed-remove:hover { color: var(--alert); background: #f7e6e1; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.seg button {
  border: none; background: #fff; color: var(--muted); font-size: 13px; font-weight: 500;
  padding: 8px 12px; cursor: pointer; font-family: inherit;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button.active { background: var(--brand); color: #fff; }

label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }

textarea {
  width: 100%; min-height: 120px; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  resize: vertical; background: #fff; color: var(--ink);
}
input[type="url"], input[type="email"] {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px;
  font-size: 15px; font-family: inherit; background: #fff; color: var(--ink);
}
.filewrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
input[type="file"] { font-size: 13px; }
.file-status { font-size: 13px; color: var(--success); }

details summary { font-size: 13px; color: var(--brand); cursor: pointer; margin-top: 8px; }
details p { font-size: 13px; color: var(--muted); margin: 8px 0 0; }

.actions { display: flex; gap: 12px; justify-content: center; margin: 20px 0 4px; flex-wrap: wrap; }
button {
  font-family: inherit; cursor: pointer; border: none; border-radius: 999px;
  padding: 12px 24px; font-weight: 600; font-size: 15px; transition: background 150ms ease;
}
button:disabled { opacity: 0.6; cursor: default; }
.primary { background: var(--brand); color: #fff; }
.primary:hover:not(:disabled) { background: var(--brand-dark); }
.ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.ghost:hover { background: rgba(13, 92, 86, 0.07); }
.link-btn { background: transparent; color: var(--brand); padding: 8px 4px; font-size: 14px; }
.link-btn:hover { text-decoration: underline; }

.form-error { text-align: center; color: var(--alert); font-size: 14px; min-height: 18px; margin-top: 6px; }

/* Results */
#results { display: none; }
#results.show { display: block; animation: fadeIn 300ms ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.summary { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.stat { flex: 1; min-width: 120px; background: #fbfcfc; border: 1px solid var(--line); border-radius: 10px; padding: 14px; text-align: center; }
.stat .n { font-family: 'Fraunces', serif; font-size: 26px; font-weight: 600; }
.stat .l { font-size: 12px; color: var(--muted); }

.risk-banner { border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; }
.risk-banner .rt { font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.risk-banner ul { margin: 0; padding-left: 18px; font-size: 14px; }
.risk-banner li { margin: 2px 0; }
.risk-green { background: var(--success-bg); color: var(--success); }
.risk-amber { background: var(--amber-bg); color: var(--amber); }
.risk-red { background: var(--alert-bg); color: var(--alert); }

.timeline-wrap { margin-bottom: 16px; overflow-x: auto; }

.conflict { border: 1px solid #eeccc0; background: #fdf6f3; border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; }
.conflict .dates { font-weight: 600; font-size: 14px; font-family: 'IBM Plex Mono', monospace; }
.conflict .cals { font-size: 13px; color: var(--muted); margin-top: 4px; }
.conflict .nights { font-size: 12px; color: var(--alert); margin-top: 4px; font-weight: 600; }

.feed-status { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; font-size: 14px; display: flex; gap: 10px; align-items: baseline; }
.feed-status.dead, .feed-status.error { border-color: #eeccc0; background: #fdf6f3; }
.feed-status.suspicious { border-color: #ecdcb8; background: #fbf6ea; }
.feed-status.ok { background: #fbfcfc; }
.feed-status .dot { flex: none; width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; }
.dot.ok { background: var(--success); }
.dot.suspicious { background: var(--amber); }
.dot.dead, .dot.error { background: var(--alert); }
.feed-status .fname { font-weight: 600; }
.feed-note { font-size: 12px; color: var(--muted); margin-top: 4px; font-style: italic; }

.result-actions { display: flex; gap: 10px; margin: 4px 0 14px; }

.why { font-size: 13px; color: var(--muted); background: #f1f3f2; border-radius: 10px; padding: 14px 16px; margin-top: 6px; }
.why strong { color: var(--ink); }

/* Waitlist */
.waitlist h3 { font-family: 'Fraunces', serif; font-weight: 600; margin-top: 0; font-size: 19px; }
.waitlist p { color: var(--muted); font-size: 14px; }
.wform { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.wform input { flex: 1; min-width: 200px; }
.msg { font-size: 13px; margin-top: 8px; min-height: 16px; }
.msg.success { color: var(--success); }
.msg.error { color: var(--alert); }
.muted { color: var(--muted); font-size: 13px; }

footer { text-align: center; color: var(--muted); font-size: 12px; margin-top: 32px; }

@media (max-width: 640px) {
  h1 { font-size: 24px; }
  .tagline { font-size: 15px; }
  .actions button, .wform button { width: 100%; }
  .wform input { min-width: 0; }
}
