/* Design-system components for web pages (Setup, Your prompts, Referrals).
 *
 * Copied unchanged from the tinker design system, components/bundle.css:
 * the Sidebar block (.tk-side, .tk-row, .tk-iconbtn), the Sign in block
 * (.tk-modal, .tk-signin, .tk-phone, .tk-begin, .tk-or, .tk-alt,
 * .tk-digits, .tk-textlink), and the web page blocks: Page head
 * (.tk-head, .tk-eyebrow, .tk-title, .tk-lede, .tk-status), Tool list
 * (.tk-tools, .tk-tool, .tk-pill, .tk-steps, .tk-note), Copy field
 * (.tk-copy), Fine print (.tk-fine, .tk-quietlink), Prompt list
 * (.tk-plist), Filter bar (.tk-filters, .tk-chip) and Summary (.tk-summary). Values come from styles.css + design-tokens.css.
 * Pages position these (drawer, fixed scrim); they don't restyle them.
 */

/* Sidebar */
.tk-side { width: var(--sidebar-width); box-sizing: border-box; display: flex; flex-direction: column; gap: 12px; padding: 20px 16px 6px;
  background: linear-gradient(180deg, var(--color-background), var(--color-parchment)); border-right: 1px solid var(--color-border); }
.tk-side__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tk-side__brand { display: inline-flex; align-items: center; gap: 9px; padding: 0 4px; font: 400 16px/1 var(--font-display);
  font-variation-settings: "SOFT" 100, "WONK" 0, "opsz" 144; color: var(--color-ink); }
.tk-iconbtn { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: var(--radius-icon); background: transparent; color: var(--color-foreground); }
.tk-folder { display: flex; align-items: center; gap: 7px; min-height: 40px; padding: 6px 10px; font: 400 13px/1.35 var(--font-mono); color: var(--color-muted, #6f6a65); }
.tk-folder svg path { fill: #efe2cc; stroke: #cdb995; stroke-width: 1.2; }
.tk-folder.is-current { color: var(--color-foreground); }
.tk-row { display: flex; align-items: center; gap: 9px; min-height: 44px; box-sizing: border-box; padding: 10px 9px 10px 10px; border: 1px solid transparent;
  border-radius: var(--radius-chip); font: 400 15px/1.35 var(--font-sans); color: var(--color-foreground); }
.tk-row.is-hover { background: rgba(255,255,255,.55); }
.tk-row[aria-current="page"] { background: var(--color-surface); border-color: var(--color-border); box-shadow: var(--shadow-card); }
.tk-row[aria-current="page"] svg { color: var(--color-forest); }
.tk-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-side__bottom { margin-top: auto; display: flex; justify-content: flex-end; padding: 8px 4px 12px; }
.tk-new { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--color-border); border-radius: 50%; background: #fff;
  color: var(--color-foreground); box-shadow: 0 1px 2px rgba(28,25,23,.05); }

/* Sign in: phone first, GitHub second, as a modal over the page it unlocks.
 * .tk-modal is the scrim; --sheet docks the card to the bottom on phones. */
.tk-modal { position: absolute; inset: 0; z-index: 20; box-sizing: border-box; display: flex; align-items: flex-start; justify-content: center;
  padding: 120px 16px 16px; background: rgba(45,42,38,.32); }
.tk-modal--sheet { align-items: flex-end; padding: 0; }
.tk-signin { position: relative; width: 100%; max-width: 440px; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 36px 28px 28px; border-radius: 20px; background: var(--color-background); text-align: center; font-family: var(--font-sans); color: var(--color-foreground);
  box-shadow: 0 24px 64px rgba(45,42,38,.22), 0 2px 6px rgba(45,42,38,.08); }
.tk-modal--sheet .tk-signin { max-width: none; padding: 28px 16px 28px; border-radius: 20px 20px 0 0; }
.tk-modal--sheet .tk-signin::before { content: ""; position: absolute; top: 8px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--color-border); }
.tk-signin__mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 12px; background: var(--color-cream); }
.tk-signin h2 { margin: 0; font: 700 26px/1.2 var(--font-display); letter-spacing: -0.02em; color: var(--color-foreground); }
.tk-signin p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--color-muted); }
.tk-signin p strong { font-weight: 600; color: var(--color-foreground); }
.tk-phone { display: flex; align-items: center; gap: 8px; width: 100%; box-sizing: border-box; padding: 6px; border: 1px solid var(--color-border);
  border-radius: 24px; background: var(--color-surface); box-shadow: var(--shadow-soft); }
