/* FileQuiet — calm paper + deep green. System fonts, no decoration theater. */

:root {
  --paper: #f7f6f1;
  --surface: #ffffff;
  --ink: #232a26;
  --muted: #66716b;
  --accent: #1e6b4d;
  --accent-deep: #16543c;
  --accent-soft: #e7f2ec;
  --hairline: #e4e2d9;
  --bad: #93402f;
  --bad-soft: #f6e9e4;
  --warn: #8a6a22;
  --warn-soft: #f5eeda;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(35, 42, 38, 0.06), 0 4px 16px rgba(35, 42, 38, 0.05);
}

* { box-sizing: border-box; }

/* The HTML hidden attribute must win over any display property in our CSS. */
[hidden] { display: none !important; }

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

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

.wrap { max-width: 880px; margin: 0 auto; padding: 0 20px; }

a { color: var(--accent); }
a:hover { color: var(--accent-deep); }

/* ---------------------------------------------------------------- header */

.site-header {
  border-bottom: 1px solid var(--hairline);
  background: var(--paper);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 650;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.brand svg { display: block; }
.site-nav { display: flex; gap: 22px; font-size: 14.5px; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--ink); }

/* ------------------------------------------------------------------ hero */

.hero { padding: 64px 0 40px; }
.hero h1 {
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.022em;
  margin: 0 0 16px;
  max-width: 17ch;
}
.hero .lede {
  font-size: 18.5px;
  color: var(--muted);
  max-width: 58ch;
  margin: 0 0 8px;
}
.quiet-claim {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 7px 14px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 550;
}

/* ----------------------------------------------------------------- cards */

.section { padding: 34px 0; }
.section > h2 {
  font-size: 22px;
  letter-spacing: -0.015em;
  margin: 0 0 18px;
}
.tool-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 28px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 120ms ease;
}
.tool-card:hover { border-color: var(--accent); color: var(--ink); }
.tool-card h3 { margin: 0 0 6px; font-size: 19px; letter-spacing: -0.01em; }
.tool-card p { margin: 0; color: var(--muted); font-size: 15.5px; }
.tool-card .go { color: var(--accent); font-weight: 600; font-size: 15px; margin-top: 12px; display: inline-block; }
.tool-grid { display: grid; gap: 14px; }
.tool-card.soon {
  background: transparent;
  box-shadow: none;
  border-style: dashed;
}
.tool-card.soon h3 { color: var(--muted); }
.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-deep);
  background: var(--accent-soft);
  padding: 2px 9px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.tag.gray { color: var(--muted); background: #ecebe4; }

/* ------------------------------------------------------------- promises */

.promises { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .promises { grid-template-columns: 1fr 1fr 1fr; } }
.promise {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.promise h3 { margin: 0 0 6px; font-size: 16px; }
.promise p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* ---------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--hairline);
  margin-top: 56px;
  padding: 26px 0 40px;
  color: var(--muted);
  font-size: 14px;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 26px; justify-content: space-between; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); }

/* -------------------------------------------------------------- tool page */

.tool-head { padding: 46px 0 8px; }
.tool-head h1 {
  font-size: clamp(26px, 4.4vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  max-width: 24ch;
}
.tool-head .lede { color: var(--muted); font-size: 17px; max-width: 60ch; margin: 0; }
.error-quotes { margin: 20px 0 0; display: grid; gap: 8px; }
.error-quote {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px;
  color: var(--bad);
  background: var(--bad-soft);
  border-radius: 8px;
  padding: 9px 14px;
}

.dropzone {
  margin: 28px 0 0;
  background: var(--surface);
  border: 2px dashed var(--hairline);
  border-radius: var(--radius);
  padding: 44px 24px;
  text-align: center;
  transition: border-color 120ms ease, background 120ms ease;
}
.dropzone.dragging { border-color: var(--accent); background: var(--accent-soft); }
.dropzone p { color: var(--muted); margin: 12px 0 0; font-size: 15px; }
.dropzone .privacy-line { font-size: 13.5px; margin-top: 16px; }

.btn {
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 12px 22px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--hairline); margin-left: 10px; }
.btn-ghost:hover { color: var(--ink); }

