/* Instrument Sans (SIL OFL 1.1), latin subset, self-hosted: the panel loads nothing external. */
@font-face {
  font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/static/instrument-sans.woff2) format("woff2");
}
/* ---------- tokens ---------- */
:root {
  --mist: #F2F4F7;
  --paper: #FFFFFF;
  --ink: #17202B;
  --ink-fg: #FFFFFF;
  --slate: #5B6675;
  --line: #E3E7ED;
  --soft: #EAEEF3;
  --online: #138A5B;
  --online-bg: #E3F4EC;
  --info: #2F5BB7;
  --info-bg: #E5ECFA;
  --amber: #D99A00;
  --amber-bg: #FFF4D6;
  --down: #D14343;
  --down-bg: #FCE8E8;
  --marigold: #FFB400;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(23, 32, 43, .06), 0 8px 24px rgba(23, 32, 43, .06);
  --font: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --mist: #101923;
  --paper: #17222F;
  --ink: #EEF2F6;
  --ink-fg: #101923;
  --slate: #9AA7B6;
  --line: #263444;
  --soft: #1E2B3A;
  --online: #4CC38A;
  --online-bg: #123428;
  --info: #8FB3FF;
  --info-bg: #1C2C4A;
  --amber: #F2B21F;
  --amber-bg: #3A2F10;
  --down: #F07070;
  --down-bg: #3C1D1F;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --mist: #101923;
    --paper: #17222F;
    --ink: #EEF2F6;
    --ink-fg: #101923;
    --slate: #9AA7B6;
    --line: #263444;
    --soft: #1E2B3A;
    --online: #4CC38A;
    --online-bg: #123428;
  --info: #8FB3FF;
  --info-bg: #1C2C4A;
    --amber: #F2B21F;
    --amber-bg: #3A2F10;
    --down: #F07070;
    --down-bg: #3C1D1F;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font: 400 1rem/1.5 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, p { margin: 0; }
h1, h2 { text-wrap: balance; }
p { text-wrap: pretty; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--paper); color: var(--ink);
  font-weight: 550; font-size: .9375rem; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, transform .1s;
}
.btn:hover { border-color: var(--slate); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--ink); color: var(--ink-fg); border-color: var(--ink); }
.btn--primary:hover { border-color: var(--ink); background: color-mix(in srgb, var(--ink) 88%, var(--mist)); }
.btn--primary[disabled] { opacity: .55; cursor: default; }
.btn--quiet { border-color: transparent; background: transparent; color: var(--slate); padding: 0 12px; }
.btn--quiet:hover { color: var(--ink); border-color: transparent; background: var(--soft); }
.btn--danger { color: var(--down); }
.btn--danger:hover { background: var(--down-bg); color: var(--down); }
.seg { display: inline-flex; gap: 2px; padding: 4px; background: var(--soft); border-radius: 999px; margin-top: 28px; }
.seg button { min-height: 38px; padding: 0 20px; border: 0; background: none; border-radius: 999px; font-weight: 550; font-size: .9375rem; color: var(--slate); transition: color .15s, background-color .15s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-selected="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(23, 32, 43, .12); }
.section__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.section__head a { font-size: .9375rem; color: var(--slate); text-underline-offset: 3px; }
.section__head a:hover { color: var(--ink); }
.bk-about { color: var(--slate); margin-top: 16px; max-width: 58ch; }
.btn--quiet.btn--danger { color: var(--slate); }
.btn--quiet.btn--danger:hover { color: var(--down); background: var(--down-bg); }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: .875rem; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 10; }
/* blur lives on a pseudo-element: backdrop-filter on .top itself would make it the
   containing block for the fixed mobile tab bar and pin the bar to the header */
