:root {
    --bg: #f8e3c8;
    --bg-soft: #f4d9b8;
    --card-bg: #fdf2dd;
    --card-stroke: #f0cfa2;
    --accent: #d78246;
    --accent-strong: #b66432;

    --text-main: #5a3a24;
    --text-soft: #8c6a49;
    --text-muted: #b58c63;

    --radius-lg: 26px;
    --radius-pill: 999px;

    --shadow-soft: 0 14px 30px rgba(203, 152, 92, 0.25);
}

/* базовый каркас */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
        sans-serif;
    background: radial-gradient(circle at top, var(--bg), var(--bg-soft));
    color: var(--text-main);
}

.app {
    min-height: 100vh;
    max-width: 420px;
    margin: 0 auto;
    padding: 16px 14px 80px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.app-beige {
    background: transparent;
}

/* карточка */

.card {
    background-color: var(--card-bg);
    background-image: var(--snow-cap);
    background-repeat: no-repeat;
    background-size: 100% var(--snow-cap-height);
    background-position: 0 0;
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--card-stroke);
    box-shadow: var(--shadow-soft);
    padding: 14px 16px;
}

/* заголовок */

.wishlist-header h1 {
    margin: 0 0 6px;
    font-size: 22px;
}

.wishlist-subtitle {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--text-soft);
}

/* панель */

.wishlist-panel {
    display: flex;
    flex-direction: column;
}

.wishlist-tabs {
    display: flex;
    gap: 6px;
    background: var(--bg-soft);
    border-radius: 999px;
    padding: 4px;
    border: 1px solid var(--card-stroke);
}

.wishlist-limit {
    margin: 10px 0 0;
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
}

.wishlist-tab {
    flex: 1;
    border: none;
    border-radius: 999px;
    padding: 7px 8px;
    font-size: 13px;
    color: var(--text-soft);
    background: transparent;
    cursor: pointer;
}

.wishlist-tab-active {
    background: var(--card-bg);
    color: var(--text-main);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.6);
}

.wishlist-empty {
    margin: 14px 0 6px;
    font-size: 13px;
    color: var(--text-soft);
    text-align: center;
}

.wishlist-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.wishlist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 18px;
    border: 1px solid var(--wish-accent, rgba(236, 192, 138, 0.85));
    background: var(--wish-bg, #fff6e6);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.wishlist-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--wish-accent, #eac08a), transparent);
    opacity: 0.7;
}

.wishlist-item-readonly {
    cursor: pointer;
}

.wishlist-item-thumb {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--wish-thumb, #fbe8ca);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex: 0 0 auto;
    overflow: hidden;
}

.wishlist-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wishlist-item-text {
    flex: 1;
    min-width: 0;
}

.wishlist-item-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.wishlist-item-desc {
    margin: 3px 0 0;
    font-size: 12px;
    color: var(--text-soft);
}

.wishlist-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.wishlist-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--wish-accent, rgba(232, 186, 119, 0.7));
    background: var(--wish-pill, #fff1df);
    color: var(--text-main);
    white-space: nowrap;
}

.wishlist-pill .wishlist-pill-icon {
    font-size: 12px;
    line-height: 1;
}

.wishlist-pill.priority {
    border-style: dashed;
}

.wishlist-pill.priority::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--priority-accent, #d89a3d);
}

.wishlist-heart {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
}

.wishlist-heart.is-active {
    color: #d89a3d;
}

.wishlist-item[data-category="gift"] {
    --wish-accent: rgba(232, 176, 120, 0.95);
    --wish-bg: #fff0db;
    --wish-thumb: #ffe0bf;
    --wish-pill: #ffe6c9;
}

.wishlist-item[data-category="experience"] {
    --wish-accent: rgba(204, 170, 228, 0.95);
    --wish-bg: #fff3f7;
    --wish-thumb: #f3def5;
    --wish-pill: #f6e7fb;
}

.wishlist-item[data-category="together"] {
    --wish-accent: rgba(156, 199, 182, 0.95);
    --wish-bg: #f3fbf7;
    --wish-thumb: #dff3ea;
    --wish-pill: #e3f7ef;
}

.wishlist-item[data-priority="high"] {
    --priority-accent: #d36a4b;
}

.wishlist-item[data-priority="medium"] {
    --priority-accent: #d89a3d;
}

.wishlist-item[data-priority="low"] {
    --priority-accent: #7d9b7e;
}

.wishlist-add-btn {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.wishlist-add-icon {
    width: 24px;
    height: 24px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
}

/* модалка */

.wishlist-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(41, 25, 11, 0.25);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding: 14px;
    z-index: 10;
}

