/* ==========================================================================
   OfflineScan (offlinescan.com) — one stylesheet for every page.
   Same "Ink" palette as the app (mobile/flutter_app/lib/theme/ink_tokens.dart),
   tuned for first-time visitors: big targets, few words, one action per step.
   ========================================================================== */

@font-face { font-family: 'Inter'; src: url('../fonts/Inter-400.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/Inter-600.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/Inter-700.ttf') format('truetype'); font-weight: 700; font-display: swap; }

:root {
  --bg: #090B0E;
  --surface-1: #0F1217;
  --surface-2: #151921;
  --surface-3: #1C222D;
  --line: #222733;
  --line-strong: #31384A;

  --fg: #F3F5F8;
  --fg-secondary: #A3ACBE;
  --fg-muted: #6C7689;

  --accent: #10B981;
  --accent-bright: #34D399;
  --accent-soft: rgba(16, 185, 129, 0.12);
  --accent-line: rgba(16, 185, 129, 0.45);
  --warn: #F59E0B;

  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html { background: var(--bg); color: var(--fg); font-family: var(--font); -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg) radial-gradient(ellipse 80% 40% at 50% -10%, rgba(16, 185, 129, 0.10), transparent);
  color: var(--fg);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}

a { color: var(--accent-bright); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.container.narrow { max-width: 960px; }

/* Header ------------------------------------------------------------------ */
.site-header { border-bottom: 1px solid var(--line); background: rgba(9, 11, 14, 0.9); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(8px); }
.header-inner { max-width: 960px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand-link { display: flex; align-items: center; gap: 10px; color: var(--fg); }
.brand-link:hover { text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--surface-3); border: 1px solid var(--line-strong); display: grid; place-items: center; }
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.header-link { font-size: 14px; font-weight: 600; color: var(--fg-secondary); }

/* Hero -------------------------------------------------------------------- */
.hero { padding: 40px 0 8px; text-align: center; }
.hero h1 { margin: 0 0 10px; font-size: clamp(28px, 5vw, 44px); line-height: 1.15; letter-spacing: -0.02em; }
.hero-sub { margin: 0 auto; max-width: 640px; color: var(--fg-secondary); font-size: clamp(15px, 2vw, 18px); }
.hero .actions { margin-top: 20px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.step-heading { font-size: 18px; margin: 32px 0 12px; }

.hero-drop { margin: 24px auto 0; max-width: 640px; padding: 40px 16px; border-color: var(--accent-line); background: rgba(16, 185, 129, 0.05); }
.hero-drop .dropzone-main { font-size: 18px; }

.result-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.result-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; background: var(--bg); border-radius: var(--radius-sm); cursor: pointer; border: 1px solid transparent; }
.result-list li.active { border-color: var(--accent-line); }
.result-list .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.result-list .sizes { color: var(--fg-secondary); white-space: nowrap; }
.result-list .saved { color: var(--accent-bright); font-weight: 600; }

/* Task picker ------------------------------------------------------------- */
.task-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.task-grid.three { grid-template-columns: repeat(3, 1fr); }
.task-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left;
  padding: 18px; min-height: 132px; cursor: pointer;
  background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--fg); transition: border-color 0.15s, background 0.15s;
}
a.task-card:hover { text-decoration: none; }
.task-card:hover { border-color: var(--line-strong); background: var(--surface-2); }
.task-card.active { border-color: var(--accent); background: var(--accent-soft); }
.task-icon { font-size: 26px; line-height: 1; margin-bottom: 6px; }
.task-title { font-weight: 700; font-size: 17px; }
.task-sub { color: var(--fg-secondary); font-size: 14px; }

