:root {
    --feelings-bg: #f9f7f3;
    --feelings-card: #ffffff;
    --feelings-border: #d9d5cd;
    --feelings-ink: #2e2e2e;
    --feelings-accent: #4e4f73;
}

.feelings-page {
    padding-bottom: 80px;
}

.suitcase-credit {
    margin-top: 18px;
    margin-bottom: 6px;
    padding: 14px 16px;
    border: 1px solid #d6d2c8;
    border-radius: 12px;
    background: linear-gradient(135deg, #fffefc 0%, #f4f1ea 100%);
    color: #5d5a55;
    font-size: 0.95rem;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 4px 14px rgba(62, 54, 44, 0.06);
}

.suitcase-credit p {
    margin: 0;
}

.suitcase-credit-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.suitcase-credit-icon {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    flex-shrink: 0;
    object-fit: contain;
    background: #fffdf8;
    border: 1px solid #e4ded2;
    padding: 5px;
}

.suitcase-credit a {
    color: var(--feelings-accent);
    font-weight: 600;
}

.suitcase-credit a:hover {
    text-decoration: underline;
}

.suitcase-credit-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--feelings-accent);
    background: #fff;
    color: var(--feelings-accent);
    text-decoration: none;
    font-size: 0.86rem;
    line-height: 1;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.suitcase-credit-cta:hover {
    background: var(--feelings-accent);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

.help-toggle-btn {
    margin-top: 6px;
    width: 100%;
    text-align: left;
    font-size: 0.88rem;
    color: var(--feelings-accent);
    background: transparent;
    border-color: transparent;
    padding-left: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.help-toggle-btn:hover {
    background: transparent;
    color: var(--feelings-ink);
}

.help-panel {
    margin-top: 12px;
    padding: 12px;
    border-radius: 12px;
    border: 1px dashed #c8c3ba;
    background: #faf7f0;
}

.help-panel.is-hidden {
    display: none;
}

.help-note {
    margin: 0 0 10px;
    color: #5d5a55;
    font-size: 0.9rem;
}

.help-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.help-title {
    font-weight: 600;
    color: #4a4a4a;
    margin-right: 4px;
}

.help-chip {
    border: 1px solid var(--feelings-border);
    background: #fff;
    color: var(--feelings-ink);
    border-radius: 999px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.88rem;
}

.tool-layout {
    display: grid;
    grid-template-columns: minmax(280px, 380px) minmax(320px, 1fr);
    gap: 30px;
    margin-top: 28px;
}

.controls-panel,
.body-panel {
    background: var(--feelings-card);
    border: 1px solid var(--feelings-border);
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

.controls-panel h2,
.body-panel h2 {
    margin: 0 0 14px;
    font-size: 1.4rem;
    color: var(--feelings-ink);
}

.label {
    display: block;
    font-weight: 600;
    margin: 12px 0 8px;
}

input[type="text"],
select {
    width: 100%;
    border: 1px solid #c9c5bc;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 1rem;
    background: #fff;
}

input[type="range"] {
    width: 100%;
    margin-top: 6px;
}

.intensity-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.intensity-row input[type="range"] {
    flex: 1;
    margin-top: 0;
}

#intensityValue {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--feelings-accent);
    min-width: 28px;
    text-align: right;
}

.palette {
    border: 0;
    margin: 12px 0 0;
    padding: 0;
}

.palette legend {
    font-weight: 600;
    margin-bottom: 10px;
}

.toggle-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.tag-btn {
    border: 1px solid var(--feelings-border);
    background: #fff;
    color: var(--feelings-ink);
    border-radius: 999px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.9rem;
}

.tag-btn.active {
    background: var(--feelings-accent);
    color: #fff;
    border-color: var(--feelings-accent);
}

.tag-hint {
    color: #6a6762;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.color-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
    margin: 0 8px 8px 0;
    cursor: pointer;
}

.color-btn.active {
    box-shadow: 0 0 0 3px var(--feelings-accent);
}

.color-btn[data-color="#f4b400"] { background: #f4b400; }
.color-btn[data-color="#e67e22"] { background: #e67e22; }
.color-btn[data-color="#d32f2f"] { background: #d32f2f; }
.color-btn[data-color="#2e7d32"] { background: #2e7d32; }
.color-btn[data-color="#1e88e5"] { background: #1e88e5; }
.color-btn[data-color="#6a1b9a"] { background: #6a1b9a; }
.color-btn[data-color="#212121"] { background: #212121; }
.color-btn[data-color="#f7cac9"] { background: #f7cac9; }

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.btn {
    border: 1px solid var(--feelings-border);
    background: #fff;
    color: var(--feelings-ink);
    border-radius: 10px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary,
.btn.is-active {
    background: var(--feelings-accent);
    color: #fff;
    border-color: var(--feelings-accent);
}

.hint {
    margin-top: 16px;
    color: #5d5a55;
    font-size: 0.92rem;
    line-height: 1.5;
}

.storage-note {
    color: #6a6762;
    font-size: 0.85rem;
    margin-top: 6px;
}

.body-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 15px;
    flex-wrap: wrap;
}

.body-header p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.body-canvas-wrap {
    margin-top: 12px;
    background: radial-gradient(circle at 50% 24%, #ffffff 0%, #f9f7f3 46%, #f1ece2 100%);
    border-radius: 14px;
    border: 1px solid #d8d2c8;
    padding: 16px 18px 18px;
}

#bodyMap {
    display: block;
    width: min(100%, 460px);
    margin: 0 auto;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.08));
}

.zone-layer {
    pointer-events: none;
}

.zone-shape {
    fill: rgba(78, 79, 115, 0);
    stroke: rgba(78, 79, 115, 0);
    transition: fill 0.18s ease, stroke 0.18s ease;
}

.zone-shape.is-active {
    fill: rgba(78, 79, 115, 0.2);
    stroke: rgba(78, 79, 115, 0.42);
    stroke-width: 1.4;
}

.body-outline .man-shape {
    fill: #1f1f1f;
    stroke: none;
}

.body-hit path,
.body-hit circle,
.body-hit ellipse {
    fill: transparent;
    stroke: none;
    pointer-events: fill;
}

.marker {
    cursor: pointer;
    opacity: 0.58;
    stroke: #111;
    stroke-width: 1;
}

.intensity-legend {
    margin: 12px auto 0;
    width: min(100%, 460px);
    padding: 10px 12px 8px;
    border: 1px solid #d8d2c8;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
}

.legend-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.legend-title {
    font-size: 0.88rem;
    color: #595853;
}

#legendCurrent {
    font-size: 0.92rem;
    color: var(--feelings-accent);
}

.legend-scale {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
}

.legend-level {
    --legend-size: 12px;
    width: var(--legend-size);
    height: var(--legend-size);
    border-radius: 50%;
    border: 1px solid rgba(37, 39, 59, 0.18);
    background: var(--feelings-accent);
    opacity: 0.32;
    cursor: pointer;
    transition: opacity 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.legend-level[data-intensity="1"] {
    --legend-size: 11px;
}

.legend-level[data-intensity="3"] {
    --legend-size: 15px;
}

.legend-level[data-intensity="5"] {
    --legend-size: 19px;
}

.legend-level[data-intensity="7"] {
    --legend-size: 24px;
}

.legend-level[data-intensity="10"] {
    --legend-size: 29px;
}

.legend-level:hover {
    opacity: 0.58;
}

.legend-level.is-active {
    opacity: 0.95;
    transform: scale(1.08);
    box-shadow: 0 0 0 3px rgba(78, 79, 115, 0.2);
}

.legend-labels {
    margin-top: 6px;
    display: flex;
    justify-content: space-between;
    color: #77746d;
    font-size: 0.78rem;
}

.zones-summary {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid var(--feelings-border);
    border-radius: 12px;
    background: #fff;
}

.zones-summary h3 {
    margin: 0 0 8px;
    font-size: 1.02rem;
    color: var(--feelings-ink);
}

.zones-summary-text {
    margin: 0;
    color: #5f5d58;
    font-size: 0.9rem;
    line-height: 1.45;
}

.zones-top-list {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.zone-top-item {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 8px;
    align-items: center;
    padding: 7px 10px;
    border: 1px solid #e2ddd4;
    border-radius: 10px;
    background: #fcfbf8;
}

.zone-top-rank {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--feelings-accent);
    background: rgba(78, 79, 115, 0.12);
    font-size: 0.84rem;
}

.zone-top-text {
    font-size: 0.88rem;
    color: #3d3d3a;
    line-height: 1.35;
}

.zones-summary-list {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.zone-item-header {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.zone-name {
    font-weight: 600;
    color: #2f2f2f;
}

.zone-meta {
    color: #67635d;
    font-size: 0.86rem;
    white-space: nowrap;
}

.zone-track {
    height: 8px;
    border-radius: 999px;
    background: #ece8df;
    overflow: hidden;
}

.zone-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #7f83bb 0%, var(--feelings-accent) 100%);
}

.word-bank {
    margin-top: 18px;
}

.word-bank h3 {
    margin: 0 0 10px;
    font-size: 1.05rem;
}

.word-bank ul {
    list-style: none;
    columns: 2;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.word-bank ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    columns: unset;
    margin: 0;
    padding: 0;
}

.word-chip {
    border: 1px solid var(--feelings-border);
    background: #fff;
    color: var(--feelings-ink);
    border-radius: 999px;
    padding: 5px 12px;
    cursor: pointer;
    font-size: 0.88rem;
    transition: background 0.15s;
}

.word-chip:hover {
    background: var(--feelings-accent);
    color: #fff;
    border-color: var(--feelings-accent);
}

@media (max-width: 900px) {
    .tool-layout {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .controls-panel,
    .body-panel {
        padding: 18px;
    }

    input[type="text"],
    select {
        min-height: 44px;
        font-size: 16px;
    }

    .btn,
    .tag-btn,
    .help-chip,
    .word-chip {
        min-height: 42px;
        padding: 9px 13px;
    }

    .color-btn {
        width: 36px;
        height: 36px;
    }

    .actions-mobile-sticky {
        position: sticky;
        bottom: -2px;
        z-index: 3;
        margin-top: 16px;
        padding-top: 10px;
        background: linear-gradient(to top, rgba(255, 255, 255, 0.98) 68%, rgba(255, 255, 255, 0.2) 100%);
    }

    .actions-mobile-sticky .btn {
        flex: 1 1 calc(50% - 6px);
    }

    .actions-mobile-sticky #downloadPng {
        flex-basis: 100%;
    }

    #bodyMap,
    .intensity-legend {
        width: min(100%, 390px);
    }

    .word-bank ul {
        columns: 1;
    }
}

@media (max-width: 640px) {
    .controls-panel,
    .body-panel {
        padding: 14px;
    }

    .body-canvas-wrap {
        padding: 12px;
    }

    #bodyMap,
    .intensity-legend {
        width: min(100%, 340px);
    }

    .body-header h2 {
        font-size: 1.2rem;
    }

    .zone-meta {
        font-size: 0.8rem;
    }

    .suitcase-credit {
        gap: 10px;
    }

    .suitcase-credit-icon {
        width: 44px;
        height: 44px;
    }

    .suitcase-credit-cta {
        width: 100%;
    }
}
