@import url("https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&family=Fredoka:wght@400;500;600;700&display=swap");

:root {
    color-scheme: light dark;
    --ink: #3d2233;
    --muted: #9b7a8d;
    --panel: rgba(255, 255, 255, 0.9);
    --panel-strong: rgba(255, 255, 255, 0.98);
    --accent: #f472a8;
    --accent-2: #ff9ec4;
    --accent-3: #ffcbe0;
    --accent-dark: #c43d78;
    --accent-glow: rgba(244, 114, 168, 0.25);
    --outline: #fce4ef;
    --field-bg: rgba(255, 255, 255, 0.95);
    --dropdown-bg: rgba(255, 255, 255, 0.98);
    --dropdown-hover: rgba(244, 114, 168, 0.1);
    --shadow: none;
    --shadow-soft: none;
    --check-bg: #fff;
    --check-border: rgba(244, 114, 168, 0.4);
    --check-active-bg: linear-gradient(135deg, #f472a8, #ff9ec4);
    --check-active-border: rgba(196, 61, 120, 0.5);
    --switch-track: #f0d4e0;
    --switch-track-active: linear-gradient(135deg, #f472a8, #ff9ec4);
    --range-track: #fce4ef;
    --range-thumb: linear-gradient(135deg, #f472a8, #ff9ec4);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Quicksand", "Fredoka", "Segoe UI", sans-serif;
    background: linear-gradient(135deg, #fff5f9 0%, #ffe8f1 35%, #fff0f5 60%, #fef0f8 100%);
    color: var(--ink);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle at 14% 8%, rgba(244, 114, 168, 0.15), transparent 55%),
        radial-gradient(circle at 85% 12%, rgba(255, 158, 196, 0.14), transparent 55%),
        radial-gradient(circle at 18% 90%, rgba(255, 203, 224, 0.18), transparent 55%),
        radial-gradient(circle at 78% 82%, rgba(252, 228, 239, 0.2), transparent 55%);
    opacity: 0.8;
    pointer-events: none;
}

/* ── Page layout ─────────────────────────────────────── */

.page {
    width: 95vw;
    max-width: none;
    margin: 0 auto;
    padding: 32px 24px 48px;
    position: relative;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 1px 8px rgba(244, 114, 168, 0.06);
    border: 1px solid rgba(255, 230, 240, 0.7);
    backdrop-filter: blur(10px);
    animation: fadeDown 0.6s ease-out;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f472a8, #ffb3d4);
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.6);
}

.brand-title {
    font-family: "Fredoka", "Quicksand", sans-serif;
    font-size: 22px;
    letter-spacing: 0.2px;
    font-weight: 700;
    color: var(--ink);
}

.brand-sub {
    font-size: 13px;
    color: var(--muted);
}

.actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

/* ── Buttons ─────────────────────────────────────────── */

.button,
a.button {
    border: none;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    font-family: "Quicksand", "Fredoka", sans-serif;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(244, 114, 168, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

button {
    font-family: "Quicksand", "Fredoka", sans-serif;
}

.button:hover,
a.button:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 4px 16px rgba(244, 114, 168, 0.25);
}

.button.ghost,
a.button.ghost {
    background: transparent;
    color: var(--accent-dark);
    border: 1px solid rgba(244, 114, 168, 0.3);
    box-shadow: none;
}

.button.ghost:hover,
a.button.ghost:hover {
    background: rgba(244, 114, 168, 0.06);
    border-color: rgba(244, 114, 168, 0.5);
}

.button.full {
    width: 100%;
}

.button:focus-visible,
a.button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.button.small {
    padding: 6px 10px;
    font-size: 12px;
}

/* ── Layout ──────────────────────────────────────────── */

.layout {
    margin-top: 26px;
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr);
    gap: 20px;
    animation: fadeUp 0.7s ease-out;
}

.settings-layout {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* ── Panels ──────────────────────────────────────────── */

.error-banner {
    margin-top: 16px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(244, 114, 168, 0.12);
    border: 1px solid rgba(244, 114, 168, 0.3);
    color: var(--accent-dark);
}

.panel {
    background: var(--panel);
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 1px 6px rgba(244, 114, 168, 0.04);
    display: flex;
    flex-direction: column;
    gap: 14px;
    border: 1px solid rgba(255, 230, 240, 0.6);
    transition: transform 0.25s ease;
}

.trip-panel {
    margin-top: 18px;
}

.panel:hover {
    transform: translateY(-2px);
}

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

.panel-header h2 {
    font-family: "Fredoka", "Quicksand", sans-serif;
    font-size: 20px;
    margin: 0;
}

.panel-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.sidebar-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 0;
}

.sidebar-top,
.sidebar-bottom {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-bottom {
    padding-top: 14px;
    border-top: 1px dashed rgba(244, 114, 168, 0.2);
}

.empty {
    padding: 16px;
    border-radius: 12px;
    background: rgba(255, 240, 245, 0.7);
    color: var(--muted);
    text-align: center;
}

.pill {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(244, 114, 168, 0.14);
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 600;
}

.section-title {
    margin-top: 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

/* ── Collections & lists ─────────────────────────────── */

.collection-card {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid var(--outline);
    transition: transform 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.collection-card.active {
    border-color: rgba(244, 114, 168, 0.45);
    background: rgba(255, 240, 245, 0.6);
}

.collection-title {
    font-weight: 700;
}

.collection-meta {
    font-size: 12px;
    color: var(--muted);
}

.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px 10px 28px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.82);
    cursor: grab;
    transition: border-color 0.2s ease, transform 0.2s ease;
    position: relative;
    gap: 10px;
}

.list-row::before {
    content: "";
    position: absolute;
    left: 10px;
    width: 6px;
    height: 14px;
    border-radius: 6px;
    background: repeating-linear-gradient(
        to bottom,
        rgba(244, 114, 168, 0.4),
        rgba(244, 114, 168, 0.4) 2px,
        transparent 2px,
        transparent 4px
    );
    opacity: 0.6;
}

.list-row.active {
    border-color: rgba(244, 114, 168, 0.45);
    background: rgba(255, 240, 245, 0.5);
}

.list-row .count {
    margin-left: auto;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-dark);
}

/* ── Icon buttons ────────────────────────────────────── */

.icon-button {
    margin-left: auto;
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    cursor: pointer;
    transition: color 0.15s ease;
}

.collection-card .icon-button {
    position: absolute;
    top: 8px;
    right: 10px;
    margin-left: 0;
}

.list-row .icon-button {
    margin-left: 8px;
}

.icon-button:hover {
    color: var(--accent-dark);
}

/* ── Main panel ──────────────────────────────────────── */

.main-panel {
    background: var(--panel-strong);
}

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

.list-title {
    font-family: "Fredoka", "Quicksand", sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--ink);
}

.list-meta {
    font-size: 13px;
    color: var(--muted);
}

.trip-panel .list-meta {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
}

.list-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── Menu / dropdown ─────────────────────────────────── */

.menu {
    position: relative;
}

.menu-trigger {
    list-style: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--outline);
    display: grid;
    place-items: center;
    cursor: pointer;
    background: var(--field-bg);
    color: var(--accent-dark);
    font-size: 18px;
    transition: border-color 0.15s ease;
}

