/* ================================================================
   Control Panel — "Toon" theme
   Flat, toonish redesign: thick ink outlines, hard offset shadows,
   chunky rounded shapes, cream paper background, no blur/gradients.
   ================================================================ */

/* ---------- bundled rounded font (self-hosted, works offline) ---------- */
@font-face {
  font-family: "Fredoka";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/fredoka-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fredoka";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/fredoka-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fredoka";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/fredoka-hebrew.woff2") format("woff2");
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}

/* ---------- toon design tokens ---------- */
:root {
  --paper: #FFF6E3;        /* warm cream background */
  --paper-2: #FFEDCB;      /* deeper cream (tints, headers) */
  --card: #FFFFFF;
  --ink: #2E2A3A;          /* outline + text ink */
  --ink-soft: #736D85;     /* muted text */
  --sky: #5BC8F5;   --sky-deep: #1F9BD8;    /* files */
  --sun: #FFD54A;   --sun-deep: #D9A61C;    /* primary / notes */
  --leaf: #93DC5F;  --leaf-deep: #5AA62B;   /* todos / success */
  --grape: #B7A0F7; --grape-deep: #7C5CE8;  /* repos */
  --coral: #FF9A6B; --coral-deep: #D95C2B;  /* users */
  --tomato: #FF6B6B; --tomato-deep: #CF3B3B;/* danger */
  --pink: #FFA6C9;  --pink-deep: #D65488;   /* notes / accents */
  --mint: #6FE0B8;  --mint-deep: #27A87F;
  --bw: 3px;                 /* standard ink border width */
  --r-sm: 10px; --r-md: 14px; --r-lg: 18px;
  --sh-1: 2px 2px 0 var(--ink);
  --sh-2: 3px 3px 0 var(--ink);
  --sh-3: 4px 4px 0 var(--ink);
  --sh-4: 6px 6px 0 var(--ink);
  --sh-5: 8px 8px 0 var(--ink);
  --sh-6: 10px 10px 0 rgba(46,42,58,.92);
  --font: "Fredoka", "Comic Sans MS", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; }

body {
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  background-color: var(--paper);
  /* flat polka dots */
  background-image: radial-gradient(rgba(46,42,58,.07) 2px, transparent 2.6px);
  background-size: 30px 30px;
  background-attachment: fixed;
}
/* flat corner blobs for a playful backdrop */
body::before, body::after {
  content: ""; position: fixed; border-radius: 50%; z-index: -1; pointer-events: none;
}
body::before {
  width: 460px; height: 460px; top: -180px; right: -140px;
  background: rgba(91,200,245,.20);
}
body::after {
  width: 520px; height: 520px; bottom: -220px; left: -180px;
  background: rgba(183,160,247,.20);
}

::selection { background: var(--sun); color: var(--ink); }

.hidden { display: none !important; }
.muted { color: var(--ink-soft); }
.center { text-align: center; }
.hint { color: var(--ink-soft); font-size: 12.5px; }
.error { color: var(--tomato-deep); min-height: 20px; font-size: 14px; font-weight: 600; }
.row { display: flex; gap: 10px; align-items: center; }
.row.end { justify-content: flex-end; }

