/* As mesmas fontes do app (GitGymUI/Fonts): Mona Sans e Monaspace Neon, do GitHub. */
@font-face { font-family: 'Mona Sans'; src: url('/fonts/MonaSans-Regular.otf') format('opentype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Mona Sans'; src: url('/fonts/MonaSans-Medium.otf') format('opentype'); font-weight: 500 700; font-display: swap; }
@font-face { font-family: 'Monaspace Neon'; src: url('/fonts/MonaspaceNeon-Regular.otf') format('opentype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Monaspace Neon'; src: url('/fonts/MonaspaceNeon-Medium.otf') format('opentype'); font-weight: 500 700; font-display: swap; }

/* Tokens do app (GitGymUI/Theme.swift). */
:root {
  color-scheme: dark;
  --bg: #0d1117; --term: #010409; --raise: #161b22; --line: #30363d; --line2: #21262d;
  --fg: #e6edf3; --mu: #7d8590; --dim: #484f58; --ok: #238636; --blue: #58a6ff; --red: #f85149;
  --g0: #161b22; --g1: #0e4429; --g2: #006d32; --g3: #26a641; --g4: #39d353;
  --sans: 'Mona Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
  --mono: 'Monaspace Neon', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.5 var(--sans); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
b { font-weight: 500; }
.mu { color: var(--mu); }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
svg { fill: currentColor; flex: none; }

/* topo */
.topbar { background: var(--term); border-bottom: 1px solid var(--line2); }
.topbar-in { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.crumbs { display: flex; align-items: center; gap: 10px; color: var(--fg); font-size: 16px; }
.crumbs:hover { text-decoration: none; }
.crumbs img { border-radius: 6px; }
.crumbs .sep { color: var(--mu); }
.crumbs b { font-weight: 500; }

.gh-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 6px; border: 1px solid #f0f6fc1a; background: var(--raise); color: var(--fg); font: 500 14px var(--sans); cursor: pointer; white-space: nowrap; }
.gh-btn:hover { text-decoration: none; background: #21262d; }
.gh-btn.primary { background: var(--ok); color: #fff; }
.gh-btn.primary:hover { background: #29903b; }
.gh-btn:disabled { opacity: .6; cursor: progress; }
.gh-btn.sm { height: 28px; font-size: 12px; padding: 0 10px; }

.repohead { border-bottom: 1px solid var(--line2); padding-top: 16px; }
.repo-title { display: flex; align-items: center; gap: 8px; color: var(--mu); }
.repo-title h1 { margin: 0; font-size: 20px; font-weight: 500; color: var(--blue); }
.label { border: 1px solid var(--line); border-radius: 2em; padding: 0 7px; font-size: 12px; font-weight: 500; line-height: 18px; color: var(--mu); }
.label.green { color: #3fb950; border-color: #238636; }
.tabs { display: flex; gap: 8px; margin-top: 16px; overflow-x: auto; }
.tabs a { color: var(--fg); padding: 8px 8px 10px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { text-decoration: none; border-color: var(--dim); }
.tabs a[aria-current] { border-color: #f78166; font-weight: 500; }

/* layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 296px; gap: 24px; padding-top: 24px; padding-bottom: 40px; }
.box { border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
.col-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* heatmap estilo perfil do GitHub */
.contrib { padding: 16px; }
.contrib-head { display: flex; justify-content: space-between; font-size: 16px; margin-bottom: 12px; }
.contrib-head .mu { font-size: 12px; }
.contrib-scroll { overflow-x: auto; padding-bottom: 4px; }
.contrib-grid { display: grid; grid-template-columns: 28px auto; grid-template-rows: 15px auto; gap: 4px 4px; width: max-content; font-size: 12px; color: var(--fg); }
.months { grid-column: 2; position: relative; height: 15px; }
.months span { position: absolute; top: 0; }
.days { display: grid; grid-template-rows: repeat(7, 10px); gap: 3px; font-size: 11px; line-height: 10px; }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 10px); grid-auto-columns: 10px; gap: 3px; }
.heat i, .legend i, .sw { display: block; width: 10px; height: 10px; border-radius: 2px; background: var(--g0); outline: 1px solid #1b1f230f; outline-offset: -1px; }
.heat i { opacity: 0; transition: opacity .25s; }
.heat i.on { opacity: 1; }
.heat i.pad { visibility: hidden; }
.l0 { background: var(--g0) !important; } .l1 { background: var(--g1) !important; } .l2 { background: var(--g2) !important; }
.l3 { background: var(--g3) !important; } .l4 { background: var(--g4) !important; }
.contrib-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; font-size: 12px; }
.legend { display: inline-flex; align-items: center; gap: 3px; }

/* README */
.file-head { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-bottom: 1px solid var(--line); font-weight: 500; position: sticky; top: 0; background: var(--bg); border-radius: 6px 6px 0 0; }
.md { padding: 32px; font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md h2, .md h3 { font-weight: 500; line-height: 1.25; margin: 24px 0 16px; }
.md .h1, .md h2 { padding-bottom: .3em; border-bottom: 1px solid var(--line2); }
.md .h1 { font-size: 2em; }
.md h2 { font-size: 1.5em; }
.md h3 { font-size: 1.25em; }
.md p, .md ul, .md table, .md pre { margin: 0 0 16px; }
.md ul { padding-left: 2em; }
.md li + li { margin-top: .25em; }
.md code, .md kbd { font-family: var(--mono); font-size: 85%; }
.md code { background: #6e768166; border-radius: 6px; padding: .2em .4em; }
.md kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; background: var(--raise); }
.md pre { background: var(--raise); border-radius: 6px; padding: 16px; overflow-x: auto; font-size: 85%; line-height: 1.45; }
.md pre code { background: none; padding: 0; font-size: 100%; }
.md pre .c { color: var(--g4); } .md pre .k { color: #79c0ff; } .md pre .mu { color: var(--mu); }
.md table { border-collapse: collapse; display: block; width: max-content; max-width: 100%; overflow: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 6px 13px; }
.md th { font-weight: 500; }
.md tr:nth-child(2n) { background: var(--raise); }
.sw { width: 14px; height: 14px; }

/* formulário estilo GitHub */
.gh-form { border: 1px solid var(--line); border-radius: 6px; padding: 16px; background: var(--raise); font-size: 14px; }
.field { margin: 0 0 16px; border: 0; padding: 0; }
.field > label, legend { display: block; font-weight: 500; margin-bottom: 6px; padding: 0; }
.gh-form input[type=email], .prefix { width: 100%; height: 32px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; color: var(--fg); font: 14px var(--sans); }
.gh-form input[type=email] { padding: 0 12px; }
.gh-form input:focus-visible, .prefix:focus-within { outline: 2px solid #1f6feb; outline-offset: -1px; border-color: #1f6feb; }
.prefix { display: flex; align-items: center; padding-left: 12px; }
.prefix span { color: var(--mu); }
.prefix input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; color: inherit; font: inherit; padding: 0 12px 0 2px; outline: none; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg label { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; cursor: pointer; background: var(--bg); }
.seg label + label { border-left: 1px solid var(--line); }
.seg label:has(input:checked) { background: #21262d; font-weight: 500; }
.seg input { accent-color: var(--g3); margin: 0; }
.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.actions .gh-btn { font-family: var(--mono); font-size: 13px; }
.form-msg { margin: 0; font-family: var(--mono); font-size: 13px; }
.form-msg.ok { color: #3fb950; } .form-msg.err { color: var(--red); }
.note { margin: 12px 0 0; font-size: 12px; color: var(--mu); }

/* lateral */
.col-side h2 { font-size: 16px; font-weight: 500; margin: 0 0 12px; }
.col-side h2:not(:first-child), .side-extra h2 { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line2); }
.col-side p { margin: 0 0 12px; }
.col-side > p:first-of-type { font-size: 16px; }
.meta { list-style: none; padding: 0; margin: 0 0 12px; color: var(--mu); }
.meta li { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.topics { display: flex; flex-wrap: wrap; gap: 6px; }
.topics span { background: #388bfd1a; color: var(--blue); border-radius: 2em; padding: 0 10px; font-size: 12px; font-weight: 500; line-height: 22px; }
.release b { font-weight: 500; }
.langbar { display: flex; height: 8px; border-radius: 6px; overflow: hidden; gap: 2px; margin-bottom: 8px; }
.langs { list-style: none; padding: 0; margin: 0; display: flex; gap: 16px; font-size: 12px; }
.langs i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }

.foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--line2); padding-top: 24px; padding-bottom: 32px; font-size: 12px; color: var(--mu); }
.foot span { display: inline-flex; align-items: center; gap: 8px; }
.foot img { border-radius: 4px; }
.foot a { color: var(--mu); }

@media (max-width: 1012px) {
  .layout { grid-template-columns: 1fr; }
  .col-side { order: -1; }
  .col-side h2:not(:first-child), .col-side .langbar, .col-side .langs, .col-side .release { display: none; }
  .col-side > p:last-child, .col-side .topics, .col-side .side-extra { display: none; }
}
@media (max-width: 544px) {
  .md { padding: 16px; }
  .md .h1 { font-size: 1.6em; }
}
@media (prefers-reduced-motion: reduce) {
  .heat i { transition: none; }
}

.doc { max-width: 1012px; padding-top: 24px; padding-bottom: 40px; }

/* prints do app, como as imagens de um README */
.md .shots { scrollbar-color: var(--line) transparent; display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; margin: 0 0 16px; }
.md .shots figure { margin: 0; flex: 0 0 200px; scroll-snap-align: start; text-align: center; }
.md .shots img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--term); }
.md .shots figcaption { font-family: var(--mono); font-size: 12px; color: var(--mu); margin-top: 8px; }
.md .shots:focus-visible { outline: 2px solid #1f6feb; outline-offset: 2px; border-radius: 6px; }
@media (max-width: 544px) { .md .shots figure { flex-basis: 70%; } }

.unavailable { margin: -8px 0 16px; padding: 8px 12px; border: 1px solid #9e6a03; border-radius: 6px; background: #bb800926; color: #e3b341; font-size: 13px; }
