:root {
  --ink: #142033;
  --blue: #1f6feb;
  --blue-deep: #0c3f86;
  --paper: #f3f6fb;
  --card: #ffffff;
  --line: #d5e0ee;
  --muted: #5c6b80;
  --bad: #9f2d2d;
  --ok: #146c43;
  --shadow: 0 10px 30px rgba(20, 32, 51, 0.06);
  font-family: "Segoe UI", "Avenir Next", "Trebuchet MS", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
a { color: var(--blue-deep); }
.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.8rem 1.4rem; background: var(--ink); color: white;
}
.top a { color: white; text-decoration: none; }
.brand { display: flex; gap: 0.6rem; align-items: center; font-weight: 700; letter-spacing: 0.02em; }
.brand img { width: 32px; height: 32px; }
.top nav { display: flex; gap: 1rem; align-items: center; }
.top button, .btn, button {
  background: var(--blue); color: white; border: 0; border-radius: 999px;
  padding: 0.45rem 0.9rem; cursor: pointer; font: inherit;
}
.btn.ghost, button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.top button { background: transparent; border: 1px solid rgba(255,255,255,.35); }
main { max-width: 980px; margin: 0 auto; padding: 1.4rem; }
.hero { display: grid; grid-template-columns: 120px 1fr; gap: 1.2rem; align-items: center; }
.hero img { width: 120px; }
.card, .panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 1rem 1.1rem; box-shadow: var(--shadow); margin: 0.8rem 0;
}
.flash { padding: 0.7rem 0.9rem; border-radius: 12px; background: #e5f6ec; color: var(--ok); }
.flash.bad { background: #fde8e8; color: var(--bad); }
.tabs, .sub { display: flex; gap: 0.8rem; flex-wrap: wrap; margin: 0.4rem 0 1rem; }
.sub a { text-decoration: none; padding-bottom: 0.2rem; }
.muted { color: var(--muted); }
.preview { margin: 0.15rem 0 0.7rem; color: var(--muted); word-break: break-all; }
.preview:empty { display: none; }
label { display: block; margin: 0.55rem 0; }
input[type="checkbox"] { width: auto; }
input, textarea, select {
  width: 100%; padding: 0.5rem 0.6rem; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; background: white;
}
textarea { min-height: 7rem; }
.row { display: flex; gap: 0.6rem; align-items: center; }
.row input, .row select { width: auto; flex: 1; }
code, pre { font-family: "IBM Plex Mono", "ui-monospace", monospace; }
pre, .code {
  background: #0f1b2d; color: #e7eef8; padding: 0.8rem 1rem; border-radius: 12px; overflow: auto;
}
form.wh .wh-field { display: none; }
form.wh[data-preset="custom"] .for-custom,
form.wh[data-preset="generic"] .for-generic,
form.wh[data-preset="discord"] .for-discord,
form.wh[data-preset="slack"] .for-slack,
form.wh[data-preset="teams"] .for-teams,
form.wh[data-preset="mattermost"] .for-mattermost,
form.wh[data-preset="rocketchat"] .for-rocketchat,
form.wh[data-preset="telegram"] .for-telegram,
form.wh[data-preset="matrix"] .for-matrix,
form.wh[data-preset="googlechat"] .for-googlechat,
form.wh[data-preset="ntfy"] .for-ntfy,
form.wh[data-preset="gotify"] .for-gotify,
form.wh[data-preset="grok"] .for-grok { display: block; }
form.wh .wh-field .muted { display: block; margin-top: 0.25rem; }
ul.clean { list-style: none; padding: 0; }
ul.clean li { padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.pill { font-size: 0.78rem; border: 1px solid var(--line); border-radius: 999px; padding: 0.1rem 0.45rem; }
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: 0.4rem 0.3rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 720px) {
  .hero, .grid-2 { grid-template-columns: 1fr; }
  main { padding: 0.8rem; }
}
main.wide { max-width: 1180px; }
.sub a.on { border-bottom: 2px solid var(--blue); color: var(--ink); }
.crumbs { color: var(--muted); margin: 0 0 0.4rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.projhead { display: flex; align-items: center; gap: 0.7rem; }
.projhead h1 { margin: 0; font-size: 1.6rem; }
.tile {
  width: 42px; height: 42px; border-radius: 8px; display: grid; place-items: center;
  background: #e56a93; color: white; font-weight: 700; font-size: 1.2rem;
}
.vis { width: 18px; height: 18px; color: var(--muted); }
.ficon { width: 16px; height: 16px; vertical-align: -2px; margin-right: 0.25rem; }
.proj { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 1.2rem; align-items: start; }
.toolbar { display: flex; justify-content: space-between; gap: 0.8rem; align-items: center; margin: 0.9rem 0; flex-wrap: wrap; }
.toolbar .left, .toolbar .right { display: flex; gap: 0.45rem; align-items: center; flex-wrap: wrap; }
.branch select { width: auto; border-radius: 8px; padding: 0.35rem 0.5rem; background: #f6f8fa; }
.pathnow { color: var(--ink); }
.pathnow a { color: inherit; text-decoration: none; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; right: 0; top: 2.3rem; z-index: 4; width: min(420px, 80vw);
  background: white; border: 1px solid var(--line); border-radius: 12px; padding: 0.8rem;
  box-shadow: var(--shadow);
}
.copyline { display: flex; gap: 0.4rem; }
.copyline input { font-family: ui-monospace, monospace; font-size: 0.85rem; }
.commitbar {
  display: flex; gap: 0.7rem; align-items: center; background: #f6f8fa;
  border: 1px solid var(--line); border-radius: 10px; padding: 0.55rem 0.75rem; margin: 0.4rem 0 0.8rem;
}
.commitbar .grow { flex: 1; min-width: 0; }
.commitbar .subject { display: block; font-weight: 650; color: inherit; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: #d5e0ee; color: var(--ink);
  display: grid; place-items: center; font-size: 0.85rem; font-weight: 700; flex: none;
}
img.avatar { object-fit: cover; display: block; }
.avatar.lg { width: 64px; height: 64px; font-size: 1.35rem; }
.commitwho a { color: var(--ink); font-weight: 650; text-decoration: none; }
.commitwho a:hover { text-decoration: underline; }
ul.clean li.commitline { display: flex; gap: 0.65rem; align-items: center; }
.sha { background: white; border: 1px solid var(--line); border-radius: 6px; padding: 0.15rem 0.4rem; }
.iconbtn, .copyline button {
  background: white; color: var(--ink); border: 1px solid var(--line); border-radius: 8px;
  padding: 0.3rem 0.55rem; cursor: pointer; font: inherit;
}
table.files { background: white; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table.files th { color: var(--muted); font-weight: 600; font-size: 0.92rem; }
table.files td.msg { max-width: 280px; }
table.files td.msg a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; text-decoration: none; }
.readme, .codebox, .side {
  background: white; border: 1px solid var(--line); border-radius: 12px; margin-top: 1rem;
}
.readme header, .codebox header { padding: 0.7rem 1rem; border-bottom: 1px solid var(--line); font-weight: 600; }
.mdbody { padding: 0.2rem 1.1rem 1rem; }
.mdbody h1, .mdbody h2, .mdbody h3 { margin: 1rem 0 0.4rem; }
table.md { margin: 0.6rem 0 1rem; }
table.md th, table.md td { border: 1px solid var(--line); padding: 0.4rem 0.6rem; }
.side { margin-top: 0.2rem; padding: 0.9rem 1rem; }
.side h2 { margin: 0 0 0.5rem; font-size: 1rem; }
.counts { list-style: none; padding: 0; margin: 0.6rem 0; }
.counts li { padding: 0.28rem 0; }
.counts a { text-decoration: none; }
.fileview { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 1rem; align-items: start; }
.treebox h2 { margin: 0 0 0.5rem; font-size: 1.15rem; }
.treelist { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.treelist li { padding: 0.18rem 0.3rem; border-radius: 6px; white-space: nowrap; }
.treelist li a { color: inherit; text-decoration: none; }
.treelist li.active { background: #ddf4ff; }
.treelist li.depth-1 { padding-left: 0.9rem; }
.treelist li.depth-2 { padding-left: 1.6rem; }
.treelist li.depth-3 { padding-left: 2.3rem; }
.treelist li.depth-4 { padding-left: 3rem; }
.treelist li.depth-5 { padding-left: 3.7rem; }
.treelist li.depth-6, .treelist li.depth-7, .treelist li.depth-8 { padding-left: 4.4rem; }
.filename { display: flex; align-items: center; gap: 0.35rem; margin: 0.2rem 0 0.6rem; }
.codebox { margin-top: 0.8rem; overflow: auto; }
table.code { border-collapse: collapse; width: 100%; }
table.code td { border: 0; padding: 0 0.7rem; vertical-align: top; font-family: ui-monospace, monospace; font-size: 0.86rem; line-height: 1.45; }
table.code td.ln { color: #8c959f; text-align: right; width: 1%; user-select: none; background: #f6f8fa; }
table.code td.src { white-space: pre; }
.hl-k { color: #8250df; }
.hl-s { color: #cf222e; }
.hl-c { color: #6e7781; }
.hl-n { color: #0550ae; }
.heat {
  background: white; border: 1px solid var(--line); border-radius: 16px;
  padding: 1rem 1.1rem 0.8rem; box-shadow: var(--shadow); margin: 0.4rem 0 1.1rem;
}
.heat h2 { margin: 0 0 0.55rem; font-size: 1.05rem; }
.heat-scroll { overflow-x: auto; padding: 1.7rem 0.2rem 0.15rem; }
.heat-months, .heat-cols {
  display: grid; grid-auto-flow: column; grid-auto-columns: 11px; column-gap: 3px;
}
.heat-months { margin: 0 0 0.25rem 20px; height: 1rem; font-size: 0.68rem; color: var(--muted); }
.heat-months span { white-space: nowrap; line-height: 1rem; }
.heat-body { display: flex; gap: 4px; }
.heat-dow {
  display: grid; grid-template-rows: repeat(7, 11px); row-gap: 3px;
  width: 16px; font-size: 0.65rem; color: var(--muted); line-height: 11px;
}
.heat-col { display: grid; grid-auto-rows: 11px; row-gap: 3px; }
.sq { width: 11px; height: 11px; border-radius: 2px; display: block; position: relative; }
.sq[title]:hover::after, .sq[title]:focus::after {
  content: attr(title);
  position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%);
  background: #142033; color: white; padding: 0.28rem 0.5rem; border-radius: 6px;
  font-size: 0.78rem; line-height: 1.2; white-space: nowrap; z-index: 5; pointer-events: none;
}
.sq.off { background: transparent; }
.sq.lv0 { background: #e6edf5; }
.sq.lv1 { background: #b9d4f6; }
.sq.lv2 { background: #6eacf0; }
.sq.lv3 { background: #1f6feb; }
.sq.lv4 { background: #0c3f86; }
.heat-foot {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem;
  margin-top: 0.7rem; color: var(--muted); font-size: 0.85rem;
}
.heat-total, .heat-legend, .heat-foot .muted { margin: 0; }
.heat-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.heat-foot .muted { text-align: right; margin-top: 0.2rem; }
.chooser { display: flex; gap: 1rem; flex-wrap: wrap; margin: 1.2rem 0 0.4rem; transition: opacity .28s ease, transform .28s ease; }
.chooser.away { opacity: 0; transform: translateY(-10px) scale(.97); pointer-events: none; }
.pick { min-width: 11rem; padding: 1rem 1.3rem; font-size: 1.05rem; }
.sheet { transform-origin: top center; }
.sheet.open { animation: unfold .32s ease; }
.sheet.closing { animation: fold .28s ease forwards; }
@keyframes unfold {
  from { opacity: 0; transform: scaleY(.55); }
  to { opacity: 1; transform: scaleY(1); }
}
@keyframes fold {
  from { opacity: 1; transform: scaleY(1); }
  to { opacity: 0; transform: scaleY(.45); }
}
.preview { min-height: 1.2rem; display: flex; gap: .7rem; align-items: baseline; flex-wrap: wrap; }
.flag.ok { color: var(--ok); font-weight: 600; }
.flag.bad { color: var(--bad); font-weight: 600; }
.form-err:empty { display: none; }
.form-err { color: var(--bad); margin: 0.2rem 0; }
.bar { display: flex; gap: .6rem; align-items: center; margin: .4rem 0 .2rem; }
.bar input[type="search"] { flex: 1; }
.sortlabel { color: var(--muted); }
.iconbtn { text-decoration: none; border: 1px solid var(--line); border-radius: 8px; padding: .35rem .55rem; background: white; color: var(--ink); }
.repolist { list-style: none; padding: 0; margin: .4rem 0 1rem; }
.repolist > li { display: flex; align-items: center; gap: .7rem; padding: .75rem .2rem; border-bottom: 1px solid var(--line); }
.reponame { font-weight: 600; text-decoration: none; }
.stars { color: #9a6700; white-space: nowrap; }
.grown { flex: 1; }
.rowmenu { position: relative; }
.rowmenu > summary { list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: 8px; padding: .15rem .55rem; background: white; }
.rowmenu > summary::-webkit-details-marker { display: none; }
.rowmenu .menu-panel { position: absolute; right: 0; z-index: 3; min-width: 9rem; }
.rowmenu .menu-panel button, .rowmenu .menu-panel form { width: 100%; }
.rowmenu .menu-panel button { text-align: left; border-radius: 8px; }
img.tile { object-fit: cover; background: #fff; }
@font-face {
  font-family: "Noto Sans Cuneiform";
  src: url("/assets/NotoSansCuneiform-Regular.ttf") format("truetype");
  font-display: swap;
}
html.cunei, html.cunei body, html.cunei button, html.cunei input, html.cunei select, html.cunei textarea {
  font-family: "Noto Sans Cuneiform", "Segoe UI", sans-serif;
}
@media (max-width: 800px) {
  .proj, .fileview { grid-template-columns: 1fr; }
  .heat-foot { flex-direction: column; align-items: flex-start; }
  .heat-legend, .heat-foot .muted { justify-content: flex-start; text-align: left; }
  .repolist > li { flex-wrap: wrap; }
}
