/**
 * Height Calculator Styles
 * 키 계산기 전용 스타일
 *
 * @package Zipper
 */

#htcCalculator {
    --htc-accent: #d4af37;
    --htc-accent-dark: #b8860b;
    --htc-accent-deep: #8a6500;
    --htc-accent-soft: rgba(212, 175, 55, 0.12);
    --htc-accent-soft-strong: rgba(212, 175, 55, 0.2);
    --htc-surface: #fffdf8;
    --htc-surface-alt: #faf7f0;
    --htc-surface-muted: #f6f1e7;
    --htc-border: #e8e0cf;
    --htc-border-strong: #e1cf9f;
    --htc-text: #2d2a26;
    --htc-text-muted: #6c6259;
    --htc-text-soft: #8a7d6d;
    --htc-shadow-sm: 0 1px 4px rgba(45, 42, 38, 0.06);
    --htc-shadow-md: 0 8px 20px rgba(184, 134, 11, 0.14);
}

#htcCalculator .tool-layout-split {
    grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
    gap: 20px;
}

#htcCalculator .tool-layout-input,
#htcCalculator .tool-layout-result {
    min-width: 0;
}

.htc-intro {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.htc-lead {
    margin: 0;
    color: var(--htc-text-muted);
    font-size: 15px;
    line-height: 1.65;
}

.htc-section,
.htc-result-hero,
.htc-kpi-card,
.htc-note-card,
.htc-waiting {
    background: var(--htc-surface);
    border: 1px solid var(--htc-border);
    border-radius: 12px;
    box-shadow: var(--htc-shadow-sm);
}

.htc-section {
    display: grid;
    gap: 10px;
    padding: 16px;
}

.htc-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.htc-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--htc-text);
}

.htc-section-title i,
.htc-live-pill i {
    color: var(--htc-accent-dark);
}

.htc-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.12);
    color: var(--htc-accent-deep);
    border: 1px solid rgba(212, 175, 55, 0.24);
    font-size: 13px;
    font-weight: 600;
}

.htc-mode-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.htc-mode-btn,
.htc-preset-btn,
.htc-reset-btn {
    border: 1px solid var(--htc-border);
    border-radius: 10px;
    background: var(--htc-surface-alt);
    color: var(--htc-text-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.htc-mode-btn {
    padding: 9px 10px;
}

.htc-mode-btn:hover,
.htc-preset-btn:hover,
.htc-reset-btn:hover {
    border-color: var(--htc-border-strong);
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.12);
    color: var(--htc-accent-deep);
}

.htc-mode-btn:focus-visible,
.htc-preset-btn:focus-visible,
.htc-reset-btn:focus-visible {
    outline: none;
    border-color: var(--htc-accent);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.16);
}

.htc-mode-btn.is-active,
.htc-preset-btn.is-active {
    background: linear-gradient(135deg, #fbf1cf 0%, #f4e1a6 100%);
    border-color: #e0c06d;
    color: var(--htc-accent-deep);
}

.htc-field-stack,
.htc-note-stack,
.htc-tip-list {
    display: grid;
    gap: 12px;
}

.htc-imperial-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: start;
}

.htc-imperial-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.htc-imperial-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--htc-text-muted);
}

.htc-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.htc-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--htc-text-muted);
}

.htc-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.htc-input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--htc-border);
    background: #fff;
    color: var(--htc-text);
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.htc-input:hover {
    border-color: var(--htc-border-strong);
}

.htc-input:focus {
    outline: none;
    border-color: var(--htc-accent);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.14);
}

.htc-input::placeholder {
    color: #b1a89d;
}

.htc-input-unit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px solid var(--htc-border);
    background: var(--htc-surface-alt);
    color: var(--htc-text-muted);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.htc-field-hint,
.htc-inline-card-help,
.htc-ruler-caption,
.htc-note-text,
.htc-tip-list,
.htc-summary-table th,
.htc-summary-table td {
    font-size: 13px;
    line-height: 1.6;
}

