/* TLN Constructions — calculators & AI tools */

.tool-head { padding-block: clamp(26px, 4vw, 48px) clamp(26px, 4vw, 40px); }
.tool-head .wrap { position: relative; z-index: 1; }
.tool-head-row { display: flex; align-items: center; gap: 18px; }
.tool-head-ic { width: 68px; height: 68px; border-radius: 20px; display: grid; place-items: center; background: var(--amber); color: #0e1a2b; flex: none; box-shadow: 0 14px 30px -12px rgba(224, 142, 0, .7); }
.tool-head-ic.is-ai { background: var(--ink); color: var(--amber); box-shadow: var(--shadow); }
:root[data-theme="dark"] .tool-head-ic.is-ai { background: #1b2740; }
.tool-title { font-size: clamp(1.8rem, 4.2vw, 2.8rem); font-weight: 900; font-stretch: 110%; margin: 0; }
.tool-head .eyebrow { margin-bottom: .4em; }
.tool-intro { max-width: 72ch; color: var(--ink-2); font-size: 1.05rem; margin: 16px 0 0; }
.hub-head .hero-title { font-size: clamp(2rem, 4.6vw, 3.4rem); }
.hub-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.hub-item { display: flex; }
.hub-item .tool-card { width: 100%; }

.tool-app { padding-block: 28px 12px; }
.calc { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 0; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.calc-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: clamp(18px, 3vw, 30px); align-content: start; }
.calc-form .field-wide, .calc-form .check { grid-column: 1 / -1; }
.calc-form .check + .check { margin-top: -6px; }
.form-hint { font-size: .85rem; color: var(--muted); margin: 0; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.input-suffix { position: relative; display: block; }
.input-suffix input { padding-right: 72px; }
.input-suffix em { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: .82rem; font-weight: 650; color: var(--muted); pointer-events: none; white-space: nowrap; }
.calc-out { padding: clamp(18px, 3vw, 30px); background: var(--surface-2); border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.out-hero { padding: 20px 22px; border-radius: var(--r); background: var(--ink); color: #fff; position: relative; overflow: hidden; }
.out-hero::after { content: ""; position: absolute; inset: auto 0 0; height: 5px; background: repeating-linear-gradient(-45deg, var(--amber) 0 12px, transparent 12px 24px); opacity: .9; }
:root[data-theme="dark"] .out-hero { background: #1b2740; }
.out-label { display: block; font: 700 12px/1 var(--f-body); letter-spacing: .1em; text-transform: uppercase; color: #aebbd0; margin-bottom: 8px; }
.out-big { display: block; font: 900 clamp(1.7rem, 3.4vw, 2.4rem)/1.1 var(--f-head); font-stretch: 112%; color: var(--amber); word-break: break-word; }
.out-sub { display: block; margin-top: 6px; font-size: .92rem; color: #d3dbe7; }
.out-body { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.out-body h3 { font-size: 1rem; margin: 0 0 8px; }
.out-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.out-table th, .out-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.out-table td:last-child, .out-table th:last-child { text-align: right; white-space: nowrap; }
.out-table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.out-table tr.total td { font-weight: 800; border-top: 2px solid var(--ink); border-bottom: 0; }
.out-scroll { overflow-x: auto; max-height: 360px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.out-scroll .out-table th { position: sticky; top: 0; background: var(--surface); }
.out-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.out-stat { padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.out-stat span { display: block; font-size: .78rem; color: var(--muted); font-weight: 650; }
.out-stat strong { display: block; font: 800 1.12rem/1.25 var(--f-head); word-break: break-word; }
.bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--line); }
.bar i { display: block; height: 100%; }
.legend { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; font-size: .84rem; }
.legend li { display: flex; align-items: center; gap: 7px; min-width: 0; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.legend b { font-weight: 700; white-space: nowrap; }
.donut { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut svg { width: 120px; height: 120px; flex: none; }
.out-note { font-size: .86rem; color: var(--muted); margin: 0; }
.out-warn { font-size: .9rem; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--brick) 12%, transparent); color: color-mix(in srgb, var(--brick) 80%, var(--ink)); margin: 0; }
.out-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 6px; }
.custom-size { display: none; }
.calc-form.show-custom .custom-size { display: flex; }
.calc[data-calc="concrete"] .dim-dia { display: none; }
.calc[data-calc="concrete"].is-round .dim-dia { display: flex; }
.calc[data-calc="concrete"].is-round .dim-l, .calc[data-calc="concrete"].is-round .dim-w { display: none; }

.rooms { display: grid; gap: 8px; }
.rooms-head, .room-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) 34px; gap: 8px; align-items: center; }
.rooms-head { font-size: .8rem; font-weight: 700; color: var(--muted); }
.reno .rooms-head, .reno .room-row { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr) minmax(0, 1.1fr) minmax(0, .9fr) 34px; }
.room-row input, .room-row select { padding: 9px 10px; font-size: .95rem; }
.rooms > .btn, .reno-add { justify-self: start; }
.reno-add { display: flex; gap: 8px; align-items: center; }
.reno-add select { width: auto; padding-block: 8px; }
@media (max-width: 560px) {
	.reno .rooms-head { display: none; }
	.reno .room-row { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
	.reno .room-row .icon-btn { justify-self: end; }
}

@media (max-width: 900px) {
	.calc { grid-template-columns: minmax(0, 1fr); }
	.calc-out { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 480px) { .calc-form { grid-template-columns: minmax(0, 1fr); } }

/* AI tools */
.ai-out { justify-content: flex-start; }
.ai-empty { text-align: center; color: var(--muted); padding: 40px 12px; margin: auto 0; }
.ai-empty-ic { width: 72px; height: 72px; border-radius: 22px; background: var(--surface); border: 1px dashed var(--line-2); display: grid; place-items: center; margin: 0 auto 14px; color: var(--amber-strong); }
.ai-loading { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; padding: 48px 12px; color: var(--muted); }
.ai-loading span { width: 10px; height: 10px; border-radius: 50%; background: var(--amber); animation: dot 1s infinite ease-in-out; }
.ai-loading span:nth-child(2) { animation-delay: .15s; }
.ai-loading span:nth-child(3) { animation-delay: .3s; }
.ai-loading p { width: 100%; text-align: center; margin: 10px 0 0; }
@keyframes dot { 0%, 80%, 100% { transform: scale(.6); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }
.ai-result-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.ai-mode { display: inline-flex; align-items: center; gap: 5px; font: 800 11px/1 var(--f-body); letter-spacing: .1em; text-transform: uppercase; padding: 6px 10px; border-radius: 999px; background: var(--amber-soft); color: var(--amber-ink); }
.ai-actions { display: flex; gap: 4px; }
.prose { font-size: .98rem; line-height: 1.65; }
.prose h3 { font-size: 1.05rem; margin: 1.3em 0 .45em; }
.prose h3:first-child, .prose h4:first-child { margin-top: 0; }
.prose h4 { font-size: 1rem; margin: 1.1em 0 .4em; }
.prose ul, .prose ol { padding-left: 1.2em; margin: 0 0 1em; }
.prose li { margin-bottom: .35em; }
.prose li::marker { color: var(--amber-strong); }
.prose .lead { font-size: 1.05rem; font-weight: 600; }
.prose .warn { padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--brick) 12%, transparent); }
.prose a:not(.btn) { color: var(--blue); }
.prose .btn { margin-top: 6px; text-decoration: none; }
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 6px; background-color: #ccc; border: 1px solid rgba(0,0,0,.12); vertical-align: -3px; margin-right: 6px; }

/* Info below tool */
.tool-info { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 36px; padding-block: 28px 8px; align-items: start; }
.tool-how h2, .tool-info .faq h2 { font-size: 1.45rem; }
.tool-how p { color: var(--ink-2); }
.tool-info .faq { margin-top: 24px; }
.tool-disclaimer { display: flex; gap: 8px; align-items: flex-start; font-size: .88rem; color: var(--muted); padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.tool-disclaimer .tln-icon { margin-top: 3px; }
.tool-info-side { display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 1000px) { .tool-info { grid-template-columns: minmax(0, 1fr); } }

@media print {
	.tool-head .hero-grid-bg, .calc-form, .tool-info, .section { display: none !important; }
	.calc { display: block; box-shadow: none; border: 0; }
	.calc-out { border: 0; }
	.out-hero { background: #fff !important; color: #000; border: 2px solid #000; }
	.out-big { color: #000 !important; }
	.out-sub, .out-label { color: #333 !important; }
}
.calc-form.ai-form { position: sticky; top: 90px; align-self: start; }
@media (max-width: 900px) { .calc-form.ai-form { position: static; } }
