* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    background: #f7f7f5;
    color: #1f2924;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
    line-height: 1.6;
}

a {
    color: inherit;
}

.container {
    width: min(1100px, calc(100% - 40px));
    margin: 0 auto;
}

/* Header */

.header {
    background: #ffffff;
    border-bottom: 1px solid #e2e5e2;
}

.header-inner {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.logo {
    color: #18352a;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-decoration: none;
}

nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

nav a {
    color: #53615b;
    font-size: 0.9rem;
    text-decoration: none;
}

nav a:hover {
    color: #18352a;
}

/* Main */

main {
    min-height: calc(100vh - 128px);
}

/* Hut cards */

.hut-search {
    padding-top: 10px;
}

.hut-search input {
    width: 100%;
    height: 42px;
    padding: 0 13px;
    color: #1f2924;
    background: #ffffff;
    border: 1px solid #dfe3e0;
    border-radius: 7px;
    font: inherit;
    font-size: 0.85rem;
    outline: none;
}

.hut-search input::placeholder {
    color: #8a938e;
}

.hut-search input:focus {
    border-color: #18352a;
    box-shadow: 0 0 0 3px rgba(24, 53, 42, 0.08);
}

.huts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    padding: 20px 0;
}

.hut-card {
    display: block;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #dfe3e0;
    border-radius: 8px;
    text-decoration: none;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.hut-card:hover {
    border-color: #b8c2bc;
    box-shadow: 0 6px 20px rgba(20, 35, 28, 0.06);
    transform: translateY(-2px);
}

.hut-info h2 {
    margin: 0 0 8px;
    color: #18352a;
    font-size: 1.15rem;
    line-height: 1.3;
}

.hut-info p {
    margin: 0;
    color: #68736e;
    font-size: 0.9rem;
}

/* Card rating */

.hut-card-rating {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid #e6e9e7;
}

.rating-count {
    margin-top: 2px;
    color: #78827d;
    font-size: 0.7rem;
}

.rating-categories {
    display: grid;
    gap: 9px;
    margin-top: 12px;
}

.rating-category {
    display: grid;
    gap: 4px;
}

.rating-category span {
    color: #53615b;
    font-size: 0.72rem;
}

.rating-bar {
    width: 100%;
    height: 6px;
    overflow: hidden;
    background: #e8ebe9;
    border-radius: 999px;
}

.rating-bar-fill {
    height: 100%;
    background: #315a47;
    border-radius: 999px;
    transition: width 0.2s ease;
}

/* Card flags */

.hut-card-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #e6e9e7;
}

.hut-flag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    color: #53615b;
    background: #f1f3f1;
    border: 1px solid #dfe3e0;
    border-radius: 999px;
    font-size: 0.7rem;
    line-height: 1.4;
    white-space: nowrap;
}

.hut-flag strong {
    color: #18352a;
    font-size: 0.68rem;
    font-weight: 700;
}

/* Hut detail */

.hut-detail {
    max-width: 680px;
    padding: 28px 0 40px;
}

.hut-detail > a:first-child {
    display: inline-block;
    margin-bottom: 16px;
    color: #65716b;
    font-size: 0.8rem;
    text-decoration: none;
}

.hut-detail > a:first-child:hover {
    color: #18352a;
}

.hut-detail h1 {
    margin: 0 0 6px;
    color: #18352a;
    font-size: 2rem;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.hut-detail > p {
    max-width: 600px;
    margin: 0 0 20px;
    color: #65716b;
    font-size: 0.85rem;
}

/* Detail sections */

.hut-rating,
.hut-flags,
.rating-form {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #dfe3e0;
}

.hut-detail h2 {
    margin: 0 0 12px;
    color: #18352a;
    font-size: 1rem;
}

/* Detail rating */

.rating-total {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 2px;
}

.rating-total strong {
    color: #18352a;
    font-size: 1.8rem;
    line-height: 1;
}

.rating-total span {
    color: #78827d;
    font-size: 0.75rem;
}

.hut-rating > p {
    margin: 0 0 12px;
    color: #78827d;
    font-size: 0.75rem;
}

.hut-rating dl {
    display: grid;
    grid-template-columns: 1fr auto;
    margin: 0;
    border-top: 1px solid #e6e9e7;
}

.hut-rating dt,
.hut-rating dd {
    margin: 0;
    padding: 7px 0;
    border-bottom: 1px solid #e6e9e7;
    font-size: 0.78rem;
}

.hut-rating dt {
    color: #4e5b55;
}

.hut-rating dd {
    color: #18352a;
    font-weight: 600;
}

/* Detail flags */

.hut-flags ul {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hut-flags li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    color: #4e5b55;
    border-bottom: 1px solid #e6e9e7;
    font-size: 0.78rem;
}

/* Rating form */

.rating-form h2 {
    margin: 0 0 14px;
}

.rating-form form {
    display: grid;
    gap: 10px;
}

.rating-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 7px 0;
    border-bottom: 1px solid #e6e9e7;
}

.rating-group > label {
    color: #35423c;
    font-size: 0.78rem;
    font-weight: 600;
}

.rating-options {
    display: flex;
    flex-shrink: 0;
    gap: 4px;
}

.rating-options label {
    cursor: pointer;
}

.rating-options input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.rating-options span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    color: #53615b;
    background: #ffffff;
    border: 1px solid #cfd6d2;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
}

.rating-options input:checked + span {
    color: #ffffff;
    background: #18352a;
    border-color: #18352a;
}

.rating-options span:hover {
    border-color: #18352a;
}

/* Checkboxes */

fieldset {
    display: grid;
    gap: 6px;
    margin: 8px 0 0;
    padding: 0;
    border: 0;
}

fieldset legend {
    margin-bottom: 3px;
    color: #35423c;
    font-size: 0.78rem;
    font-weight: 600;
}

fieldset label {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #53615b;
    font-size: 0.78rem;
    cursor: pointer;
}

fieldset input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: #315a47;
}

/* Form button */

.rating-form button {
    width: fit-content;
    min-height: 36px;
    padding: 0 15px;
    margin-top: 5px;
    color: #ffffff;
    background: #18352a;
    border: 1px solid #18352a;
    border-radius: 5px;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}

.rating-form button:hover {
    background: #244838;
    border-color: #244838;
}

.rating-form button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(24, 53, 42, 0.15);
}

/* Footer */

footer {
    background: #ffffff;
    border-top: 1px solid #e2e5e2;
}

.footer-inner {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    color: #7a847f;
    font-size: 0.8rem;
}

.footer-inner span:first-child {
    color: #18352a;
    font-weight: 700;
    letter-spacing: 0.08em;
}

@media (max-width: 600px) {
    .container {
        width: min(100% - 28px, 1100px);
    }

    .header-inner {
        min-height: 58px;
    }

    nav {
        gap: 14px;
    }

    .huts {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 24px 0;
    }

    .hut-search {
        padding-top: 20px;
    }

    .hut-card {
        padding: 18px;
    }

    .hut-detail {
        padding: 22px 0 32px;
    }

    .hut-detail h1 {
        font-size: 1.7rem;
    }

    .hut-rating,
    .hut-flags,
    .rating-form {
        margin-top: 15px;
        padding-top: 15px;
    }

    .rating-group {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .rating-options span {
        width: 30px;
        height: 30px;
    }

    .footer-inner {
        min-height: 58px;
    }
}