/* Tool -------------------------------------------------------------------- */
.tool { margin-top: 16px; scroll-margin-top: 72px; }
.tool-grid {
  display: grid; grid-template-columns: 1fr 340px; gap: 20px;
  padding: 20px; background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius);
}
.tool-controls { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.tool-result { display: flex; flex-direction: column; gap: 12px; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-weight: 600; font-size: 15px; }
.hint { margin: 0; font-size: 13px; color: var(--fg-muted); }

label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--fg-secondary); }
input[type=text], input[type=number], select {
  width: 100%; padding: 10px 12px; font-size: 15px;
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--fg);
}
input:focus, select:focus { outline: 2px solid var(--accent-line); outline-offset: 1px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

label.check { flex-direction: row; align-items: center; gap: 10px; font-size: 15px; color: var(--fg); cursor: pointer; }
label.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px; min-height: 40px; border-radius: 999px; cursor: pointer; font-size: 14px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--fg-secondary);
}
.chip:hover { color: var(--fg); }
.chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--fg); }

.dropzone {
  position: relative; align-items: center; justify-content: center; text-align: center; gap: 2px;
  padding: 22px 16px; border: 2px dashed var(--line-strong); border-radius: var(--radius); cursor: pointer;
  background: var(--bg); color: var(--fg);
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone.small { padding: 16px 10px; }
.dropzone-main { font-weight: 700; font-size: 15px; color: var(--accent-bright); }
.dropzone-sub { font-size: 13px; color: var(--fg-muted); }

details.more summary { cursor: pointer; color: var(--fg-secondary); font-size: 14px; font-weight: 600; }
details.more[open] summary { margin-bottom: 10px; }

.page-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.page-list li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; background: var(--bg); border-radius: var(--radius-sm); }
.page-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-btn { background: none; border: 0; color: var(--fg-muted); cursor: pointer; font-size: 13px; }
.link-btn:hover { color: var(--fg); }

.preview {
  position: relative; margin: 0; min-height: 220px; padding: 16px;
  display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
}
.preview img { max-width: 100%; max-height: 360px; border-radius: 4px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5); }
.preview-badge {
  position: absolute; top: 10px; left: 10px; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--fg-secondary);
}

.status { margin: 0; font-size: 14px; color: var(--fg-secondary); min-height: 1.5em; }
.status.ok { color: var(--accent-bright); font-weight: 600; }
.status.warn { color: var(--warn); }

/* Buttons ----------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 20px; min-height: 48px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 16px; font-weight: 700; border: 1px solid transparent;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #04120C; }
.btn-primary:hover { background: var(--accent-bright); }
.btn-primary:disabled { background: var(--surface-3); color: var(--fg-muted); cursor: not-allowed; }
.btn-secondary { background: var(--surface-2); border-color: var(--line-strong); color: var(--fg); }
.btn-block { width: 100%; }

/* Reassurance + FAQ ------------------------------------------------------- */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 40px; font-size: 14px; color: var(--fg-secondary); }
.facts strong { display: block; color: var(--fg); font-size: 15px; margin-bottom: 2px; }

.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 8px 0 0; color: var(--fg-secondary); font-size: 15px; }

/* Plain text pages (privacy, terms) --------------------------------------- */
.prose { max-width: 720px; padding-top: 40px; padding-bottom: 64px; }
.prose h1 { font-size: clamp(28px, 4vw, 38px); margin: 0 0 6px; }
.prose h2 { font-size: 19px; margin: 28px 0 6px; }
.prose p, .prose li { color: var(--fg-secondary); }
.prose .meta { color: var(--fg-muted); font-size: 14px; margin: 0 0 20px; }

/* Footer ------------------------------------------------------------------ */
.site-footer { margin-top: 56px; border-top: 1px solid var(--line); padding: 20px 0 32px; font-size: 14px; color: var(--fg-muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--fg-secondary); }

/* Small screens ----------------------------------------------------------- */
@media (max-width: 960px) {
  .task-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .tool-grid { grid-template-columns: 1fr; padding: 16px; }
  .preview { min-height: 160px; }
  .preview img { max-height: 260px; }
}
@media (max-width: 640px) {
  .hero { padding-top: 28px; }
  .task-grid, .task-grid.three, .facts { grid-template-columns: 1fr; }
  .task-card { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 12px; }
  .task-icon { margin: 0; }
  .task-sub { flex-basis: 100%; }
}