.top::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: color-mix(in srgb, var(--mist) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.top__in {
  max-width: 920px; margin: 0 auto; height: 64px;
  padding: 0 clamp(20px, 5vw, 40px);
  display: flex; align-items: center; gap: 28px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand__mark { width: 32px; height: 32px; flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name { font-weight: 650; letter-spacing: -.025em; font-size: 1.125rem; }
.brand__sub { margin-top: 3px; font-weight: 500; font-size: .8125rem; letter-spacing: .005em; color: var(--slate); }
.tabs { display: flex; gap: 4px; margin-right: auto; }
.tabs a {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 14px; border-radius: 999px;
  text-decoration: none; color: var(--slate); font-weight: 550; font-size: .9375rem;
  transition: color .15s, background-color .15s;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); background: var(--soft); }
.tabs .icon { display: none; }
.me { position: relative; margin-left: auto; }
.tabs + .me { margin-left: 0; }
.me summary {
  list-style: none; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: var(--paper); color: var(--slate); border: 1px solid var(--line);
  transition: color .15s, border-color .15s;
}
.me summary:hover, .me[open] summary { color: var(--ink); border-color: var(--slate); }
.me summary::-webkit-details-marker { display: none; }
.me__menu {
  position: absolute; right: 0; top: 48px; min-width: 220px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 8px;
}
.me__who { padding: 8px 12px 10px; font-size: .875rem; color: var(--slate); border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.me__who b { display: block; color: var(--ink); font-weight: 600; font-size: .9375rem; }
.me__menu button { width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 8px; font-weight: 500; }
.me__menu button:hover { background: var(--soft); }

/* ---------- page ---------- */
.page { max-width: 920px; margin: 0 auto; padding: clamp(32px, 7vw, 72px) clamp(20px, 5vw, 40px) 120px; }
.screen[hidden] { display: none; }

.hero h1 {
  font-size: clamp(2.5rem, 7.2vw, 4.4rem); font-weight: 600; line-height: 1.02; letter-spacing: -.038em;
  max-width: 14ch;
}
.hero__sub { margin-top: 18px; color: var(--slate); display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; max-width: 60ch; }
.dot { width: 9px; height: 9px; margin-top: .55em; border-radius: 50%; background: var(--online); flex: none; box-shadow: 0 0 0 4px var(--online-bg); }
body[data-state="issue"] .dot { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-bg); }
.hero__actions { display: flex; gap: 10px; margin-top: clamp(28px, 5vw, 40px); flex-wrap: wrap; }

.section { margin-top: clamp(52px, 9vw, 84px); }
.section h2 { font-size: 1rem; font-weight: 600; letter-spacing: -.01em; margin-bottom: 4px; }
.section__hint { color: var(--slate); font-size: .9375rem; max-width: 56ch; }

.rows { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); }
.row:last-child { border-bottom: 1px solid var(--line); }
.row__main { flex: 1; min-width: 0; }
.row__title { font-weight: 560; overflow-wrap: anywhere; }
.row__meta { color: var(--slate); font-size: .9375rem; margin-top: 2px; }
.row__side { display: flex; align-items: center; gap: 8px; flex: none; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: .9375rem; font-weight: 500; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--online); }
.status--wait { color: var(--amber); }
.status--wait::before { background: var(--amber); }

/* page headers for inner screens */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.head h1 { font-size: clamp(2rem, 4.6vw, 2.75rem); font-weight: 600; letter-spacing: -.034em; line-height: 1.05; }
.head p { color: var(--slate); margin-top: 10px; max-width: 54ch; }

/* backups list */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.brow { display: flex; align-items: center; gap: 16px; padding: 18px 22px; border-top: 1px solid var(--line); position: relative; }
.brow:first-child { border-top: 0; }
.brow__main { flex: 1; min-width: 0; }
.brow__when { font-weight: 560; }
.brow__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--slate); font-size: .9375rem; margin-top: 2px; }
.tag { display: inline-flex; padding: 0 9px; border-radius: 999px; background: var(--soft); font-size: .8125rem; font-weight: 500; line-height: 22px; color: var(--slate); }
.tag--you { background: color-mix(in srgb, var(--marigold) 24%, var(--paper)); color: var(--ink); }
.tag--auto { background: var(--info-bg); color: var(--info); }
.brow--new::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--marigold);
  animation: fade 3.2s ease-out .4s forwards;
}
@keyframes fade { to { opacity: 0; } }
.brow--confirm { background: var(--down-bg); }
.brow--confirm .brow__when { color: var(--down); }

.progress { padding: 20px 22px; border-bottom: 1px solid var(--line); }
.progress__top { display: flex; justify-content: space-between; gap: 12px; font-weight: 560; }
.progress__top span:last-child { color: var(--slate); font-weight: 500; }
.bar { height: 6px; border-radius: 999px; background: var(--soft); margin-top: 12px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0%; background: var(--marigold); border-radius: 999px; transition: width .25s linear; }
.progress__note { margin-top: 10px; color: var(--slate); font-size: .875rem; }

.notice { display: flex; gap: 12px; padding: 16px 18px; border-radius: var(--radius-sm); margin-top: 24px; font-size: .9375rem; }
.notice--bad { background: var(--down-bg); color: var(--ink); }
.notice--bad .icon { color: var(--down); margin-top: 1px; }
.notice b { font-weight: 600; }