.wishlist-modal {
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    max-height: 80svh;
    background: var(--card-bg);
    border-radius: 22px;
    border: 1px solid var(--card-stroke);
    box-shadow: var(--shadow-soft);
    padding: 14px 14px 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.wishlist-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.wishlist-modal-header h3 {
    margin: 0;
    font-size: 17px;
}

.wishlist-modal-close {
    border: none;
    background: transparent;
    font-size: 16px;
    cursor: pointer;
    color: var(--text-soft);
}

.wishlist-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wishlist-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wishlist-field select {
    border-radius: 16px;
    border: 1px solid var(--card-stroke);
    padding: 9px 12px;
    font-size: 16px;
    background: var(--card-bg);
    color: var(--text-main);
    outline: none;
    box-sizing: border-box;
}

.wishlist-secret-field {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.wishlist-lock {
    font-size: 12px;
    margin-left: 6px;
    opacity: 0.6;
}

.wishlist-field.is-locked {
    opacity: 0.7;
    cursor: pointer;
}

.wishlist-field.is-locked select,
.wishlist-field.is-locked input[type="checkbox"] {
    pointer-events: none;
}

.wishlist-field:not(.is-locked) .wishlist-lock {
    display: none;
}

.wishlist-field-label {
    font-size: 12px;
    color: var(--text-soft);
}

.wishlist-field input,
.wishlist-field textarea {
    border-radius: 16px;
    border: 1px solid var(--card-stroke);
    padding: 9px 12px;
    font-size: 16px;
    background: var(--card-bg);
    color: var(--text-main);
    outline: none;
    box-sizing: border-box;
}

.wishlist-field textarea {
    resize: vertical;
    min-height: 80px;
}

.wishlist-file {
    position: relative;
    display: flex;
    width: 100%;
    align-items: center;
    gap: 10px;
    border-radius: 16px;
    border: 1px solid var(--card-stroke);
    padding: 8px 10px;
    background: var(--card-bg);
}

.wishlist-file input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    padding: 0;
    border: none;
    background: transparent;
}

.wishlist-file:focus-within {
    box-shadow: 0 0 0 2px var(--accent-soft);
}

.wishlist-file-button {
    border-radius: 999px;
    border: 1px solid var(--card-stroke);
    background: var(--bg-soft);
    color: var(--text-soft);
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.wishlist-file-name {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wishlist-preview {
    width: 100%;
    border-radius: 18px;
    border: 1px solid var(--card-stroke);
    object-fit: cover;
}

.wishlist-form-hint {
    margin: 4px 0 0;
    font-size: 12px;
    color: #b6493a;
    text-align: center;
}

.wishlist-form-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.wishlist-view {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 6px 4px 2px;
}

.wishlist-view-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.wishlist-view-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--wish-accent, rgba(232, 186, 119, 0.7));
    background: var(--wish-pill, #fff1df);
    color: var(--text-main);
}

.wishlist-view-pill .wishlist-pill-icon {
    font-size: 12px;
    line-height: 1;
}

.wishlist-view-pill.priority {
    border-style: dashed;
}

.wishlist-view-pill.priority::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--priority-accent, #d89a3d);
}

.wishlist-view[data-category="gift"] {
    --wish-accent: rgba(232, 176, 120, 0.95);
    --wish-pill: #ffe6c9;
}

.wishlist-view[data-category="experience"] {
    --wish-accent: rgba(204, 170, 228, 0.95);
    --wish-pill: #f6e7fb;
}

.wishlist-view[data-category="together"] {
    --wish-accent: rgba(156, 199, 182, 0.95);
    --wish-pill: #e3f7ef;
}

.wishlist-view[data-category="gift"] .wishlist-view-emoji {
    background: #ffe0bf;
}

.wishlist-view[data-category="experience"] .wishlist-view-emoji {
    background: #f3def5;
}

.wishlist-view[data-category="together"] .wishlist-view-emoji {
    background: #dff3ea;
}

.wishlist-view[data-priority="high"] {
    --priority-accent: #d36a4b;
}

.wishlist-view[data-priority="medium"] {
    --priority-accent: #d89a3d;
}

.wishlist-view[data-priority="low"] {
    --priority-accent: #7d9b7e;
}

.wishlist-view-title {
    margin: 0;
    font-size: 16px;
    color: var(--text-main);
}

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

.wishlist-view-emoji {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.wishlist-view-image {
    width: 100%;
    border-radius: 16px;
    border: 1px solid var(--card-stroke);
    object-fit: cover;
}

.wishlist-view-link {
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
    word-break: break-all;
}

.wishlist-view-link.is-copied {
    color: var(--accent-strong);
    text-decoration: underline;
}

.wishlist-view-description {
    margin: 0;
    font-size: 13px;
    color: var(--text-soft);
    line-height: 1.35;
}

.secondary-btn {
    border-radius: var(--radius-pill);
    border: 1px solid var(--card-stroke);
    background: var(--card-bg);
    color: var(--text-soft);
    padding: 8px 12px;
    font-weight: 600;
    cursor: pointer;
}

.primary-btn.btn-bounce {
    animation: btn-bounce 0.18s ease-out;
}

@keyframes btn-bounce {
    0% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(1px) scale(0.97);
    }

    100% {
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 390px) {
    .app {
        padding-inline: 10px;
    }

    .wishlist-item {
        padding: 8px 10px;
    }
}
