.tool-hero {
    padding: 150px 5% 72px;
    background:
        radial-gradient(circle at 15% 20%, rgba(201, 169, 110, 0.2), transparent 34%),
        linear-gradient(135deg, #111827 0%, #1f2937 58%, #0f172a 100%);
    color: #fff;
}

.tool-hero-inner,
.tool-layout {
    width: min(1180px, 100%);
    margin: 0 auto;
}

.tool-eyebrow {
    display: inline-block;
    margin-bottom: 18px;
    color: #ead8b7;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.tool-hero h1 {
    max-width: 760px;
    font-size: clamp(2.5rem, 6vw, 5.2rem);
    line-height: 1.05;
    letter-spacing: -0.05em;
}

.tool-hero > .tool-hero-inner > p {
    max-width: 720px;
    margin-top: 24px;
    color: rgba(255, 255, 255, 0.78);
    font-size: clamp(1rem, 2vw, 1.25rem);
}

.tool-privacy {
    max-width: 720px;
    margin-top: 28px;
    padding: 16px 18px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.84);
}

.tool-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
}

.tool-button {
    min-height: 46px;
    padding: 0 20px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #fff;
    color: #111827;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.tool-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.15);
}

.tool-button:focus-visible,
.tool-field input:focus-visible,
.tool-field textarea:focus-visible,
.energy-log-table input:focus-visible,
.tool-index a:focus-visible {
    outline: 3px solid rgba(201, 169, 110, 0.55);
    outline-offset: 3px;
}

.tool-button--primary {
    border-color: #c9a96e;
    background: #c9a96e;
    color: #111827;
}

.save-status {
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.9rem;
}

.tool-layout {
    padding: 48px 24px 100px;
}

.tool-index {
    position: sticky;
    top: 92px;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 36px;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(12px);
}

.tool-index a {
    padding: 13px 16px;
    border-radius: 10px;
    color: #374151;
    font-size: 0.92rem;
    font-weight: 700;
    text-align: center;
}

.tool-index a:hover {
    background: #f3f4f6;
    color: #111827;
}

.tool-section {
    scroll-margin-top: 170px;
    margin-bottom: 30px;
    padding: clamp(24px, 5vw, 48px);
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.06);
}

.tool-section-heading {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 30px;
}

.tool-section-heading > span {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: #111827;
    color: #fff;
    font-weight: 800;
}

.tool-section-heading h2 {
    color: #111827;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    line-height: 1.2;
    letter-spacing: -0.035em;
}

.tool-section-heading p {
    margin-top: 8px;
    color: #6b7280;
}

.tool-grid {
    display: grid;
    gap: 18px;
}

.tool-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tool-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.tool-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tool-field > span {
    color: #111827;
    font-weight: 800;
}

.tool-field small {
    min-height: 1.4em;
    color: #6b7280;
}

.tool-field input,
.tool-field textarea,
.energy-log-table input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: #f9fafb;
    color: #111827;
    font: inherit;
}

.tool-field input,
.energy-log-table input { min-height: 46px; padding: 10px 12px; }
.tool-field textarea { min-height: 128px; padding: 14px; resize: vertical; line-height: 1.65; }

.tool-field input:hover,
.tool-field textarea:hover,
.energy-log-table input:hover { border-color: #9ca3af; }

.boundary-output {
    margin-top: 18px;
    padding: 22px;
    border-left: 4px solid #c9a96e;
    border-radius: 0 14px 14px 0;
    background: #fffbeb;
    color: #374151;
    font-size: 1.05rem;
    line-height: 1.75;
}

#boundary-build { margin-top: 20px; }

.table-scroll {
    overflow-x: auto;
    margin-bottom: 22px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
}

.energy-log-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
}

.energy-log-table th {
    padding: 14px 12px;
    background: #111827;
    color: #fff;
    font-size: 0.86rem;
    text-align: left;
}

.energy-log-table td {
    padding: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.energy-log-table tbody tr:last-child td { border-bottom: 0; }
.energy-log-table td:nth-child(1) { width: 150px; }
.energy-log-table td:nth-child(2),
.energy-log-table td:nth-child(4) { width: 90px; }

.tool-limit {
    margin-top: 24px;
    padding: 20px;
    border: 1px solid #f3d3d3;
    border-radius: 14px;
    background: #fff7f7;
    color: #5f3030;
}

.tool-limit a { color: #7f1d1d; text-decoration: underline; }

@media (max-width: 860px) {
    .tool-index { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tool-grid--two,
    .tool-grid--three { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .tool-hero { padding: 112px 20px 52px; }
    .tool-layout { padding: 28px 14px 72px; }
    .tool-index { grid-template-columns: 1fr; }
    .tool-section { border-radius: 18px; padding: 22px 16px; }
    .tool-section-heading { gap: 12px; }
    .tool-section-heading > span { width: 40px; height: 40px; }
    .tool-actions { align-items: stretch; }
    .tool-button { width: 100%; }
    .save-status { width: 100%; text-align: center; }
}

@media print {
    .site-header,
    .site-footer,
    .tool-index,
    .tool-actions,
    .scroll-indicator { display: none !important; }

    body { color: #000; background: #fff; }
    .tool-hero { padding: 0 0 24px; background: none; color: #000; }
    .tool-hero h1 { font-size: 30pt; }
    .tool-hero > .tool-hero-inner > p,
    .tool-privacy { color: #222; }
    .tool-privacy { padding: 8px 0; border: 0; background: none; }
    .tool-layout { width: 100%; padding: 0; }
    .tool-section { break-inside: avoid; margin: 0 0 18px; padding: 16px; box-shadow: none; border-color: #999; }
    .tool-field input,
    .tool-field textarea,
    .energy-log-table input { border: 0; background: transparent; color: #000; }
    .table-scroll { overflow: visible; }
    .energy-log-table { min-width: 0; font-size: 8pt; }
    .energy-log-table th { background: #eee; color: #000; }
    .boundary-output { background: #fff; }
}