.htc-field-hint,
.htc-inline-card-help,
.htc-ruler-caption,
.htc-note-text {
    margin: 0;
    color: var(--htc-text-muted);
}

.htc-inline-card {
    display: grid;
    gap: 5px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--htc-border);
    background: var(--htc-surface-alt);
}

.htc-inline-card-label,
.htc-note-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--htc-text-muted);
}

.htc-inline-card-value {
    font-size: 17px;
    font-weight: 700;
    color: var(--htc-text);
    letter-spacing: -0.02em;
}

.htc-btn-row.is-realtime {
    display: grid;
    gap: 8px;
}

.htc-reset-btn {
    width: 100%;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--htc-text-muted);
    background: var(--htc-surface-alt);
    border-radius: 10px;
}

.htc-preset-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.htc-preset-btn {
    padding: 8px 10px;
    font-size: 12px;
}

.htc-tip-list {
    margin: 0;
    padding-left: 18px;
    color: var(--htc-text);
}

.htc-tip-list li {
    margin: 0;
}

.htc-result-hero {
    display: grid;
    gap: 8px;
    padding: 18px;
    background: linear-gradient(135deg, #fff8e7 0%, #f8efd5 100%);
    border-color: #ead7a5;
    box-shadow: var(--htc-shadow-md);
}

.htc-hero-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.htc-status-badge,
.htc-hero-origin {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.htc-status-badge.is-example {
    background: rgba(255, 253, 248, 0.9);
    color: var(--htc-accent-deep);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.htc-status-badge.is-live {
    background: rgba(243, 231, 189, 0.68);
    color: #775400;
    border: 1px solid rgba(184, 134, 11, 0.22);
}

.htc-status-badge.is-warning {
    background: rgba(255, 241, 214, 0.92);
    color: #9c5d12;
    border: 1px solid rgba(201, 133, 40, 0.2);
}

.htc-hero-origin {
    background: rgba(255, 253, 248, 0.7);
    color: var(--htc-text-muted);
    border: 1px solid rgba(113, 96, 69, 0.12);
}

.htc-hero-value {
    font-size: clamp(32px, 5vw, 44px);
    font-weight: 800;
    color: var(--htc-text);
    line-height: 1.02;
    letter-spacing: -0.04em;
}

.htc-hero-secondary {
    font-size: 18px;
    font-weight: 700;
    color: var(--htc-accent-dark);
    letter-spacing: -0.02em;
}

.htc-hero-summary {
    margin: 0;
    color: var(--htc-text-muted);
    line-height: 1.7;
}

.htc-formula-box {
    padding: 9px 11px;
    border-radius: 10px;
    background: rgba(255, 253, 248, 0.82);
    border: 1px solid rgba(184, 134, 11, 0.15);
    color: var(--htc-text-muted);
    font-size: 13px;
    font-weight: 600;
}

.htc-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.htc-kpi-card {
    display: grid;
    gap: 5px;
    padding: 12px;
    background: #fffdfa;
}

.htc-kpi-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--htc-text-muted);
}

.htc-kpi-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--htc-text);
    letter-spacing: -0.02em;
}

.htc-ruler-wrap {
    display: grid;
    gap: 10px;
}

.htc-ruler-bar {
    position: relative;
    height: 16px;
    border-radius: 999px;
    background:
        linear-gradient(90deg, rgba(212, 175, 55, 0.14) 0%, rgba(184, 134, 11, 0.24) 100%),
        repeating-linear-gradient(to right, rgba(184, 134, 11, 0.16) 0 2px, transparent 2px 20%);
    overflow: hidden;
}

.htc-ruler-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to right, rgba(184, 134, 11, 0.2) 0 1px, transparent 1px) left center / 20% 100% repeat-x,
        linear-gradient(to right, transparent calc(100% - 1px), rgba(184, 134, 11, 0.2) calc(100% - 1px) 100%);
    pointer-events: none;
}