.menu-trigger:hover {
    border-color: rgba(244, 114, 168, 0.45);
}

.menu-trigger::-webkit-details-marker {
    display: none;
}

.menu-content {
    position: absolute;
    right: 0;
    top: 44px;
    min-width: 160px;
    background: var(--dropdown-bg);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(244, 114, 168, 0.1);
    border: 1px solid var(--outline);
    padding: 6px;
    display: grid;
    gap: 4px;
    z-index: 5;
}

.menu-item {
    border: none;
    background: transparent;
    text-align: left;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-family: "Quicksand", "Fredoka", sans-serif;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s ease, color 0.15s ease;
}

.menu-icon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.menu-item:hover {
    background: var(--dropdown-hover);
    color: var(--accent-dark);
}

/* ── Form elements ───────────────────────────────────── */

/* Inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="search"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="month"],
input[type="week"] {
    font-family: "Quicksand", "Fredoka", sans-serif;
    color: var(--ink);
    background: var(--field-bg);
    border: 1px solid var(--outline);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: rgba(244, 114, 168, 0.55);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
    opacity: 0.7;
}

/* Textarea */
textarea {
    font-family: "Quicksand", "Fredoka", sans-serif;
    color: var(--ink);
    background: var(--field-bg);
    border: 1px solid var(--outline);
    border-radius: 14px;
    padding: 12px;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Select */
select {
    font-family: "Quicksand", "Fredoka", sans-serif;
    color: var(--ink);
    background-color: var(--field-bg);
    border: 1px solid var(--outline);
    border-radius: 12px;
    padding: 10px 36px 10px 12px;
    font-size: 13px;
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--accent-dark) 50%),
        linear-gradient(135deg, var(--accent-dark) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
    background-size: 6px 6px;
    background-repeat: no-repeat;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

select:focus {
    outline: none;
    border-color: rgba(244, 114, 168, 0.55);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

option {
    color: var(--ink);
    background: var(--dropdown-bg);
}

/* Checkbox */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    border: 2px solid var(--check-border);
    border-radius: 4px;
    background: var(--check-bg);
    cursor: pointer;
    position: relative;
    transition: background 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
    margin: 0;
}

input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent-dark);
}

