@charset "UTF-8";

#tool-dbm-power-converter,
.pdbm-tool {
    --bg: #faf9f7;
    --surface: #ffffff;
    --surface-soft: #fffdf8;
    --border: #e8e4dc;
    --text: #2d2a26;
    --muted: #5f5a56;
    --accent: #b8860b;
    --accent-strong: #8a6500;
    --accent-light: #fbf7eb;
    --accent-mid: #eadfb8;
    --warn: #b54708;
    --warn-light: #fff4e5;
    --mono: 'Courier New', Courier, monospace;
    --sans: Helvetica, Arial, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow: 0 1px 4px rgba(45, 42, 38, 0.06), 0 0 0 1px rgba(45, 42, 38, 0.04);
    --shadow-strong: 0 18px 42px rgba(138, 101, 0, 0.14);
    max-width: 100%;
    box-sizing: border-box;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at top left, rgba(212, 175, 55, 0.16), transparent 34%),
        linear-gradient(180deg, var(--surface-soft) 0%, var(--bg) 100%);
    color: var(--text);
    font-family: var(--sans);
    display: grid;
    gap: 14px;
}

#tool-dbm-power-converter,
#tool-dbm-power-converter * {
    box-sizing: border-box;
}

#tool-dbm-power-converter :is(button, input, select) {
    font-family: inherit;
}

.pdbm-tool-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}

.pdbm-title-block {
    min-width: 0;
    display: grid;
    gap: 6px;
}

.pdbm-kicker {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--accent-light);
    border: 1px solid var(--accent-mid);
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.pdbm-heading.tool-section-title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    letter-spacing: -0.02em;
}

.pdbm-heading i {
    color: var(--accent);
}

.pdbm-lead {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.pdbm-header-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    max-width: 320px;
}

.pdbm-header-badges span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 9px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.72);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.pdbm-control-panel,
.pdbm-example-strip,
.pdbm-result-hero,
.pdbm-scale-card,
.pdbm-table-card,
.pdbm-reference-card,
.pdbm-disclaimer {
    max-width: 100%;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.pdbm-control-panel {
    display: grid;
    grid-template-columns: minmax(240px, 1.35fr) minmax(160px, 0.75fr) minmax(160px, 0.7fr) minmax(100px, auto);
    align-items: end;
    gap: 12px;
    padding: 14px;
}

.pdbm-field {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.pdbm-field-main {
    align-self: stretch;
}

.pdbm-label,
.pdbm-strip-label,
.pdbm-metric-label,
.pdbm-hero-eyebrow {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
}

.pdbm-input-unit-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
}

.pdbm-input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-family: var(--mono);
    font-size: 18px;
    line-height: 1.3;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.pdbm-input:hover {
    border-color: var(--accent-mid);
}

.pdbm-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.14);
}

.pdbm-input[aria-invalid="true"] {
    border-color: var(--warn);
    background: var(--warn-light);
    box-shadow: 0 0 0 3px rgba(181, 71, 8, 0.12);
}

.pdbm-unit-chip {
    min-height: 42px;
    min-width: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--accent-mid);
    background: var(--accent-light);
    color: var(--accent-strong);
    font-family: var(--mono);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.pdbm-input-status {
    min-height: 18px;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.pdbm-input-status.is-error {
    color: var(--warn);
    font-weight: 700;
}

.pdbm-sr-select {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.pdbm-segmented {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    min-width: 0;
}

.pdbm-decimal-buttons {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pdbm-segment,
.pdbm-chip,
.pdbm-reset-btn,
.pdbm-copy-btn {
    appearance: none;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.pdbm-segment {
    min-height: 42px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 700;
}

.pdbm-segment:hover,
.pdbm-segment:focus-visible,
.pdbm-chip:hover,
.pdbm-chip:focus-visible,
.pdbm-reset-btn:hover,
.pdbm-reset-btn:focus-visible,
.pdbm-copy-btn:hover,
.pdbm-copy-btn:focus-visible {
    outline: none;
    border-color: var(--accent);
    color: var(--accent-strong);
    background: var(--accent-light);
    transform: translateY(-1px);
}

.pdbm-segment.is-active,
.pdbm-chip.active {
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--accent-light) 0%, #fff8df 100%);
    color: var(--accent-strong);
    box-shadow: 0 0 0 1px rgba(184, 134, 11, 0.08);
}

.pdbm-actions {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.pdbm-reset-btn {
    min-height: 42px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--accent-strong);
    background: var(--accent-light);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.pdbm-example-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
}

.pdbm-strip-label {
    flex: 0 0 auto;
    color: var(--accent-strong);
}

.pdbm-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    min-width: 0;
}

.pdbm-chip {
    min-height: 36px;
    padding: 8px 11px;
    border-radius: 999px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.15;
}

.pdbm-results-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.42fr) minmax(260px, 0.72fr);
    gap: 12px;
    align-items: stretch;
    min-width: 0;
    max-width: 100%;
}

