/* Tool pages (templates/tool_page.html, all 252 tools) and the React tool interface (#tool-interface).
   The React markup keeps its existing classes; this file gives them the new look. */

/* Intro tile */
.tc-intro__icon .tc-ico3d { width: 64px; height: 64px; }
.tc-intro__icon .tc-ico3d__badge { font-size: 10px; padding: 3px 5px; }

/* Numbered mastheads: the section number comes from a CSS counter so optional sections keep the order */
.tc-sections { counter-reset: tc-sec; }
.tc-sections .tc-masthead { counter-increment: tc-sec; }
.tc-sections .tc-masthead .n::before { content: counter(tc-sec, decimal-leading-zero) " / "; }

/* Workspace frame (P4) */
.tc-workspace__frame { padding: 0; }
.tc-workspace__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--border); font-family: var(--tc-mono); font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
.tc-workspace__top > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.tc-workspace__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.tc-workspace__name { max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px 9px; border: 1px solid var(--border); border-radius: 20px; background: var(--tc-surface); font-family: var(--tc-font); font-size: 10px; font-weight: 600; letter-spacing: 0; text-transform: none; color: #6b7280; }
.tc-workspace__inner { max-width: 820px; margin: 0 auto; padding: 40px 24px 36px; background: radial-gradient(ellipse 70% 60% at 50% 0, var(--tc-blue-50), transparent); }
.tc-toolpage #tool-interface { font-size: 14px; }

/* Panels inside the instrument become flat sections; the frame tile is the card */
#tool-interface .tc-panel, .tc-workspace .tc-panel { background: transparent; border: 0; box-shadow: none; border-radius: 0; padding: 0; }
#tool-interface .tc-options { margin: 24px 0 0; padding: 20px 0 0; border-top: 1px solid var(--tc-line); }
.tc-options__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 20px; }