input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

input[type="checkbox"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Radio */
input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--check-border);
    border-radius: 50%;
    background: var(--check-bg);
    cursor: pointer;
    position: relative;
    transition: border-color 0.2s ease;
    flex-shrink: 0;
}

input[type="radio"]:checked {
    border-color: var(--accent-dark);
}

input[type="radio"]:checked::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--accent);
}

input[type="radio"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Range slider */
input[type="range"] {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--range-track);
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid white;
    box-shadow: 0 1px 6px rgba(244, 114, 168, 0.3);
    cursor: grab;
    transition: transform 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid white;
    box-shadow: 0 1px 6px rgba(244, 114, 168, 0.3);
    cursor: grab;
}

/* File input */
input[type="file"] {
    font-family: "Quicksand", "Fredoka", sans-serif;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
}

input[type="file"]::file-selector-button {
    font-family: "Quicksand", "Fredoka", sans-serif;
    border: 1px solid var(--outline);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-right: 12px;
    transition: transform 0.15s ease;
}

input[type="file"]::file-selector-button:hover {
    transform: translateY(-1px);
}

/* Color input */
input[type="color"] {
    appearance: none;
    -webkit-appearance: none;
    width: 40px;
    height: 40px;
    border: 2px solid var(--outline);
    border-radius: 10px;
    padding: 2px;
    cursor: pointer;
    background: var(--field-bg);
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 7px;
}

/* Label */
label {
    font-family: "Quicksand", "Fredoka", sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
}

/* Fieldset & legend */
fieldset {
    border: 1px solid var(--outline);
    border-radius: 14px;
    padding: 16px;
    margin: 0;
}

legend {
    font-family: "Fredoka", "Quicksand", sans-serif;
    font-weight: 600;
    color: var(--accent-dark);
    padding: 0 8px;
    font-size: 14px;
}

/* Progress bar */
progress {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    border: none;
}

progress::-webkit-progress-bar {
    background: var(--range-track);
    border-radius: 4px;
}

progress::-webkit-progress-value {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-radius: 4px;
}

progress::-moz-progress-bar {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-radius: 4px;
}

/* ── Item input / add row ────────────────────────────── */

.item-input {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.item-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.item-actions .menu {
    margin-left: auto;
}

.child-item-input {
    margin-left: 36px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0 2px;
}

.child-item-input input {
    flex: 1;
    border-radius: 12px;
    border: 1px solid var(--outline);
    padding: 8px 10px;
    font-size: 13px;
    background: var(--field-bg);
}

.inline-control {
    border: 1px solid var(--outline);
    background: var(--field-bg);
    color: var(--muted);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    font-family: "Quicksand", "Fredoka", sans-serif;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, color 0.2s ease;
}

.inline-control:hover {
    transform: translateY(-1px);
    color: var(--accent-dark);
}

.inline-control.active {
    background: rgba(244, 114, 168, 0.14);
    color: var(--accent-dark);
    border-color: rgba(244, 114, 168, 0.4);
}

.item-input input {
    flex: 1;
    min-width: 180px;
    border-radius: 14px;
    border: 1px solid var(--outline);
    padding: 12px 14px;
    font-size: 14px;
    background: var(--field-bg);
}

.item-input input:focus {
    outline: none;
    border-color: rgba(244, 114, 168, 0.55);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── Item rows ───────────────────────────────────────── */

.item-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.trip-item-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.trip-item-add {
    padding: 8px 12px 4px;
}

.item-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--outline);
    transition: transform 0.2s ease;
    cursor: grab;
}