.empty { padding: 56px 24px; text-align: center; }
.empty h2 { font-size: 1.125rem; font-weight: 600; margin-bottom: 6px; }
.empty p { color: var(--slate); max-width: 40ch; margin: 0 auto 20px; }

/* files */
.crumbs { display: flex; align-items: center; gap: 4px; font-size: .9375rem; margin-bottom: 14px; flex-wrap: wrap; }
.crumbs button { border: 0; background: none; padding: 4px 8px; margin-left: -8px; border-radius: 8px; color: var(--slate); font-weight: 500; }
.crumbs button:hover { color: var(--ink); background: var(--soft); }
.crumbs b { color: var(--ink); font-weight: 600; padding: 4px 0; }
.crumbs i { color: var(--slate); font-style: normal; }
.frow { display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 18px; border-top: 1px solid var(--line); min-height: 64px; }
.frow:first-child { border-top: 0; }
.frow--link { cursor: pointer; }
.frow--link:hover { background: color-mix(in srgb, var(--soft) 55%, transparent); }
.frow__icon { width: 40px; height: 40px; border-radius: 10px; background: var(--soft); color: var(--slate); display: grid; place-items: center; flex: none; overflow: hidden; }
.frow__icon--img { background: var(--g, linear-gradient(135deg, #a7c4ff, #6c8cff)); }
.frow__name { flex: 1; min-width: 0; font-weight: 520; overflow-wrap: anywhere; }
.frow__name small { display: block; color: var(--slate); font-size: .875rem; font-weight: 400; }
.frow__meta { color: var(--slate); font-size: .9375rem; width: 84px; text-align: right; flex: none; }
.frow__more { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; color: var(--slate); display: grid; place-items: center; }
.frow__more:hover, .frow__more[aria-expanded="true"] { background: var(--soft); color: var(--ink); }
.frow--confirm { background: var(--down-bg); cursor: default; }
.frow--confirm .frow__name { color: var(--down); }
.frow--upload { cursor: default; }
.frow--upload .bar { margin-top: 8px; }
.frow__rename { width: 100%; max-width: 320px; min-height: 40px; }
.drop {
  margin-top: 16px; border: 1.5px dashed var(--line); border-radius: var(--radius);
  padding: 26px 20px; text-align: center; color: var(--slate); font-size: .9375rem;
  transition: border-color .15s, background-color .15s;
}
.drop b { color: var(--ink); font-weight: 600; }
.drop.is-over { border-color: var(--marigold); background: color-mix(in srgb, var(--marigold) 12%, transparent); }
.menu {
  position: fixed; z-index: 30; min-width: 190px; padding: 6px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 12px; border: 0; background: none; border-radius: 8px; text-align: left; font-weight: 500; }
.menu button:hover { background: var(--soft); }
.menu .icon { width: 18px; height: 18px; color: var(--slate); }
.menu .is-danger, .menu .is-danger .icon { color: var(--down); }
.head__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- sign in ---------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; padding: 28px clamp(20px, 5vw, 40px); }
.auth__body { flex: 1; display: grid; place-items: center; padding: 40px 0; }
.auth__box { width: 100%; max-width: 380px; }
.auth h1 { font-size: clamp(2.25rem, 7vw, 3rem); font-weight: 600; letter-spacing: -.04em; line-height: 1.02; }
.auth__sub { color: var(--slate); margin-top: 12px; }
.field { margin-top: 22px; }
.field label { display: block; font-weight: 560; font-size: .9375rem; margin-bottom: 8px; }
.input {
  width: 100%; min-height: 48px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--paper);
  transition: border-color .15s, box-shadow .15s;
}
.input:hover { border-color: var(--slate); }
.input:focus-visible { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--marigold) 55%, transparent); }
.input[aria-invalid="true"] { border-color: var(--down); }
.pw { position: relative; }
.pw .input { padding-right: 76px; }
.pw button { position: absolute; right: 6px; top: 6px; min-height: 36px; border: 0; background: none; color: var(--slate); font-weight: 550; font-size: .875rem; padding: 0 12px; border-radius: 8px; }
.pw button:hover { color: var(--ink); background: var(--soft); }
.err { margin-top: 18px; color: var(--down); font-size: .9375rem; display: flex; gap: 8px; }
.err .icon { width: 18px; height: 18px; margin-top: 2px; }
.auth .btn--primary { width: 100%; margin-top: 26px; min-height: 50px; }
.auth__fine { margin-top: 22px; color: var(--slate); font-size: .9375rem; }
.auth__fine a { color: var(--ink); text-underline-offset: 3px; }
.steps { margin: 22px 0 0; padding-left: 22px; display: grid; gap: 22px; }
.steps li::marker { font-weight: 600; color: var(--slate); }
.qr { display: grid; place-items: center; margin-top: 14px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; width: fit-content; }
.qr img { display: block; image-rendering: pixelated; }
.key { font-variant-numeric: tabular-nums; letter-spacing: .06em; overflow-wrap: anywhere; }
.recovery { list-style: none; margin: 12px 0 0; padding: 14px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; font-variant-numeric: tabular-nums; letter-spacing: .04em; font-weight: 560; }
.code { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 26px; }
.code .input { padding: 0; text-align: center; font-size: 1.375rem; font-weight: 600; min-height: 56px; }