/* ---------- buttons: chunky & pressable ---------- */
.btn {
  border: var(--bw) solid var(--ink);
  background: var(--card);
  color: var(--ink);
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
  font: 600 14px var(--font);
  text-decoration: none;
  display: inline-block;
  box-shadow: var(--sh-3);
  transition: transform .12s, box-shadow .12s, background .12s;
}
.btn:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(3px,3px); box-shadow: 1px 1px 0 var(--ink); }
.btn:focus-visible { outline: 3px solid var(--sky-deep); outline-offset: 2px; }
.btn.primary { background: var(--sun); }
.btn.primary:hover { background: #FFDD70; }
.btn.danger { background: var(--tomato); color: #fff; }
.btn.danger:hover { background: #FF8181; }
.btn.ghost { background: var(--card); }
.btn.ghost:hover { background: var(--paper-2); }
.btn.full { width: 100%; }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 10px; box-shadow: var(--sh-1); }
.btn.small:hover { box-shadow: var(--sh-3); }
.btn.small:active { box-shadow: 1px 1px 0 var(--ink); }

/* ---------- inputs ---------- */
input, textarea, select {
  width: 100%;
  background: var(--card);
  border: var(--bw) solid var(--ink);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14.5px;
  font-family: inherit;
  font-weight: 500;
  margin-bottom: 10px;
  transition: box-shadow .12s, transform .12s;
}
input::placeholder, textarea::placeholder { color: var(--ink-soft); }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 4px 4px 0 var(--sky);
  transform: translate(-1px,-1px);
}
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--sky-deep); outline-offset: 2px;
}
select {
  appearance: none; -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%232E2A3A' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
input[type=checkbox] {
  width: 22px; height: 22px; margin: 0;
  appearance: none; -webkit-appearance: none;
  background: var(--card);
  border: var(--bw) solid var(--ink);
  border-radius: 7px;
  cursor: pointer;
  display: inline-grid; place-content: center;
  flex-shrink: 0;
  box-shadow: 2px 2px 0 var(--ink);
  transition: .12s;
}
input[type=checkbox]:hover { transform: translate(-1px,-1px); box-shadow: 3px 3px 0 var(--ink); }
input[type=checkbox]:checked {
  background: var(--leaf);
  box-shadow: 0 0 0 var(--ink);
  transform: translate(1px,1px);
}
input[type=checkbox]:checked::after {
  content: "✓"; color: var(--ink); font-size: 15px; font-weight: 700; line-height: 1;
}
input[type=checkbox]:focus-visible { outline: 3px solid var(--sky-deep); outline-offset: 2px; }

/* ---------- auth ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card {
  background: var(--card);
  border: var(--bw) solid var(--ink);
  border-radius: 24px;
  padding: 40px 36px 32px;
  width: 400px;
  text-align: center;
  box-shadow: var(--sh-6);
  animation: toon-pop .25s cubic-bezier(.2,1.5,.4,1);
}
.mascot { width: 88px; height: 88px; animation: toon-bob 3s ease-in-out infinite; }
.auth-card h1 { font-size: 28px; font-weight: 700; color: var(--ink); margin: 14px 0 4px; letter-spacing: .3px; }
.auth-card .muted { font-weight: 500; }
.tabs-mini { display: flex; gap: 8px; margin: 20px 0 14px; }
.mini {
  flex: 1; padding: 9px;
  background: var(--card);
  border: var(--bw) solid var(--ink);
  color: var(--ink-soft);
  border-radius: 12px;
  cursor: pointer;
  font: 600 14px var(--font);
  transition: .12s;
}
.mini:hover { color: var(--ink); transform: translate(-1px,-1px); box-shadow: var(--sh-2); }
.mini.active {
  color: var(--ink);
  background: var(--sun);
  box-shadow: var(--sh-2);
}
.mini:focus-visible { outline: 3px solid var(--sky-deep); outline-offset: 2px; }

/* ---------- layout ---------- */
.topbar {
  display: flex; align-items: center; gap: 20px; padding: 10px 26px;
  background: var(--card);
  border-bottom: var(--bw) solid var(--ink);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; color: var(--ink); white-space: nowrap; }
.brand .mascot { width: 34px; height: 34px; animation-duration: 4s; }
.topbar nav { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.navbtn {
  background: var(--card); border: var(--bw) solid transparent; color: var(--ink-soft);
  padding: 8px 14px; border-radius: 12px; cursor: pointer;
  font: 600 14px var(--font);
  transition: .12s;
}
.navbtn:hover { color: var(--ink); background: var(--paper-2); }
.navbtn:focus-visible { outline: 3px solid var(--sky-deep); outline-offset: 2px; }
.navbtn.active {
  color: var(--ink);
  background: var(--sun);
  border-color: var(--ink);
  box-shadow: var(--sh-2);
}
/* per-module accent colors for active nav pills */
.navbtn[data-view="files"].active  { background: var(--sky); }
.navbtn[data-view="notes"].active  { background: var(--sun); }
.navbtn[data-view="todos"].active  { background: var(--leaf); }
.navbtn[data-view="repos"].active  { background: var(--grape); }
.navbtn[data-view="users"].active  { background: var(--coral); }
.userbox { display: flex; gap: 12px; align-items: center; }
#whoami {
  background: var(--paper-2);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 4px 12px;
  font-weight: 600; font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
}
main { max-width: 1040px; margin: 34px auto 70px; padding: 0 22px; }
.view-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 24px; flex-wrap: wrap; }
.view-head h2 {
  font-size: 28px; font-weight: 700; color: var(--ink);
  display: inline-block;
  border-bottom: 7px solid var(--sun);
  border-radius: 4px;
  padding-bottom: 3px;
  letter-spacing: .3px;
}
#view-files .view-head h2  { border-bottom-color: var(--sky); }
#view-notes .view-head h2  { border-bottom-color: var(--sun); }
#view-todos .view-head h2  { border-bottom-color: var(--leaf); }
#view-repos .view-head h2  { border-bottom-color: var(--grape); }
#view-users .view-head h2  { border-bottom-color: var(--coral); }