.item-row.child {
    margin-left: 26px;
    background: rgba(244, 114, 168, 0.06);
    border-style: dashed;
    cursor: default;
}

.item-text-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.item-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(244, 114, 168, 0.15);
    color: var(--accent-dark);
}

.item-row:hover {
    transform: translateY(-2px);
}

/* ── Check circles ───────────────────────────────────── */

.check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--check-border);
    background: var(--check-bg);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
}

.check.checked {
    background: var(--accent);
    border-color: var(--accent-dark);
}

.check.checked::after {
    content: "";
    width: 8px;
    height: 4px;
    border-left: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(-45deg);
}

.item-text {
    font-weight: 600;
}

.item-row.completed .item-text {
    text-decoration: line-through;
    color: var(--accent-dark);
}

.item-row.completed {
    opacity: 1;
    background: rgba(244, 114, 168, 0.1);
    border-color: rgba(244, 114, 168, 0.3);
}

.item-row.completed .item-note {
    color: var(--accent-dark);
    opacity: 0.75;
}

.item-note {
    font-size: 12px;
    color: var(--muted);
}

.item-source {
    margin-top: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-dark);
}

.item-text-input {
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--outline);
    padding: 6px 10px;
    font-size: 14px;
    background: var(--field-bg);
}

.tag {
    margin-left: auto;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 203, 224, 0.3);
    color: var(--accent-dark);
    font-weight: 600;
}

/* ── Chips ───────────────────────────────────────────── */

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--outline);
    background: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: 600;
    cursor: grab;
}

.chip.static {
    cursor: default;
}

.chip-remove {
    margin-left: 6px;
    border: none;
    background: transparent;
    color: var(--accent-dark);
    font-weight: 700;
    cursor: pointer;
}

/* ── Resolved list ───────────────────────────────────── */

.resolved-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.resolved-list li {
    padding: 10px 12px 10px 32px;
    border-radius: 12px;
    background: rgba(255, 240, 245, 0.7);
    border: 1px dashed rgba(244, 114, 168, 0.25);
    position: relative;
}

.resolved-list li::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.resolved-list li.optional {
    color: var(--muted);
    border-color: rgba(244, 114, 168, 0.15);
}

.panel-actions {
    display: flex;
    gap: 10px;
}

/* ── Trips ───────────────────────────────────────────── */

.trip-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.trip-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
}

.trip-row {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--outline);
    background: var(--field-bg);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.trip-row:hover {
    border-color: rgba(244, 114, 168, 0.3);
}

.trip-row.active {
    border-color: rgba(244, 114, 168, 0.5);
    background: rgba(255, 240, 245, 0.5);
}

.trip-row.archived {
    opacity: 0.6;
}

.trip-title {
    font-weight: 600;
}

.trip-meta {
    font-size: 12px;
    color: var(--muted);
}

.trip-actions {
    margin-top: 6px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.active-trip-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px dashed rgba(244, 114, 168, 0.3);
    background: rgba(255, 240, 245, 0.4);
}

.active-trip-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    flex: 1;
}

/* ── Export / schedules ───────────────────────────────── */

.export-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.schedule-form {
    display: grid;
    gap: 10px;
}

.schedule-form label {
    display: grid;
    gap: 6px;
    font-size: 12px;
    color: var(--muted);
}

.schedule-form input,
.schedule-form select {
    border-radius: 12px;
    border: 1px solid var(--outline);
    padding: 10px 12px;
    font-size: 13px;
    background: var(--field-bg);
}

