/* LabCodeHub – single stylesheet, light and dark. */
:root {
  --bg: #f6f8fa;
  --surface: #ffffff;
  --surface-2: #f0f3f6;
  --border: #d5dbe2;
  --text: #1c2128;
  --muted: #64707d;
  --accent: #2f6feb;
  --accent-fg: #ffffff;
  --ok: #1a7f37;
  --warn: #9a6700;
  --err: #cf222e;
  --add-bg: #e6ffec;
  --add-ln: #ccffd8;
  --del-bg: #ffebe9;
  --del-ln: #ffd7d5;
  --hunk-bg: #eef2f8;
  --t-kw: #cf222e;
  --t-typ: #0550ae;
  --t-str: #0a7c42;
  --t-num: #7c3aed;
  --t-com: #6e7781;
  --t-pun: #57606a;
  --t-meta: #953800;
  --radius: 8px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --surface: #161b22;
    --surface-2: #1c2129;
    --border: #30363d;
    --text: #e6edf3;
    --muted: #8b949e;
    --accent: #4c8dff;
    --accent-fg: #06101f;
    --ok: #3fb950;
    --warn: #d29922;
    --err: #f85149;
    --add-bg: #12261e;
    --add-ln: #1c3a29;
    --del-bg: #2d1214;
    --del-ln: #48211f;
    --hunk-bg: #1b2430;
    --t-kw: #ff7b72;
    --t-typ: #79c0ff;
    --t-str: #7ee787;
    --t-num: #d2a8ff;
    --t-com: #8b949e;
    --t-pun: #a9b1ba;
    --t-meta: #ffa657;
  }
}

* { box-sizing: border-box; }
/* display:flex on a container would otherwise beat the hidden attribute. */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 2px; }
h2 { font-size: 17px; margin: 0; }
code, pre { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }
.grow { flex: 1; min-width: 0; }
.err { color: var(--err); }
.sep { color: var(--muted); }

/* ---------------------------------------------------------- top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40; }
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 15px; }
.brand:hover { text-decoration: none; }
.brand b { font-weight: 700; }
.mainnav { display: flex; gap: 4px; }
.mainnav a { color: var(--text); padding: 5px 10px; border-radius: 6px; font-weight: 500; }
.mainnav a:hover { background: var(--surface-2); text-decoration: none; }
.mainnav a.active { background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--accent); }

.usermenu { position: relative; }
.usermenu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 6px; }
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu > summary:hover { background: var(--surface-2); }
.uname { font-weight: 500; }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-fg);
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex: none;
}
.avatar.tiny { width: 18px; height: 18px; font-size: 9px; }
.avatar.org { background: linear-gradient(135deg, #7c5cff, #2f6feb); }
.avatar.org.big { width: 46px; height: 46px; font-size: 18px; }

.dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 260px; z-index: 50;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0,0,0,.22); padding: 6px;
}
.dropdown.right { left: auto; right: 0; }
.dropdown a, .dropdown .linklike { display: block; padding: 7px 10px; border-radius: 6px; color: var(--text); width: 100%; text-align: left; }
.dropdown a:hover, .dropdown .linklike:hover { background: var(--surface-2); text-decoration: none; }
.dd-head { padding: 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.linklike { background: none; border: 0; font: inherit; cursor: pointer; }

/* ---------------------------------------------------------- layout */
.page { max-width: 1180px; margin: 0 auto; padding: 22px 16px 60px; }
.foot { max-width: 1180px; margin: 0 auto; padding: 16px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--border); }
.pagehead { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.pagehead .actions { margin-left: auto; display: flex; gap: 8px; }
.orghead { display: flex; gap: 14px; align-items: center; }
.section { margin: 26px 0 10px; font-size: 15px; text-transform: none; }
.section.flat { margin: 0; }

.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid var(--border); background: var(--surface); }
.flash.ok { border-color: var(--ok); color: var(--ok); }
.flash.error { border-color: var(--err); color: var(--err); }
.flash.small { padding: 6px 10px; font-size: 12.5px; }

