:root {
    --bg: #0f172a;
    --bg-soft: #1e293b;
    --card: #1e293b;
    --border: #334155;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --accent: #38bdf8;
    --ok: #22c55e;
    --err: #ef4444;
    --warn: #f59e0b;
}
* { box-sizing: border-box; }
html, body {
    margin: 0; padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}
body {
    padding: env(safe-area-inset-top, 12px) 16px env(safe-area-inset-bottom, 16px);
    max-width: 640px; margin: 0 auto;
}
header { padding: 24px 4px 16px; }
header h1 { margin: 0; font-size: 26px; font-weight: 700; }
header .sub { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
}
.card.hidden { display: none; }

label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; margin: 8px 0 14px; }
input[type="password"], input[type="text"] {
    width: 100%;
    padding: 14px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 16px;
    font-family: ui-monospace, SFMono-Regular, monospace;
}
input:focus { outline: none; border-color: var(--accent); }

button {
    appearance: none;
    background: var(--accent);
    color: #0f172a;
    border: 0;
    padding: 14px 18px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    margin-top: 12px;
}
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.link {
    background: none;
    color: var(--muted);
    text-decoration: underline;
    padding: 12px;
    width: auto;
    font-size: 13px;
}

.picker {
    display: flex; flex-direction: column; align-items: center;
    padding: 32px 16px; border: 2px dashed var(--border); border-radius: 12px;
    cursor: pointer; transition: border-color .15s, background .15s;
}
.picker:active { background: var(--bg-soft); border-color: var(--accent); }
.picker-icon {
    font-size: 40px; line-height: 1; margin-bottom: 10px;
    color: var(--accent); font-weight: 300;
}
.picker-text { font-weight: 600; font-size: 17px; }
.picker-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }

.status { margin: 8px 0 0; font-size: 14px; min-height: 18px; }
.status.ok { color: var(--ok); }
.status.err { color: var(--err); }

.queue { margin-top: 12px; }
.item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    margin: 10px 0;
}
.item-name { font-weight: 600; word-break: break-all; font-size: 15px; }
.item-meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.item-bar {
    height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden;
    margin-top: 10px;
}
.item-bar-fill {
    height: 100%; background: var(--accent); width: 0%;
    transition: width .25s ease;
}
.item-bar-fill.ok { background: var(--ok); }
.item-bar-fill.err { background: var(--err); }

.item.done .item-meta::before { content: "OK "; color: var(--ok); font-weight: 700; }
.item.fail .item-meta::before { content: "FEHLER "; color: var(--err); font-weight: 700; }

footer { color: var(--muted); font-size: 12px; padding: 24px 0 8px; text-align: center; }