.working {
  margin: 28px 0 0;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
}
.spinner {
  width: 26px;
  height: 26px;
  margin: 0 auto 14px;
  border: 3px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.result {
  margin: 28px 0 0;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 28px;
}
.verdict { margin: 0 0 6px; font-size: 22px; letter-spacing: -0.015em; }
.verdict-good { color: var(--accent-deep); }
.verdict-ok { color: var(--accent-deep); }
.verdict-bad { color: var(--bad); }
.verdict-stats { color: var(--muted); font-weight: 600; margin: 0 0 10px; font-size: 15px; }
.verdict-body { margin: 0 0 4px; color: var(--ink); max-width: 62ch; }

.preview { margin-top: 20px; }
.preview-tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--hairline); }
.preview-tab {
  appearance: none;
  background: transparent;
  border: 1px solid var(--hairline);
  border-bottom: none;
  border-radius: 7px 7px 0 0;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 7px 14px;
  cursor: pointer;
}
.preview-tab.active { background: var(--accent-soft); color: var(--accent-deep); border-color: var(--accent); }
.preview-grid-wrap { display: none; overflow-x: auto; }
.preview-grid-wrap.active { display: block; }
.preview-grid {
  border-collapse: collapse;
  margin-top: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  min-width: 100%;
}
.preview-grid td {
  border: 1px solid var(--hairline);
  padding: 4px 9px;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.preview-grid td.rownum { color: var(--muted); background: var(--paper); font-size: 11px; text-align: right; }
.preview-grid td.empty { background: #fbfaf7; }
.preview-note { color: var(--muted); font-size: 13.5px; margin: 10px 0 0; }

.notes-title { font-size: 15px; margin: 22px 0 6px; }
.notes { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14.5px; }
.notes li { margin: 3px 0; }

#action-slot { margin-top: 24px; }
.fine { color: var(--muted); font-size: 13.5px; margin: 10px 0 0; max-width: 58ch; }
.error { color: var(--bad); font-size: 14.5px; margin: 14px 0 0; }
.info, .page-msg {
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14.5px;
  margin: 16px 0 0;
}

/* ----------------------------------------------------------- prose pages */

.prose { padding: 44px 0; max-width: 720px; }
.prose h1 { font-size: 30px; letter-spacing: -0.02em; margin: 0 0 18px; }
.prose h2 { font-size: 19px; letter-spacing: -0.01em; margin: 30px 0 8px; }
.prose p, .prose li { color: #3c453f; font-size: 15.5px; }
.prose .updated { color: var(--muted); font-size: 13.5px; }

/* ------------------------------------------------------------------ faq */

.faq { margin-top: 8px; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 10px;
}
.faq summary { font-weight: 600; cursor: pointer; font-size: 15.5px; }
.faq p { color: var(--muted); font-size: 14.5px; margin: 10px 0 0; }

.steps { display: grid; gap: 14px; grid-template-columns: 1fr; counter-reset: step; }
@media (min-width: 640px) { .steps { grid-template-columns: 1fr 1fr 1fr; } }
.step { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 18px 20px; }
.step::before {
  counter-increment: step;
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 10px;
}
.step h3 { margin: 0 0 4px; font-size: 15.5px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }

/* ------------------------------------------------------- redact editor */

.editor {
  margin: 28px 0 0;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 18px;
}
.editor-top {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
}
.editor-info { min-width: 0; }
.editor-info strong {
  font-size: 15.5px;
  overflow-wrap: anywhere;
}
.doc-pages { color: var(--muted); font-size: 13.5px; margin-left: 8px; white-space: nowrap; }
.editor-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-small { padding: 7px 12px; font-size: 13.5px; margin-left: 0; }
.btn-small:disabled, .btn:disabled { opacity: 0.45; cursor: default; }
.editor-hint {
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 9px 13px;
  font-size: 13.5px;
  margin: 12px 0;
}
.editor-hint.scan-notice { color: var(--warn); background: var(--warn-soft); }

.editor-body { display: flex; gap: 14px; align-items: flex-start; }
.thumb-rail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 640px;
  overflow-y: auto;
  flex: 0 0 auto;
  padding: 2px;
}
.thumb {
  position: relative;
  appearance: none;
  background: var(--paper);
  border: 2px solid var(--hairline);
  border-radius: 6px;
  padding: 0;
  cursor: pointer;
  width: 88px;
  overflow: hidden;
}
.thumb.active { border-color: var(--accent); }
.thumb-pic { display: block; line-height: 0; }
.thumb-canvas { width: 100%; height: auto; display: block; }
.thumb-num {
  position: absolute;
  left: 4px;
  bottom: 4px;
  background: rgba(35, 42, 38, 0.72);
  color: #fff;
  font-size: 10.5px;
  font-weight: 650;
  border-radius: 4px;
  padding: 1px 5px;
}
.thumb-badge {
  position: absolute;
  right: 4px;
  top: 4px;
  background: var(--ink);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.thumb-badge.pending { background: var(--warn); }

.stage-scroll { flex: 1 1 auto; overflow: auto; min-width: 0; }
.stage {
  position: relative;
  margin: 0 auto;
  box-shadow: var(--shadow);
  border: 1px solid var(--hairline);
  background: #fff;
}
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.overlay {
  position: absolute;
  inset: 0;
  cursor: crosshair;
  touch-action: none;
}
.redact-box {
  position: absolute;
  background: #000;
  box-sizing: border-box;
}
.redact-box.draft { outline: 1px dashed rgba(255, 255, 255, 0.7); outline-offset: -2px; }
.box-x {
  position: absolute;
  top: -9px;
  right: -9px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--bad);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.redact-box:hover .box-x, .redact-box:focus-within .box-x { display: inline-flex; }
@media (pointer: coarse) { .box-x { display: inline-flex; } }

.suggestion {
  position: absolute;
  appearance: none;
  background: rgba(138, 106, 34, 0.16);
  border: 2px dashed var(--warn);
  border-radius: 3px;
  cursor: pointer;
  padding: 0;
  box-sizing: border-box;
}
.suggestion:hover { background: rgba(138, 106, 34, 0.28); }
.suggestion-label {
  position: absolute;
  top: -20px;
  left: -2px;
  background: var(--warn);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 4px 4px 4px 0;
  padding: 2px 7px;
  white-space: nowrap;
}
.suggestion-x {
  position: absolute;
  top: -20px;
  right: -2px;
  background: var(--warn-soft);
  color: var(--warn);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
}

.editor-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  border-top: 1px solid var(--hairline);
  padding-top: 14px;
}
.box-count { color: var(--muted); font-size: 14px; }

/* ------------------------------------------------------- redact review */

.verify-banner { border-radius: 8px; padding: 16px 18px; }
.verify-banner.ok { background: var(--accent-soft); }
.verify-banner.bad { background: var(--bad-soft); color: var(--bad); }
.verify-title { margin: 0 0 8px; font-size: 19px; letter-spacing: -0.01em; }
.verify-banner.ok .verify-title { color: var(--accent-deep); }
.verify-list { margin: 0; padding-left: 20px; font-size: 14.5px; color: var(--ink); }
.verify-list li { margin: 3px 0; }
.verify-tradeoff { color: var(--muted); font-size: 13.5px; margin: 10px 0 0; }

.review-pages {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.review-page { margin: 0; }
.review-page img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow);
}
.review-page figcaption { color: var(--muted); font-size: 12.5px; margin-top: 5px; text-align: center; }
#review-actions { margin-top: 22px; }

/* ----------------------------------------------------------- email viewer */

.viewer { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--hairline); border-radius: 10px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); margin-top: 24px; }
.viewer-head { padding: 14px 18px 10px; border-bottom: 1px solid var(--hairline); display: flex; flex-direction: column; gap: 4px; }
.viewer-head strong { font-size: 15px; color: var(--ink); word-break: break-all; }
.doc-pages { color: var(--muted); font-size: 13px; }
.archive-notes { display: flex; flex-direction: column; gap: 4px; }
.note { background: #fffbeb; border: 1px solid #fde68a; border-radius: 5px; padding: 6px 10px; font-size: 13px; color: #78350f; margin: 0; }

.viewer-search { padding: 10px 18px; border-bottom: 1px solid var(--hairline); display: flex; align-items: center; gap: 12px; }
.search-box { flex: 1; padding: 7px 11px; border: 1px solid var(--hairline); border-radius: 6px; font-size: 14px; font-family: inherit; background: #fff; color: var(--ink); outline: none; }
.search-box:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(30,107,77,.12); }
.list-count { font-size: 12.5px; color: var(--muted); white-space: nowrap; }

.viewer-body { display: grid; grid-template-columns: 190px 280px 1fr; height: 540px; border-bottom: 1px solid var(--hairline); }
.folder-panel { border-right: 1px solid var(--hairline); overflow-y: auto; background: #f9f9f7; }
.folder-list { display: flex; flex-direction: column; padding: 6px 0; }
.folder-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 12px; font-size: 13px; color: var(--ink); background: none; border: none; cursor: pointer; text-align: left; border-radius: 0; }
.folder-item:hover { background: var(--surface-hover, rgba(0,0,0,.04)); }
.folder-item.active { background: #e4f2ed; color: var(--accent-deep); font-weight: 500; }
.folder-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-count { font-size: 11.5px; color: var(--muted); flex-shrink: 0; }

.message-panel { border-right: 1px solid var(--hairline); overflow-y: auto; }
.message-list { display: flex; flex-direction: column; }
.message-row { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border-bottom: 1px solid var(--hairline); background: none; border-left: none; border-right: none; border-top: none; cursor: pointer; text-align: left; font-family: inherit; }
.message-row:hover { background: var(--surface-hover, rgba(0,0,0,.04)); }
.message-row.active { background: #e4f2ed; }
.row-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.row-from { font-size: 13.5px; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.row-date { font-size: 11.5px; color: var(--muted); flex-shrink: 0; }
.row-subject { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-snippet { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-list { padding: 16px 12px; color: var(--muted); font-size: 13px; }

.preview-panel { overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; }
.preview-empty { color: var(--muted); font-size: 13.5px; margin: 0; }
.preview-head { display: flex; flex-direction: column; gap: 8px; }
.preview-subject { font-size: 16px; font-weight: 600; color: var(--ink); margin: 0; }
.preview-fields { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 13px; margin: 0; }
.preview-fields dt { color: var(--muted); font-weight: 500; white-space: nowrap; }
.preview-fields dd { color: var(--ink); margin: 0; word-break: break-word; }
.preview-body { font-size: 13.5px; color: var(--ink); white-space: pre-wrap; word-break: break-word; line-height: 1.6; flex: 1; }
.preview-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--hairline); }

.export-bar { padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; }
.export-title { font-weight: 600; color: var(--ink); font-size: 15px; margin: 0; }
.export-sub { color: var(--muted); font-size: 13.5px; margin: 0; }
.export-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.export-status { color: var(--muted); font-size: 13px; margin: 0; }
.export-error { color: var(--error, #dc2626); font-size: 13px; margin: 0; }

/* -------------------------------------------------------- excel-unlock verdict */

.verdict { border-radius: 8px; padding: 16px 20px; margin-bottom: 16px; }
.verdict-ok { background: #f0fdf4; border: 1px solid #bbf7d0; }
.verdict-good { background: #fffbeb; border: 1px solid #fde68a; }
.verdict-title { font-size: 17px; font-weight: 600; margin: 0 0 8px; }
.verdict-ok .verdict-title { color: #15803d; }
.verdict-good .verdict-title { color: #92400e; }
.verdict-list { margin: 8px 0 0; padding-left: 20px; font-size: 13.5px; color: var(--ink); }
.verdict-list li { margin: 4px 0; }
.download-status { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
#review-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }

/* --------------------------------------------------------------- mobile */

@media (max-width: 480px) {
  .site-nav { gap: 14px; }
  .result { padding: 20px 16px; }
  .btn-ghost { margin-left: 0; margin-top: 10px; }
  .editor { padding: 12px; }
  .editor-body { flex-direction: column; align-items: stretch; }
  .thumb-rail {
    flex-direction: row;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
  }
  .thumb { width: 64px; flex: 0 0 auto; }
  .editor-foot .btn-primary { width: 100%; }
  .review-pages { grid-template-columns: 1fr 1fr; }
}