/* ---------- files ---------- */
#drop-zone {
  border: 3px dashed var(--ink-soft);
  border-radius: var(--r-md);
  padding: 26px;
  text-align: center; color: var(--ink-soft);
  margin-bottom: 18px;
  background: rgba(255,255,255,.65);
  font-weight: 600; font-size: 15px;
  transition: .15s;
}
#drop-zone.over {
  border-color: var(--ink);
  background: var(--leaf);
  color: var(--ink);
  animation: toon-bounce .3s;
}
.tbl {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--card);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--sh-4);
}
.tbl th {
  text-align: left; padding: 13px 14px;
  background: var(--paper-2);
  border-bottom: var(--bw) solid var(--ink);
  color: var(--ink); font-weight: 700; font-size: 12px;
  text-transform: uppercase; letter-spacing: .06em;
}
.tbl td { padding: 13px 14px; border-bottom: 2px solid rgba(46,42,58,.12); font-weight: 500; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: #FFF3C9; }
.tbl .btn.small { white-space: nowrap; }

/* ---------- notes: sticky-note cards ---------- */
.note-card {
  border: var(--bw) solid var(--ink);
  border-radius: 14px;
  padding: 22px 20px 18px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  position: relative;
  display: flex; flex-direction: column;
  box-shadow: var(--sh-3);
}
/* rotating pastel sticky colors */
.note-card:nth-child(4n+1) { background: var(--sun); }
.note-card:nth-child(4n+2) { background: var(--sky); }
.note-card:nth-child(4n+3) { background: var(--pink); }
.note-card:nth-child(4n+4) { background: var(--mint); }
.note-card:nth-child(odd)  { transform: rotate(-.7deg); }
.note-card:nth-child(even) { transform: rotate(.7deg); }
/* tape strip */
.note-card::before {
  content: ""; position: absolute; top: -11px; left: 50%; margin-left: -36px;
  width: 72px; height: 22px;
  background: rgba(255,255,255,.6);
  border: 2px solid rgba(46,42,58,.3);
  transform: rotate(-2deg);
  border-radius: 4px;
}
.note-card:hover {
  transform: rotate(0) translate(-2px,-5px) scale(1.02);
  box-shadow: 8px 8px 0 var(--ink);
}
.note-card h3 { margin-bottom: 8px; font-size: 16.5px; font-weight: 700; }
.note-card p {
  color: var(--ink); opacity: .78; font-size: 13.5px; line-height: 1.55;
  margin-bottom: 14px; white-space: pre-wrap; word-break: break-word; flex: 1;
  font-weight: 500;
}
.note-card small { color: var(--ink); opacity: .65; font-size: 12px; font-weight: 500; }
#note-content { min-height: 300px; resize: vertical; line-height: 1.6; }

/* ---------- todos ---------- */
.todos { list-style: none; padding: 0; margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.todo {
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  border: var(--bw) solid var(--ink);
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: var(--sh-2);
  transition: transform .12s, box-shadow .12s;
}
.todo:hover { transform: translate(-2px,-2px); box-shadow: var(--sh-3); }
.todo span { flex: 1; font-weight: 500; }
.todo.done { background: #F3F7E9; box-shadow: 2px 2px 0 rgba(46,42,58,.45); }
.todo.done span { text-decoration: line-through; color: var(--ink-soft); }

/* ---------- generic cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.svc-card {
  background: var(--card);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-lg);
  padding: 20px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  position: relative;
  box-shadow: var(--sh-3);
}
.svc-card:hover { transform: translate(-2px,-4px); box-shadow: var(--sh-5); }
.svc-card h3 { margin-bottom: 6px; font-size: 17px; font-weight: 700; }
.svc-card p { color: var(--ink-soft); font-size: 14px; margin-bottom: 10px; font-weight: 500; }
.badge {
  display: inline-block;
  background: var(--paper-2);
  border: 2px solid var(--ink);
  border-radius: 20px;
  padding: 2px 11px; font-size: 12px; font-weight: 600; color: var(--ink);
  margin-right: 6px;
}
.badge.pkg   { background: var(--mint); }
.badge.admin { background: var(--sun); }
.badge.open  { background: var(--leaf); }
.badge.closed{ background: #E4E0EE; color: var(--ink-soft); }
.badge.pub   { background: var(--leaf); }
.badge.priv  { background: var(--tomato); color: #fff; }
.badge.rel   { background: var(--sky); }
.badge.lang  { background: var(--pink); }

/* ---------- modal ---------- */
.modal {
  position: fixed; inset: 0;
  background: rgba(46,42,58,.55);
  display: flex; align-items: center; justify-content: center; z-index: 10;
  padding: 20px;
}
.modal-card {
  background: var(--card);
  border: var(--bw) solid var(--ink);
  border-radius: 20px;
  padding: 30px;
  width: 430px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--sh-6);
  animation: toon-pop .2s cubic-bezier(.2,1.5,.4,1);
}
.modal-card.wide { width: 660px; }
.modal-card h3 { margin-bottom: 16px; font-size: 19px; font-weight: 700; }
.modal-card .row > input { margin-bottom: 0; }

/* ---------- readme / markdown (flat light styling) ---------- */
.readme {
  background: var(--card);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-md);
  padding: 18px 20px;
  margin: 12px 0; font-size: 14.5px; line-height: 1.65;
  box-shadow: var(--sh-3);
  color: var(--ink);
  white-space: normal;
}
.readme-title { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-soft); margin-bottom: 12px; font-weight: 700; }
.readme h1, .readme h2, .readme h3, .readme h4 { margin: 18px 0 8px; line-height: 1.3; color: var(--ink); font-weight: 700; }
.readme h1 { font-size: 23px; border-bottom: 3px solid var(--sun); display: inline-block; padding-bottom: 2px; }
.readme h2 { font-size: 19.5px; border-bottom: 3px solid var(--sky); display: inline-block; padding-bottom: 2px; }
.readme h3 { font-size: 16.5px; }
.readme p { margin: 8px 0; }
.readme ul, .readme ol { margin: 8px 0 8px 24px; }
.readme li { margin: 4px 0; }
.readme li input[type=checkbox] { width: 15px; height: 15px; margin: 0 5px 0 0; vertical-align: -2px; border-width: 2px; }
.readme a { color: var(--sky-deep); font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; }
.readme a:hover { color: var(--grape-deep); }
.readme blockquote {
  border-left: 5px solid var(--ink);
  margin: 10px 0; padding: 6px 14px;
  background: var(--paper-2);
  border-radius: 0 10px 10px 0;
  color: var(--ink);
}
.readme pre {
  background: #2E2A3A;
  border: var(--bw) solid var(--ink);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 10px 0;
  overflow-x: auto;
  box-shadow: var(--sh-2);
}
.readme pre code { background: none; padding: 0; color: #E8E4F5; }
.readme code {
  background: #FFE3EE;
  border: 1.5px solid rgba(46,42,58,.25);
  padding: 2px 7px; border-radius: 6px;
  color: var(--ink);
  font-family: "SF Mono", "Cascadia Code", Consolas, Menlo, monospace; font-size: 12.5px;
}
.readme img { max-width: 100%; border-radius: 12px; border: 2px solid var(--ink); }
.readme table { border-collapse: collapse; margin: 12px 0; width: 100%; }
.readme th, .readme td { border: 2px solid rgba(46,42,58,.3); padding: 7px 12px; text-align: left; }
.readme th { background: var(--paper-2); }
.readme hr { border: none; border-top: 3px dashed var(--ink-soft); margin: 16px 0; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: var(--card);
  border: var(--bw) solid var(--ink);
  border-left: 9px solid var(--leaf);
  padding: 13px 24px;
  border-radius: 13px; z-index: 20;
  font-weight: 700; font-size: 14.5px; color: var(--ink);
  box-shadow: var(--sh-4);
  animation: toast-pop .25s cubic-bezier(.2,1.5,.4,1);
  max-width: 90vw;
}
.toast.err { border-left-color: var(--tomato); }

/* ---------- admin ---------- */
.admin-create {
  background: var(--card);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-md);
  padding: 20px; margin-bottom: 18px;
  box-shadow: var(--sh-3);
}
.admin-create h3 { margin-bottom: 12px; font-size: 16px; font-weight: 700; }
.admin-create input { margin-bottom: 0; }
.admin-check { white-space: nowrap; color: var(--ink-soft); font-size: 14px; font-weight: 600; }
.admin-check input { width: auto; }