.tk-phone__cc { padding-left: 14px; font-size: 16px; color: var(--color-muted); }
.tk-phone__num { flex: 1; min-width: 0; text-align: left; font-size: 16px; color: var(--color-foreground); }
.tk-modal--sheet .tk-phone { flex-wrap: wrap; border-radius: 20px; }
.tk-modal--sheet .tk-phone__num { padding: 10px 0; }
.tk-modal--sheet .tk-phone .tk-begin { width: 100%; }
.tk-begin { min-height: 44px; padding: 0 22px; border: 0; border-radius: 22px; background: var(--color-accent-strong); color: #fff; font: 600 15px var(--font-sans); box-shadow: var(--shadow-purple); }
/* The phone pill's number is the real input. */
.tk-phone__num { min-height: 44px; padding: 0; border: 0; outline: none; background: transparent; font-family: inherit; }
.tk-phone__num::placeholder { color: var(--color-muted); }
.tk-phone:focus-within { border-color: var(--color-accent-strong); box-shadow: var(--focus-ring); }
.tk-begin--wide { width: 100%; min-height: 48px; border-radius: 24px; }
.tk-or { display: flex; align-items: center; gap: 12px; width: 100%; font-size: 13px; color: var(--color-muted); }
.tk-or::before, .tk-or::after { content: ""; flex: 1; height: 1px; background: var(--color-border); }
.tk-alt { width: 100%; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--color-border);
  border-radius: 24px; background: var(--color-surface); color: var(--color-foreground); font: 600 15px var(--font-sans); }
/* The texted code: one box per digit over a single one-time-code input. */
.tk-digits { display: flex; justify-content: center; gap: 8px; width: 100%; }
.tk-digits i { flex: 1 1 0; max-width: 52px; height: 60px; display: grid; place-items: center; box-sizing: border-box; border: 1px solid var(--color-border);
  border-radius: var(--radius-card); background: var(--color-surface); box-shadow: var(--shadow-card);
  font: 500 24px/1 var(--font-sans); font-style: normal; font-variant-numeric: tabular-nums; color: var(--color-foreground); }
.tk-digits i.is-focus { border-color: var(--color-accent-strong); box-shadow: var(--focus-ring); }
.tk-digits i.is-focus::after { content: ""; width: 2px; height: 26px; border-radius: 1px; background: var(--color-accent-strong); }
.tk-textlink { min-height: 44px; padding: 0 12px; border: 0; background: transparent; color: var(--color-muted); font: 500 14px var(--font-sans); }