.schedule-form select,
.inline-form select {
    padding-right: 36px;
}

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.schedule-row {
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--outline);
    background: var(--field-bg);
    display: grid;
    gap: 8px;
}

.schedule-row input {
    border-radius: 10px;
    border: 1px solid var(--outline);
    padding: 8px 10px;
    font-size: 12px;
    background: var(--field-bg);
}

.schedule-meta {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-dark);
}

.schedule-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── Modal ───────────────────────────────────────────── */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(60, 30, 45, 0.3);
    backdrop-filter: blur(4px);
    display: grid;
    place-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 100;
}

.modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    width: min(520px, 90vw);
    background: var(--dropdown-bg);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 40px rgba(244, 114, 168, 0.12);
    border: 1px solid var(--outline);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

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

.modal-title {
    font-family: "Fredoka", "Quicksand", sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--ink);
}

.modal-sub {
    font-size: 13px;
    color: var(--muted);
}

.modal-count {
    margin-top: 6px;
    font-size: 12px;
    color: var(--accent-dark);
    font-weight: 600;
}

.modal textarea {
    min-height: 150px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ── Forms ────────────────────────────────────────────── */

.form-grid {
    display: grid;
    gap: 12px;
}

.form-grid label {
    display: grid;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
}

.form-grid input {
    border-radius: 12px;
    border: 1px solid var(--outline);
    padding: 10px 12px;
    font-size: 14px;
    background: var(--field-bg);
}

.trip-list-select {
    display: grid;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(244, 114, 168, 0.2);
}

.trip-list-options {
    display: grid;
    gap: 6px;
    max-height: 180px;
    overflow: auto;
    padding: 8px;
    border-radius: 12px;
    border: 1px solid var(--outline);
    background: var(--field-bg);
}

.trip-list-option {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}

.trip-list-hint {
    font-size: 12px;
    color: var(--muted);
}

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.inline-form input,
.inline-form select {
    flex: 1;
    min-width: 160px;
    border-radius: 12px;
    border: 1px solid var(--outline);
    padding: 10px 12px;
    font-size: 13px;
    background: var(--field-bg);
}

.inline-edit {
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--outline);
    padding: 6px 10px;
    font-size: 13px;
    background: var(--field-bg);
    font-family: "Quicksand", "Fredoka", sans-serif;
}

