:root {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172b25;
  background: #f5f6f1;
  font-synthesis: none;
  --muted: #536760;
  --line: #dbe2da;
  --action: #1d5342;
  --surface: #fff;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; }
button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .58; }
:focus-visible { outline: 3px solid #3a8570; outline-offset: 4px; }
.masthead { background: #173e33; color: #fff; }
.header-inner {
  max-width: 1192px; min-height: 72px; padding: 0 32px; margin: auto;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.brand { display: flex; gap: 12px; align-items: center; font-size: 20px; font-weight: 750; }
.brand-icon { width: 29px; height: 29px; border-radius: 8px; background: #c9edda; position: relative; }
.brand-icon::before {
  content: ""; position: absolute; inset: 9px 6px 7px;
  border: 2px solid #1d5342; border-top-width: 4px; border-radius: 2px;
}
.brand-icon::after { content: ""; position: absolute; height: 2px; width: 5px; top: 16px; left: 12px; background: #1d5342; }
.header-actions { display: flex; gap: 8px; align-items: center; }
.quiet { border: 0; background: transparent; color: #effaf5; padding: 11px; font-size: 14px; border-radius: 8px; }
.quiet:hover { background: #2e594a; }
.layout { max-width: 1192px; padding: 48px 32px 80px; margin: auto; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(30px, 5vw, 48px); letter-spacing: -.055em; line-height: 1.12; }
h2 { font-size: 21px; letter-spacing: -.027em; }
.muted { color: var(--muted); font-size: 14px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 26px; }
#subtitle { margin-top: 10px; }
.primary, .secondary {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px; border: 1px solid transparent;
  padding: 12px 17px; min-height: 46px; border-radius: 11px; font-weight: 680; font-size: 14px;
}
.primary { color: #fff; background: var(--action); }
.primary:hover { background: #153c30; }
.secondary { color: var(--action); background: #fff; border-color: var(--line); }
.secondary:hover { background: #f1f6f0; }
.plus { font-size: 22px; line-height: 16px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; font-size: 14px; color: var(--muted); }
.crumbs a { text-decoration: underline; text-underline-offset: 4px; }
.crumbs a::after { content: "›"; margin-left: 10px; display: inline-block; text-decoration: none; }
.tools { margin-bottom: 25px; }
.search { width: min(100%, 380px); position: relative; display: block; }
.search input { padding-left: 42px; }
.glass {
  position: absolute; top: 15px; left: 15px; width: 13px; height: 13px; border: 2px solid #537168;
  border-radius: 50%; pointer-events: none;
}
.glass::after { content: ""; width: 6px; height: 2px; position: absolute; background: #537168; transform: rotate(45deg); top: 10px; left: 8px; }
input, select { width: 100%; min-height: 45px; padding: 10px 12px; background: #fff; border: 1px solid #bfcfc5; border-radius: 9px; color: #172b25; font-size: 16px; }
.folder-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.folder-card {
  --folder-bg: #e8effc; --folder-color: #436294; min-height: 166px; background: #fff;
  display: flex; flex-direction: column; align-items: flex-start; gap: 17px; justify-content: center;
  position: relative; padding: 20px 22px; border: 1px solid var(--line); border-radius: 17px;
  transition: border-color .15s, box-shadow .15s;
}
.folder-card:hover { border-color: #82a393; box-shadow: 0 5px 18px #274c3910; }
.teal { --folder-bg: #e0f0e8; --folder-color: #347259; }
.violet { --folder-bg: #ede8f8; --folder-color: #67518e; }
.amber { --folder-bg: #f7eddb; --folder-color: #8a5c23; }
.rose { --folder-bg: #f8e9e9; --folder-color: #925165; }
.sage { --folder-bg: #edf0df; --folder-color: #62713d; }
.folder-icon { display: block; position: relative; height: 49px; width: 52px; border-radius: 12px; background: var(--folder-bg); }
.folder-icon::before {
  content: ""; position: absolute; top: 16px; left: 12px; width: 28px; height: 20px;
  border: 2px solid var(--folder-color); border-radius: 4px;
}
.folder-icon::after { content: ""; position: absolute; top: 12px; left: 12px; width: 13px; height: 7px; border: 2px solid var(--folder-color); border-bottom: 0; border-radius: 4px 4px 0 0; }
.folder-label { display: grid; gap: 4px; }
.folder-label strong { font-size: 21px; letter-spacing: -.025em; }
.chevron { position: absolute; right: 19px; top: 19px; color: #587266; font-size: 25px; line-height: 1; }
#documents { margin-top: 29px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 12px; }
.rows { border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.empty { padding: 24px; color: var(--muted); font-size: 15px; }
.doc-row {
  display: grid; grid-template-columns: 45px minmax(0, 1fr) auto; gap: 13px; align-items: center;
  padding: 14px; border-bottom: 1px solid var(--line);
}
.doc-row:last-child { border: 0; }
.doc-icon { display: grid; place-items: center; width: 41px; height: 41px; background: #e6efe9; color: #315e4f; border-radius: 9px; font-weight: 700; font-size: 11px; }
.doc-info { min-width: 0; display: grid; gap: 4px; }
.doc-title { text-align: left; padding: 0; border: 0; background: none; color: #172b25; font-weight: 700; overflow-wrap: anywhere; }
button.doc-title:hover { text-decoration: underline; }
.doc-meta { font-size: 13px; color: var(--muted); }
.row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.small { display: inline-flex; align-items: center; padding: 7px 8px; min-height: 36px; border: 0; border-radius: 7px; background: transparent; font-size: 13px; font-weight: 650; color: var(--action); }
.small:hover { background: #edf3ef; }
.gate { max-width: 470px; margin: 34px auto; padding: clamp(22px, 6vw, 38px); border: 1px solid var(--line); border-radius: 18px; background: white; }
.gate h1 { font-size: 33px; }
.gate p { color: var(--muted); margin: 12px 0 20px; line-height: 1.55; }
form label { display: grid; gap: 7px; margin: 15px 0; font-size: 14px; font-weight: 650; }
dialog { border: 1px solid var(--line); border-radius: 18px; padding: 22px; width: min(550px, calc(100% - 24px)); max-height: calc(100% - 24px); color: inherit; }
dialog::backdrop { background: #102e26a3; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.dialog-heading h2 { overflow-wrap: anywhere; }
.close { min-width: 44px; height: 44px; border: 0; background: #edf2ee; border-radius: 8px; font-size: 25px; color: var(--action); }
.file-actions, .dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.file-actions .file-button { position: relative; display: inline-flex; margin: 0; cursor: pointer; }
.file-button input {
  position: absolute; inset: 0; height: 100%; padding: 0; opacity: 0; cursor: pointer;
}
.file-button:focus-within { outline: 3px solid #3a8570; outline-offset: 4px; }
.camera-view { display: grid; gap: 10px; margin-top: 12px; }
#camera-feed {
  width: 100%; max-height: min(46vh, 420px); object-fit: contain;
  background: #172b25; border-radius: 8px;
}
.dialog-actions { margin-top: 20px; justify-content: end; }
#ocr-status { margin: 12px 0; line-height: 1.4; }
.selected { display: flex; gap: 12px; align-items: center; background: #eff4ef; padding: 10px; border-radius: 8px; margin-top: 10px; overflow-wrap: anywhere; font-size: 14px; }
.selected img { width: 58px; height: 64px; object-fit: contain; }
.error { color: #a5272f !important; font-size: 14px; }
.notice { margin-bottom: 15px; padding: 12px; background: #e3efe8; border-radius: 9px; }
#document-preview { display: block; width: 100%; max-height: min(63vh, calc(100dvh - 172px)); object-fit: contain; background: #f0f2ee; border-radius: 8px; margin-bottom: 15px; }
@media (max-width: 740px) {
  .layout { padding: 32px 19px 55px; }
  .header-inner { min-height: 62px; padding: 0 19px; }
  .page-heading { align-items: start; flex-direction: column; gap: 15px; margin-bottom: 18px; }
  .folder-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .folder-card { min-height: 140px; padding: 14px; gap: 13px; }
  .folder-label strong { font-size: 18px; }
  .folder-label .muted { font-size: 13px; }
  .chevron { right: 13px; top: 15px; }
  .doc-row { grid-template-columns: 42px minmax(0, 1fr); gap: 7px 10px; }
  .row-actions { grid-column: 2; justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