/* Page head: the eyebrow, Fraunces title and lede that open a web page (Setup, Your prompts). */
.tk-head { display: flex; flex-direction: column; gap: 8px; }
.tk-eyebrow { margin: 0; font: 500 12px var(--font-sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-foreground); }
.tk-title { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 36px; line-height: 1.25; letter-spacing: -0.025em; text-wrap: balance; color: var(--color-foreground); }
.tk-lede { margin: 0 0 8px; max-width: 60ch; font-size: 15px; line-height: 1.55; color: var(--color-muted); }
.tk-status { margin: 0; font-size: 14px; color: var(--color-muted); }
.tk-status--error { color: var(--color-danger, #b42318); }
@media (max-width: 560px) { .tk-title { font-size: 30px; } }

/* Tool list: a white card of tools, each a row (icon, name, status, pill button) that opens numbered steps. */
.tk-tools { overflow: hidden; border: 1px solid var(--color-border); border-radius: var(--radius-card); background: var(--color-surface);
  box-shadow: 0 1px 2px rgba(45, 42, 38, 0.04), 0 8px 24px rgba(45, 42, 38, 0.05); }
.tk-tools__head { margin: 0; display: flex; align-items: baseline; justify-content: space-between; padding: 14px 16px;
  font-size: 12px; font-weight: 500; letter-spacing: 0.025em; text-transform: uppercase; }
.tk-tools__count { text-transform: none; letter-spacing: 0; color: var(--color-muted); }
.tk-tool { border-top: 1px solid var(--color-border); }
.tk-tool__row { box-sizing: content-box; display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 8px 16px; }
.tk-tool__icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--color-cream); }
.tk-tool__icon svg { width: 24px; height: 24px; }
.tk-tool__name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tk-tool__name b { font-weight: 500; font-size: 16px; }
.tk-tool__name small { font-size: 13px; color: var(--color-muted); }
.tk-tool[data-connected="true"] .tk-tool__name small { color: var(--color-forest); }
.tk-pill { appearance: none; flex: none; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px;
  border: 1px solid var(--web-rule-soft, #e6e2d8); border-radius: 22px; background: var(--color-surface); color: var(--color-foreground);
  font: 600 15px var(--font-sans); cursor: pointer; }
.tk-pill:hover { border-color: var(--color-foreground); }
.tk-pill:disabled { opacity: 0.55; cursor: default; }
.tk-pill--primary { background: var(--color-foreground); border-color: var(--color-foreground); color: var(--color-background); }
.tk-pill--primary:hover { opacity: 0.92; }
.tk-pill:focus-visible, .tk-copy__btn:focus-visible, .tk-quietlink:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.tk-steps { margin: 0; padding: 0 16px 18px; list-style: none; counter-reset: tk-step; display: flex; flex-direction: column; gap: 14px; font-size: 14px; line-height: 1.5; }
.tk-steps li { position: relative; min-width: 0; padding-left: 54px; counter-increment: tk-step; }
/* Numbers sit in the icon column so step text lines up with the tool name. */
.tk-steps li::before { content: counter(tk-step); position: absolute; left: 8px; top: 0; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: var(--color-cream); color: var(--color-muted); font-size: 12px; font-weight: 600; line-height: 1; }
.tk-steps li > span { display: block; padding-top: 2px; margin-bottom: 8px; }
.tk-steps li:last-child > span, .tk-steps li > span:only-child { margin-bottom: 0; }
.tk-steps code { font-family: var(--font-mono); font-size: 12.5px; }
.tk-note { margin: 8px 0 0; font-size: 13px; color: var(--color-muted); }
.tk-note--error { color: var(--color-danger, #b42318); }
@media (max-width: 560px) { .tk-tool__row { gap: 12px; } .tk-steps li { padding-left: 52px; } }

/* Copy field: a value to copy and its button. Copied: indigo accent, a check and "Copied" beside it. */
.tk-copy { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 6px 6px 12px; border: 1px solid var(--web-rule, #ede5d6); border-radius: 10px; background: var(--color-parchment); }
.tk-copy code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; -webkit-text-size-adjust: none; }
.tk-copy__btn { appearance: none; flex: none; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 10px;
  background: var(--color-surface); color: var(--color-foreground); cursor: pointer; }
.tk-copy__btn[data-copied="true"] { background: var(--color-accent-dim); color: var(--color-accent-press); }
.tk-copy__done { flex: none; font: 600 13px var(--font-sans); color: var(--color-accent-press); white-space: nowrap; }
.tk-copy__done--hint { font-weight: 500; color: var(--color-muted); }

/* Fine print and quiet links: one muted 13px line; actions in it are underlined text, never buttons. */
.tk-fine { margin: 0; font: 400 13px/1.5 var(--font-sans); color: var(--color-muted); }
.tk-fine b { font-weight: 600; color: var(--color-foreground); }
.tk-quietlink { padding: 0; border: 0; background: none; font: inherit; color: var(--color-foreground);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.tk-quietlink:disabled { opacity: 0.5; cursor: default; }

/* Prompt list: prompts in sessions, word for word in order. Each session: title, "time · sources · Word for word, in order", rows. */
.tk-plist { display: flex; flex-direction: column; gap: 56px; }
.tk-plist__session > .tk-title { margin-top: 10px; }
.tk-plist__session + .tk-plist__session > .tk-title { margin-top: 0; font-size: 28px; }
.tk-plist__sub { margin: 12px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 14px; color: var(--color-muted); }
.tk-plist__sub a { color: var(--color-accent-press); }
.tk-plist__sub .tk-plist__marks svg { width: 14px; height: 14px; }
.tk-plist__dot { color: var(--color-muted); }
.tk-plist__items { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-direction: column; }
.tk-plist__item { display: flex; flex-direction: column; gap: 8px; padding: 18px 0; border-top: 1px solid var(--color-border); }
.tk-plist__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; font-size: 13px; color: var(--color-muted); }
.tk-plist__marks { display: inline-flex; align-items: center; gap: 4px; }
.tk-plist__marks svg { display: block; }
.tk-plist__source { color: var(--color-foreground); }
.tk-plist__repo { min-width: 0; overflow-wrap: anywhere; font: 12px var(--font-mono); }
/* Delete: quiet text at the end of the meta row; a 32px target that doesn't make the row taller. On a mouse it shows on hover or focus. */
.tk-plist__delete { margin: -8px 0 -8px auto; min-height: 32px; padding: 0 4px; border: 0; background: none; font: 500 13px var(--font-sans); color: var(--color-muted); cursor: pointer; }
.tk-plist__delete:hover { color: var(--color-danger, #b42318); text-decoration: underline; text-underline-offset: 3px; }
.tk-plist__delete:disabled { opacity: 0.5; cursor: default; }
@media (hover: hover) {
  .tk-plist__delete { opacity: 0; }
  .tk-plist__item:hover .tk-plist__delete, .tk-plist__delete:focus-visible { opacity: 1; }
}
.tk-plist__text { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 19px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--color-foreground); }
.tk-plist__quoted { font-size: 13px; color: var(--color-muted); }
.tk-plist__foot { margin-top: 4px; padding-top: 18px; border-top: 1px solid var(--color-border); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.tk-plist__foot .tk-quietlink { min-height: 32px; }
@media (max-width: 560px) { .tk-plist__text { font-size: 18px; } }

/* Choice list (OpenPR options, Dictation in Tinker): options as text rows;
 * the picked one sits on parchment with a forest check. */
.tk-opts { display: flex; flex-direction: column; margin-top: 2px; }
.tk-opts[hidden] { display: none; }
.tk-opt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; box-sizing: border-box; padding: 8px 10px; border: 0; border-radius: 7px;
  background: none; text-align: left; font: 500 14px/1.35 var(--font-sans); color: var(--color-foreground); cursor: pointer; }
.tk-opt > span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tk-opt:hover, .tk-opt:focus-visible { outline: none; background: var(--color-parchment); }
.tk-opt[aria-checked="true"] { background: var(--color-parchment); }
.tk-opt[aria-checked="true"]::after { content: ""; flex: none; width: 12px; height: 7px; margin: 0 4px 3px 0; border-left: 2px solid var(--color-forest); border-bottom: 2px solid var(--color-forest); transform: rotate(-45deg); }
.tk-opt small { font-weight: 400; font-size: 12px; line-height: 1.45; color: var(--color-muted, #6f6a65); }
.tk-opt small.is-connected { color: var(--color-forest); }
.tk-opt__icon { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--color-cream); font-style: normal; }

/* Filter bar: what the prompt list shows. "Filter by", source chips that
 * toggle (each with its mark), menus for repo and time, then the count and
 * Summarize at the end. Two rows: sources, then menus. Picked chips sit on
 * parchment in forest. */
.tk-filters { display: flex; flex-direction: column; gap: 8px; }
.tk-filters__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tk-filters__label { margin-right: 2px; font: 500 13px var(--font-sans); color: var(--color-muted); }
.tk-chip { appearance: none; box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--web-rule-soft, #e6e2d8); border-radius: 22px; background: var(--color-surface); color: var(--color-foreground); font: 500 14px var(--font-sans); cursor: pointer; }
.tk-chip:hover { border-color: var(--color-foreground); }
.tk-chip[aria-pressed="true"] { border-color: var(--web-rule, #ede5d6); background: var(--color-parchment); color: var(--color-forest); }
.tk-chip svg { flex: none; display: block; }
select.tk-chip { padding-right: 34px; background-repeat: no-repeat; background-position: right 12px center; background-size: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5l3 3 3-3' stroke='%232d2a26' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
select.tk-chip.is-set { border-color: var(--web-rule, #ede5d6); background-color: var(--color-parchment); color: var(--color-forest); }
.tk-chip:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.tk-filters__end { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; }
.tk-filters__count { font-size: 13px; color: var(--color-muted); white-space: nowrap; }
@media (max-width: 560px) { .tk-filters__end { margin-left: 0; width: 100%; justify-content: space-between; } }

/* Summary: what the prompts in view are about, in a few lines, each line
 * traced to how many of them it came from. Parchment card; not saved. */
.tk-summary { display: flex; flex-direction: column; gap: 12px; padding: 20px 20px 18px; border: 1px solid var(--web-rule, #ede5d6); border-radius: var(--radius-card); background: var(--color-parchment); }
.tk-summary__head { display: flex; align-items: center; gap: 8px; margin: 0; font: 500 12px var(--font-sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-foreground); }
.tk-summary__scope { font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--color-muted); }
.tk-summary__head .tk-quietlink { margin-left: auto; min-height: 32px; font-size: 13px; letter-spacing: 0; text-transform: none; }
.tk-summary__title { margin: 0; font: 400 22px/1.35 var(--font-display); letter-spacing: -0.01em; text-wrap: balance; color: var(--color-foreground); }
.tk-summary__points { margin: 0; padding: 0 0 0 18px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.55; color: var(--color-foreground); }
.tk-summary__from { margin-left: 6px; font-size: 13px; color: var(--color-muted); white-space: nowrap; }
.tk-summary.is-loading .tk-summary__title, .tk-summary.is-loading .tk-summary__points { opacity: 0.5; }
