/* Online tools: calculator pages and index. Builds on the --r-* tokens in site-refine.css. */

.tl-page { background: var(--r-paper, #f5f8fb); }
.tl-main { color: var(--r-text, #1c3048); font-family: var(--r-body); }
.tl-shell { width: var(--r-shell, min(1320px, calc(100% - 40px))); margin-inline: auto; }
.tl-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Hero */
.tl-hero { padding: clamp(28px, 4vw, 48px) 0 clamp(20px, 3vw, 32px); background: linear-gradient(180deg, var(--r-mist, #eef4f9), var(--r-paper, #f5f8fb)); border-bottom: 1px solid var(--r-line, #dde6ef); }
.tl-crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 18px; padding: 0; font-size: 13px; color: var(--r-muted, #51647a); }
.tl-crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--r-dim, #b6c8da); }
.tl-crumbs a { color: var(--r-blue, #0b6fa4); text-decoration: none; }
.tl-crumbs a:hover { text-decoration: underline; }
.tl-kicker { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--r-blue, #0b6fa4); }
.tl-hero h1 { margin: 0 0 12px; font-family: var(--r-display); font-weight: 800; font-size: clamp(28px, 3.6vw, 44px); line-height: 1.1; letter-spacing: -.01em; color: var(--r-ink, #0b2545); max-width: 22ch; }
.tl-hero--index h1 { max-width: 26ch; }
.tl-answer { margin: 0; max-width: 78ch; font-size: clamp(15px, 1.25vw, 17px); line-height: 1.6; color: var(--r-text, #1c3048); }

/* App layout */
.tl-app { padding: clamp(20px, 3vw, 36px) 0; }
.tl-app-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(16px, 2vw, 28px); align-items: start; }
.tl-card { background: #fff; border: 1px solid var(--r-line-soft, rgba(11,37,69,.08)); border-radius: 14px; box-shadow: var(--r-shadow); padding: clamp(18px, 2.2vw, 28px); }
.tl-card-head h2 { margin: 0; font-family: var(--r-display); font-size: 18px; font-weight: 700; color: var(--r-ink, #0b2545); }
.tl-card-head p { margin: 4px 0 0; font-size: 13px; color: var(--r-muted, #51647a); }
.tl-card-head { margin-bottom: 18px; }
.tl-results { position: sticky; top: 96px; border-top: 4px solid var(--r-blue, #0b6fa4); }

/* Fields */
.tl-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.tl-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.tl-field[hidden] { display: none; }
.tl-field--wide { grid-column: 1 / -1; }
.tl-field > label, .tl-field > legend { font-size: 14px; font-weight: 600; color: var(--r-ink, #0b2545); line-height: 1.35; padding: 0; }
.tl-input { display: flex; align-items: stretch; border: 1px solid #c9d6e3; border-radius: 10px; background: #fff; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.tl-input:focus-within { border-color: var(--r-blue, #0b6fa4); box-shadow: 0 0 0 3px rgba(11,111,164,.15); }
.tl-input input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 11px 12px; font: 600 16px/1.2 var(--r-body); color: var(--r-ink, #0b2545); background: transparent; -moz-appearance: textfield; }
.tl-input input::-webkit-outer-spin-button, .tl-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tl-unit, .tl-unit-select { display: flex; align-items: center; padding: 0 12px; font-size: 13px; font-weight: 500; color: var(--r-muted, #51647a); background: var(--r-mist, #eef4f9); border-left: 1px solid #dbe5ee; white-space: nowrap; }
.tl-unit-select { border: 0; border-left: 1px solid #dbe5ee; font-family: var(--r-body); cursor: pointer; padding-right: 8px; }
.tl-field select:not(.tl-unit-select) { width: 100%; padding: 11px 36px 11px 12px; font: 500 15px/1.3 var(--r-body); color: var(--r-ink, #0b2545); border: 1px solid #c9d6e3; border-radius: 10px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%230b2545' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 14px center; -webkit-appearance: none; appearance: none; }
.tl-field select:focus { outline: 0; border-color: var(--r-blue, #0b6fa4); box-shadow: 0 0 0 3px rgba(11,111,164,.15); }
.tl-help { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--r-muted, #51647a); }

/* Table input */
.tl-tablewrap { overflow-x: auto; border: 1px solid #dbe5ee; border-radius: 10px; }
.tl-tablefield table { width: 100%; border-collapse: collapse; font-size: 14px; counter-reset: row; }
.tl-tablefield th { text-align: left; font-size: 12px; font-weight: 600; color: var(--r-muted, #51647a); background: var(--r-mist, #eef4f9); padding: 8px 10px; }
.tl-tablefield td { padding: 4px 6px; border-top: 1px solid #edf2f7; }
.tl-tablefield tbody tr { counter-increment: row; }
.tl-rownum::before { content: counter(row); }
.tl-tablefield td.tl-rownum { width: 32px; padding: 0 10px; font-size: 12px; color: var(--r-muted, #51647a); }
.tl-tablefield td input { width: 100%; padding: 8px; border: 1px solid transparent; border-radius: 6px; font: 600 15px var(--r-body); color: var(--r-ink, #0b2545); background: transparent; }
.tl-tablefield td input:focus { outline: 0; border-color: var(--r-blue, #0b6fa4); background: #fff; }
.tl-row-del { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--r-muted, #51647a); font-size: 18px; cursor: pointer; }
.tl-row-del:hover { background: #fdecec; color: #b42318; }
.tl-row-add { align-self: flex-start; margin-top: 8px; }

/* Buttons */
.tl-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid #edf2f7; }
.tl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 16px; border-radius: 999px; font: 600 14px var(--r-body); text-decoration: none; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.tl-btn--ghost { border: 1px solid #c9d6e3; background: #fff; color: var(--r-ink, #0b2545); }
.tl-btn--ghost:hover { border-color: var(--r-blue, #0b6fa4); color: var(--r-blue, #0b6fa4); }
.tl-btn--primary { border: 1px solid var(--r-ink, #0b2545); background: var(--r-ink, #0b2545); color: #fff !important; }
.tl-btn--primary:hover { background: var(--r-blue, #0b6fa4); border-color: var(--r-blue, #0b6fa4); }
.tl-btn:focus-visible, .tl-tile a:focus-visible, .tl-faq summary:focus-visible { outline: 3px solid rgba(11,111,164,.45); outline-offset: 2px; }

/* Results */
.tl-res-primary { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: 12px; background: var(--r-ink, #0b2545); color: #fff; }
.tl-res-label { font-size: 13px; font-weight: 500; color: var(--r-ice, #9fdcf2); }
.tl-res-value { font-family: var(--r-display); font-size: clamp(30px, 3.4vw, 40px); font-weight: 800; line-height: 1.1; letter-spacing: -.01em; overflow-wrap: anywhere; }
.tl-res-unit { margin-left: 8px; font-family: var(--r-body); font-size: 16px; font-weight: 600; color: var(--r-ice, #9fdcf2); }
.tl-res-note { font-size: 13px; color: #d6e6f2; }
.tl-res-list { margin: 14px 0 0; }
.tl-res-list > div { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 10px 2px; border-bottom: 1px solid #edf2f7; }
.tl-res-list dt { font-size: 14px; color: var(--r-muted, #51647a); }
.tl-res-list dd { margin: 0; font-size: 15px; font-weight: 700; color: var(--r-ink, #0b2545); text-align: right; white-space: nowrap; }
.tl-res-list dd span { font-weight: 500; color: var(--r-muted, #51647a); font-size: 13px; }
.tl-verdict { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; line-height: 1.45; border-left: 4px solid; }
.tl-verdict--ok { background: #ecf8f1; border-color: #1f9d55; color: #14532d; }
.tl-verdict--warn { background: #fff7e8; border-color: #d97706; color: #7c4a03; }
.tl-verdict--bad { background: #fdecec; border-color: #c62828; color: #7f1d1d; }
.tl-res-notes { margin: 14px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.5; color: var(--r-muted, #51647a); }
.tl-res-notes li + li { margin-top: 4px; }
.tl-res-error { padding: 16px; border-radius: 12px; background: #fff7e8; color: #7c4a03; font-size: 14px; border: 1px solid #f5d9a8; }
.tl-res-table { margin-top: 14px; overflow-x: auto; }
.tl-res-table table, .tl-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tl-res-table th, .tl-res-table td, .tl-table th, .tl-table td { padding: 7px 8px; text-align: right; border-bottom: 1px solid #edf2f7; }
.tl-res-table th:first-child, .tl-res-table td:first-child, .tl-table th, .tl-table td { text-align: left; }
.tl-res-table th, .tl-table th { font-weight: 600; color: var(--r-muted, #51647a); background: var(--r-mist, #eef4f9); }
.tl-res-figure { margin-top: 14px; }
.tl-tri { width: 100%; max-width: 340px; display: block; margin: 0 auto; }
.tl-tri-frame { fill: var(--r-mist, #eef4f9); stroke: var(--r-ink, #0b2545); stroke-width: 1.5; }
.tl-tri-grid line { stroke: #c9d6e3; stroke-width: 1; }
.tl-tri text { font: 600 12px var(--r-body); fill: var(--r-ink, #0b2545); }
.tl-tri-pt { fill: var(--r-blue, #0b6fa4); stroke: #fff; stroke-width: 2.5; }
.tl-disclaimer { margin: 16px 0 0; font-size: 12px; color: var(--r-muted, #51647a); }

/* Content */
.tl-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(24px, 3vw, 48px); padding: clamp(16px, 2vw, 24px) 0 clamp(56px, 6vw, 88px); align-items: start; }
.tl-article { min-width: 0; }
.tl-article section { padding: 26px 0; border-top: 1px solid var(--r-line, #dde6ef); }
.tl-article section:first-child { border-top: 0; padding-top: 4px; }
.tl-article h2, .tl-index h2 { margin: 0 0 12px; font-family: var(--r-display); font-size: clamp(20px, 2vw, 24px); font-weight: 700; color: var(--r-ink, #0b2545); line-height: 1.25; }
.tl-article p, .tl-article li { font-size: 16px; line-height: 1.65; color: var(--r-text, #1c3048); }
.tl-article ul, .tl-article ol { padding-left: 22px; margin: 0; }
.tl-article li + li { margin-top: 6px; }
.tl-steps { counter-reset: s; list-style: none; padding: 0 !important; }
.tl-steps li { position: relative; padding-left: 40px; counter-increment: s; }
.tl-steps li::before { content: counter(s); position: absolute; left: 0; top: 1px; width: 26px; height: 26px; border-radius: 50%; background: var(--r-mist, #eef4f9); color: var(--r-blue, #0b6fa4); font: 700 13px/26px var(--r-body); text-align: center; }
.tl-formula .tl-eq { margin: 10px 0; padding: 12px 16px; border-radius: 10px; background: #fff; border: 1px solid var(--r-line, #dde6ef); font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 15px; color: var(--r-ink, #0b2545); overflow-x: auto; }
.tl-formula .tl-table { margin: 12px 0; background: #fff; }
.tl-example-answer { padding: 12px 16px; border-left: 4px solid var(--r-blue, #0b6fa4); background: #fff; border-radius: 0 10px 10px 0; }
.tl-faq details { border-bottom: 1px solid var(--r-line, #dde6ef); }
.tl-faq summary { position: relative; padding: 14px 32px 14px 0; font-weight: 600; font-size: 16px; color: var(--r-ink, #0b2545); cursor: pointer; list-style: none; }
.tl-faq summary::-webkit-details-marker { display: none; }
.tl-faq summary::after { content: "+"; position: absolute; right: 4px; top: 10px; font-size: 22px; font-weight: 400; color: var(--r-blue, #0b6fa4); }
.tl-faq details[open] summary::after { content: "−"; }
.tl-faq details p { margin: 0 0 16px; font-size: 15.5px; line-height: 1.65; color: var(--r-text, #1c3048); }
.tl-refs li { font-size: 14.5px !important; color: var(--r-muted, #51647a) !important; }
.tl-meta { margin-top: 16px; font-size: 13px !important; color: var(--r-muted, #51647a) !important; }

.tl-side { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 16px; }
.tl-side-card { background: #fff; border: 1px solid var(--r-line-soft, rgba(11,37,69,.08)); border-radius: 14px; padding: 20px; }
.tl-side-card h2 { margin: 0 0 10px; font-family: var(--r-display); font-size: 16px; color: var(--r-ink, #0b2545); }
.tl-cta { background: var(--r-ink, #0b2545); color: #fff; }
.tl-cta .tl-kicker { color: var(--r-cyan, #3cc2e6); }
.tl-cta p { margin: 0 0 14px; font-size: 15px; line-height: 1.55; color: #dbe8f3; }
.tl-cta .tl-btn--primary { background: #fff; color: var(--r-ink, #0b2545) !important; border-color: #fff; }
.tl-cta .tl-btn--primary:hover { background: var(--r-cyan, #3cc2e6); border-color: var(--r-cyan, #3cc2e6); }
.tl-related { list-style: none; margin: 0 0 12px; padding: 0; }
.tl-related a { display: block; padding: 9px 0; border-bottom: 1px solid #edf2f7; color: var(--r-blue, #0b6fa4); font-size: 14.5px; font-weight: 500; text-decoration: none; }
.tl-related a:hover { color: var(--r-ink, #0b2545); }
.tl-all { font-size: 14px; font-weight: 600; color: var(--r-ink, #0b2545); text-decoration: none; }

/* Index */
.tl-search { position: relative; max-width: 560px; margin-top: 22px; }
.tl-search input { width: 100%; padding: 14px 110px 14px 44px; border: 1px solid #c9d6e3; border-radius: 999px; font: 500 16px var(--r-body); color: var(--r-ink, #0b2545); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2351647a' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") no-repeat 16px center; }
.tl-search input:focus { outline: 0; border-color: var(--r-blue, #0b6fa4); box-shadow: 0 0 0 3px rgba(11,111,164,.15); }
.tl-search-count { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--r-muted, #51647a); }
.tl-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tl-chips a { display: inline-flex; gap: 6px; align-items: center; padding: 7px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--r-line, #dde6ef); color: var(--r-ink, #0b2545); font-size: 13.5px; font-weight: 500; text-decoration: none; }
.tl-chips a:hover { border-color: var(--r-blue, #0b6fa4); color: var(--r-blue, #0b6fa4); }
.tl-chips span { font-size: 12px; color: var(--r-muted, #51647a); }
.tl-index { padding: clamp(20px, 3vw, 36px) 0 clamp(56px, 6vw, 88px); }
.tl-cat { padding: 22px 0; scroll-margin-top: 90px; }
.tl-cat[hidden] { display: none; }
.tl-cat-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin-bottom: 14px; }
.tl-cat-head h2 { margin: 0; }
.tl-cat-head p { margin: 0; font-size: 14px; color: var(--r-muted, #51647a); }
.tl-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tl-tile[hidden] { display: none; }
.tl-tile a { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 18px; background: #fff; border: 1px solid var(--r-line-soft, rgba(11,37,69,.08)); border-radius: 12px; text-decoration: none; box-shadow: var(--r-shadow); transition: transform .2s var(--r-ease), box-shadow .2s, border-color .2s; }
.tl-tile a:hover { transform: translateY(-2px); box-shadow: var(--r-shadow-hover); border-color: rgba(11,111,164,.35); }
.tl-tile strong { font-family: var(--r-display); font-size: 16px; font-weight: 700; color: var(--r-ink, #0b2545); line-height: 1.3; }
.tl-tile strong::after { content: " →"; color: var(--r-blue, #0b6fa4); }
.tl-tile span { font-size: 13.5px; line-height: 1.5; color: var(--r-muted, #51647a); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tl-empty { padding: 24px; text-align: center; color: var(--r-muted, #51647a); }
.tl-index-faq { max-width: 860px; margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--r-line, #dde6ef); }
.tl-index-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; margin-top: 40px; padding: clamp(22px, 3vw, 36px); border-radius: 16px; background: var(--r-ink, #0b2545); }
.tl-index-cta h2 { color: #fff !important; margin-bottom: 6px !important; }
.tl-index-cta p { margin: 0; color: #dbe8f3; max-width: 60ch; }
.tl-index-cta .tl-btn--primary { background: #fff; color: var(--r-ink, #0b2545) !important; border-color: #fff; }

/* Phone result bar */
.tl-mbar { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 40; }
.tl-mbar[hidden] { display: none; }
.tl-mbar a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; background: var(--r-ink, #0b2545); color: #fff; text-decoration: none; box-shadow: 0 10px 30px -8px rgba(7,26,51,.5); }
.tl-mbar-label { font-size: 13px; color: var(--r-ice, #9fdcf2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-mbar-value { font-size: 17px; white-space: nowrap; }

@media (max-width: 1080px) {
  .tl-body { grid-template-columns: minmax(0, 1fr); }
  .tl-side { position: static; display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .tl-app-grid { grid-template-columns: minmax(0, 1fr); }
  .tl-results { position: static; }
}
@media (max-width: 600px) {
  .tl-shell { width: calc(100% - 32px); }
  .tl-fields { grid-template-columns: minmax(0, 1fr); }
  .tl-side { grid-template-columns: minmax(0, 1fr); }
  .tl-card { border-radius: 12px; padding: 18px 16px; }
  .tl-actions .tl-btn { flex: 1 1 auto; }
  .tl-search input { padding-right: 18px; }
  .tl-search-count { display: none; }
  .tl-crumbs li:nth-child(3) { display: none; }
  .tl-mbar { right: 84px; }
}

@media print {
  .rl-header, .announce-ribbon, .mega-footer, .tl-actions, .tl-side, .tl-mbar, .tl-crumbs, #faq, #references { display: none !important; }
  .tl-app-grid, .tl-body { grid-template-columns: 1fr 1fr; }
  .tl-card { box-shadow: none; break-inside: avoid; }
  .tl-results { position: static; }
  .tl-res-primary { background: #fff; color: #000; border: 2px solid #000; }
  .tl-res-label, .tl-res-unit, .tl-res-note { color: #000; }
}
@media (prefers-reduced-motion: reduce) { .tl-tile a { transition: none; } }