/* ---------- scrollbar ---------- */
::-webkit-scrollbar { width: 13px; height: 13px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--grape); border: 3.5px solid var(--paper); border-radius: 9px; }
::-webkit-scrollbar-thumb:hover { background: var(--grape-deep); }

/* ================================================================
   Repos — GitHub-style repository UI, tooned
   ================================================================ */

/* ---------- repo listing ---------- */
.repo-filters {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin-bottom: 24px; padding: 14px;
  background: var(--card);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-md);
  box-shadow: var(--sh-2);
}
.repo-filters input { flex: 1; min-width: 160px; margin: 0; }
.repo-filters select { margin: 0; }
.check {
  display: flex; align-items: center; gap: 8px;
  color: var(--ink-soft); font-size: 14px; white-space: nowrap; cursor: pointer;
  font-weight: 600;
}
.check input { width: 18px; height: 18px; }

.repo-card {
  background: var(--card);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-lg);
  padding: 20px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--sh-3);
}
.repo-card:hover { transform: translate(-2px,-4px); box-shadow: var(--sh-5); }
.repo-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.repo-card-head h3 { font-size: 17px; font-weight: 700; }
.repo-name { color: var(--grape-deep); }
.repo-desc { color: var(--ink-soft); font-size: 14px; line-height: 1.5; flex: 1; word-break: break-word; font-weight: 500; }
.repo-card-foot { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 12.5px; font-weight: 600; }
.repo-card-foot .muted { white-space: nowrap; }

