:root {
  --bg: #0f2438;
  --card: #1a3a5c;
  --card2: #234d73;
  --accent: #f0a030;
  --text: #e8eef5;
  --muted: #9bb0c4;
  --danger: #e85d5d;
  --ok: #3ecf8e;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--font); min-height: 100%; }
body { padding-bottom: 2.5rem; }
header.appbar {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(180deg, #16324f 0%, #0f2438 100%);
  border-bottom: 1px solid #2a5075;
  padding: 0.85rem 1rem 0.75rem;
}
header h1 { margin: 0; font-size: 1.15rem; font-weight: 700; letter-spacing: 0.01em; }
header .sub { color: var(--muted); font-size: 0.78rem; margin-top: 0.2rem; }
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
  padding: 0.9rem 1rem;
}
@media (min-width: 520px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.tile {
  background: var(--card);
  border: 1px solid #2a5075;
  border-radius: var(--radius);
  padding: 0.9rem 0.75rem;
  text-align: left;
  color: inherit;
  cursor: pointer;
  min-height: 5.2rem;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: transform 0.08s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.tile:active { transform: scale(0.97); background: var(--card2); }
.tile .label { font-size: 0.82rem; font-weight: 600; line-height: 1.25; }
.tile .count {
  font-size: 1.55rem; font-weight: 800; color: var(--accent);
  margin-top: 0.35rem;
}
.view { display: none; padding: 0 1rem 2rem; }
.view.active { display: block; }
.view-head {
  display: flex; align-items: center; gap: 0.6rem;
  margin: 0.85rem 0 0.75rem;
}
.view-head h2 { margin: 0; font-size: 1.1rem; flex: 1; }
.btn {
  appearance: none; border: none; border-radius: 10px;
  padding: 0.55rem 0.9rem; font-weight: 600; font-size: 0.85rem;
  cursor: pointer; background: var(--accent); color: #1a1a1a;
}
.btn.secondary { background: var(--card2); color: var(--text); border: 1px solid #3a6088; }
.btn.block { width: 100%; margin-top: 0.5rem; }
.card-list { display: flex; flex-direction: column; gap: 0.55rem; }
.item {
  background: var(--card); border: 1px solid #2a5075;
  border-radius: 12px; padding: 0.7rem 0.8rem; font-size: 0.85rem;
}
.item .meta { color: var(--muted); font-size: 0.72rem; margin-top: 0.35rem; }
.item strong { display: block; margin-bottom: 0.15rem; }
.empty { color: var(--muted); font-size: 0.85rem; padding: 1rem 0.2rem; }
form.add {
  background: var(--card); border: 1px solid #2a5075;
  border-radius: 12px; padding: 0.85rem; margin-bottom: 1rem;
}
form.add label {
  display: block; font-size: 0.72rem; color: var(--muted);
  margin: 0.45rem 0 0.2rem; text-transform: uppercase; letter-spacing: 0.04em;
}
form.add input, form.add select, form.add textarea {
  width: 100%; padding: 0.55rem 0.6rem; border-radius: 8px;
  border: 1px solid #3a6088; background: #0f2438; color: var(--text);
  font-size: 0.95rem; font-family: inherit;
}
form.add textarea { min-height: 4.5rem; resize: vertical; }
.hint { font-size: 0.72rem; color: var(--muted); margin: 0.4rem 0 0; line-height: 1.3; }
.toast {
  position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%);
  background: var(--ok); color: #0a2018; padding: 0.55rem 1rem;
  border-radius: 999px; font-size: 0.82rem; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity 0.2s; z-index: 50;
}
.toast.show { opacity: 1; }
.toast.err { background: var(--danger); color: #fff; }
img.thumb { max-width: 100%; border-radius: 8px; margin-top: 0.4rem; }
.install-tip {
  margin: 0 1rem; padding: 0.6rem 0.75rem; font-size: 0.75rem;
  color: var(--muted); border: 1px dashed #3a6088; border-radius: 10px;
}

.appbar-row { display:flex; align-items:flex-start; gap:0.65rem; }
.appbar-row h1 { margin:0; }
.job-list { display:flex; flex-direction:column; gap:0.65rem; }
.job-row { display:flex; gap:0.5rem; align-items:stretch; }
.job-open {
  flex:1; text-align:left; background:var(--card); border:1px solid #2a5075;
  border-radius:12px; padding:0.9rem 1rem; color:inherit; cursor:pointer;
}
.job-open strong { display:block; font-size:1.05rem; }
.job-open .meta { color:var(--muted); font-size:0.75rem; }
.job-del { flex:0 0 auto; align-self:center; }