/* Dropzone (P4) */
.tc-drop { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 36px 24px; text-align: center; background: #fff; border: 2px dashed #c3ccd9; border-radius: 16px; box-shadow: 0 0 0 10px rgba(38,114,196,.04), 0 24px 45px -20px rgba(28,64,108,.2); cursor: pointer; transition: border-color .2s, background .2s, box-shadow .2s; }
.tc-drop:hover, .tc-drop:focus-visible, .tc-drop:focus-within, .tc-drop.is-dragover { border-color: var(--tc-blue-600); background: #f5faff; box-shadow: 0 0 0 10px rgba(38,114,196,.15), 0 24px 45px -20px rgba(28,64,108,.27); }
.tc-drop:focus-visible { outline: none; }
.tc-drop__icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 0 4px; border-radius: 16px; background: var(--tc-blue-50); color: var(--tc-blue-600); transition: transform .2s; }
.tc-drop__icon img { width: 44px; height: 44px; }
.tc-drop__icon svg { width: 28px; height: 28px; }
.tc-drop.is-dragover .tc-drop__icon { transform: translateY(-4px); }
.tc-drop__title { margin: 4px 0 0; font-size: 22px; font-weight: 800; letter-spacing: -.035em; color: var(--tc-text); }
.tc-drop__sub { margin: 0 0 8px; font-size: 13px; color: #6b7280; }
.tc-drop__hint { margin: 6px 0 0; font-size: 11px; color: var(--tc-faint); }
@media (max-width: 640px) { .tc-workspace__inner { padding: 28px 14px 24px; } .tc-workspace__top { padding: 12px 16px; } .tc-drop { padding: 28px 16px; } .tc-drop__title { font-size: 19px; } }

/* Legacy button names used by the React UI, mapped onto the new buttons */
.tc-btn-primary { background: var(--tc-blue-600); border-color: var(--tc-blue-600); color: #fff; }
.tc-btn-primary:hover { background: var(--tc-blue-700); border-color: var(--tc-blue-700); color: #fff; }
.tc-btn-secondary { background: #fff; color: var(--tc-blue-600); border-color: var(--tc-line-strong); }
.tc-btn-secondary:hover { background: var(--tc-blue-50); border-color: var(--tc-blue-600); }
.tc-btn-secondary::after, .tc-btn-ghost::after { display: none; }
.tc-btn-ghost { background: transparent; border-color: transparent; color: var(--tc-blue-600); }
.tc-btn-ghost:hover { background: var(--tc-blue-50); }
.tc-btn-lg { min-height: 48px; padding: 0 22px; font-size: 14px; }
.tc-btn-sm { min-height: 34px; padding: 0 12px; font-size: 12px; }
.tc-process { display: flex; width: auto; min-width: 200px; min-height: 48px; margin: 28px auto 0; padding: 0 28px; font-size: 14px; }
#tool-interface .btn { border-radius: var(--tc-radius); min-height: 44px; font-size: 13px; }
#tool-interface .btn-primary { background: var(--tc-blue-600); }
#tool-interface .btn-primary:hover { background: var(--tc-blue-700); }

/* File queue */
.tc-file-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--tc-line); border-radius: 12px; background: #fff; }
.tc-file-row .tc-ico { width: 36px; height: 36px; flex: none; }
.tc-icon-btn { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--tc-faint); }
.tc-icon-btn:hover { background: var(--tc-surface); color: var(--tc-text); }

/* Form controls inside the instrument */
#tool-interface .tc-label, #tool-interface .label { display: block; margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--tc-muted); }
#tool-interface :is(.tc-input, .tc-select, .input, .select) { min-height: 42px; border-radius: 10px; border-color: var(--tc-line-strong); font-size: 13px; }
#tool-interface :is(.tc-textarea, .textarea) { border-radius: 12px; border-color: var(--tc-line-strong); font-size: 13px; box-shadow: 0 0 0 10px rgba(38,114,196,.04), 0 24px 45px -24px rgba(28,64,108,.2); }
#tool-interface :is(.tc-input, .tc-select, .tc-textarea, .input, .select, .textarea):focus { border-color: var(--tc-blue-600); box-shadow: 0 0 0 3px rgba(97,172,227,.45); outline: none; }
.tc-segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--tc-line); border-radius: 999px; background: var(--surface-2); }
.tc-segmented__button { padding: 8px 14px; border: 1px solid transparent; border-radius: 999px; background: none; font-size: 12px; font-weight: 500; color: var(--tc-muted); transition: background .2s, color .15s, border-color .2s; }
.tc-segmented__button:hover { color: var(--tc-text); }
.tc-segmented__button.is-active { background: #fff; border-color: var(--tc-line-strong); color: var(--tc-text); font-weight: 600; box-shadow: var(--tc-shadow-card); }
.tc-chip { border-radius: 999px; }
.tc-chip.is-active { background: #fff; border-color: var(--tc-line-strong); color: var(--tc-text); }
.tc-badge--brand { background: var(--tc-blue-50); color: var(--tc-blue-700); }
#tool-interface .progress { height: 6px; border-radius: 6px; background: var(--tc-line); }
#tool-interface .progress-bar { border-radius: 6px; }
#tool-interface .card { border-radius: 12px; border-color: var(--tc-line); box-shadow: none; }

/* Overview, steps, use cases, formats, why */
.tc-overview { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(0,1fr); gap: 32px; align-items: center; padding: 36px 32px; }
.tc-overview__art, .tc-why__art { min-width: 0; display: grid; place-items: center; }
.tc-overview__art .tc-scene, .tc-why__art .tc-scene { max-width: 420px; height: 360px; }
.tc-steps-grid { margin: 0; padding: 0; list-style: none; }
.tc-card__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tc-card__top img { width: 52px; height: 52px; }
.tc-card--use > svg { width: 18px; height: 18px; color: var(--accent); }
.tc-format-note h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 15px; }
.tc-format__badge { padding: 4px 7px; border-radius: 6px; background: var(--tc-blue-600); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.tc-why { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); gap: 32px; align-items: center; padding: 36px 32px; }
.tc-why h2 { margin: 12px 0; font-size: 28px; }
.tc-why > div > p { margin-bottom: 14px; font-size: 14px; line-height: 1.8; color: var(--muted); }
.tc-related { padding: 0; }
.tc-related .tc-tools { border-top: 0; margin-right: -1px; margin-bottom: -1px; }
@media (max-width: 760px) {
  .tc-overview, .tc-why { grid-template-columns: 1fr; padding: 28px 20px; }
  .tc-overview__art .tc-scene, .tc-why__art .tc-scene { height: 320px; }
}