.topic {
  display: inline-block;
  background: #E3F6FF;
  border: 2px solid var(--ink);
  border-radius: 20px;
  padding: 2px 11px;
  font-size: 12px; font-weight: 600; color: var(--ink);
  margin-right: 6px; margin-bottom: 4px;
}
.topic.link { text-decoration: none; background: #F4EFFF; }
.topic.link:hover { background: var(--grape); }

/* ---------- repo detail head ---------- */
#view-repo { max-width: 1040px; }
#repo-head {
  background: var(--card);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  margin: 14px 0 18px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: var(--sh-4);
}
.repo-head-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.repo-head-top h2 { font-size: 25px; font-weight: 700; }
.repo-head-meta { display: flex; align-items: center; flex-wrap: wrap; }
.repo-stats { gap: 10px; flex-wrap: wrap; align-items: center; }
.stat {
  background: var(--paper-2);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 3px 11px;
  color: var(--ink); font-size: 13px; font-weight: 600;
  white-space: nowrap;
}
.repo-head-top > .row { flex-wrap: wrap; }
.repo-head-top .row .badge { margin-right: 0; }

/* ---------- tabs: chunky pill tabs ---------- */
.tabs {
  display: flex; gap: 6px; margin-bottom: 18px;
  flex-wrap: wrap;
}
.tabbtn {
  background: var(--card);
  border: var(--bw) solid var(--ink);
  color: var(--ink-soft);
  padding: 9px 16px; cursor: pointer;
  font: 600 14px var(--font);
  border-radius: 12px;
  box-shadow: var(--sh-1);
  transition: .12s;
  white-space: nowrap;
}
.tabbtn:hover { color: var(--ink); transform: translate(-1px,-1px); box-shadow: var(--sh-2); }
.tabbtn:focus-visible { outline: 3px solid var(--grape-deep); outline-offset: 2px; }
.tabbtn.active {
  color: #fff;
  background: var(--grape-deep);
  box-shadow: var(--sh-2);
  transform: translate(1px,1px);
}
.tabcount {
  background: var(--paper-2); color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 10px; padding: 1px 8px; font-size: 12px; margin-left: 4px;
  font-weight: 700;
}
.tabbtn.active .tabcount { background: var(--card); }