/* ---------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--err); border-color: var(--err); background: transparent; }
.btn.danger:hover { background: var(--del-bg); }
.btn.small { padding: 4px 9px; font-size: 12.5px; }
.btn.tiny { padding: 2px 7px; font-size: 11.5px; }
.btn.block { width: 100%; justify-content: center; }
.btn.active { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn[disabled], .btn.disabled { opacity: .45; cursor: not-allowed; }
.inline { display: inline; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 20px;
  border: 1px solid var(--border); font-size: 11.5px; color: var(--muted); background: var(--surface-2);
}
.badge.ok { color: var(--ok); border-color: var(--ok); }
.badge.warn { color: var(--warn); border-color: var(--warn); }
.badge.err { color: var(--err); border-color: var(--err); }
.badge.admin { color: var(--accent); border-color: var(--accent); }
.badge.running { color: var(--accent); border-color: var(--accent); animation: pulse 1.4s infinite; }
.badge.link { color: var(--accent); }
.badge.muted { color: var(--muted); }
@keyframes pulse { 50% { opacity: .45; } }
.pill { background: var(--surface-2); border: 1px solid var(--border); border-radius: 20px; padding: 0 7px; font-size: 11.5px; color: var(--muted); }
.permbadges { display: inline-flex; gap: 5px; flex-wrap: wrap; }

/* ---------------------------------------------------------- forms */
label { display: block; font-weight: 500; margin-bottom: 2px; }
.label { display: block; font-weight: 500; margin-bottom: 6px; }
input[type=text], input[type=password], input[type=email], input[type=search], select, textarea {
  width: 100%; padding: 7px 10px; margin-top: 4px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
input[readonly] { color: var(--muted); }
textarea { resize: vertical; }
.stack > * + * { margin-top: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid2.top { align-items: start; }
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } }
.formactions { display: flex; gap: 8px; align-items: center; }
label.check, .perms label { display: flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; }
label.check input, .perms input { width: auto; margin: 0; }
.perms { display: flex; gap: 14px; flex-wrap: wrap; }
.perms.wrap { gap: 10px 18px; }
.fs { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.fs legend { padding: 0 6px; font-weight: 600; font-size: 12.5px; color: var(--muted); }
.filterbar { display: flex; gap: 8px; margin-bottom: 16px; }
.filterbar input { max-width: 320px; }
.filterbar select { max-width: 240px; }
.filter { max-width: 100%; }
.filter.wide { width: 260px; }

/* ---------------------------------------------------------- panels, lists */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.panel.stack { padding: 16px; }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 9px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.panel.danger { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-color: var(--err); }

.list { display: flex; flex-direction: column; gap: 8px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.panel .list-row { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; }
.panel .list-row:last-child { border-bottom: 0; }
a.list-row:hover { border-color: var(--accent); text-decoration: none; }
.row-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.row-actions { display: flex; align-items: center; gap: 6px; }

.stats { display: flex; gap: 12px; flex-wrap: wrap; }
.stat { flex: 1; min-width: 140px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat .num { display: block; font-size: 26px; font-weight: 700; }
.stat .lbl { color: var(--muted); font-size: 12.5px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; color: var(--text); }
.card:hover { border-color: var(--accent); text-decoration: none; }
.card-title { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--accent); }
.card-org { color: var(--muted); font-size: 12px; margin-top: 2px; }
.card-desc { margin: 8px 0; font-size: 13px; color: var(--muted); min-height: 34px; }
.card-foot { display: flex; align-items: center; gap: 8px; font-size: 11.5px; }

.empty { padding: 34px 16px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }
.empty.small { padding: 14px; }
.empty.big { padding: 60px 16px; }
.empty .btn { margin-top: 10px; }
.errcode { font-size: 44px; font-weight: 800; color: var(--muted); }

.ico { width: 16px; height: 16px; flex: none; }
.ico.big { width: 20px; height: 20px; color: var(--muted); }
.ico.dir { color: var(--accent); }
.ico.file { color: var(--muted); }

/* ---------------------------------------------------------- repo header */
.repohead { margin-bottom: 16px; }
.repohead-title { display: flex; align-items: center; gap: 8px; font-size: 18px; flex-wrap: wrap; }
.repohead-title .repo-name { font-weight: 700; }
.repodesc { margin: 6px 0 0; color: var(--muted); }
.tabs { display: flex; gap: 2px; margin-top: 14px; border-bottom: 1px solid var(--border); }
.tabs a { padding: 7px 12px; color: var(--text); border-radius: 6px 6px 0 0; display: flex; align-items: center; gap: 6px; }
.tabs a:hover { background: var(--surface-2); text-decoration: none; }
.tabs a.active { box-shadow: inset 0 -2px 0 var(--accent); font-weight: 600; }

.toolbar { display: flex; align-items: center; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
.refswitch { position: relative; }
.refswitch > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.refswitch > summary::-webkit-details-marker { display: none; }
.refswitch > summary:hover { background: var(--surface-2); }
.refswitch .reftype { color: var(--muted); }
.refswitch .dropdown { width: 320px; max-height: 420px; overflow: auto; }
.dd-list { max-height: 340px; overflow: auto; }
.dd-section { padding: 6px 10px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.dd-item { display: flex !important; align-items: center; justify-content: space-between; gap: 10px; }
.dd-item.sel { background: var(--surface-2); font-weight: 600; }
.dd-item code { color: var(--muted); }
.dd-empty { padding: 6px 10px; color: var(--muted); font-size: 12.5px; }

.crumbbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 15px; }
.crumbbar .cur { font-weight: 600; }

.lastcommit { display: flex; align-items: center; gap: 8px; padding: 9px 14px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; border-bottom: 0; font-size: 13px; flex-wrap: wrap; }
.filetree { border: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; background: var(--surface); }
.lastcommit + .filetree { border-radius: 0 0 var(--radius) var(--radius); }
table.tree { width: 100%; border-collapse: collapse; }
table.tree td { padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tree tr:last-child td { border-bottom: 0; }
table.tree tr:hover { background: var(--surface-2); }
.ico-cell { width: 30px; text-align: center; color: var(--muted); }
.name-cell { width: 40%; }
.msg-cell { color: var(--muted); font-size: 12.5px; }
.age-cell { width: 130px; text-align: right; font-size: 12.5px; white-space: nowrap; }
@media (max-width: 720px) { .msg-cell { display: none; } }

/* ---------------------------------------------------------- code view */
.code { overflow-x: auto; background: var(--surface); }
table.codetable { border-collapse: collapse; width: 100%; }
table.codetable td { vertical-align: top; padding: 0; }
td.ln {
  width: 1%; min-width: 48px; text-align: right; padding: 0 12px 0 8px; user-select: none;
  color: var(--muted); font-family: var(--mono); font-size: 12px; line-height: 20px;
  border-right: 1px solid var(--border); background: var(--surface);
}
td.ln a { color: var(--muted); }
td.cl pre { margin: 0; padding: 0 12px; line-height: 20px; white-space: pre; }
table.codetable tr:target td { background: var(--hunk-bg); }
.tabsmall { display: flex; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--border); }

/* syntax highlighting */
.t-kw { color: var(--t-kw); }
.t-typ { color: var(--t-typ); }
.t-str { color: var(--t-str); }
.t-num { color: var(--t-num); }
.t-com { color: var(--t-com); font-style: italic; }
.t-pun { color: var(--t-pun); }
.t-meta { color: var(--t-meta); }

/* media files */
.media-view {
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background:
    repeating-conic-gradient(var(--surface-2) 0% 25%, var(--surface) 0% 50%) 50% / 22px 22px;
  min-height: 160px;
}
.media-view img, .media-view video {
  max-width: 100%; max-height: 70vh;
  border-radius: 4px; box-shadow: 0 2px 12px rgba(0,0,0,.18);
}
.media-view.audio { background: var(--surface); padding: 28px; }
.media-view audio { width: 100%; max-width: 520px; }
.pdf-view { width: 100%; height: 72vh; border: 0; background: var(--surface); }

/* ---------------------------------------------------------- diff view */
.commitbox .commit-head { padding: 14px 16px; }
.commitbox h2 { font-size: 16px; }
.commit-body { margin: 8px 0 0; white-space: pre-wrap; color: var(--muted); font-size: 12.5px; }
.commit-info { display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-top: 1px solid var(--border);
  background: var(--surface-2); flex-wrap: wrap; font-size: 13px; }
.sha { font-family: var(--mono); font-size: 12px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 6px; color: var(--accent); }
.sha.big { font-size: 12px; color: var(--muted); }
.diffstat { display: flex; align-items: center; gap: 8px; }
.add { color: var(--ok); font-weight: 600; }
.del { color: var(--err); font-weight: 600; }
.ctxswitch { display: flex; align-items: center; gap: 4px; }

.diff-head .status { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; padding: 1px 7px;
  border-radius: 20px; border: 1px solid var(--border); color: var(--muted); }
.diff-head .status.added { color: var(--ok); border-color: var(--ok); }
.diff-head .status.deleted { color: var(--err); border-color: var(--err); }
.diff-head .status.renamed { color: var(--accent); border-color: var(--accent); }
.diff-head b { font-family: var(--mono); font-size: 12.5px; word-break: break-all; }

table.difftable { width: 100%; border-collapse: collapse; }
table.difftable td { padding: 0; vertical-align: top; }
table.difftable td.dl { width: 100%; }
table.difftable td.dl pre { display: inline; margin: 0; white-space: pre-wrap; word-break: break-word; }
table.difftable td.dl .mark { display: inline-block; width: 14px; padding-left: 6px; color: var(--muted); user-select: none; }
table.difftable tr.add { background: var(--add-bg); }
table.difftable tr.add td.ln { background: var(--add-ln); }
table.difftable tr.del { background: var(--del-bg); }
table.difftable tr.del td.ln { background: var(--del-ln); }
table.difftable tr.hunk td { background: var(--hunk-bg); color: var(--muted); font-family: var(--mono); font-size: 11.5px; padding: 3px 8px; }
table.difftable tr.meta td.dl { color: var(--muted); font-style: italic; }
.diff { overflow-x: auto; }

/* ---------------------------------------------------------- commits */
.commit-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.commit-row:last-child { border-bottom: 0; }
.commit-row:hover { background: var(--surface-2); }
.commit-subject { font-weight: 600; color: var(--text); }
.commit-subject:hover { color: var(--accent); }
.commit-meta { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.commit-side { display: flex; align-items: center; gap: 6px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 18px 0; }

/* ---------------------------------------------------------- tables */
table.members { width: 100%; border-collapse: collapse; }
table.members th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); padding: 9px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
table.members td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.members tr:last-child td { border-bottom: 0; }
.member-cell { display: flex; align-items: center; gap: 10px; }
.perm-form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------------------------------------------------------- releases */
.release .panel-head { gap: 10px; }
.release .panel-head.sub { background: var(--surface); border-top: 1px solid var(--border); }
.release-title { font-size: 15px; font-weight: 700; color: var(--accent); margin: 0; }
.release-body { padding: 12px 14px; }
.release-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.release-notes { margin: 10px 0 0; white-space: pre-wrap; }
.panel.release.latest { border-color: var(--accent); float: right; margin-left: 10px; width: 40%; }
.panel.release.latest .panel-head { background: color-mix(in srgb, var(--accent) 10%, var(--surface-2)); }
.lastcommit.plain { margin-top: 12px; border-radius: var(--radius); border-bottom: 1px solid var(--border); }
table.assets { width: 100%; border-collapse: collapse; border-top: 1px solid var(--border); }
table.assets td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.assets tr:last-child td { border-bottom: 0; }
table.assets tr:hover { background: var(--surface-2); }
table.assets .name-cell { width: auto; font-family: var(--mono); font-size: 12.5px; }
label.check.mt { margin-top: 8px; }
.indent { margin-left: 26px; display: block; }
small.indent { margin-left: 26px; display: block; }

.badge.vis-public { color: var(--ok); border-color: var(--ok); }
.badge.vis-releases { color: var(--accent); border-color: var(--accent); }
.badge.vis-private { color: var(--muted); }
label.check.radio { align-items: flex-start; gap: 8px; margin: 6px 0; }
label.check.radio input { margin-top: 4px; }
label.check.radio span { font-weight: 400; }

/* ---------------------------------------------------------- builds */
.bstatus {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 20px;
  font-size: 12px; font-weight: 600; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--muted); white-space: nowrap; flex: none;
}
.bstatus::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.bstatus.ok { color: var(--ok); border-color: var(--ok); }
.bstatus.failed { color: var(--err); border-color: var(--err); }
.bstatus.running { color: var(--accent); border-color: var(--accent); }
.bstatus.running::before { animation: pulse 1.2s infinite; }
.build-row { gap: 14px; }

.build-meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 8px 20px; padding: 14px;
}
.build-meta > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.build-meta .muted { min-width: 96px; font-size: 12px; }
.build .flash { margin: 0 14px 14px; }

.buildlog {
  margin: 0; padding: 14px 16px; max-height: 60vh; overflow: auto;
  background: var(--surface-2); border-top: 1px solid var(--border);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
}
.panel.danger.neutral { border-color: var(--border); }
.targetlist label { align-items: flex-start; }
label.check.tiny { font-size: 12px; font-weight: 400; }

/* target selection */
.targetgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.targetcard {
  display: flex; gap: 10px; align-items: flex-start; margin: 0; font-weight: 400;
  padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); cursor: pointer;
}
.targetcard:hover { border-color: var(--accent); }
.targetcard:has(input:checked) { border-color: var(--accent); background: var(--surface-2); }
.targetcard input { width: auto; margin: 3px 0 0; flex: none; }
.tc-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tc-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tc-name { font-weight: 600; }
.tc-desc { font-size: 12.5px; }
.tc-meta:empty { display: none; }
.targetactions { display: flex; align-items: center; gap: 12px; padding: 14px 16px; flex-wrap: wrap; }