.pdbm-result-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 20px;
    border-color: var(--accent-mid);
    background:
        radial-gradient(circle at 86% 12%, rgba(212, 175, 55, 0.24), transparent 31%),
        linear-gradient(135deg, #fffaf0 0%, var(--surface) 68%);
    box-shadow: var(--shadow-strong);
}

.pdbm-result-hero::after {
    content: "dBm";
    position: absolute;
    right: 16px;
    bottom: -12px;
    color: rgba(184, 134, 11, 0.08);
    font-family: var(--mono);
    font-size: clamp(58px, 10vw, 112px);
    font-weight: 800;
    line-height: 1;
    pointer-events: none;
}

.pdbm-hero-eyebrow {
    position: relative;
    z-index: 1;
    width: fit-content;
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid var(--accent-mid);
    color: var(--accent-strong);
}

.pdbm-hero-value {
    position: relative;
    z-index: 1;
    color: var(--text);
    font-family: var(--mono);
    font-size: clamp(28px, 4.8vw, 46px);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.12;
    overflow-wrap: anywhere;
}

.pdbm-hero-subtext {
    position: relative;
    z-index: 1;
    margin: 0;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.pdbm-result-metrics {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 4px;
}

.pdbm-metric {
    min-width: 0;
    display: grid;
    gap: 5px;
    padding: 10px;
    border-radius: 9px;
    border: 1px solid rgba(232, 228, 220, 0.9);
    background: rgba(255, 255, 255, 0.82);
}

.pdbm-metric.is-input {
    background: var(--accent-light);
    border-color: var(--accent-mid);
}

.pdbm-metric-value {
    color: var(--text);
    font-family: var(--mono);
    font-size: 16px;
    line-height: 1.25;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.pdbm-scale-card,
.pdbm-table-card,
.pdbm-reference-card {
    display: grid;
    align-content: start;
    gap: 12px;
    padding: 16px;
}

.pdbm-card-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.pdbm-card-head h3 {
    min-width: 0;
    margin: 0;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    line-height: 1.35;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.pdbm-card-head i {
    color: var(--accent);
}

.pdbm-card-head p,
.pdbm-scale-note {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

#pdbmScaleValue {
    flex: 0 1 auto;
    min-width: 0;
    color: var(--accent-strong);
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
}

.pdbm-scale-track {
    position: relative;
    height: 14px;
    overflow: hidden;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: linear-gradient(90deg, #f4efe5 0%, #fdf8e8 50%, #eadfb8 100%);
}

.pdbm-scale-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    min-width: 6px;
    border-radius: inherit;
    background: linear-gradient(90deg, #d4af37 0%, var(--accent-strong) 100%);
    transition: width 0.24s ease;
}

.pdbm-scale-labels {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
    line-height: 1.2;
}

.pdbm-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: 12px;
    align-items: start;
    min-width: 0;
    max-width: 100%;
}

.pdbm-table-head {
    align-items: center;
}

.pdbm-table-wrap {
    max-width: 100%;
    overflow-x: hidden;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #fff;
}

.pdbm-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    border-collapse: collapse;
    background: #fff;
}

.pdbm-table th,
.pdbm-table td {
    padding: 12px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 13px;
    line-height: 1.35;
    vertical-align: middle;
}

.pdbm-table thead th {
    background: var(--accent-light);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.pdbm-table th:first-child,
.pdbm-table td:first-child {
    width: 42%;
    text-align: left;
}

.pdbm-table th:nth-child(2),
.pdbm-table td:nth-child(2) {
    width: 36%;
    text-align: right;
    font-family: var(--mono);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.pdbm-table th:last-child,
.pdbm-table td:last-child {
    width: 22%;
    text-align: right;
}

.pdbm-table tbody tr:last-child th,
.pdbm-table tbody tr:last-child td {
    border-bottom: 0;
}

.pdbm-table tbody tr:nth-child(even) {
    background: #fffdf8;
}

.pdbm-copy-btn {
    min-width: 62px;
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 999px;
    color: var(--accent-strong);
    background: #fff;
    font-size: 12px;
    font-weight: 800;
}

.pdbm-copy-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.pdbm-copy-btn.is-copied {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent-strong);
}

.pdbm-reference-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.pdbm-reference-list > div {
    min-width: 0;
    display: grid;
    gap: 4px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #fffdf8;
}

.pdbm-reference-list > div.is-current {
    border-color: var(--accent-mid);
    background: var(--accent-light);
}

.pdbm-reference-list strong,
.pdbm-reference-list span {
    font-family: var(--mono);
    overflow-wrap: anywhere;
}

.pdbm-reference-list strong {
    color: var(--text);
    font-size: 13px;
    line-height: 1.25;
}

.pdbm-reference-list span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.pdbm-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 14px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.76);
    font-size: 12px;
    line-height: 1.6;
}

.pdbm-disclaimer i {
    flex: 0 0 auto;
    margin-top: 2px;
    color: var(--accent);
}

@media (max-width: 1080px) {
    .pdbm-control-panel {
        grid-template-columns: minmax(0, 1fr) minmax(160px, 0.6fr);
    }

    .pdbm-actions {
        grid-column: 2;
    }
}

@media (max-width: 900px) {
    #tool-dbm-power-converter {
        padding: 14px;
    }

    .pdbm-tool-header,
    .pdbm-example-strip {
        align-items: flex-start;
        flex-direction: column;
    }

    .pdbm-header-badges {
        justify-content: flex-start;
        max-width: 100%;
    }

    .pdbm-control-panel,
    .pdbm-results-grid,
    .pdbm-detail-grid {
        grid-template-columns: 1fr;
    }

    .pdbm-actions {
        grid-column: auto;
    }

    .pdbm-result-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    #tool-dbm-power-converter {
        padding: 12px;
        border-radius: 12px;
    }

    .pdbm-control-panel,
    .pdbm-result-hero,
    .pdbm-scale-card,
    .pdbm-table-card,
    .pdbm-reference-card {
        padding: 12px;
    }

    .pdbm-input-unit-row {
        grid-template-columns: minmax(0, 1fr) minmax(48px, auto);
    }

    .pdbm-input {
        font-size: 16px;
    }

    .pdbm-segmented,
    .pdbm-decimal-buttons,
    .pdbm-result-metrics,
    .pdbm-reference-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pdbm-chip-group {
        width: 100%;
    }

    .pdbm-chip {
        flex: 1 1 calc(50% - 7px);
    }

    .pdbm-hero-value {
        font-size: clamp(25px, 10vw, 34px);
    }

    .pdbm-table th,
    .pdbm-table td {
        padding: 10px 7px;
        font-size: 12px;
    }

    .pdbm-table th:first-child,
    .pdbm-table td:first-child {
        width: 40%;
    }

    .pdbm-table th:nth-child(2),
    .pdbm-table td:nth-child(2) {
        width: 35%;
    }

    .pdbm-table th:last-child,
    .pdbm-table td:last-child {
        width: 25%;
    }

    .pdbm-copy-btn {
        min-width: 0;
        width: 100%;
        padding: 7px 5px;
        font-size: 11px;
        white-space: normal;
    }
}

