.threads-studio { --ts-ink: var(--text); --ts-muted: var(--text-muted); --ts-canvas: var(--surface-muted); --ts-paper: var(--surface); --ts-line: var(--border); --ts-moss: #166534; --ts-moss-dark: #14532d; --ts-moss-soft: var(--success-soft); --ts-amber: var(--attention); --ts-amber-soft: var(--attention-soft); --ts-red: var(--danger); --ts-red-soft: var(--danger-soft); --ts-blue: var(--focus); min-width: 0; color: var(--ts-ink); }
.threads-studio *, .threads-studio *::before, .threads-studio *::after { box-sizing: border-box; }
.threads-studio button, .threads-studio input, .threads-studio select, .threads-studio textarea { font: inherit; }
.threads-studio button, .threads-studio a, .threads-studio select { touch-action: manipulation; }
.threads-studio :focus-visible { outline: 3px solid var(--ts-blue); outline-offset: 3px; }
.threads-studio-shell { display: grid; gap: 18px; }
.threads-studio-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: end; }
.threads-studio h1, .threads-studio h2, .threads-studio h3, .threads-studio p { margin-top: 0; }
.threads-studio h1 { max-width: 760px; margin-bottom: 0; font-size: clamp(30px, 4vw, 46px); line-height: 1.12; letter-spacing: -.035em; }
.threads-studio h2 { margin-bottom: 6px; font-size: clamp(24px, 3vw, 32px); line-height: 1.15; letter-spacing: -.02em; }
.threads-studio h3 { margin-bottom: 6px; font-size: 18px; line-height: 1.3; }
.ts-eyebrow { margin: 0 0 7px; color: var(--ts-moss-dark); font-size: 12px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.ts-lead { max-width: 720px; margin: 10px 0 0; color: var(--ts-muted); font-size: 16px; }
.ts-provider { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--ts-line); border-radius: 12px; background: var(--ts-paper); }
.ts-provider strong, .ts-provider small { display: block; }
.ts-provider small { color: var(--ts-muted); font-size: 12px; }
.ts-status-dot { flex: 0 0 9px; width: 9px; height: 9px; border-radius: 99px; background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.14); }
.ts-banner { padding: 12px 16px; border: 1px solid #bbefcd; border-radius: 12px; background: var(--ts-moss-soft); color: var(--ts-moss-dark); }
.ts-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 5px; border: 1px solid var(--ts-line); border-radius: 14px; background: var(--ts-paper); scrollbar-width: thin; }
.ts-tabs button { flex: 0 0 auto; min-height: 44px; border: 0; border-radius: 10px; padding: 8px 14px; background: transparent; color: var(--ts-muted); cursor: pointer; font-weight: 750; }
.ts-tabs button:hover { background: var(--ts-canvas); color: var(--ts-ink); }
.ts-tabs button[aria-selected="true"] { background: var(--primary); color: var(--surface); }
.ts-count { display: inline-flex; min-width: 24px; justify-content: center; margin-left: 4px; padding: 1px 7px; border-radius: 99px; background: rgba(255,255,255,.16); font-size: 12px; }
.ts-page-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: end; margin-bottom: 22px; }
.ts-pill, .ts-tag { display: inline-flex; align-items: center; border-radius: 99px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.ts-pill { min-height: 34px; padding: 5px 11px; background: var(--ts-moss-soft); color: var(--ts-moss-dark); }
.ts-tag { min-height: 28px; padding: 3px 9px; background: var(--ts-canvas); color: var(--ts-muted); font-size: 11px; }
.ts-tag-ready, .ts-tag-succeeded, .ts-tag-done, .ts-tag-draft, .ts-tag-approved { background: var(--ts-moss-soft); color: var(--ts-moss-dark); }
.ts-tag-archived { background: var(--ts-canvas); color: var(--ts-muted); }
.ts-tag-processing, .ts-tag-generating, .ts-tag-validating, .ts-tag-partial { background: var(--ts-amber-soft); color: var(--ts-amber); }
.ts-tag-error, .ts-tag-failed { background: var(--ts-red-soft); color: var(--ts-red); }
.ts-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: 18px; align-items: start; }
.ts-stack, .ts-list { display: grid; gap: 14px; }
.ts-card { min-width: 0; overflow: hidden; border: 1px solid var(--ts-line); border-radius: var(--radius-md); background: var(--ts-paper); box-shadow: 0 1px 2px rgba(26,32,55,.03); }
.ts-card-body { padding: 20px; }
.ts-card p:last-child { margin-bottom: 0; }
.ts-muted { color: var(--ts-muted); }
.ts-form { display: grid; gap: 16px; }
.ts-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.ts-field { display: grid; gap: 6px; color: var(--ts-muted); font-size: 13px; font-weight: 750; }
.ts-field-wide { grid-column: 1 / -1; }
.ts-field input, .ts-field select, .ts-field textarea { width: 100%; min-height: 44px; border: 1px solid #cbd2c5; border-radius: 11px; padding: 10px 12px; background: var(--surface); color: var(--ts-ink); }
.ts-field textarea { min-height: 150px; resize: vertical; line-height: 1.55; }
.ts-field input:focus, .ts-field select:focus, .ts-field textarea:focus { border-color: var(--ts-moss); }
.ts-hint { color: var(--ts-muted); font-size: 12px; font-weight: 500; }
.ts-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.ts-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border: 1px solid transparent; border-radius: 11px; padding: 10px 15px; cursor: pointer; font-weight: 800; text-decoration: none; }
.ts-button-primary { background: var(--ts-moss); color: white; }
.ts-button-primary:hover { background: var(--ts-moss-dark); }
.ts-button-secondary { border-color: var(--ts-line); background: var(--surface); color: var(--ts-ink); }
.ts-button-secondary:hover { background: var(--ts-canvas); }
.ts-button-danger { border-color: #edc8c4; background: var(--ts-red-soft); color: var(--ts-red); }
.ts-button:disabled { cursor: wait; opacity: .6; }
.ts-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 15px; border: 1px solid var(--ts-line); border-radius: 13px; background: var(--surface); }
.ts-source-open { min-width: 0; display: block; border: 0; padding: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.ts-source-open strong, .ts-source-open > span { display: block; }.ts-source-open > span { margin-top: 3px; color: var(--ts-muted); font-size: 12px; }
.ts-source-open:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.ts-row-title { min-width: 0; }
.ts-row-title strong, .ts-row-title span { display: block; }
.ts-row-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-row-title span { margin-top: 3px; color: var(--ts-muted); font-size: 12px; }
.ts-meta, .ts-flow-preview { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.ts-empty { padding: 32px 20px; border: 1px dashed #bdc7b6; border-radius: 14px; background: #fbfcf8; text-align: center; }
.ts-empty strong { display: block; font-size: 17px; }
.ts-empty p { max-width: 460px; margin: 7px auto 0; color: var(--ts-muted); }
.ts-state-card { min-height: 260px; display: grid; place-items: center; align-content: center; gap: 8px; padding: 40px; border: 1px solid var(--ts-line); border-radius: var(--radius-md); background: var(--ts-paper); text-align: center; }
.ts-state-card p { max-width: 540px; margin-bottom: 0; color: var(--ts-muted); }
.ts-state-error { border-color: #edc8c4; background: var(--ts-red-soft); }
.ts-loader { width: 34px; height: 34px; border: 3px solid var(--ts-line); border-top-color: var(--ts-moss); border-radius: 99px; animation: ts-spin .8s linear infinite; }
.ts-draft-body, .ts-source-content { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.7; }
.ts-source-content { margin: 14px 0; }
.ts-compare, .ts-technical { margin-top: 13px; padding: 11px 13px; border: 1px solid var(--ts-line); border-radius: 11px; background: var(--ts-canvas); }
.ts-compare summary, .ts-technical summary { cursor: pointer; color: var(--ts-muted); font-weight: 750; }.ts-compare p, .ts-technical p { overflow-wrap: anywhere; }.ts-technical { font-size: 12px; }.ts-technical code { font-size: 11px; }
.ts-provenance { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; padding: 14px; border-radius: 12px; background: var(--ts-canvas); }
.ts-provenance div { min-width: 0; }.ts-provenance span, .ts-provenance strong { display: block; }.ts-provenance span { color: var(--ts-muted); font-size: 11px; }.ts-provenance strong { overflow-wrap: anywhere; font: 650 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; }
.ts-framework-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }.ts-framework-card { display: grid; gap: 12px; }.ts-framework-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }.ts-rule { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--ts-line); }.ts-rule:last-child { border-bottom: 0; }
.ts-run-rail { display: grid; }.ts-run { position: relative; padding: 4px 0 18px 28px; }.ts-run::before { content: ""; position: absolute; left: 7px; top: 12px; bottom: -2px; width: 2px; background: var(--ts-line); }.ts-run:last-child::before { display: none; }.ts-run::after { content: ""; position: absolute; left: 1px; top: 7px; width: 12px; height: 12px; border: 2px solid var(--ts-paper); border-radius: 99px; background: var(--ts-moss); box-shadow: 0 0 0 1px var(--ts-line); }.ts-run dl { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; margin: 10px 0 0; }.ts-run dt { color: var(--ts-muted); font-size: 11px; }.ts-run dd { margin: 2px 0 0; overflow-wrap: anywhere; font: 650 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.ts-generating { position: relative; overflow: hidden; }.ts-generating::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(216,239,159,.35), transparent); animation: ts-shimmer 1.4s infinite; }.ts-spaced { margin-top: 18px; }.ts-spaced-sm { margin-top: 15px; }.ts-top-gap { margin-top: 10px; }
@keyframes ts-spin { to { transform: rotate(360deg); } } @keyframes ts-shimmer { to { transform: translateX(100%); } }
@media (max-width: 1024px) { .ts-grid { grid-template-columns: 1fr; } }
@media (max-width: 768px) { .threads-studio-header, .ts-page-head { grid-template-columns: 1fr; }.ts-provider { justify-self: start; }.ts-framework-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .ts-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }.ts-tabs button { min-width: 0; white-space: normal; }.ts-form-grid, .ts-provenance { grid-template-columns: 1fr; }.ts-row { grid-template-columns: 1fr; }.ts-row .ts-button, .ts-actions .ts-button { width: 100%; }.ts-run dl { grid-template-columns: 1fr; }.ts-state-card { padding: 28px 18px; } }
@media (prefers-reduced-motion: reduce) { .threads-studio *, .threads-studio *::before, .threads-studio *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
