:root {
    --tsg-navy: #0f2942;
    --tsg-teal: #0f766e;
    --tsg-teal-soft: #ecfdf5;
    --tsg-blue-soft: #eff6ff;
    --tsg-amber: #a16207;
    --tsg-amber-soft: #fffbeb;
    --tsg-red: #b91c1c;
    --tsg-red-soft: #fef2f2;
    --tsg-slate: #475569;
    --tsg-border: #cbd5e1;
    --tsg-bg: #ffffff;
}

.tsg-suite { display: grid; gap: 32px; }
.tsg-tool { box-sizing: border-box; width: 100%; max-width: 1120px; margin: 28px auto; padding: 28px; color: #0f172a; background: var(--tsg-bg); border: 1px solid var(--tsg-border); border-radius: 20px; box-shadow: 0 14px 38px rgba(15, 41, 66, .08); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.tsg-tool *, .tsg-tool *::before, .tsg-tool *::after { box-sizing: border-box; }
.tsg-tool__header { margin-bottom: 24px; }
.tsg-tool__eyebrow { display: inline-block; margin-bottom: 8px; color: var(--tsg-teal); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.tsg-tool h2 { margin: 0 0 8px; color: var(--tsg-navy); font-size: clamp(25px, 3vw, 38px); line-height: 1.2; }
.tsg-tool__header p { max-width: 780px; margin: 0; color: var(--tsg-slate); line-height: 1.7; }
.tsg-grid { display: grid; gap: 18px; }
.tsg-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tsg-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tsg-grid--compact { gap: 12px; }
.tsg-panel { min-width: 0; margin: 0; padding: 20px; border: 1px solid var(--tsg-border); border-radius: 14px; background: #f8fafc; }
.tsg-panel legend { padding: 0 8px; color: var(--tsg-navy); font-weight: 800; }
.tsg-field { margin-bottom: 14px; }
.tsg-field:last-child { margin-bottom: 0; }
.tsg-field label { display: block; margin-bottom: 6px; color: #334155; font-size: 14px; font-weight: 700; }
.tsg-field input, .tsg-field select { width: 100%; min-height: 44px; margin: 0; padding: 9px 11px; color: #0f172a; background: #fff; border: 1px solid #94a3b8; border-radius: 8px; font-size: 16px; }
.tsg-field input:focus, .tsg-field select:focus { border-color: var(--tsg-teal); outline: 3px solid rgba(15, 118, 110, .18); outline-offset: 1px; }
.tsg-check { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0; color: #334155; line-height: 1.5; }
.tsg-check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--tsg-teal); }
.tsg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 20px; }
.tsg-button { min-height: 46px; padding: 11px 20px; color: #fff; background: var(--tsg-teal); border: 0; border-radius: 9px; font-size: 16px; font-weight: 800; cursor: pointer; }
.tsg-button:hover { filter: brightness(.94); }
.tsg-button:focus { outline: 3px solid rgba(15, 118, 110, .25); outline-offset: 2px; }
.tsg-button--secondary { margin-top: 18px; color: var(--tsg-navy); background: #e2e8f0; }
.tsg-local-note { color: #64748b; font-size: 13px; }
.tsg-result { margin-top: 22px; padding: 22px; border: 1px solid var(--tsg-border); border-radius: 15px; background: #fff; }
.tsg-result__top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.tsg-result__headline { color: var(--tsg-navy); font-size: 22px; font-weight: 850; }
.tsg-status { display: inline-flex; align-items: center; min-height: 30px; padding: 5px 10px; border-radius: 999px; font-size: 13px; font-weight: 900; }
.tsg-status--within { color: #166534; background: #dcfce7; }
.tsg-status--caution { color: var(--tsg-amber); background: var(--tsg-amber-soft); }
.tsg-status--stop { color: var(--tsg-red); background: var(--tsg-red-soft); }
.tsg-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.tsg-metric { padding: 14px; border: 1px solid #e2e8f0; border-radius: 11px; background: #f8fafc; }
.tsg-metric span { display: block; margin-bottom: 5px; color: #64748b; font-size: 12px; line-height: 1.4; }
.tsg-metric strong { display: block; color: var(--tsg-navy); font-size: 19px; overflow-wrap: anywhere; }
.tsg-reasons { margin-top: 18px; }
.tsg-reasons h3 { margin: 0 0 8px; font-size: 17px; }
.tsg-reasons ul { margin: 0; padding-left: 22px; }
.tsg-reasons li { margin: 7px 0; line-height: 1.55; }
.tsg-alert { padding: 14px; border-radius: 10px; font-weight: 700; }
.tsg-alert--stop { color: var(--tsg-red); background: var(--tsg-red-soft); }
.tsg-rule-card { padding: 28px; color: #0f172a; background: linear-gradient(135deg, #ecfdf5, #eff6ff); border: 3px solid var(--tsg-teal); border-radius: 18px; }
.tsg-rule-card__title { margin-bottom: 18px; color: var(--tsg-navy); font-size: 24px; font-weight: 900; letter-spacing: .08em; }
.tsg-rule-card ul { margin: 0; padding-left: 22px; columns: 2; column-gap: 36px; }
.tsg-rule-card li { break-inside: avoid; margin: 10px 0; line-height: 1.5; }
.tsg-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tsg-model { padding: 18px; border: 1px solid var(--tsg-border); border-radius: 14px; }
.tsg-model--primary { background: var(--tsg-teal-soft); }
.tsg-model--muted { background: #f8fafc; }
.tsg-model h3 { margin: 0 0 13px; color: var(--tsg-navy); font-size: 18px; }
.tsg-model .tsg-metric { margin-bottom: 8px; background: rgba(255,255,255,.75); }
.tsg-bar { width: 100%; height: 8px; margin-top: 8px; overflow: hidden; background: #e2e8f0; border-radius: 999px; }
.tsg-bar__fill { display: block; height: 100%; border-radius: inherit; }
.tsg-bar__fill--primary { background: var(--tsg-teal); }
.tsg-bar__fill--muted { background: #64748b; }
.tsg-table-wrap { margin-top: 18px; overflow-x: auto; }
.tsg-table { width: 100%; min-width: 520px; border-collapse: collapse; }
.tsg-table th, .tsg-table td { padding: 11px 12px; border-bottom: 1px solid #e2e8f0; text-align: left; vertical-align: top; }
.tsg-table th { color: var(--tsg-navy); background: #f1f5f9; font-size: 13px; }
.tsg-disclaimer { margin: 20px 0 0; padding-top: 16px; color: #64748b; border-top: 1px solid #e2e8f0; font-size: 12px; line-height: 1.65; }

@media (max-width: 780px) {
    .tsg-tool { padding: 19px; border-radius: 14px; }
    .tsg-grid--2, .tsg-grid--4, .tsg-comparison { grid-template-columns: 1fr; }
    .tsg-rule-card ul { columns: 1; }
}

@media print {
    .tsg-actions, .tsg-disclaimer, .tsg-tool__header, .tsg-panel { display: none !important; }
    .tsg-tool, .tsg-result { box-shadow: none; border: 0; padding: 0; }
}
