:root {
  color-scheme: light;
  --ink: #1d342b;
  --muted: #5c6f66;
  --green: #176a49;
  --green-dark: #105239;
  --green-pale: #edf5ef;
  --line: #d9e3dc;
  --surface: #ffffff;
  --page: #f5f8f5;
  --warning: #fff7df;
  --warning-line: #e6c35f;
  --error: #fff0ee;
  --error-line: #d98173;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--page); line-height: 1.5; }
.container { width: min(860px, calc(100% - 32px)); margin: 0 auto; }
.site-header { background: #174d38; color: white; padding: 24px 0; }
.header-inner { display: flex; gap: 16px; align-items: center; }
.brand-mark { display: grid; place-items: center; width: 52px; height: 52px; flex: 0 0 auto; border: 1px solid #a8c9b5; border-radius: 50%; font-weight: 800; letter-spacing: .04em; }
.eyebrow { margin: 0 0 2px; color: #d3e7d8; font-size: .82rem; }
h1 { max-width: 900px; margin: 0; font-size: clamp(1.65rem, 4.2vw, 2.35rem); line-height: 1.14; }
.intro { max-width: 720px; margin: 28px 0 20px; color: var(--muted); font-size: 1.05rem; }
.panel { margin: 18px 0; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 3px 12px #203a2b0a; }
.section-heading { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.step { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%; background: var(--green-pale); color: var(--green-dark); font-weight: 750; }
h2 { margin: 0; font-size: 1.25rem; }
.section-heading p { margin: 4px 0 0; color: var(--muted); }
label { display: block; margin: 15px 0 6px; font-weight: 650; }
input[type="search"], input[type="url"], select { width: 100%; min-height: 44px; border: 1px solid #9fb2a6; border-radius: 7px; padding: 9px 12px; color: var(--ink); background: white; font: inherit; }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid #91cbb0; outline-offset: 2px; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; margin-top: 18px; padding: 10px 16px; border: 0; border-radius: 7px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.button.primary { background: var(--green); color: white; }
.button.primary:hover { background: var(--green-dark); }
.button.secondary { margin: 0; border: 1px solid var(--line); background: white; color: var(--green-dark); font-weight: 600; }
.button:disabled { cursor: wait; opacity: .65; }
.hint, .privacy-note { color: var(--muted); font-size: .9rem; }
.hint { margin: 8px 0 0; }
.divider { display: flex; align-items: center; gap: 14px; margin: 22px 0; color: var(--green-dark); font-size: 1rem; font-weight: 850; letter-spacing: .12em; }
.divider::before, .divider::after { height: 2px; flex: 1; background: #9eb9a8; content: ""; }
.divider span { padding: 5px 12px; border: 2px solid #9eb9a8; border-radius: 999px; background: var(--green-pale); }
.inventory-progress { margin-top: 18px; padding: 16px; border: 1px solid #b8d0c0; border-radius: 9px; background: #f4faf5; }
.inventory-progress-title { display: flex; align-items: center; gap: 11px; }
.inventory-progress-title h3 { margin: 0; font-size: 1.05rem; }
.spinner { width: 22px; height: 22px; flex: 0 0 auto; border: 3px solid #c5d8ca; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.inventory-progress-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 15px 0 0; }
.inventory-progress-stats div { padding: 10px; border-radius: 7px; background: white; }
.inventory-progress-stats dt { color: var(--muted); font-size: .8rem; }
.inventory-progress-stats dd { margin: 3px 0 0; font-weight: 750; }
.inventory-progress .button { margin-top: 12px; }
.message { margin: 12px 0; padding: 12px 14px; border-left: 4px solid; border-radius: 5px; white-space: pre-line; }
.message.warning { border-color: var(--warning-line); background: var(--warning); }
.message.error { border-color: var(--error-line); background: var(--error); }
.project-name { font-weight: 700; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0; }
.stats-grid div { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: #fbfdfb; }
.stats-grid dt { color: var(--muted); font-size: .82rem; }
.stats-grid dd { margin: 4px 0 0; font-weight: 750; overflow-wrap: anywhere; }
.selection-tools { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 12px; }
.folder-list { display: grid; gap: 8px; }
.folder-card, .root-file-option { display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 13px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.folder-card:hover, .root-file-option:hover { background: #fbfdfb; }
input[type="checkbox"] { width: 19px; height: 19px; flex: 0 0 auto; margin: 2px 0 0; accent-color: var(--green); }
.folder-card span, .root-file-option span { min-width: 0; }
.folder-name { display: block; overflow-wrap: anywhere; }
.folder-details, .root-file-option small { display: block; margin-top: 3px; color: var(--muted); font-size: .88rem; font-weight: 400; }
.root-file-option { margin-top: 12px; background: var(--green-pale); }
.selection-summary { margin: 17px 0 0; padding: 12px 14px; border-radius: 7px; background: var(--green-pale); }
progress { display: block; width: 100%; height: 18px; accent-color: var(--green); }
.progress-details { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 9px; color: var(--muted); font-size: .9rem; }
.privacy-note { margin: 24px 0 32px; }
.site-footer { padding: 18px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.5s; }
}

@media (max-width: 620px) {
  .panel { padding: 18px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .inventory-progress-stats { grid-template-columns: 1fr; }
  .button { width: 100%; }
  .selection-tools .button { width: auto; flex: 1 1 140px; }
}
