/* BAPC Files: phone first, big targets, few words. Light and dark follow the phone. */
:root {
  --bg: #f5f7fa; --panel: #ffffff; --text: #111827; --muted: #5b6472; --line: #dde2e8;
  --accent: #1f6feb; --accent-text: #ffffff; --ok: #138a4b; --bad: #c62828; --warn: #b26a00; --bar: #e6ebf1;
  --radius: 14px;
  color-scheme: light dark;
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1720; --panel: #17212c; --text: #eef2f6; --muted: #9aa6b4; --line: #2a3644; --accent: #4c8dff; --ok: #3ccf7f; --bad: #ff6b6b; --warn: #ffb547; --bar: #253140; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); }
a { color: var(--accent); }
h1 { font-size: 26px; line-height: 1.2; margin: 8px 0 10px; }
h2 { font-size: 19px; margin: 6px 0 10px; }
.muted { color: var(--muted); } .small { font-size: 14px; } .ok { color: var(--ok); } .bad { color: var(--bad); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }

button, .button { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; min-height: 46px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; -webkit-tap-highlight-color: transparent; }
button.primary, .button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--bad); }
button.link { background: none; border: 0; padding: 4px; min-height: 0; color: var(--accent); }
button.link.wide { width: 100%; justify-content: space-between; padding: 14px 4px; color: var(--text); }
.big { font-size: 18px; padding: 14px 22px; min-height: 54px; }
.huge { font-size: 28px; font-weight: 700; padding: 30px 20px; width: 100%; max-width: 420px; border-radius: 22px; flex-direction: column; gap: 10px; box-shadow: 0 8px 24px rgba(31, 111, 235, .28); }
.huge svg { width: 56px; height: 56px; }
.huge.alt { font-size: 24px; padding: 22px 20px; margin-top: 14px; border: 2px solid var(--accent); color: var(--text); box-shadow: none; }
#allHint { max-width: 420px; margin: 12px auto 0; text-align: left; }
input { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; min-height: 46px; flex: 1; min-width: 0; }

header.top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 19px; }
#nav { display: flex; gap: 4px; }
#nav a { padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--muted); font-size: 16px; }
#nav a.on { background: var(--bar); color: var(--text); font-weight: 600; }

.screen { max-width: 680px; margin: 0 auto; padding: 20px 16px 40px; }
.center { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.center-row { justify-content: center; }
#landing { padding-top: 12vh; }
#landing h1 { font-size: 30px; }
#pick { padding-top: 6vh; gap: 14px; }
.folderline { margin: 4px 0 0; font-size: 17px; }

.bar { height: 8px; background: var(--bar); border-radius: 99px; overflow: hidden; margin: 6px 0; }
.bar.big { height: 16px; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .3s; }
.hint { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; font-size: 15px; color: var(--muted); }

.list { list-style: none; margin: 10px 0; padding: 0; text-align: left; width: 100%; }
.list > li { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 8px; }
.list .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 70vw; }
.list.files > li { padding: 0; }
.list.files > li.dayhead { background: none; border: 0; padding: 14px 4px 4px; font-weight: 600; color: var(--muted); font-size: 15px; }
button.file { width: 100%; border: 0; background: none; justify-content: flex-start; text-align: left; padding: 12px 14px; }
.kind { width: 26px; text-align: center; }
a.folder { display: flex; flex-direction: column; text-decoration: none; color: var(--text); padding: 6px 2px; }
.pickable > li { padding: 0 10px; }
.pickable small { margin-left: 10px; }

.tick { width: 110px; height: 110px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 64px; line-height: 110px; font-weight: 700; margin-top: 4vh; }
.tick.warn { background: var(--warn); }
#done h1 { font-size: 28px; }
details.checks { width: 100%; margin-top: 18px; text-align: left; }
details.checks summary { cursor: pointer; color: var(--muted); padding: 8px 0; }
details.checks li { gap: 8px; flex-wrap: nowrap; }

.foot { display: flex; gap: 14px; align-items: center; margin-top: 40px; color: var(--muted); }
.foot a { color: var(--muted); }

.sheet { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet-body { background: var(--bg); width: 100%; max-width: 680px; max-height: 90vh; overflow: auto; border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
.sheet .name { word-break: break-word; }
.preview { width: 100%; max-height: 50vh; object-fit: contain; border-radius: 12px; background: #000; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px; z-index: 30; max-width: 90vw; }
main.simple { max-width: 560px; margin: 10vh auto; padding: 0 16px; }