/* ---------- code tab: toolbar + tree ---------- */
.code-toolbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  flex-wrap: wrap; margin-bottom: 12px;
}
.breadcrumb { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 15px; font-weight: 600; min-width: 0; }
.crumb {
  background: none; border: none; color: var(--grape-deep); cursor: pointer;
  font: 600 15px var(--font); padding: 3px 8px; border-radius: 8px;
}
.crumb:hover { background: #F4EFFF; }
.crumb:focus-visible { outline: 3px solid var(--grape-deep); outline-offset: 2px; }
.crumb-sep { color: var(--ink-soft); font-weight: 700; }
.crumb-cur { color: var(--ink); padding: 3px 8px; background: var(--paper-2); border: 2px solid var(--ink); border-radius: 8px; }

.filetree {
  border: var(--bw) solid var(--ink); border-radius: var(--r-md);
  background: var(--card); overflow: hidden;
  box-shadow: var(--sh-3);
}
.tree-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px;
  border-bottom: 2px solid rgba(46,42,58,.1);
  cursor: pointer;
  transition: background .12s;
}
.tree-row:last-child { border-bottom: none; }
.tree-row:hover { background: #FFF3C9; }
.tree-icon { width: 24px; text-align: center; flex-shrink: 0; font-size: 17px; }
.tree-name { font-weight: 600; font-size: 14.5px; min-width: 180px; word-break: break-all; }
.tree-size { width: 90px; font-size: 12.5px; text-align: right; flex-shrink: 0; font-weight: 500; }
.tree-commit { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.tree-date { font-size: 12.5px; width: 110px; text-align: right; flex-shrink: 0; font-weight: 500; }
.tree-del { opacity: 0; transition: opacity .15s; flex-shrink: 0; }
.tree-row:hover .tree-del { opacity: 1; }

/* ---------- file viewer: dark code block in a toon frame ---------- */
.fileviewer {
  border: var(--bw) solid var(--ink); border-radius: var(--r-md);
  background: var(--card); overflow: hidden;
  box-shadow: var(--sh-3);
}
.fv-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px 18px; border-bottom: var(--bw) solid var(--ink); flex-wrap: wrap;
  background: var(--paper-2);
}
.fv-title { font-weight: 700; font-size: 15px; word-break: break-all; }
.code {
  font-family: "SF Mono", "Cascadia Code", Consolas, Menlo, monospace;
  font-size: 13px; line-height: 1.6;
  padding: 16px 18px; margin: 0;
  overflow-x: auto; white-space: pre; tab-size: 4;
  background: #2E2A3A;
  color: #E8E4F5;
}
textarea.code {
  width: 100%; min-height: 320px; resize: vertical;
  border: none; border-bottom: var(--bw) solid var(--ink); border-radius: 0;
  white-space: pre; overflow-x: auto;
  box-shadow: none; transform: none;
}
#fv-editor { padding: 14px 18px; background: var(--card); }
#fv-message { margin: 10px 0; }

/* syntax colors (on dark plum) */
.hl .k { color: #C792EA; font-weight: 600; }
.hl .s { color: #C3E88D; }
.hl .c { color: #8B86A8; font-style: italic; }
.hl .num { color: #F78C6C; }
.hl .fn { color: #82AAFF; }
.hl .t { color: #FFCB6B; }

/* ---------- commits ---------- */
.commit-item {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  background: var(--card);
  border: var(--bw) solid var(--ink); border-radius: var(--r-md);
  padding: 14px 18px; margin-bottom: 10px;
  box-shadow: var(--sh-2);
  transition: transform .12s, box-shadow .12s;
}
.commit-item:hover { transform: translate(-2px,-2px); box-shadow: var(--sh-3); }
.commit-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.commit-msg { font-weight: 700; word-break: break-word; }
.chip {
  background: #E3F6FF; border: 2px solid var(--ink);
  color: var(--ink); border-radius: 7px; padding: 1px 7px;
  font-size: 12px; margin-right: 4px; font-weight: 600;
}
.commit-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12.5px; white-space: nowrap; font-weight: 500; }

/* ---------- releases ---------- */
.release-card {
  background: var(--card);
  border: var(--bw) solid var(--ink); border-radius: var(--r-md);
  padding: 18px 20px; margin-bottom: 14px;
  box-shadow: var(--sh-3);
}
.release-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.release-head h3 { font-size: 16.5px; font-weight: 700; }
.rel-tag {
  background: var(--grape); color: #fff;
  border: 2px solid var(--ink);
  border-radius: 9px; padding: 2px 11px; font-size: 14px; font-weight: 700;
}
.release-foot { margin-top: 12px; flex-wrap: wrap; }

/* ---------- issues ---------- */
.issue-states { display: flex; gap: 8px; }
.issue-states .mini { flex: none; padding: 7px 16px; }
.issue-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  border: var(--bw) solid var(--ink); border-radius: var(--r-md);
  padding: 13px 18px; margin-bottom: 10px; cursor: pointer;
  box-shadow: var(--sh-2);
  transition: transform .12s, box-shadow .12s;
}
.issue-row:hover { transform: translate(-2px,-2px); box-shadow: var(--sh-3); }
.issue-dot { font-size: 16px; }
.issue-main { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.issue-title { font-weight: 700; word-break: break-word; }
.issue-main .muted { font-size: 12.5px; font-weight: 500; }

.issue-card {
  background: var(--card);
  border: var(--bw) solid var(--ink); border-radius: var(--r-md);
  padding: 20px 22px; margin-top: 12px;
  box-shadow: var(--sh-3);
}
.issue-card h3 { font-size: 19px; margin-bottom: 6px; font-weight: 700; }
#id-meta { font-size: 13px; margin-bottom: 14px; font-weight: 500; }
.comment-card {
  background: var(--paper-2);
  border: var(--bw) solid var(--ink); border-radius: 12px;
  padding: 12px 16px; margin: 12px 0;
}
.comment-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 13.5px; font-weight: 700; }
.comment-body { font-size: 14px; line-height: 1.55; font-weight: 500; }
.comment-form { margin-top: 16px; padding-top: 14px; border-top: var(--bw) solid var(--ink); }
.comment-form textarea { margin-bottom: 10px; }

/* ---------- settings ---------- */
.settings-card {
  background: var(--card);
  border: var(--bw) solid var(--ink); border-radius: var(--r-md);
  padding: 20px 22px; margin-bottom: 16px;
  box-shadow: var(--sh-3);
}
.settings-card h3 { margin-bottom: 12px; font-size: 16.5px; font-weight: 700; }
.lbl { display: block; font-size: 13px; color: var(--ink-soft); margin: 8px 0 4px; font-weight: 700; }
.danger-zone { border-color: var(--tomato); background: #FFF1EE; }
.danger-zone h3 { color: var(--tomato-deep); }

.pad { padding: 30px; }

/* ---------- empty states: dashed speech bubbles ---------- */
#files-empty, #notes-empty, #todos-empty, #repos-empty, .filetree .pad {
  border: 3px dashed var(--ink-soft);
  border-radius: 16px;
  padding: 30px 20px;
  background: rgba(255,255,255,.6);
  font-weight: 600;
  font-size: 15px;
}
.filetree .pad { border: none; background: none; }

/* ---------- animations ---------- */
@keyframes toon-pop {
  from { transform: scale(.85); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
@keyframes toast-pop {
  from { transform: translate(-50%, 18px); opacity: 0; }
  to   { transform: translate(-50%, 0); opacity: 1; }
}
@keyframes toon-bounce {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.025); }
  100% { transform: scale(1); }
}
@keyframes toon-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ================= Help page ================= */
.help-wrap { display: grid; grid-template-columns: 230px 1fr; gap: 24px; align-items: start; }
.help-nav {
  position: sticky; top: 16px;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--card);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--sh-3);
}
.help-nav h3 {
  font-size: 12.5px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-soft); margin: 0 0 8px;
}
.help-nav a {
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px;
  padding: 6px 10px; border-radius: 8px;
}
.help-nav a:hover { background: var(--sun); box-shadow: var(--sh-1); }
.help-content { max-width: 880px; }
.help-content h2 { scroll-margin-top: 14px; }
.help-content h2, .help-content ul { white-space: normal; }
.help-content li { margin: 5px 0; }
.help-content code {
  background: var(--paper-2); border: 1px solid rgba(46,42,58,.15);
  border-radius: 6px; padding: 1px 6px; font-size: 13px;
}
.navbtn[data-view="help"].active { background: var(--pink); }
@media (max-width: 720px) {
  .help-wrap { grid-template-columns: 1fr; }
  .help-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .help-nav h3 { width: 100%; }
}

/* ================= Deploy view ================= */
.deploy-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.deploy-col { display: flex; flex-direction: column; gap: 20px; }
.settings-card-inner {
  background: var(--paper-2);
  border: 2px dashed rgba(46,42,58,.25);
  border-radius: var(--r-md);
  padding: 12px;
  margin: 6px 0 10px;
}
.settings-card-inner h4 { font-size: 14px; margin: 0 0 8px; color: var(--ink); }
.profile-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 12px; border-bottom: 2px solid rgba(46,42,58,.12);
}
.profile-row:last-child { border-bottom: none; }
.profile-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.profile-info .muted { font-size: 12.5px; }
.profile-row .btn.small { white-space: nowrap; }
.mono { font-family: ui-monospace, "Cascadia Code", Menlo, Consolas, monospace; font-size: 12.5px; }
.badge.ok  { background: var(--mint); }
.badge.err { background: var(--tomato); color: #fff; }
.badge.run { background: var(--sun); }
.stage-chip {
  font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: var(--card); border: var(--bw) solid var(--ink); color: var(--ink-soft);
  white-space: nowrap;
}
.stage-chip.done { background: var(--mint); color: var(--ink); }
.stage-chip.cur  { background: var(--sky); color: var(--ink); box-shadow: var(--sh-2); }
.console {
  background: #1e1b28; color: #d8d3e8; border: var(--bw) solid var(--ink);
  border-radius: var(--r-md); padding: 14px; margin: 0;
  max-height: 340px; overflow-y: auto; white-space: pre-wrap; word-break: break-word;
  font-family: ui-monospace, "Cascadia Code", Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.5;
}
.navbtn[data-view="deploy"].active { background: var(--mint); }
@media (max-width: 900px) { .deploy-wrap { grid-template-columns: 1fr; } }
