/* =====================================================================================
   Studio: the sidebar shell, Overview, Tasks, Analytics, Revenue and Admin.
   The same Doodle Brutal system as styles.css — ink outlines, hard offset shadows, flat
   pastel fills, lemon for "you are here" — on its own classes (st-, sb-, ov-, tk-, in-, mb-)
   so nothing here leaks into the content pages.
   ===================================================================================== */

:root {
  --sb-w: 248px;
  --st-gap: 16px;
}

/* ---------- the shell ---------- */

.sidebar, .sb-scrim { display: none; }

.studio.studio-in { padding-left: var(--sb-w); }
.studio.studio-in .sidebar { display: flex; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sb-w);
  flex-direction: column;
  background: var(--panel);
  border-right: 2px solid var(--ink);
}

.sb-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 12px;
  color: var(--ink);
  text-decoration: none;
}
.sb-brand .brand-mark { width: 36px; height: 36px; font-size: 14px; flex: none; }
.sb-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.sb-brand-text b { font-size: 17px; letter-spacing: .01em; }
.sb-brand-text small { font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); }

.sb-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 14px 10px;
  padding: 7px 10px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink-soft);
  font: 500 13px/1.2 var(--font);
  cursor: pointer;
  text-align: left;
}
.sb-search span { flex: 1; }
.sb-search:hover { background: #FFFEF4; color: var(--ink); }
.sb-search kbd, .pal-foot span, .tk-kbd {
  padding: 1px 6px;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font: 700 10px/1.5 var(--font);
}

.st-icon { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.sb-nav {
  flex: 1;
  overflow-y: auto;
  padding: 2px 10px 16px;
  scrollbar-width: thin;
}

.sb-group { margin-top: 14px; }

.sb-section {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px 5px;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.sb-section .st-icon { width: 14px; height: 14px; }
.sb-section > span { flex: 1; }

.sb-langs { display: flex; gap: 2px; }
.sb-lang {
  min-width: 28px;
  padding: 1px 5px;
  border: 1.5px solid var(--ink);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  font: 700 10px/1.5 var(--font);
  letter-spacing: .04em;
  cursor: pointer;
}
.sb-lang:hover { background: var(--p-aqua); }
.sb-lang[aria-pressed="true"] { background: var(--aqua); box-shadow: 2px 2px 0 var(--ink); }
.sb-lang.is-readonly { border-style: dashed; color: var(--ink-soft); }

.sb-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px;
  border: 2px solid transparent;
  border-radius: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.sb-link:hover { border-color: var(--ink); background: var(--bg); }
.sb-link.is-active { background: var(--lemon); border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.sb-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sb-count {
  min-width: 20px;
  padding: 0 6px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--panel);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.sb-count-hot { background: var(--tomato); }

.sb-sub {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 4px 0 6px 20px;
  padding-left: 10px;
  border-left: 2px solid var(--ink);
}
.sb-sublink {
  padding: 3px 8px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.sb-sublink:hover { color: var(--ink); background: var(--bg); }
.sb-sublink.is-active { color: var(--ink); background: var(--p-lemon); }

.sb-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 2px solid var(--ink);
  background: var(--bg);
}
.sb-who { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.sb-avatar {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  flex: none;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--peri);
  font-weight: 700;
  font-size: 13px;
}
.sb-who-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.sb-who-text b { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-who-text small { font-size: 11px; color: var(--ink-soft); font-weight: 600; }

/* The top bar becomes crumbs + actions; the brand and the old tab row live in the sidebar. */
.studio.studio-in .topbar { position: sticky; top: 0; z-index: 30; flex-wrap: nowrap; padding: 10px 24px; min-height: 58px; }
.studio.studio-in .topbar .brand,
.studio.studio-in .topbar .features,
.studio.studio-in .topbar .authbar { display: none; }
.st-crumbs, .st-actions, .st-menu { display: none; }
.studio.studio-in .st-crumbs { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; font-size: 14px; color: var(--ink-soft); font-weight: 600; white-space: nowrap; overflow: hidden; }
.studio.studio-in .st-crumbs > * + *::before { content: '›'; margin-right: 8px; color: var(--ink-soft); font-weight: 400; }
.studio.studio-in .st-crumbs b { color: var(--ink); font-size: 16px; }
.studio.studio-in .st-actions { display: flex; gap: 8px; align-items: center; }
.st-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.st-new-ticket { background: var(--p-peri); }
.studio:not(.can-tasks) .st-new-ticket { display: none; }

.st-readonly {
  margin: 0 0 14px;
  padding: 8px 14px;
  border: 2px dashed var(--ink);
  border-radius: 10px;
  background: var(--p-aqua);
  font-size: 13px;
  font-weight: 600;
}

/* ---------- studio pages: shared pieces ---------- */

.studio-page { max-width: 1320px; margin: 0 auto; }

.st-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 4px 0 18px; }
.st-title { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.005em; }
.st-sub { margin: 4px 0 0; color: var(--ink-soft); font-size: 14px; }
.st-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.st-muted { color: var(--ink-soft); font-size: 13px; margin: 0; }
.st-empty { padding: 48px 16px; text-align: center; }
.st-empty h2 { margin: 0 0 6px; }
.st-spacer { flex: 1; }

.st-card {
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: 3px 3px 0 var(--ink);
  padding: 16px 18px;
  min-width: 0;
}
.st-card h2 { margin: 0; font-size: 15px; font-weight: 700; }

.st-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.st-tab {
  padding: 5px 12px;
  border: 2px solid transparent;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  background: none;
  cursor: pointer;
  font-family: var(--font);
}
.st-tab:hover { border-color: var(--ink); background: var(--panel); }
.st-tab.is-active { background: var(--lemon); border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }

.st-input, .st-select, .st-textarea {
  padding: 7px 10px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  font: 500 14px/1.35 var(--font);
  min-width: 0;
}
.st-input:focus, .st-select:focus, .st-textarea:focus { outline: none; background: #FFFEF4; box-shadow: 3px 3px 0 var(--lemon); }
.st-textarea { width: 100%; resize: vertical; min-height: 120px; }
.st-select { cursor: pointer; }
.st-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; cursor: pointer; }
.st-check input { accent-color: var(--ink); width: 15px; height: 15px; }

.st-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--panel);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 19px;
  white-space: nowrap;
}

.st-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 90;
  transform: translateX(-50%);
  padding: 9px 16px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  font-size: 14px;
  box-shadow: 3px 3px 0 var(--lemon);
  animation: st-pop .18s ease-out;
}
.st-toast.is-bad { background: var(--tomato); color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
@keyframes st-pop { from { transform: translate(-50%, 8px); opacity: 0; } }

/* ---------- no access ---------- */

.st-noaccess { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.st-noaccess-card { max-width: 440px; text-align: center; }
.st-noaccess-card .brand-mark { margin: 0 auto 16px; display: grid; }
.st-noaccess-card .st-row { justify-content: center; margin-top: 16px; }

/* ---------- Overview ---------- */

.ov-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: row dense; gap: var(--st-gap); align-items: start; }
.ov-wide { grid-column: span 2; }
.ov-card { display: flex; flex-direction: column; gap: 12px; }
.ov-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ov-tickets { display: flex; flex-direction: column; gap: 6px; }

.ov-pulse { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ov-stat {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
  background: var(--bg);
}
.ov-stat b { font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ov-stat span { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.ov-stat.is-hot { background: var(--p-tomato); }
.ov-stat:hover { box-shadow: 3px 3px 0 var(--ink); }

.ov-content { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.ov-tile {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
}
.ov-tile:hover { background: var(--p-lemon); }
.ov-tile b { font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ov-tile span { font-size: 12px; font-weight: 600; color: var(--ink-soft); }

.ov-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }

.ov-gos { display: flex; flex-direction: column; gap: 4px; }
.ov-go { display: flex; flex-direction: column; padding: 7px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; border: 2px solid transparent; }
.ov-go:hover { border-color: var(--ink); background: var(--bg); }
.ov-go b { font-size: 14px; }
.ov-go small { font-size: 12px; color: var(--ink-soft); }

/* ---------- command palette ---------- */

.pal-scrim { position: fixed; inset: 0; z-index: 95; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: rgba(22, 22, 22, .28); }
.pal {
  width: min(620px, 100%);
  display: flex;
  flex-direction: column;
  max-height: 70vh;
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: 16px;
  box-shadow: 6px 6px 0 var(--ink);
  overflow: hidden;
  animation: st-drop .14s ease-out;
}
@keyframes st-drop { from { transform: translateY(-8px); opacity: 0; } }
.pal-input { border: 0; border-bottom: 2px solid var(--ink); padding: 14px 16px; font: 600 16px/1.3 var(--font); background: var(--panel); color: var(--ink); outline: none; }
.pal-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.pal-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.pal-row[aria-selected="true"] { background: var(--lemon); }
.pal-label { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-where { font-size: 12px; color: var(--ink-soft); white-space: nowrap; font-weight: 600; }
.pal-empty { padding: 16px; color: var(--ink-soft); }
.pal-foot { display: flex; gap: 8px; padding: 8px 12px; border-top: 2px solid var(--ink); background: var(--bg); font-size: 11px; }
.pal-foot span { font-weight: 600; }

/* ---------- small screens ---------- */

@media (max-width: 1100px) {
  .ov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-wide { grid-column: span 2; }
}

@media (max-width: 900px) {
  .studio.studio-in { padding-left: 0; }
  .studio.studio-in .sidebar { transform: translateX(-102%); transition: transform .18s ease-out; box-shadow: 6px 0 0 var(--ink); }
  .studio.studio-in.sb-open .sidebar { transform: none; }
  .studio.studio-in.sb-open .sb-scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(22, 22, 22, .3); }
  .studio.studio-in .st-menu { display: inline-flex; padding: 6px 8px; }
  .studio.studio-in .topbar { padding: 8px 12px; gap: 10px; }
  .st-new-ticket span { display: none; }
  .ov-grid { grid-template-columns: minmax(0, 1fr); }
  .ov-wide { grid-column: auto; }
  main { padding-left: 16px; padding-right: 16px; }
}

/* ---------- Tasks ---------- */

.tk-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.tk-filters .st-select { max-width: 170px; font-size: 13px; padding: 6px 8px; }
.tk-search { width: 240px; }

.tk-key { font-size: 12px; font-weight: 700; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.tk-type { font-size: 11px; }
.tk-c-tomato { background: var(--p-tomato); }
.tk-c-lemon { background: var(--p-lemon); }
.tk-c-green { background: var(--p-green); }
.tk-c-peri { background: var(--p-peri); }
.tk-c-aqua { background: var(--p-aqua); }
.tk-c-orange { background: #FDE0C2; }
.tk-c-off { background: var(--off-fill); }

.tk-pri { font-size: 11px; font-weight: 700; padding: 0 5px; border-radius: 6px; border: 1.5px solid var(--ink); line-height: 17px; }
.tk-pri-0 { background: var(--tomato); }
.tk-pri-1 { background: var(--orange); }
.tk-pri-2 { background: var(--panel); }
.tk-pri-3 { background: var(--off-fill); color: var(--ink-soft); border-color: var(--off-ink); }

.tk-blocked { background: var(--tomato); }
.tk-label { background: var(--bg); font-weight: 600; }
.tk-st { font-size: 11px; }
.tk-st-backlog { background: var(--off-fill); }
.tk-st-todo { background: var(--panel); }
.tk-st-doing { background: var(--p-lemon); }
.tk-st-qa { background: var(--p-peri); }
.tk-st-done { background: var(--p-green); }

.tk-avatar {
  display: inline-grid;
  place-items: center;
  width: 24px; height: 24px;
  flex: none;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--p-aqua);
  font-size: 10px;
  font-weight: 700;
}
.tk-avatar.is-none { background: var(--panel); color: var(--off-ink); border-style: dashed; }

/* Board */
.tk-board { display: flex; flex-direction: column; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.tk-cols-head, .tk-cols { display: grid; grid-template-columns: repeat(var(--cols), minmax(230px, 1fr)); gap: 12px; }
.tk-col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px; }
.tk-col-head b { font-size: 14px; }
.tk-col-head .btn { margin-left: auto; }
.tk-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 90px;
  padding: 8px;
  border: 2px dashed transparent;
  border-radius: 14px;
  background: rgba(22, 22, 22, .035);
}
.tk-col.is-over { border-color: var(--ink); background: var(--p-lemon); }
.tk-col-empty { padding: 14px 0; text-align: center; color: var(--off-ink); font-size: 13px; }
.tk-lane-head { display: flex; align-items: baseline; gap: 8px; padding: 6px 4px 0; border-top: 2px solid var(--ink); }
.tk-lane-head b { font-size: 14px; }
.tk-quick { width: 100%; }

.tk-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 10px;
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: 3px 3px 0 var(--ink);
  color: var(--ink);
  text-decoration: none;
  cursor: grab;
  position: relative;
}
.tk-card:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.tk-card.is-dragging { opacity: .4; }
.tk-card.is-blocked { background: repeating-linear-gradient(-45deg, var(--panel) 0 10px, #FDEBE7 10px 20px); }
.tk-card.is-unread::after { content: ''; position: absolute; top: -5px; right: -5px; width: 12px; height: 12px; border: 2px solid var(--ink); border-radius: 50%; background: var(--peri); }
.tk-card-top { display: flex; align-items: center; gap: 6px; }
.tk-card-title { font-weight: 600; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.tk-card-meta { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; font-size: 12px; color: var(--ink-soft); }
.tk-meta-n { font-variant-numeric: tabular-nums; font-weight: 600; }
.tk-meta-n.is-late { color: var(--danger); }

/* Rows: Overview, My work, releases, archive */
.tk-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 2px solid transparent;
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}
.tk-row:hover { border-color: var(--ink); background: var(--bg); }
.tk-row-title { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Backlog */
.tk-scope { margin-bottom: 10px; }
.tk-bulk {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-bottom: 10px; padding: 8px 12px;
  border: 2px solid var(--ink); border-radius: 12px; background: var(--lemon); box-shadow: 3px 3px 0 var(--ink);
  position: sticky; top: 66px; z-index: 5;
}
.tk-bulk .st-select { font-size: 13px; padding: 4px 8px; }
.tk-table { border: 2px solid var(--ink); border-radius: 14px; background: var(--panel); box-shadow: 3px 3px 0 var(--ink); overflow: hidden; }
.tk-trow {
  display: grid;
  grid-template-columns: 22px 48px minmax(200px, 1fr) 110px 120px 72px 150px 130px 130px;
  gap: 10px;
  align-items: center;
  padding: 7px 12px;
  border-top: 1px solid var(--hair);
  font-size: 13px;
}
.tk-trow:first-child { border-top: 0; }
.tk-thead { background: var(--bg); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.tk-trow.is-picked { background: var(--p-lemon); }
.tk-trow.is-over { box-shadow: inset 0 3px 0 var(--ink); }
.tk-trow.is-dragging { opacity: .4; }
.tk-trow[draggable="true"] { cursor: grab; }
.tk-trow input[type="checkbox"] { accent-color: var(--ink); width: 15px; height: 15px; }
.tk-trow-title { font-weight: 600; font-size: 14px; color: var(--ink); text-decoration: none; display: flex; gap: 6px; align-items: center; min-width: 0; overflow: hidden; }
.tk-trow-title:hover { text-decoration: underline; text-decoration-color: var(--lemon); text-decoration-thickness: 3px; }
.tk-cell { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-who { display: flex; align-items: center; gap: 6px; }
.tk-trow .st-select { font-size: 12px; padding: 3px 6px; border-width: 1.5px; }
.tk-none { padding: 24px 0; }

.tk-mine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: var(--st-gap); align-items: start; }
.tk-mine { display: flex; flex-direction: column; gap: 6px; }

/* Releases */
.tk-releases { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(460px, 100%), 1fr)); gap: var(--st-gap); align-items: start; margin-bottom: 12px; }
.tk-release { display: flex; flex-direction: column; gap: 8px; }
.tk-release.is-shipped { background: var(--p-green); }
.tk-progress { height: 14px; border: 2px solid var(--ink); border-radius: 999px; background: var(--bg); overflow: hidden; }
.tk-progress span { display: block; height: 100%; background: var(--green); border-right: 2px solid var(--ink); }
.tk-progress-note { margin: -2px 0 0; font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.tk-ms-planned { background: var(--panel); }
.tk-ms-active { background: var(--lemon); }
.tk-ms-shipped { background: var(--green); }

.tk-archive { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.tk-arow { display: flex; align-items: center; gap: 8px; }
.tk-arow .tk-row { flex: 1; }

/* The ticket drawer */
.tk-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(22, 22, 22, .25); }
.tk-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 61;
  width: min(640px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-left: 2px solid var(--ink);
  box-shadow: -6px 0 0 var(--ink);
  animation: tk-in .16s ease-out;
}
@keyframes tk-in { from { transform: translateX(24px); opacity: 0; } }
.tk-drawer.is-blocked { border-left-color: var(--tomato); }
.tk-drawer-head { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-bottom: 2px solid var(--ink); background: var(--panel); }
.tk-drawer-head .tk-key { font-size: 14px; color: var(--ink); }
.tk-drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px 32px; display: flex; flex-direction: column; gap: 14px; }
.tk-drawer-foot { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 2px solid var(--ink); background: var(--panel); }

.tk-title-input {
  width: 100%;
  resize: none;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 6px 8px;
  margin: 0 -8px;
  background: transparent;
  color: var(--ink);
  font: 700 22px/1.25 var(--font);
}
.tk-title-input:hover:not(:disabled), .tk-title-input:focus { border-color: var(--ink); background: var(--panel); outline: none; }

.tk-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tk-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tk-field > span { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.tk-field .st-select, .tk-field .st-input { font-size: 13px; padding: 5px 8px; width: 100%; }
.tk-field:last-child { grid-column: span 2; }
.tk-block { align-self: flex-start; }

.tk-labels { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 3px 6px; min-height: 34px; border: 2px solid var(--ink); border-radius: 10px; background: var(--panel); }
.tk-label-input { border: 0; outline: none; background: transparent; font: 500 13px var(--font); flex: 1; min-width: 60px; color: var(--ink); }
.tk-x { border: 0; background: none; padding: 0 3px; font: 700 14px/1 var(--font); color: var(--ink-soft); cursor: pointer; }
.tk-x:hover { color: var(--danger); }

.tk-sec { display: flex; flex-direction: column; gap: 8px; position: relative; }
.tk-sec h3 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.tk-sec-tools { position: absolute; right: 0; top: -4px; }
.tk-desc { padding: 10px 12px; border: 2px solid var(--ink); border-radius: 10px; background: var(--panel); font-size: 14px; overflow-wrap: anywhere; }
.tk-desc p, .tk-comment-body p { margin: 0 0 6px; }
.tk-desc ul, .tk-comment-body ul { margin: 0 0 6px; padding-left: 20px; }
.tk-desc code, .tk-comment-body code { padding: 0 4px; border-radius: 4px; background: var(--p-lemon); font-size: 13px; }
.tk-desc a, .tk-comment-body a, .tk-link-row a { color: var(--ink); text-decoration-color: var(--peri); text-decoration-thickness: 2px; font-weight: 600; }

.tk-checklist, .tk-links { display: flex; flex-direction: column; gap: 4px; }
.tk-check-row, .tk-link-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.tk-check-row input { accent-color: var(--ink); width: 16px; height: 16px; }
.tk-check-row span { flex: 1; }
.tk-check-row .is-done { text-decoration: line-through; color: var(--ink-soft); }
.tk-link-row a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-checklist .st-input, .tk-links .st-input { font-size: 13px; padding: 5px 8px; }

.tk-thread { display: flex; flex-direction: column; gap: 10px; }
.tk-comment { padding: 10px 12px; border: 2px solid var(--ink); border-radius: 12px; background: var(--panel); }
.tk-comment-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 13px; }
.tk-comment-head .st-muted { font-size: 12px; }
.tk-comment-body { font-size: 14px; overflow-wrap: anywhere; }
.tk-comment-new { display: flex; flex-direction: column; gap: 6px; }
.tk-comment-new .st-textarea { min-height: 70px; }

.tk-foot-meta { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 2px dashed var(--hair); }
.tk-history summary { cursor: pointer; font-size: 13px; font-weight: 700; }
.tk-hist-row { font-size: 13px; padding: 3px 0; }

/* Small modal (releases) */
.tk-modal-scrim { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(22, 22, 22, .3); }
.tk-modal { width: min(440px, 100%); padding: 18px 20px; background: var(--bg); border: 2px solid var(--ink); border-radius: 16px; box-shadow: 6px 6px 0 var(--ink); }
.tk-modal h2 { margin: 0 0 12px; font-size: 18px; }
.tk-form { display: flex; flex-direction: column; gap: 10px; }
.tk-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.tk-modal-actions { justify-content: flex-end; margin-top: 16px; }

@media (max-width: 900px) {
  .tk-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tk-trow { grid-template-columns: 22px 40px minmax(160px, 1fr) 120px; }
  .tk-trow > :nth-child(4), .tk-trow > :nth-child(5), .tk-trow > :nth-child(6), .tk-trow > :nth-child(7), .tk-trow > :nth-child(8) { display: none; }
  .tk-mine-grid, .tk-releases { grid-template-columns: minmax(0, 1fr); }
  .tk-search { width: 100%; }
  .tk-drawer { box-shadow: none; }
}

/* ---------- Analytics & Revenue ---------- */

.in-ranges { margin-bottom: 14px; }
.in-sources { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.in-body { display: flex; flex-direction: column; gap: var(--st-gap); }

.in-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.in-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: 3px 3px 0 var(--ink);
  min-width: 0;
}
.ov-kpis .in-tile { box-shadow: none; background: var(--bg); }
.in-tile-label { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.in-tile-value { font-size: 26px; font-weight: 700; line-height: 1.15; }
.in-tile-foot { display: flex; gap: 6px; align-items: baseline; font-size: 11px; min-height: 16px; }
.in-tile-foot .st-muted { font-size: 11px; }
.in-delta { font-weight: 700; font-size: 12px; color: var(--ink-soft); }
.in-delta.is-good { color: var(--green-text); }
.in-delta.is-bad { color: #B42318; }
.in-spark { width: 100%; max-width: 160px; height: 28px; margin-top: 4px; }

.in-card { display: flex; flex-direction: column; gap: 8px; }
.in-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.in-card .st-muted { margin: 0; }
.in-plot { width: 100%; min-height: 220px; }
.in-plot svg { display: block; }
.in-axis { font: 500 11px var(--font); fill: #5A544C; font-variant-numeric: tabular-nums; }
.in-hit { cursor: crosshair; }
.in-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; font-weight: 600; }
.in-legend span { display: inline-flex; align-items: center; gap: 6px; }
.in-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

.in-tip {
  position: fixed;
  z-index: 99;
  pointer-events: none;
  min-width: 150px;
  padding: 8px 10px;
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 12px;
}
.in-tip b { display: block; margin-bottom: 4px; font-size: 13px; }
.in-tip div { display: flex; align-items: center; gap: 6px; }
.in-tip i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.in-tip span { margin-left: auto; padding-left: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.in-tip-total { border-top: 1px solid var(--hair); margin-top: 3px; padding-top: 3px; }

.in-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--st-gap); }
.in-hbars, .in-funnel { display: flex; flex-direction: column; gap: 6px; }
.in-hbar { display: grid; grid-template-columns: minmax(70px, 120px) 1fr auto; gap: 8px; align-items: center; font-size: 13px; }
.in-hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.in-hbar-track { height: 12px; }
.in-hbar-track i { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.in-hbar-value { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.in-hbar-value small { display: block; font-weight: 500; font-size: 11px; color: var(--ink-soft); }

.in-table summary { cursor: pointer; font-size: 13px; font-weight: 700; }
.in-table-wrap { overflow-x: auto; max-height: 420px; overflow-y: auto; }
.in-table-wrap table { width: 100%; border-collapse: collapse; font-size: 13px; }
.in-table-wrap th { position: sticky; top: 0; background: var(--panel); text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); padding: 6px 8px; border-bottom: 2px solid var(--ink); }
.in-table-wrap td { padding: 5px 8px; border-bottom: 1px solid var(--hair); }
.in-num { text-align: right; font-variant-numeric: tabular-nums; }
.in-cohorts td.in-heat { font-weight: 700; }

@media (max-width: 1000px) {
  .in-grid3 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- signed out ---------- */

.st-signin { display: none; }
.studio:not(.studio-in) .st-signin { display: grid; place-items: center; min-height: 60vh; }
.studio:not(.studio-in) #goHome, .studio:not(.studio-in) .features { display: none; }
.st-signin-card {
  max-width: 420px;
  padding: 32px 28px;
  text-align: center;
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: 18px;
  box-shadow: 6px 6px 0 var(--ink);
}
.st-signin-card .brand-mark { display: grid; margin: 0 auto 14px; width: 52px; height: 52px; font-size: 18px; }
.st-signin-card h1 { margin: 0 0 6px; font-size: 26px; }
.st-signin-card p { margin: 0 0 18px; color: var(--ink-soft); }
.st-signin-card .st-muted { margin: 14px 0 0; }
.tk-drawer-body > * { flex-shrink: 0; }
.tk-title-input { box-sizing: border-box; min-height: 44px; }

/* ---------- Members & Integrations ---------- */

.mb-add { display: flex; flex-direction: column; gap: 10px; margin-bottom: var(--st-gap); }
.mb-add-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mb-add-row .st-input[type="email"] { width: 260px; }
.mb-langs { display: flex; gap: 8px; }
.mb-table { margin-bottom: var(--st-gap); }
.mb-scroll { overflow-x: auto; margin-top: 10px; }
.mb-grid { display: grid; min-width: 1140px; }
.mb-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) 130px repeat(12, 50px) 140px 110px;
  gap: 6px;
  align-items: center;
  padding: 8px 6px;
  border-top: 1px solid var(--hair);
}
.mb-head { border-top: 0; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.mb-perm-head { text-align: center; line-height: 1.15; }
.mb-cell { display: grid; place-items: center; }
.mb-cell input { width: 16px; height: 16px; accent-color: var(--ink); }
.mb-row .st-select { font-size: 13px; padding: 4px 6px; }
.mb-row.is-dirty { background: var(--p-lemon); border-radius: 10px; }
.mb-row.is-me { background: rgba(108, 199, 218, .12); border-radius: 10px; }
.mb-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mb-who > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.mb-who b { font-size: 14px; }
.mb-who small { font-size: 12px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; }
.mb-legend summary { cursor: pointer; font-weight: 700; margin-bottom: 10px; }
.mb-roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.mb-role { padding: 12px; border: 2px solid var(--ink); border-radius: 12px; background: var(--panel); }
.mb-role p { margin: 4px 0 8px; font-size: 13px; color: var(--ink-soft); }
.mb-perm-chips { display: flex; flex-wrap: wrap; gap: 4px; }

.mb-sources { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); gap: var(--st-gap); align-items: start; }
.mb-src { display: flex; flex-direction: column; gap: 10px; }
.mb-src-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mb-src-form .st-input { width: 100%; font-size: 13px; }
.mb-saved { font-style: normal; color: var(--green-text); text-transform: none; letter-spacing: 0; }
.mb-src-when { margin: 0; font-size: 12px; font-weight: 600; }
.mb-src-err { margin: 0; padding: 6px 10px; border: 2px solid var(--ink); border-radius: 8px; background: var(--p-tomato); font-size: 13px; overflow-wrap: anywhere; }
.mb-src-note { margin: 0; font-size: 12px; color: var(--ink-soft); }
.mb-how summary { cursor: pointer; font-size: 13px; font-weight: 700; }
.mb-how ol { margin: 6px 0 0; padding-left: 20px; font-size: 13px; }
.mb-how li { margin-bottom: 4px; }
.mb-state-off { background: var(--off-fill); }
.mb-state-on { background: var(--p-aqua); }
.mb-state-ok { background: var(--green); }
.mb-state-bad { background: var(--tomato); }

@media (max-width: 900px) {
  .mb-src-form { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .tk-filters .st-select { flex: 1 1 40%; max-width: none; }
  .tk-cols-head, .tk-cols { grid-template-columns: repeat(var(--cols), minmax(78vw, 1fr)); }
}
