/* Noa Studio on the web (src/studio/). On top of styles.css: the same ink, paper and components, a top bar in place
   of the dashboard's sidebar, and the pieces only it has (work rows, the chat thread, highlight cards). Nothing changes
   size or place on hover. */

.st-app { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------------------------------------------------------------- top bar */

.st-top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 -3px 0 -2px var(--margin);
}
.st-top-inner {
  max-width: 72rem; margin: 0 auto; padding: 10px 32px;
  display: flex; align-items: center; gap: 18px;
}
.st-brand { padding: 4px 0; white-space: nowrap; flex: none; }
.st-nav { display: flex; gap: 2px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.st-nav::-webkit-scrollbar { display: none; }
.st-nav-link {
  display: block; padding: 7px 11px; border-radius: 8px; white-space: nowrap;
  color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14.5px;
}
.st-nav-link:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.st-nav-link[aria-current="page"] { background: var(--highlight); color: var(--highlight-ink); }
.st-top-end { display: flex; align-items: center; gap: 8px; flex: none; min-width: 0; }
.st-who { font-size: 13px; color: var(--ink-3); text-decoration: none; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-who:hover { color: var(--ink); text-decoration: underline; }

.st-main { flex: 1; width: 100%; max-width: 72rem; margin: 0 auto; padding: 28px 32px 64px; min-width: 0; }
.st-page { max-width: none; }

/* ---------------------------------------------------------------- overview */

.st-notes:empty { display: none; }
.st-overview-top { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 1.6fr); gap: 20px; align-items: stretch; }
.st-saved-panel { justify-content: center; gap: 6px; }
.st-saved-panel .hero-figure { font-variant-numeric: tabular-nums; }
.st-saved-sub { font-weight: 600; color: var(--ink-2); }
.st-saved-panel .muted.small { max-width: 26rem; margin-top: 4px; }
.st-counts { display: flex; flex-direction: column; justify-content: center; }
.tiles.st-count-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); height: 100%; }
.st-count-tiles .tile { justify-content: space-between; }
.st-count-tiles .tile-value { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- work rows (Overview, Activity) */

.st-items { list-style: none; margin: 0; padding: 0; }
.st-item { padding: 12px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.st-item:first-child { border-top: 0; padding-top: 4px; }
.st-item:last-child { padding-bottom: 0; }
.st-item-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.st-item-title { font-weight: 650; color: var(--ink); min-width: 0; flex: 1 1 auto; overflow-wrap: anywhere; }
a.st-item-title { text-decoration-color: var(--line-strong); }
a.st-item-title:hover { text-decoration-color: var(--margin); }
.st-item-time { flex: none; font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-item-result { color: var(--ink-2); font-size: 14px; overflow-wrap: anywhere; }
.st-item-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--ink-3); }
.st-item-meta a { font-weight: 600; }
.st-sites { font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }
.st-saved { color: var(--ok); font-weight: 600; }
.st-scope { font-weight: 600; color: var(--ink-2); }
.st-pending { font-style: italic; }
.st-item.is-failed .st-item-title { color: var(--ink-2); }

.st-kind {
  flex: none; display: inline-block; padding: 1px 7px; border-radius: 6px;
  font-size: 12px; font-weight: 650; white-space: nowrap; line-height: 1.5;
  background: var(--muted-soft); color: var(--ink-2);
}
.st-kind-job { background: var(--accent-soft); color: var(--accent); }
.st-kind-scheduled { background: var(--warn-soft); color: var(--warn); }
.st-kind-todo { background: var(--ok-soft); color: var(--ok); }
.st-failed { flex: none; font-size: 12px; font-weight: 650; color: var(--bad); white-space: nowrap; }

.st-days { display: flex; flex-direction: column; gap: 16px; }
.st-day-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.st-day-head .panel-title { font-size: 16px; }
.st-day-total { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--ok); }
.st-day-total:empty { display: none; }

/* ---------------------------------------------------------------- chats */