/* ---------------------------------------------------------- markdown */
.panel.readme { margin-top: 16px; }
.markdown { padding: 18px 22px; }
.markdown .md-h { margin: 20px 0 10px; padding-bottom: 5px; border-bottom: 1px solid var(--border); }
.markdown h1.md-h { font-size: 22px; }
.markdown h2.md-h { font-size: 18px; }
.markdown h3.md-h, .markdown h4.md-h { font-size: 15px; border-bottom: 0; }
.markdown p { margin: 0 0 12px; }
.markdown ul, .markdown ol { margin: 0 0 12px; padding-left: 24px; }
.markdown li { margin: 3px 0; }
.markdown code { background: var(--surface-2); border-radius: 5px; padding: 1px 5px; }
.markdown pre.md-code { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; overflow-x: auto; }
.markdown pre.md-code code { background: none; padding: 0; }
.md-table-wrap { overflow-x: auto; margin: 0 0 14px; }
.markdown table.md-table { border-collapse: collapse; width: auto; min-width: 50%; font-size: 13.5px; }
.markdown table.md-table th, .markdown table.md-table td {
  border: 1px solid var(--border); padding: 6px 12px; text-align: left; vertical-align: top;
}
.markdown table.md-table th { background: var(--surface-2); font-weight: 600; white-space: nowrap; }
.markdown table.md-table tr:nth-child(even) td { background: var(--surface-2); }
.markdown blockquote { margin: 0 0 12px; padding: 2px 14px; border-left: 3px solid var(--border); color: var(--muted); }
.markdown hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.markdown .md-img { color: var(--muted); }

