* { box-sizing: border-box; margin: 0; }
:root {
  --bg: #f4f6f9; --card: #fff; --text: #1c2333; --muted: #68738a;
  --accent: #4f6ef7; --ok: #1fa971; --fail: #e2544a; --border: #e2e7f0;
}
body { background: var(--bg); color: var(--text); font: 16px/1.5 -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 1.5rem; margin: 1rem 0; }
h2 { font-size: 1.2rem; margin: 1.6rem 0 .6rem; }
h3 { margin: .3rem 0; }
h4 { margin: 0 0 .3rem; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: .85rem; }
.error { color: var(--fail); margin: .5rem 0; }
.prewrap { white-space: pre-wrap; }

.topbar { background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: 960px; margin: 0 auto; padding: .7rem 1rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; }
.brand { font-weight: 700; color: var(--text); }
.topbar nav { display: flex; gap: 1rem; flex-wrap: wrap; }

.container { max-width: 960px; margin: 0 auto; padding: 1rem 1rem 5rem; }

.login-box { max-width: 360px; margin: 14vh auto; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 2rem; text-align: center; }
.login-box input { width: 100%; margin: 1rem 0 .3rem; }

input, textarea, select { font: inherit; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 8px; width: 100%; background: #fff; color: var(--text); }
textarea { min-height: 70px; resize: vertical; }
label { display: block; margin: .5rem 0; font-size: .9rem; }
.stack { display: flex; flex-direction: column; gap: .4rem; max-width: 640px; }
.inline-form { display: flex; gap: .5rem; margin-top: .6rem; }
.inline-form select { width: auto; }

.btn { display: inline-block; border: 1px solid var(--border); background: #fff; color: var(--text); padding: .55rem 1.1rem; border-radius: 8px; cursor: pointer; font: inherit; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-lg { padding: .8rem 2rem; font-size: 1.05rem; }
.btn-small { padding: .3rem .8rem; font-size: .85rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1rem; margin: .6rem 0; display: block; color: var(--text); }
.run-card:hover { border-color: var(--accent); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.run-id { color: var(--muted); font-weight: 600; }
.build-card { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

.badge { font-size: .75rem; padding: .18rem .6rem; border-radius: 99px; white-space: nowrap; background: #eef1f7; color: var(--muted); }
.badge-open { background: #e8edff; color: var(--accent); }
.badge-submitted { background: #fff3d6; color: #9a6b00; }
.badge-processed { background: #e2f6ec; color: var(--ok); }
.badge-sev-critical { background: #ffe0dd; color: #b3261e; font-weight: 700; }
.badge-sev-major { background: #ffe9d6; color: #a05a00; }
.badge-sev-minor { background: #e8edff; color: var(--accent); }
.badge-sev-info { background: #eef1f7; color: var(--muted); }
.badge-task-open { background: #ffe9d6; color: #a05a00; }
.badge-task-in_progress { background: #e8edff; color: var(--accent); }
.badge-task-done { background: #e2f6ec; color: var(--ok); }
.badge-task-wontfix { background: #eef1f7; color: var(--muted); }

.progress { height: 8px; background: #e6eaf2; border-radius: 99px; overflow: hidden; margin: .5rem 0 .2rem; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }
.sticky-progress { position: sticky; top: 52px; z-index: 10; }

.run-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

.checklist { list-style: none; padding: 0; }
.check-item { background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--border); border-radius: 12px; padding: 1rem; margin: .8rem 0; }
.check-item.ok { border-left-color: var(--ok); }
.check-item.fail { border-left-color: var(--fail); }
.check-row { display: flex; gap: .9rem; }
.check-body { flex: 1; min-width: 0; }
.steps, .expected { font-size: .92rem; margin: .35rem 0; color: #333c52; }
.check-body textarea { margin-top: .5rem; }

.checkbox-wrap { position: relative; flex: 0 0 auto; margin-top: .1rem; }
.checkbox-wrap input { position: absolute; opacity: 0; width: 28px; height: 28px; cursor: pointer; }
.checkmark { display: block; width: 28px; height: 28px; border: 2px solid var(--border); border-radius: 8px; background: #fff; }
.checkbox-wrap input:checked + .checkmark { background: var(--ok); border-color: var(--ok); }
.checkbox-wrap input:checked + .checkmark::after { content: "✓"; color: #fff; display: block; text-align: center; line-height: 24px; font-weight: 700; }
.checkbox-wrap input:disabled + .checkmark { opacity: .6; }

.shots { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; }
.shot { position: relative; }
.shot img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }
.shot-del { position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%; border: none; background: var(--fail); color: #fff; cursor: pointer; line-height: 1; }
.shot-add { width: 84px; height: 84px; border: 2px dashed var(--border); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: var(--muted); cursor: pointer; }
.shot-add:hover { border-color: var(--accent); color: var(--accent); }
.save-state { display: block; min-height: 1.1em; margin-top: .3rem; }

.submit-bar { position: sticky; bottom: 0; background: var(--card); border: 1px solid var(--border); border-radius: 12px 12px 0 0; padding: .9rem 1.2rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; box-shadow: 0 -4px 16px rgba(20,30,60,.06); }

.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin: .8rem 0; }
.chip { padding: .25rem .8rem; border-radius: 99px; border: 1px solid var(--border); background: var(--card); color: var(--muted); font-size: .85rem; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 12px; overflow: hidden; font-size: .92rem; }
.table th, .table td { text-align: left; padding: .55rem .8rem; border-bottom: 1px solid var(--border); }
.table th { background: #eef1f7; font-weight: 600; }

details.card summary { cursor: pointer; font-weight: 600; }
details.card[open] summary { margin-bottom: .8rem; }
