/* ==========================================================================
   WisenutssX free tools — shared styles (builds on css/calm.css tokens)
   ========================================================================== */

body.t-body { margin: 0; background: var(--bg-canvas, #fbfaf7); color: var(--c-ink, #131b2e); font-family: var(--font-body, Inter, system-ui, sans-serif); }
.t-body .main-viewport { padding-top: 72px; }

/* Breadcrumb + hero */
.t-crumbs { font-size: 13px; color: var(--c-ink-3); padding-top: 28px; }
.t-crumbs a { color: var(--c-ink-3); text-decoration: none; }
.t-crumbs a:hover { color: var(--c-ink); text-decoration: underline; }
.t-hero { padding: 20px 0 32px; display: flex; flex-direction: column; gap: 16px; max-width: 860px; }
.t-byline { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--c-rose-text); }
.t-title { margin: 0; font-family: var(--c-serif); font-weight: 400; font-size: clamp(36px, 5vw, 58px); line-height: 1.06; letter-spacing: -0.01em; }
.t-answer { margin: 0; font-size: 19px; line-height: 1.6; color: var(--c-ink-2); max-width: 720px; }
.t-trust { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 4px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--c-ink-3); }
.t-trust li::before { content: "✓"; color: var(--c-rose-text); font-weight: 700; margin-right: 8px; }