/* ---------------------------------------------------------- error page */
.errpage {
  display: flex; align-items: center; justify-content: center; gap: 46px;
  flex-wrap: wrap; min-height: 62vh; padding: 20px 0;
}
.err-art-wrap { flex: 0 0 auto; }
.err-art { width: 220px; height: 210px; overflow: visible; }
.err-text { flex: 1 1 320px; max-width: 460px; }
.err-code {
  font-size: 68px; font-weight: 800; line-height: 1;
  color: var(--border); letter-spacing: -2px;
}
.err-text h1 { font-size: 26px; margin: 4px 0 8px; }
.err-msg { margin: 0 0 6px; font-size: 15px; }
.err-joke { margin: 0 0 20px; font-size: 13.5px; font-style: italic; }
.err-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.err-note { margin-top: 18px; max-width: 420px; }
@media (max-width: 640px) {
  .errpage { gap: 22px; text-align: center; flex-direction: column; }
  .err-actions { justify-content: center; }
  .err-note { margin-left: auto; margin-right: auto; }
}

/* shared drawing styles */
.art-shadow { fill: var(--border); opacity: .5; }
.art-body { fill: var(--surface-2); stroke: var(--border); stroke-width: 3; stroke-linejoin: round; }
.art-eye { fill: var(--text); }
.art-eye.dark { fill: var(--surface-2); }
.art-mouth { fill: var(--text); opacity: .75; }
.art-brow { stroke: var(--text); stroke-width: 3.5; stroke-linecap: round; fill: none; }
.art-brow.dark { stroke: var(--surface-2); }
.art-mouth-line { stroke: var(--text); stroke-width: 3.5; stroke-linecap: round; }
.art-mouth-line.dark { stroke: var(--surface-2); }
.art-trail circle { fill: var(--border); }
.art-shackle { fill: none; stroke: var(--muted); stroke-width: 12; stroke-linecap: round; }
.art-body.lock { fill: var(--muted); stroke: var(--muted); }
.art-lid { fill: var(--surface-2); stroke: var(--border); stroke-width: 3; }
.art-fold { stroke: var(--border); stroke-width: 3; fill: none; stroke-linejoin: round; }
.art-dash { stroke: var(--border); stroke-width: 3; stroke-dasharray: 7 8; stroke-linecap: round; }
.art-smoke circle { fill: var(--border); opacity: .65; }