.st-toolbar { display: flex; gap: 10px; flex-wrap: wrap; }
.st-toolbar .st-search { flex: 1 1 18rem; max-width: 32rem; }
.st-toolbar select { width: auto; flex: 0 1 16rem; }
.st-chat-panel { padding-top: 10px; padding-bottom: 10px; }
.st-chat-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.st-chat-title { font-weight: 650; color: var(--ink); text-decoration-color: var(--line-strong); overflow-wrap: anywhere; }
.st-chat-title:hover { text-decoration-color: var(--margin); }
.st-chat-end { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.st-none { grid-template-columns: 1fr; }

.st-back { font-weight: 600; font-size: 14px; text-decoration: none; align-self: flex-start; }
.st-back:hover { text-decoration: underline; }
.st-thread-head { align-items: flex-start; }
.st-thread-title { font-size: 26px; overflow-wrap: anywhere; }
.st-thread { display: flex; flex-direction: column; gap: 12px; max-width: 48rem; }
.st-msg { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.st-msg p { white-space: pre-wrap; overflow-wrap: anywhere; }
.st-msg-who { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.st-msg-user { background: var(--highlight); border-color: transparent; color: var(--highlight-ink); margin-left: 12%; }
.st-msg-user .st-msg-who { color: color-mix(in srgb, var(--highlight-ink) 70%, transparent); }
.st-msg-noa { margin-right: 6%; }
.st-tools { list-style: none; margin: 0; padding: 2px 0 2px 14px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 2px; font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); overflow-wrap: anywhere; }
.st-tools-group { display: flex; flex-direction: column; gap: 6px; }
.st-tools-toggle { align-self: flex-start; background: none; border: 0; padding: 2px 0 2px 16px; font: inherit; font-size: 13px; color: var(--ink-3); cursor: pointer; border-left: 2px solid var(--line); }
.st-tools-toggle::before { content: "▸ "; }
.st-tools-toggle[aria-expanded="true"]::before { content: "▾ "; }
.st-tools-toggle:hover { color: var(--ink); }
.st-end { display: flex; gap: 10px; align-items: baseline; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2); }
.st-end p { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.st-end .chip { flex: none; }
.st-end-ok { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.st-end-bad { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }

/* ---------------------------------------------------------------- highlights */

.st-hl-toolbar { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.st-periods { align-self: auto; }
.st-check { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 550; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.st-check input { margin: 0; width: 16px; height: 16px; }
.st-collect { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.panel .st-collect { padding: 0; border: 0; background: none; }
.st-collect label { gap: 2px; cursor: pointer; }
.st-collect-label { font-weight: 600; font-size: 14.5px; }
.st-hl-privacy { max-width: 52rem; }
.st-hl-status:empty { display: none; }
.st-hl-total { font-weight: 650; color: var(--ok); }
.st-hl-total:empty { display: none; }
.st-hl-list { display: flex; flex-direction: column; gap: 14px; max-width: 52rem; }
.st-hl {
  display: flex; flex-direction: column; gap: 12px; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  border-left: 3px solid var(--margin);
}
.st-hl-text { font-size: 15.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.st-hl-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.st-hl-meta { font-size: 13px; color: var(--ink-3); min-width: 0; }
.st-hl-actions { display: flex; align-items: center; gap: 16px; flex: none; }
.st-copy { min-width: 6.5rem; }
.st-hl.is-used { opacity: 0.55; border-left-color: var(--line-strong); box-shadow: none; }
.st-hl.is-used .st-hl-text { color: var(--ink-2); }

/* ---------------------------------------------------------------- settings */

.st-token code, .st-token-value { font-family: var(--mono); }
.st-no-tokens { padding: 6px 0; }
.st-usage-details { margin-top: 14px; }
.st-usage-details summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink-2); width: max-content; max-width: 100%; }
.st-usage-details p { margin: 8px 0; }
.st-usage {
  margin: 0; padding: 12px 14px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line);
  font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink);
}
.st-new-token .st-once { display: block; font-weight: 600; }
.st-token-value { display: block; padding: 12px 14px; border-radius: 8px; background: var(--highlight); color: var(--highlight-ink); font-size: 14px; overflow-wrap: anywhere; user-select: all; }
.st-account { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- sign-in */

.st-signin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.st-signin > .btn { align-self: flex-start; }

/* ---------------------------------------------------------------- narrow screens */

@media (max-width: 900px) {
  .st-overview-top { grid-template-columns: minmax(0, 1fr); }
  .st-who { display: none; }
}
@media (max-width: 700px) {
  .st-top-inner { flex-wrap: wrap; padding: 8px 16px 0; gap: 4px 12px; }
  .st-brand { order: 0; }
  .st-top-end { order: 1; margin-left: auto; }
  .st-nav { order: 2; flex-basis: 100%; margin: 0 -16px; padding: 2px 12px 8px; }
  .st-main { padding: 20px 16px 48px; }
  .st-msg-user { margin-left: 0; }
  .st-msg-noa { margin-right: 0; }
  .st-item-head { flex-wrap: wrap; }
  .st-item-title { flex-basis: 100%; order: 3; }
  .st-item-time { margin-left: auto; }
}
