:root {
  --brand: #1f4f8f;
  --bg: #f6f6f4;
  --card: #ffffff;
  --text: #1c1917;
  --muted: #6b6560;
  --line: #e6e3df;
  --danger: #b42318;
  --radius: 10px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.55 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--brand); }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.wrap.wide { max-width: 1280px; }
.topbar { background: var(--card); border-bottom: 1px solid var(--line); border-top: 4px solid var(--brand); }
.topbar .wrap { display: flex; align-items: center; min-height: 56px; }
.brand { font-weight: 700; letter-spacing: .01em; }
main.wrap { padding-top: 28px; padding-bottom: 28px; }
h1 { font-size: 24px; line-height: 1.25; margin: 0 0 6px; }
h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 10px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card h1 { margin-bottom: 10px; }
.share-head { margin-bottom: 22px; }
.message { margin-top: 12px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 6px; padding: 12px 14px; white-space: pre-wrap; }
.alert { background: #fef3f2; border: 1px solid #fecdca; color: var(--danger); border-radius: 8px; padding: 10px 12px; margin: 12px 0; }
.stack { display: grid; gap: 12px; margin-top: 14px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
input[type=password], input[type=email], input[type=text] { font: inherit; padding: 10px 12px; border: 1px solid #cfcac4; border-radius: 8px; background: #fff; width: 100%; }
input:focus-visible, .btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent); outline-offset: 1px; }
.btn { font: inherit; font-weight: 600; cursor: pointer; border: 1px solid var(--brand); background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 8px; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--brand); }
.btn:disabled { opacity: .6; cursor: default; }
.files-layout { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 20px; align-items: start; }
.file-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.file { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; gap: 10px; }
.file.selected { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.file-info { display: grid; min-width: 0; }
.file-name { font-weight: 600; overflow-wrap: anywhere; }
.file-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.file-actions form { margin: 0; }
.viewer { position: sticky; top: 16px; background: #e9e7e3; border: 1px solid var(--line); border-radius: var(--radius); min-height: 70vh; max-height: calc(100vh - 32px); overflow: auto; }
.viewer-empty { display: grid; place-items: center; min-height: 70vh; color: var(--muted); padding: 24px; text-align: center; }
.viewer-bar { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; gap: 8px; align-items: center; background: rgba(255,255,255,.95); border-bottom: 1px solid var(--line); padding: 8px 12px; font-size: 13px; }
.viewer-bar .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pages { display: grid; gap: 12px; padding: 12px; justify-items: center; }
.pages canvas { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); max-width: 100%; height: auto; }
.viewer img { display: block; max-width: 100%; height: auto; margin: 12px auto; background: #fff; }
.foot { color: var(--muted); font-size: 13px; padding-bottom: 32px; }
.foot .legal { margin: 0 0 8px; }
.foot nav a { color: var(--muted); }
.home h1 { font-size: 28px; }
.home section { margin-top: 20px; }
.legal-text h2 { text-transform: none; letter-spacing: 0; color: var(--text); font-size: 18px; margin-top: 24px; }
.legal-text table { border-collapse: collapse; width: 100%; font-size: 14px; }
.legal-text th, .legal-text td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
@media (max-width: 860px) {
  .files-layout { grid-template-columns: 1fr; }
  .viewer { position: static; max-height: none; min-height: 50vh; }
  .viewer-empty { min-height: 40vh; }
}
.info { background: #eff4fb; border: 1px solid #c9d8ee; border-radius: 8px; padding: 10px 12px; margin: 12px 0; }
.resend { margin-top: 12px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand); text-decoration: underline; cursor: pointer; font: inherit; font-size: 14px; }
.legal-text ul { padding-left: 20px; }
.legal-text li { margin: 4px 0; }
mark.pending { background: #fef0c7; color: #93370d; padding: 0 4px; border-radius: 4px; }
.foot .legal p { margin: 0 0 6px; }
