:root {
  --bg: #f6f7f8;
  --card: #fff;
  --ink: #17201f;
  --muted: #6b7671;
  --teal: #0f766e;
  --line: #e2e5e4;
  --err: #b42318;
  --ok: #12784f;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { padding: 0 16px calc(48px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; }

header { display: flex; align-items: baseline; justify-content: space-between;
  padding: 16px 0 8px; }
header h1 { font-size: 20px; margin: 0; color: var(--teal); }
.acct { display: flex; gap: 10px; align-items: baseline; }
.muted { color: var(--muted); font-size: 13px; }

.tabs { display: flex; gap: 6px; margin: 8px 0 16px; }
.tab { flex: 1; padding: 10px; border: 1px solid var(--line); background: var(--card);
  border-radius: 10px; font-size: 14px; color: var(--muted); }
.tab.active { color: #fff; background: var(--teal); border-color: var(--teal); }

form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 13px; font-weight: 600; }
input, select, textarea { font: inherit; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--card); color: var(--ink); width: 100%; }
input[type="file"] { padding: 9px; }
textarea { resize: vertical; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); }
.check input { width: auto; margin-top: 2px; }

.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb { position: relative; width: 76px; height: 76px; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; padding: 0;
  border: none; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; line-height: 20px; }

.primary { padding: 13px; border: none; border-radius: 12px; background: var(--teal); color: #fff;
  font-size: 16px; font-weight: 600; }
.primary:disabled { opacity: .55; }
.secondary { padding: 11px; border: 1px solid var(--teal); border-radius: 12px; background: transparent;
  color: var(--teal); font-size: 15px; font-weight: 600; align-self: flex-start; }
.secondary:disabled { opacity: .5; }
.link { border: none; background: none; color: var(--teal); font-size: 13px; padding: 4px; }

.status { font-size: 14px; margin: 4px 0 0; min-height: 1.2em; }
.status.busy { color: var(--muted); }
.status.ok { color: var(--ok); }
.status.error { color: var(--err); }

.list { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 6px; }
.list li button { width: 100%; text-align: left; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--card); font-size: 14px; }
.list li button.sel { border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); }
.row-between { display: flex; justify-content: space-between; align-items: center; }
.selected { font-weight: 600; font-size: 14px; background: #ecfdf5; padding: 8px 10px; border-radius: 8px; }

footer { margin-top: 28px; text-align: center; }

@media (prefers-color-scheme: dark) {
  :root { --bg: #121514; --card: #1b201f; --ink: #e8ebea; --muted: #9aa5a1; --line: #2c3331;
    --teal: #2dd4bf; --ok: #4ade80; --err: #f87171; }
  .tab.active { color: #04211d; }
  .primary { color: #04211d; }
  .selected { background: #0c2b24; }
}