/* ---------- toast ---------- */
.toasts { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 40; display: grid; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast {
  background: var(--ink); color: var(--ink-fg); border-radius: 999px; padding: 12px 20px;
  font-weight: 520; font-size: .9375rem; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 10px; pointer-events: auto;
  animation: pop .22s cubic-bezier(.2, .8, .3, 1) both;
}
.toast button { border: 0; background: none; color: inherit; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; padding: 0; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .top__in { height: 58px; gap: 12px; }
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; margin: 0; gap: 0;
    background: color-mix(in srgb, var(--paper) 92%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .tabs a { flex: 1; flex-direction: column; gap: 3px; min-height: 52px; justify-content: center; font-size: .75rem; padding: 0; border-radius: 12px; }
  .tabs a[aria-current="page"] { background: transparent; }
  .tabs a[aria-current="page"] .icon { color: var(--ink); }
  .tabs .icon { display: block; }
  .me, .tabs + .me { margin-left: auto; }
  .page { padding-bottom: 130px; }
  .toasts { bottom: 92px; }
  .row { flex-wrap: wrap; align-items: flex-start; }
  .row__side { width: 100%; }
  .brow { flex-wrap: wrap; padding: 16px 18px; }
  .brow__side { width: 100%; display: flex; gap: 8px; }
  .brow__side .btn { flex: 1; }
  .head .btn--primary { width: 100%; }
  .head > form { width: 100%; }
  .head > form .btn { width: 100%; }
  .brow__side .btn--quiet { flex: none; }
  .head__actions { width: 100%; }
  .head__actions .btn { flex: 1; }
  .frow { padding: 10px 6px 10px 14px; }
  .frow__meta.hide-sm { display: none; }
  .hero__actions .btn { flex: 1; }
}
@media (min-width: 721px) {
  .brow__side { display: flex; gap: 8px; flex: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- additions for the real panel ---------- */
.icon--sm { width: 18px; height: 18px; }
.foot { max-width: 920px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 40px) 40px; color: var(--slate); font-size: .8125rem; }
.auth .foot { padding: 0; }
form.inline { display: inline; margin: 0; }
.btn[disabled] { opacity: .55; cursor: default; }
.seg a { display: inline-flex; align-items: center; min-height: 38px; padding: 0 20px; border-radius: 999px; font-weight: 550; font-size: .9375rem; color: var(--slate); text-decoration: none; transition: color .15s, background-color .15s; }
.seg a:hover { color: var(--ink); }
.seg a[aria-selected="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(23, 32, 43, .12); }
.mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; } .mt-14 { margin-top: 14px; }
.notice--warn { background: var(--amber-bg); }
.notice--warn .icon { color: var(--amber); margin-top: 1px; }
.crumbs a { padding: 4px 8px; margin-left: -8px; border-radius: 8px; color: var(--slate); font-weight: 500; text-decoration: none; }
.crumbs a:hover { color: var(--ink); background: var(--soft); }
.frow__icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.frow__name a { text-decoration: none; }
.sr-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.err--info { color: var(--slate); }
.hero__sub .copy { color: var(--ink); }
.sprite { position: absolute; width: 0; height: 0; }

/* backups: one section per type */
.bk { margin-top: clamp(44px, 8vw, 72px); }
.bk__head h2 { font-size: clamp(1.375rem, 3vw, 1.75rem); font-weight: 600; letter-spacing: -.025em; line-height: 1.1; margin: 0; }
.bk__head { flex-wrap: nowrap; align-items: flex-end; }
.bk__head > div { flex: 1; min-width: 0; }
.bk__head p { max-width: 58ch; }
.bk .panel { margin-top: 24px; }
@media (max-width: 720px) {
  .bk__head { flex-wrap: wrap; }
  .bk__head > div { flex: 1 1 100%; }
}