.item-note-input {
    margin-top: 6px;
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--outline);
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.5;
    background: var(--field-bg);
    min-height: 72px;
    resize: vertical;
    font-family: "Quicksand", "Fredoka", sans-serif;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.item-note-input:focus {
    outline: none;
    border-color: rgba(244, 114, 168, 0.55);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.item-note-input::placeholder {
    color: var(--muted);
}

.note-actions {
    margin-top: 6px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.inline-form select {
    min-height: 38px;
}

/* ── Scrollbar ───────────────────────────────────────── */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(244, 114, 168, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(244, 114, 168, 0.35);
}

/* ── Login page ──────────────────────────────────────── */

.login-page {
    display: grid;
    place-items: center;
    min-height: 70vh;
    animation: fadeUp 0.7s ease-out;
}

.login-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 40px 48px;
    border-radius: 24px;
    background: var(--panel-strong);
    border: 1px solid rgba(255, 230, 240, 0.6);
    box-shadow: 0 4px 30px rgba(244, 114, 168, 0.08);
    text-align: center;
    max-width: 360px;
    width: 100%;
}

.login-card .brand-mark {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    margin-bottom: 4px;
}

.login-card .brand-title {
    font-size: 28px;
}

.login-card .brand-sub {
    margin-bottom: 8px;
}

/* ── Animations ──────────────────────────────────────── */

@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Light theme (explicit) ──────────────────────────── */

:root[data-theme="light"] {
    color-scheme: light;
}

/* ── Dark theme (explicit) ───────────────────────────── */

:root[data-theme="dark"] {
    color-scheme: dark;
    --ink: #fce4ef;
    --muted: #d4a8be;
    --panel: rgba(30, 16, 24, 0.92);
    --panel-strong: rgba(36, 18, 28, 0.98);
    --outline: rgba(255, 255, 255, 0.1);
    --accent: #e8608f;
    --accent-2: #d4507d;
    --accent-3: #f0a0bd;
    --accent-dark: #ffb3d4;
    --accent-glow: rgba(232, 96, 143, 0.25);
    --field-bg: rgba(36, 18, 28, 0.95);
    --dropdown-bg: rgba(30, 14, 22, 0.98);
    --dropdown-hover: rgba(232, 96, 143, 0.12);
    --check-bg: rgba(36, 18, 28, 0.9);
    --check-border: rgba(232, 96, 143, 0.4);
    --range-track: rgba(232, 96, 143, 0.2);
}

:root[data-theme="dark"] .button:hover,
:root[data-theme="dark"] a.button:hover {
    box-shadow: 0 4px 16px rgba(232, 96, 143, 0.2);
}

:root[data-theme="dark"] body {
    background: linear-gradient(135deg, #1e1018 0%, #2a1420 45%, #201822 100%);
    color: var(--ink);
}

:root[data-theme="dark"] body::before {
    background-image:
        radial-gradient(circle at 18% 12%, rgba(232, 96, 143, 0.1), transparent 55%),
        radial-gradient(circle at 80% 14%, rgba(255, 158, 196, 0.08), transparent 55%),
        radial-gradient(circle at 22% 82%, rgba(240, 160, 189, 0.08), transparent 55%),
        radial-gradient(circle at 80% 80%, rgba(252, 228, 239, 0.06), transparent 55%);
    opacity: 0.6;
}

:root[data-theme="dark"] .topbar {
    background: rgba(30, 16, 24, 0.92);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

:root[data-theme="dark"] .panel {
    background: var(--panel);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

:root[data-theme="dark"] .main-panel {
    background: var(--panel-strong);
}

:root[data-theme="dark"] .collection-card,
:root[data-theme="dark"] .list-row,
:root[data-theme="dark"] .item-row,
:root[data-theme="dark"] .menu-trigger,
:root[data-theme="dark"] .menu-content,
:root[data-theme="dark"] .chip,
:root[data-theme="dark"] .item-input input,
:root[data-theme="dark"] .modal-card,
:root[data-theme="dark"] .empty,
:root[data-theme="dark"] .resolved-list li {
    background: var(--field-bg);
    border-color: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .menu-content {
    background: var(--dropdown-bg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

:root[data-theme="dark"] .inline-control {
    background: var(--field-bg);
    color: var(--muted);
    border-color: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .button.ghost,
:root[data-theme="dark"] a.button.ghost {
    border-color: rgba(255, 255, 255, 0.15);
}

:root[data-theme="dark"] .check {
    background: var(--check-bg);
    border-color: var(--check-border);
}

:root[data-theme="dark"] .check.checked {
    background: var(--accent);
    border-color: rgba(255, 179, 212, 0.5);
}

:root[data-theme="dark"] .check.checked::after {
    border-left-color: #fce4ef;
    border-bottom-color: #fce4ef;
}

:root[data-theme="dark"] .item-row.completed {
    background: rgba(232, 96, 143, 0.2);
    border-color: rgba(255, 179, 212, 0.35);
}

:root[data-theme="dark"] .item-row.child {
    background: rgba(232, 96, 143, 0.1);
}

:root[data-theme="dark"] .item-row.completed .item-text,
:root[data-theme="dark"] .item-row.completed .item-note {
    color: var(--accent-dark);
}

:root[data-theme="dark"] .collection-card.active {
    background: rgba(232, 96, 143, 0.12);
}

:root[data-theme="dark"] .list-row.active {
    background: rgba(232, 96, 143, 0.1);
}

:root[data-theme="dark"] .modal-card {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

/* ── Dark theme (system preference) ──────────────────── */

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        color-scheme: dark;
        --ink: #fce4ef;
        --muted: #d4a8be;
        --panel: rgba(30, 16, 24, 0.92);
        --panel-strong: rgba(36, 18, 28, 0.98);
        --outline: rgba(255, 255, 255, 0.1);
        --accent: #e8608f;
        --accent-2: #d4507d;
        --accent-3: #f0a0bd;
        --accent-dark: #ffb3d4;
        --accent-glow: rgba(232, 96, 143, 0.25);
        --field-bg: rgba(36, 18, 28, 0.95);
        --dropdown-bg: rgba(30, 14, 22, 0.98);
        --dropdown-hover: rgba(232, 96, 143, 0.12);
        --check-bg: rgba(36, 18, 28, 0.9);
        --check-border: rgba(232, 96, 143, 0.4);
        --range-track: rgba(232, 96, 143, 0.2);
    }

    :root:not([data-theme]) body {
        background: linear-gradient(135deg, #1e1018 0%, #2a1420 45%, #201822 100%);
        color: var(--ink);
    }

    :root:not([data-theme]) body::before {
        background-image:
            radial-gradient(circle at 18% 12%, rgba(232, 96, 143, 0.1), transparent 55%),
            radial-gradient(circle at 80% 14%, rgba(255, 158, 196, 0.08), transparent 55%),
            radial-gradient(circle at 22% 82%, rgba(240, 160, 189, 0.08), transparent 55%),
            radial-gradient(circle at 80% 80%, rgba(252, 228, 239, 0.06), transparent 55%);
        opacity: 0.6;
    }

    :root:not([data-theme]) .topbar {
        background: rgba(30, 16, 24, 0.92);
        border-color: rgba(255, 255, 255, 0.08);
        box-shadow: none;
    }

    :root:not([data-theme]) .panel {
        background: var(--panel);
        border-color: rgba(255, 255, 255, 0.08);
        box-shadow: none;
    }

    :root:not([data-theme]) .main-panel {
        background: var(--panel-strong);
    }

    :root:not([data-theme]) .collection-card,
    :root:not([data-theme]) .list-row,
    :root:not([data-theme]) .item-row,
    :root:not([data-theme]) .menu-trigger,
    :root:not([data-theme]) .menu-content,
    :root:not([data-theme]) .chip,
    :root:not([data-theme]) .item-input input,
    :root:not([data-theme]) .modal-card,
    :root:not([data-theme]) .empty,
    :root:not([data-theme]) .resolved-list li {
        background: var(--field-bg);
        border-color: rgba(255, 255, 255, 0.08);
    }

    :root:not([data-theme]) .menu-content {
        background: var(--dropdown-bg);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }

    :root:not([data-theme]) .inline-control {
        background: var(--field-bg);
        color: var(--muted);
        border-color: rgba(255, 255, 255, 0.08);
    }

    :root:not([data-theme]) .button.ghost,
    :root:not([data-theme]) a.button.ghost {
        border-color: rgba(255, 255, 255, 0.15);
    }

    :root:not([data-theme]) .check {
        background: var(--check-bg);
        border-color: var(--check-border);
    }

    :root:not([data-theme]) .check.checked {
        background: var(--accent);
        border-color: rgba(255, 179, 212, 0.5);
    }

    :root:not([data-theme]) .check.checked::after {
        border-left-color: #fce4ef;
        border-bottom-color: #fce4ef;
    }

    :root:not([data-theme]) .item-row.completed {
        background: rgba(232, 96, 143, 0.2);
        border-color: rgba(255, 179, 212, 0.35);
    }

    :root:not([data-theme]) .item-row.child {
        background: rgba(232, 96, 143, 0.1);
    }

    :root:not([data-theme]) .item-row.completed .item-text,
    :root:not([data-theme]) .item-row.completed .item-note {
        color: var(--accent-dark);
    }

    :root:not([data-theme]) .button:hover,
    :root:not([data-theme]) a.button:hover {
        box-shadow: 0 4px 16px rgba(232, 96, 143, 0.2);
    }

    :root:not([data-theme]) .collection-card.active {
        background: rgba(232, 96, 143, 0.12);
    }

    :root:not([data-theme]) .list-row.active {
        background: rgba(232, 96, 143, 0.1);
    }

    :root:not([data-theme]) .modal-card {
        box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    }
}

/* ── Responsive ──────────────────────────────────────── */

@media (max-width: 1100px) {
    .layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .item-input {
        flex-direction: column;
        align-items: stretch;
    }
}