.htc-ruler-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 28px;
    border-radius: 999px;
    background: var(--htc-accent-dark);
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.22);
}

.htc-ruler-marker::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -8px;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid var(--htc-accent-dark);
}

.htc-ruler-scale {
    position: relative;
    height: 18px;
    color: var(--htc-text-soft);
    font-size: 12px;
    font-weight: 600;
}

.htc-ruler-scale span {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    white-space: nowrap;
}

.htc-ruler-scale span:nth-child(1) {
    left: 0;
    transform: none;
}

.htc-ruler-scale span:nth-child(2) {
    left: 20%;
}

.htc-ruler-scale span:nth-child(3) {
    left: 40%;
}

.htc-ruler-scale span:nth-child(4) {
    left: 60%;
}

.htc-ruler-scale span:nth-child(5) {
    left: 80%;
}

.htc-ruler-scale span:nth-child(6) {
    left: 100%;
    transform: translateX(-100%);
}

.htc-support-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.htc-table-wrap {
    max-width: 100%;
    overflow-x: auto;
}

.htc-summary-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 0;
}

.htc-summary-table th,
.htc-summary-table td {
    padding: 10px 0;
    border-bottom: 1px solid #edf0f6;
    vertical-align: top;
}

.htc-summary-table tr:last-child th,
.htc-summary-table tr:last-child td {
    border-bottom: 0;
    padding-bottom: 0;
}

.htc-summary-table th {
    width: 38%;
    text-align: left;
    color: var(--htc-text-muted);
    font-weight: 700;
}

.htc-summary-table td {
    color: var(--htc-text);
    font-weight: 600;
}

.htc-note-stack {
    min-width: 0;
}

.htc-note-card {
    display: grid;
    gap: 8px;
    padding: 12px;
    background: #fffcf6;
}

.htc-note-card a {
    color: var(--htc-accent-deep);
    font-weight: 700;
    text-decoration: none;
}

.htc-note-card a:hover {
    text-decoration: underline;
}

.htc-waiting {
    display: grid;
    gap: 8px;
    padding: 16px;
    margin-bottom: 12px;
    text-align: center;
    color: var(--htc-text-muted);
    border-style: dashed;
    background: #fffaf0;
}

.htc-waiting i {
    font-size: 28px;
    color: var(--htc-accent-dark);
}

.htc-hidden {
    display: none !important;
}

.tool-description #height-calculator-details ul,
.tool-description #use-cases ul,
.tool-description #features ul,
.tool-description #how-to-use ol {
    line-height: 1.8;
}

@media (max-width: 1080px) {
    #htcCalculator .tool-layout-split {
        grid-template-columns: 1fr;
    }

    .htc-kpi-grid,
    .htc-support-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .tool-layout-input,
    .tool-layout-result {
        max-width: 100%;
        overflow: hidden;
    }

    .htc-kpi-grid,
    .htc-support-grid {
        grid-template-columns: 1fr;
    }

    .htc-input {
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 768px) {
    .htc-section,
    .htc-result-hero,
    .htc-kpi-card,
    .htc-note-card,
    .htc-waiting {
        padding: 16px;
    }

    .htc-hero-value {
        font-size: 34px;
    }

    .htc-hero-secondary {
        font-size: 18px;
    }

    .htc-imperial-row {
        grid-template-columns: 1fr;
    }

    .htc-ruler-scale {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .tool-section,
    .tool-layout-split,
    .tool-layout-input,
    .tool-layout-result {
        max-width: 100%;
        overflow-x: hidden;
    }

    .htc-mode-switch,
    .htc-input-row {
        grid-template-columns: 1fr;
    }

    .htc-input-unit {
        justify-content: flex-start;
    }

    .htc-preset-list {
        display: grid;
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .htc-mode-btn,
    .htc-preset-btn,
    .htc-reset-btn,
    .htc-input,
    .htc-kpi-card,
    .htc-note-card {
        transition: none !important;
    }
}