/* animations – calm, never distracting */
.art-float { animation: art-float 3.4s ease-in-out infinite; }
@keyframes art-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-11px); } }
.art-eyes { animation: art-blink 5s infinite; transform-origin: center 104px; }
@keyframes art-blink { 0%, 92%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
.art-trail circle { animation: art-fade 3.4s ease-in-out infinite; }
.art-trail circle:nth-child(2), .art-trail circle:nth-child(4) { animation-delay: .5s; }
@keyframes art-fade { 0%, 100% { opacity: .25; } 50% { opacity: .9; } }
.art-shake { animation: art-shake 4s ease-in-out infinite; transform-origin: 110px 140px; }
@keyframes art-shake {
  0%, 84%, 100% { transform: rotate(0deg); }
  88% { transform: rotate(-4deg); } 92% { transform: rotate(4deg); } 96% { transform: rotate(-2deg); }
}
.art-tilt { animation: art-tilt 4.5s ease-in-out infinite; transform-origin: 110px 180px; }
@keyframes art-tilt { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
.art-smoke circle { animation: art-rise 3s ease-out infinite; }
.art-smoke circle:nth-child(2) { animation-delay: .6s; }
.art-smoke circle:nth-child(3) { animation-delay: 1.2s; }
@keyframes art-rise {
  0% { transform: translateY(14px) scale(.6); opacity: 0; }
  40% { opacity: .7; }
  100% { transform: translateY(-22px) scale(1.25); opacity: 0; }
}
.art-wobble { animation: art-wobble 4s ease-in-out infinite; transform-origin: 110px 130px; }
@keyframes art-wobble { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }

@media (prefers-reduced-motion: reduce) {
  .art-float, .art-eyes, .art-shake, .art-tilt, .art-wobble,
  .art-smoke circle, .art-trail circle { animation: none; }
}

/* ---------------------------------------------------------- login */
.login-wrap { min-height: 70vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 28px; }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--accent); }
.login-brand h1 { color: var(--text); font-weight: 400; }
.login-brand h1 b { font-weight: 800; }
.pushbox { margin: 10px 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.pushbox .flash { margin: 0; }
.login-back { margin: 16px 0 0; }
.setupform { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.setupform input { max-width: 320px; margin: 0; }
.tokenbox { margin: 8px 0 0; padding: 10px 12px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 6px; user-select: all; overflow-x: auto; }
.clonebox { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.clonebox code { flex: 1; min-width: 240px; padding: 8px 10px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 6px; user-select: all; overflow-x: auto; }
.cloneblock { margin: 0; padding: 12px 14px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
/* Instructions stack: the commands contain long URLs that must stay readable
   and copyable, so they get the full width instead of narrow columns. */
.startguide { display: flex; flex-direction: column; gap: 14px; }
.startguide b { display: block; margin-bottom: 6px; }
.startguide .cloneblock { white-space: pre-wrap; word-break: break-word; user-select: all; }

/* ---------------------------------------------------------- pull requests */
.tabs.sub { border-bottom: 0; margin: 0; }
.prstate { width: 26px; text-align: center; font-size: 15px; flex: none; }
.prstate.open { color: var(--ok); }
.prstate.merged { color: var(--accent); }
.prstate.closed { color: var(--muted); }
.branchpick { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.branchpick label { flex: 1; min-width: 180px; margin: 0; }
.branchpick .arrow { padding-bottom: 9px; color: var(--muted); }
.mergebox .release-body > * + * { margin-top: 12px; }
.mergeform { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); }
.mergeform label { margin: 0; }
.mergeform select { min-width: 280px; }
.closeform { margin-top: 12px; }
.ok-line { color: var(--ok); margin: 0; }
.conflictlist { margin: 6px 0 0; padding-left: 22px; }
.comment { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.comment:last-child { border-bottom: 0; }
.comment-body { margin: 4px 0 0; white-space: pre-wrap; }

/* Issues: Beschreibung und Kommentare sind auswählbare Bausteine für den
   Arbeitsauftrag, deshalb sitzt die Checkbox im Kopf des jeweiligen Kastens. */
.issuetext { padding: 0 14px 12px; }
.issuebody .panel-head label,
.issuecomment .panel-head label { margin: 0; }
.briefbar { display: flex; align-items: center; gap: 14px; padding: 14px; }
.brief {
  margin: 0; padding: 14px 16px; max-height: 70vh; overflow: auto;
  background: var(--surface-2); border-top: 1px solid var(--border);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
}