/* Tool app */
.t-app { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; align-items: start; margin-bottom: 72px; }
@media (max-width: 960px) { .t-app { grid-template-columns: minmax(0, 1fr); } }
.t-panel { background: #fff; border: 1px solid var(--c-line); border-radius: 20px; padding: 28px; }
@media (max-width: 640px) { .t-panel { padding: 20px; } }
.t-panel h2 { margin: 0 0 6px; font-family: var(--c-serif); font-weight: 500; font-size: 24px; }
.t-panel .t-hint { margin: 0 0 18px; font-size: 14px; color: var(--c-ink-3); }

.t-tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--bg-canvas-subtle, #f4f2ec); border-radius: 999px; margin-bottom: 20px; }
.t-tabs button { min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; font: 600 14px var(--font-body); color: var(--c-ink); cursor: pointer; }
.t-tabs button[aria-pressed="true"] { background: var(--c-ink); color: #fff; }

.t-form { display: flex; flex-direction: column; gap: 16px; }
.t-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 520px) { .t-row { grid-template-columns: minmax(0, 1fr); } }
.t-field { display: flex; flex-direction: column; gap: 6px; }
.t-field label, .t-legend { font-size: 14px; font-weight: 500; color: var(--c-ink); }
.t-field small { font-size: 12.5px; color: var(--c-ink-3); line-height: 1.45; }
.t-field input, .t-field select, .t-field textarea {
  width: 100%; box-sizing: border-box; min-height: 46px; padding: 10px 12px; border: 1px solid var(--c-line); border-radius: 10px;
  background: var(--bg-canvas, #fbfaf7); font: 400 16px var(--font-body); color: var(--c-ink);
}
.t-field textarea { min-height: 110px; resize: vertical; }
.t-field input:focus, .t-field select:focus, .t-field textarea:focus { outline: none; border-color: var(--c-ink); box-shadow: 0 0 0 3px rgba(19,27,46,.08); }
.t-field input[aria-invalid="true"] { border-color: var(--c-rose); }
.t-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--c-ink-2); line-height: 1.5; }
.t-check input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--c-ink); }
fieldset.t-fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.t-options { display: flex; flex-wrap: wrap; gap: 8px; }
.t-chip { position: relative; }
.t-chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.t-chip span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--c-line); border-radius: 999px; font-size: 14px; background: #fff; }
.t-chip input:checked + span { background: var(--c-ink); color: #fff; border-color: var(--c-ink); }
.t-chip input:focus-visible + span { outline: 2px solid var(--c-rose); outline-offset: 2px; }

.t-error { color: #8a0028; background: #fff0f2; border: 1px solid #ffd0d8; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.t-note { font-size: 13px; color: var(--c-ink-3); }

/* Results */
.t-result-empty { color: var(--c-ink-3); font-size: 15px; display: flex; flex-direction: column; gap: 8px; min-height: 160px; justify-content: center; }
.t-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.t-figure { background: var(--bg-canvas-subtle, #f4f2ec); border: 1px solid var(--c-line); border-radius: 14px; padding: 16px; }
.t-figure .t-fig-label { font-size: 13px; color: var(--c-ink-3); }
.t-figure .t-fig-value { font-family: var(--c-serif); font-size: 30px; line-height: 1.15; margin-top: 4px; color: var(--c-ink); }
.t-figure.is-main { background: var(--c-ink); border-color: var(--c-ink); }
.t-figure.is-main .t-fig-label { color: #c9cfe0; }
.t-figure.is-main .t-fig-value { color: #fff; }
.t-table-wrap { overflow-x: auto; border: 1px solid var(--c-line); border-radius: 12px; margin: 8px 0 16px; }
.t-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.t-table th, .t-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--c-line); vertical-align: top; }
.t-table th { background: var(--bg-canvas-subtle, #f4f2ec); font-weight: 600; font-size: 13px; color: var(--c-ink); }
.t-table td.num, .t-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t-table tr:last-child td { border-bottom: 0; }
.t-table tr.is-total td { font-weight: 600; background: #fdfcf9; }
.t-warn { border-left: 3px solid #c47a00; background: #fff8ec; padding: 10px 12px; border-radius: 0 10px 10px 0; font-size: 14px; color: #5c3b00; margin: 8px 0; }
.t-basis { font-size: 12.5px; color: var(--c-ink-3); line-height: 1.5; margin: 12px 0 0; }
.t-basis a { color: var(--c-ink-3); }

.t-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--c-line); }
.t-lock { font-size: 13px; color: var(--c-ink-3); }

/* Product card */
.t-product { margin-top: 20px; border: 1px solid var(--c-rose); border-radius: 16px; padding: 18px 20px; display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; background: #fff; }
.t-product .t-p-status { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--c-rose-text); }
.t-product .t-p-name { font-family: var(--c-serif); font-size: 21px; margin: 2px 0; }
.t-product .t-p-line { font-size: 14px; color: var(--c-ink-2); max-width: 520px; }

/* Explainer */
.t-explainer { max-width: 760px; padding-bottom: 80px; }
.t-explainer h2 { font-family: var(--c-serif); font-weight: 400; font-size: 34px; margin: 56px 0 14px; line-height: 1.15; }
.t-explainer h3 { font-family: var(--c-serif); font-weight: 500; font-size: 22px; margin: 28px 0 8px; }
.t-explainer p, .t-explainer li { font-size: 17px; line-height: 1.7; color: var(--c-ink-2); }
.t-explainer .t-formula { font-family: var(--c-serif); font-size: 20px; background: #fff; border: 1px solid var(--c-line); border-radius: 12px; padding: 16px 20px; color: var(--c-ink); }
.t-faq details { border-top: 1px solid var(--c-line); padding: 16px 0; }
.t-faq details:last-child { border-bottom: 1px solid var(--c-line); }
.t-faq summary { cursor: pointer; font-weight: 600; font-size: 17px; color: var(--c-ink); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.t-faq summary::after { content: "+"; font-weight: 400; font-size: 22px; line-height: 1; color: var(--c-ink-3); }
.t-faq details[open] summary::after { content: "−"; }
.t-faq details p { margin: 10px 0 0; }
.t-checked { font-size: 14px; color: var(--c-ink-3); }

/* Hub cards */
.t-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; padding-bottom: 80px; }
.t-card { display: flex; flex-direction: column; gap: 10px; padding: 26px; background: #fff; border: 1px solid var(--c-line); border-radius: 20px; text-decoration: none; color: var(--c-ink); transition: border-color .3s ease, transform .4s var(--c-ease); }
.t-card:hover { border-color: #cfcabd; transform: translateY(-2px); }
.t-card h2, .t-card h3 { margin: 0; font-family: var(--c-serif); font-weight: 500; font-size: 24px; }
.t-card p { margin: 0; color: var(--c-ink-2); line-height: 1.55; }
.t-card .t-meta { margin-top: auto; padding-top: 8px; font-size: 13px; color: var(--c-ink-3); display: flex; justify-content: space-between; }

/* Gate modal */
.t-modal[hidden] { display: none; }
.t-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(19, 27, 46, 0.45); }
.t-dialog { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto; background: #fff; border-radius: 20px; padding: 28px; box-shadow: 0 24px 60px rgba(19,27,46,.25); position: relative; }
.t-dialog h2 { margin: 0 0 6px; font-family: var(--c-serif); font-weight: 500; font-size: 26px; }
.t-dialog > p { margin: 0 0 18px; color: var(--c-ink-2); font-size: 15px; line-height: 1.55; }
.t-close { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border: 0; background: transparent; font-size: 26px; cursor: pointer; color: var(--c-ink-3); border-radius: 999px; }
.t-close:hover { background: var(--bg-canvas-subtle); color: var(--c-ink); }
.t-code-input { font-size: 28px !important; letter-spacing: 10px; text-align: center; font-family: var(--c-serif) !important; }
.t-success { display: flex; flex-direction: column; gap: 10px; }

/* Small helpers */
.t-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.t-spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: tSpin .8s linear infinite; vertical-align: -3px; }
@keyframes tSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .t-spinner { animation-duration: 2s; } }

/* Standalone pages (tools, products) load calm.css without the legacy style.css */
.t-body .site-header { position: fixed; top: 0; left: 0; width: 100%; z-index: 100; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.t-body *, .t-body *::before, .t-body *::after { box-sizing: border-box; }
.t-body img { max-width: 100%; }
.t-body .c-nav a.is-current { border-bottom-color: var(--c-ink); }
.t-body [hidden] { display: none !important; }
.t-dialog a, .t-explainer a, .t-panel a:not(.c-btn) { color: var(--c-rose-text); }
.t-panel code, .t-explainer code { font-size: 0.92em; background: var(--bg-canvas-subtle); padding: 1px 5px; border-radius: 4px; }