@media (max-width: 380px) {
    .pdbm-table th,
    .pdbm-table td {
        padding: 9px 5px;
        font-size: 11px;
    }

    .pdbm-copy-btn {
        font-size: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #tool-dbm-power-converter *,
    #tool-dbm-power-converter *::before,
    #tool-dbm-power-converter *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* 2026-04-25 compact density pass: keep the main result prominent while reducing vertical scan cost. */
#tool-dbm-power-converter,
.pdbm-tool {
    padding: 12px;
    gap: 10px;
    border-radius: 14px;
}

.pdbm-tool-header {
    gap: 10px;
}

.pdbm-title-block {
    gap: 4px;
}

.pdbm-kicker {
    min-height: 22px;
    padding: 3px 8px;
    font-size: 11px;
}

.pdbm-heading.tool-section-title {
    gap: 7px;
    font-size: clamp(22px, 2.4vw, 26px);
    line-height: 1.18;
}

.pdbm-lead {
    font-size: 13px;
    line-height: 1.45;
}

.pdbm-header-badges {
    gap: 5px;
}

.pdbm-header-badges span {
    min-height: 24px;
    padding: 3px 8px;
    font-size: 11px;
}

.pdbm-control-panel {
    grid-template-columns: minmax(220px, 1.45fr) minmax(150px, 0.72fr) minmax(150px, 0.72fr) minmax(92px, auto);
    gap: 8px;
    padding: 10px;
}

.pdbm-field {
    gap: 5px;
}

.pdbm-label,
.pdbm-strip-label,
.pdbm-metric-label,
.pdbm-hero-eyebrow {
    font-size: 11px;
}

.pdbm-input-unit-row {
    gap: 6px;
}

.pdbm-input {
    min-height: 40px;
    padding: 8px 10px;
    border-radius: 7px;
    font-size: 16px;
}

.pdbm-unit-chip {
    min-height: 38px;
    min-width: 50px;
    padding: 7px 10px;
    border-radius: 7px;
    font-size: 13px;
}

.pdbm-input-status {
    min-height: 14px;
    font-size: 11px;
    line-height: 1.35;
}

.pdbm-segmented {
    gap: 5px;
}

.pdbm-segment,
.pdbm-reset-btn {
    min-height: 38px;
    padding: 7px 9px;
    border-radius: 7px;
    font-size: 12px;
}

.pdbm-example-strip {
    gap: 8px;
    padding: 7px 10px;
    box-shadow: 0 1px 3px rgba(45, 42, 38, 0.04), 0 0 0 1px rgba(45, 42, 38, 0.03);
}

.pdbm-chip-group {
    gap: 5px;
}

.pdbm-chip {
    min-height: 30px;
    padding: 6px 9px;
    font-size: 11px;
}

.pdbm-results-grid,
.pdbm-detail-grid {
    gap: 10px;
}

.pdbm-result-hero {
    gap: 7px;
    padding: 14px;
    box-shadow: 0 10px 26px rgba(138, 101, 0, 0.11);
}

.pdbm-hero-eyebrow {
    min-height: 21px;
    padding: 2px 8px;
}

.pdbm-hero-value {
    font-size: clamp(26px, 4vw, 38px);
    line-height: 1.08;
}

.pdbm-hero-subtext {
    font-size: 12px;
    line-height: 1.4;
}

.pdbm-result-metrics {
    gap: 6px;
    margin-top: 2px;
}

.pdbm-metric {
    gap: 3px;
    padding: 8px;
    border-radius: 8px;
}

.pdbm-metric-value {
    font-size: 14px;
    line-height: 1.2;
}

.pdbm-scale-card,
.pdbm-table-card,
.pdbm-reference-card {
    gap: 9px;
    padding: 12px;
}

.pdbm-card-head {
    gap: 8px;
}

.pdbm-card-head h3 {
    gap: 5px;
    font-size: 14px;
    line-height: 1.25;
}

.pdbm-card-head p,
.pdbm-scale-note {
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.42;
}

#pdbmScaleValue {
    font-size: 12px;
}

.pdbm-scale-track {
    height: 10px;
}

.pdbm-scale-labels {
    font-size: 10px;
}

.pdbm-table th,
.pdbm-table td {
    padding: 9px 10px;
    font-size: 12px;
}

.pdbm-table thead th {
    font-size: 11px;
}

.pdbm-copy-btn {
    min-width: 56px;
    min-height: 30px;
    padding: 6px 8px;
    font-size: 11px;
}

.pdbm-reference-list {
    gap: 6px;
}

.pdbm-reference-list > div {
    gap: 3px;
    padding: 8px;
    border-radius: 8px;
}

.pdbm-reference-list strong {
    font-size: 12px;
}

.pdbm-reference-list span {
    font-size: 11px;
    line-height: 1.25;
}

.pdbm-disclaimer {
    gap: 8px;
    padding: 10px 12px;
    font-size: 11px;
    line-height: 1.45;
}

@media (max-width: 900px) {
    #tool-dbm-power-converter,
    .pdbm-tool {
        padding: 10px;
    }

    .pdbm-control-panel {
        gap: 8px;
        padding: 10px;
    }
}

@media (max-width: 520px) {
    #tool-dbm-power-converter,
    .pdbm-tool {
        padding: 9px;
        gap: 9px;
        border-radius: 12px;
    }

    .pdbm-control-panel,
    .pdbm-result-hero,
    .pdbm-scale-card,
    .pdbm-table-card,
    .pdbm-reference-card {
        padding: 10px;
    }

    .pdbm-hero-value {
        font-size: clamp(24px, 9vw, 32px);
    }

    .pdbm-table th,
    .pdbm-table td {
        padding: 8px 5px;
        font-size: 11px;
    }

    .pdbm-copy-btn {
        min-height: 30px;
        padding: 6px 4px;
        font-size: 10px;
    }
}

/* Compact pass responsive guard: keep appended desktop density overrides from leaking into mobile widths. */
@media (max-width: 900px) {
    .pdbm-control-panel,
    .pdbm-results-grid,
    .pdbm-detail-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile scan order: show the ready-made result card before controls, then inputs/examples. */
@media (max-width: 900px) {
    .pdbm-tool-header { order: 1; }
    .pdbm-results-grid { order: 2; }
    .pdbm-control-panel { order: 3; }
    .pdbm-example-strip { order: 4; }
    .pdbm-detail-grid { order: 5; }
    .pdbm-disclaimer { order: 6; }
}

/* 2026-04-25 40/60 row pass: input and result share the first desktop row with no unused grid track. */
#toolResult {
    container-type: inline-size;
}

@media (min-width: 901px) {
    #tool-dbm-power-converter,
    .pdbm-tool {
        grid-template-columns: minmax(260px, 2fr) minmax(0, 3fr);
        grid-template-areas:
            "header header"
            "control results"
            "examples examples"
            "details details"
            "notice notice";
        align-items: stretch;
    }

    .pdbm-tool-header {
        grid-area: header;
    }

    .pdbm-control-panel {
        grid-area: control;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(70px, 0.58fr);
        grid-template-areas:
            "amount amount amount"
            "unit decimals actions";
        align-self: stretch;
        align-content: start;
        gap: 8px;
        padding: 10px;
    }

    .pdbm-field-main {
        grid-area: amount;
    }

    .pdbm-control-panel .pdbm-field:nth-of-type(2) {
        grid-area: unit;
    }

    .pdbm-control-panel .pdbm-field:nth-of-type(3) {
        grid-area: decimals;
    }

    .pdbm-actions {
        grid-area: actions;
        grid-column: auto;
        align-self: end;
    }

    .pdbm-reset-btn {
        width: 100%;
        min-height: 38px;
        padding: 6px 10px;
    }

    .pdbm-example-strip {
        grid-area: examples;
    }

    .pdbm-results-grid {
        grid-area: results;
        grid-template-columns: minmax(0, 1fr) minmax(0, 0.42fr);
        align-items: stretch;
        gap: 8px;
        min-height: 0;
    }

    .pdbm-result-hero {
        min-height: 0;
        gap: 6px;
        padding: 12px;
    }

    .pdbm-result-hero::after {
        right: 10px;
        bottom: -9px;
        font-size: clamp(48px, 5.8vw, 76px);
    }

    .pdbm-hero-eyebrow {
        min-height: 20px;
        padding: 2px 8px;
    }

    .pdbm-hero-value {
        font-size: clamp(24px, 2.5vw, 34px);
        line-height: 1.06;
    }

    .pdbm-hero-subtext {
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        font-size: 11px;
        line-height: 1.34;
    }

    .pdbm-result-metrics {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 5px;
        margin-top: 0;
    }

    .pdbm-metric {
        gap: 2px;
        padding: 7px;
    }

    .pdbm-metric-value {
        font-size: 13px;
        line-height: 1.18;
    }

    .pdbm-scale-card {
        min-height: 0;
        gap: 7px;
        padding: 10px;
    }

    .pdbm-card-head {
        gap: 7px;
    }

    .pdbm-card-head h3 {
        font-size: 13px;
        line-height: 1.22;
    }

    #pdbmScaleValue {
        font-size: 11px;
    }

    .pdbm-scale-track {
        height: 9px;
    }

    .pdbm-scale-labels {
        font-size: 10px;
    }

    .pdbm-scale-note {
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        font-size: 11px;
        line-height: 1.34;
    }

    .pdbm-detail-grid {
        grid-area: details;
    }

    .pdbm-disclaimer {
        grid-area: notice;
    }
}

@container (max-width: 620px) {
    #tool-dbm-power-converter,
    .pdbm-tool {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "results"
            "control"
            "examples"
            "details"
            "notice";
    }

    .pdbm-control-panel,
    .pdbm-results-grid,
    .pdbm-detail-grid {
        grid-template-columns: 1fr;
    }

    .pdbm-control-panel {
        grid-template-areas:
            "amount"
            "unit"
            "decimals"
            "actions";
    }

    .pdbm-result-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
