[hidden] { display: none !important; }
:root {
  --bg: #0f1115; --card: #181b22; --line: #2a2f3a; --text: #e8eaf0; --muted: #8b93a5;
  --accent: #6d8cff; --accent-2: #8a6dff; --danger: #ff6b6b; --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
h1 { font-size: 1.15rem; margin: 0; }
h2 { font-size: 1rem; margin: 0 0 .75rem; }
main { max-width: 720px; margin: 0 auto; padding: 12px; }
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: rgba(15,17,21,.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
label { display: block; font-size: .85rem; color: var(--muted); margin: 14px 0 6px; }
.row-between label { margin: 0; }
textarea, input, select {
  width: 100%; font: inherit; font-size: 16px; color: var(--text); background: #0f1218;
  border: 1px solid var(--line); border-radius: 10px; padding: 12px;
}
textarea { resize: vertical; min-height: 180px; }
textarea:focus, input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px;
  border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: 0; color: #fff; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: .9rem; }
.btn.block { width: 100%; margin-top: 16px; }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .5; cursor: wait; }
.link { background: none; border: 0; color: var(--accent); font: inherit; padding: 0 0 0 8px; cursor: pointer; }
.file-btn { margin: 0 !important; color: var(--text) !important; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.meta { text-align: right; font-size: .85rem; color: var(--muted); margin-top: 6px; }
.muted { color: var(--muted); }
.small-text { font-size: .82rem; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; word-break: break-all; }
.center { text-align: center; }
.error { color: var(--danger); font-size: .9rem; margin: 8px 0 0; }
.error:empty { display: none; }
audio { width: 100%; margin-top: 12px; }

.loading { display: flex; align-items: center; gap: 14px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.tab { display: none; }
.tab.active { display: block; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex;
  background: rgba(24,27,34,.95); backdrop-filter: blur(8px); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button { flex: 1; min-height: 56px; background: none; border: 0; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.tabbar button.active { color: var(--text); box-shadow: inset 0 2px 0 var(--accent); }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; }
.stat span { font-size: .8rem; color: var(--muted); }
.stat strong { font-size: 1.4rem; }
.stat small { color: var(--muted); }
.job .preview { color: var(--muted); font-size: .9rem; margin: 10px 0 0; white-space: pre-wrap; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.badge { font-size: .78rem; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge.err { color: var(--danger); border-color: var(--danger); }

.add-form { display: grid; gap: 8px; }
.list { list-style: none; padding: 0; margin: 12px 0 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }

.login-page { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login-card { width: 100%; max-width: 360px; }
.login-card .btn { width: 100%; margin-top: 16px; }

@media (min-width: 640px) {
  .add-form { grid-template-columns: 1fr 1.4fr auto; }
  .tabbar { justify-content: center; }
  .tabbar button { flex: 0 0 160px; }
}
