:root {
    --bg: #f6f8f6;
    --paper: #ffffff;
    --ink: #18221f;
    --muted: #68736d;
    --line: #dce5df;
    --primary: #0b7f73;
    --primary-dark: #075f56;
    --accent: #e5a83b;
    --rose: #d95f76;
    --green: #5f9b68;
    --shadow: 0 24px 80px rgba(24, 34, 31, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(229, 168, 59, 0.22), transparent 31rem),
        radial-gradient(circle at 82% 18%, rgba(54, 126, 190, 0.14), transparent 28rem),
        linear-gradient(135deg, #f6f8f6 0%, #eaf4f1 48%, #f7f9fb 100%);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: var(--primary);
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 22px 0 56px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 38px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: var(--ink);
    color: var(--paper);
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(24, 34, 31, 0.18);
}

.brand small {
    color: var(--muted);
    font-weight: 700;
}

.nav {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.nav a,
.ghost-button {
    color: var(--ink);
    border: 0;
    background: transparent;
    cursor: pointer;
    font-weight: 700;
}

.nav-cta {
    padding: 10px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 253, 247, 0.78);
}

.hero-grid,
.auth-wrap,
.editor-layout,
.poll-create-layout,
.public-booking {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(340px, 1.05fr);
    gap: 34px;
    align-items: start;
}

.hero-copy,
.auth-copy,
.editor-copy,
.booking-intro {
    padding-top: 20px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-dark);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 760px;
    margin-bottom: 18px;
    font-size: clamp(2.3rem, 5vw, 5.4rem);
    line-height: 0.96;
    letter-spacing: 0;
}

h2 {
    font-size: 1.25rem;
    margin-bottom: 12px;
}

h3 {
    font-size: 1rem;
}

p {
    color: var(--muted);
    line-height: 1.7;
}

.hero-copy p,
.auth-copy p,
.editor-copy p,
.booking-intro p {
    max-width: 620px;
    font-size: 1.08rem;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 28px;
}

.panel {
    background: rgba(255, 253, 247, 0.88);
    border: 1px solid rgba(222, 216, 201, 0.9);
    border-radius: 22px;
    box-shadow: var(--shadow);
    padding: 24px;
    backdrop-filter: blur(14px);
}

.quick-panel {
    position: relative;
}

.panel-heading {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 18px;
}

.panel-heading h2,
.panel-heading p {
    margin-bottom: 0;
}

.mini-icon,
.integration-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 15px;
    color: var(--paper);
    background: var(--primary);
    font-weight: 900;
}

label {
    display: grid;
    gap: 8px;
    color: var(--ink);
    font-weight: 750;
    margin-bottom: 16px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
    color: var(--ink);
    padding: 13px 14px;
    outline: none;
    transition: border-color 0.16s, box-shadow 0.16s, transform 0.16s;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(12, 124, 123, 0.7);
    box-shadow: 0 0 0 4px rgba(12, 124, 123, 0.12);
}

.two-cols,
.three-cols {
    display: grid;
    gap: 14px;
}

.two-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-cols {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.slot-builder {
    display: grid;
    gap: 10px;
    margin: 18px 0;
}

.slot-builder-head,
.section-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.icon-button {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--primary);
    font-size: 1.4rem;
    cursor: pointer;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 18px;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 850;
    text-align: center;
    transition: transform 0.16s, box-shadow 0.16s, background 0.16s;
}

.button:hover {
    transform: translateY(-1px);
}

.button.primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 14px 28px rgba(12, 124, 123, 0.22);
}

.button.primary:hover {
    background: var(--primary-dark);
}

.button.secondary,
.button.google {
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--ink);
}

.button.compact {
    min-height: 36px;
    padding: 8px 13px;
    background: var(--ink);
    color: white;
}

.button.full {
    width: 100%;
}

.button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.flash {
    margin-bottom: 22px;
    padding: 14px 18px;
    border-radius: 16px;
    font-weight: 750;
}

.flash-success {
    background: rgba(95, 155, 104, 0.16);
    color: #2f6c39;
}

.flash-error {
    background: rgba(217, 95, 118, 0.14);
    color: #9a2c42;
}

.flash-info {
    background: rgba(12, 124, 123, 0.12);
    color: var(--primary-dark);
}

.section-grid {
    display: grid;
    grid-template-columns: 1fr 220px 220px;
    gap: 18px;
    align-items: stretch;
    margin-top: 44px;
}

.section-title h1,
.section-title h2 {
    margin-bottom: 8px;
}

.stat-card,
.item-card {
    background: rgba(255, 253, 247, 0.72);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 20px;
}

.stat-card strong {
    display: block;
    font-size: 1.8rem;
}

.stat-card span,
.muted,
.small {
    color: var(--muted);
}

.small {
    font-size: 0.9rem;
}

.center {
    text-align: center;
}

.list-section,
.settings-layout {
    margin-top: 42px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.item-card {
    min-height: 170px;
}

.status,
.pill {
    display: inline-flex;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(12, 124, 123, 0.1);
    color: var(--primary-dark);
    font-size: 0.82rem;
    font-weight: 850;
}

.status-confirmed {
    background: rgba(95, 155, 104, 0.16);
    color: #2f6c39;
}

.card-link {
    display: inline-flex;
    margin-top: 12px;
    font-weight: 850;
}

.auth-panel,
.editor-panel {
    max-width: 620px;
    margin-left: auto;
}

.poll-create-layout {
    grid-template-columns: minmax(280px, 0.55fr) minmax(0, 1.45fr);
}

.poll-builder-panel {
    max-width: none;
}

.calendar-workspace {
    display: grid;
    grid-template-columns: minmax(310px, 0.95fr) minmax(320px, 1.05fr);
    gap: 18px;
    align-items: start;
    margin: 18px 0;
}

.calendar-main,
.day-planner,
.selected-slots-panel {
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.62);
    padding: 16px;
}

.calendar-toolbar,
.day-planner-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.calendar-weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.calendar-weekdays span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 850;
    text-align: center;
}

.calendar-day {
    display: grid;
    gap: 4px;
    min-height: 68px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--paper);
    color: var(--ink);
    cursor: pointer;
    padding: 10px;
    text-align: left;
}

.calendar-day span {
    font-weight: 900;
}

.calendar-day small {
    color: var(--muted);
    font-size: 0.72rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-day.outside {
    opacity: 0.45;
}

.calendar-day:disabled {
    cursor: not-allowed;
    opacity: 0.34;
}

.calendar-day.has-events {
    border-color: rgba(217, 95, 118, 0.38);
    background: rgba(217, 95, 118, 0.08);
}

.calendar-day.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(11, 127, 115, 0.12);
}

.calendar-status {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(104, 115, 109, 0.12);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 850;
    white-space: nowrap;
}

.calendar-status[data-kind="ok"] {
    background: rgba(95, 155, 104, 0.15);
    color: #2f6c39;
}

.calendar-status[data-kind="error"] {
    background: rgba(217, 95, 118, 0.14);
    color: #9a2c42;
}

.time-slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 10px;
    max-height: 430px;
    overflow: auto;
    padding-right: 4px;
}

.time-slot-button {
    display: grid;
    gap: 4px;
    min-height: 62px;
    border: 1px solid rgba(95, 155, 104, 0.36);
    border-radius: 16px;
    background: rgba(95, 155, 104, 0.1);
    color: var(--ink);
    cursor: pointer;
    padding: 10px;
    text-align: left;
}

.time-slot-button strong {
    font-size: 1rem;
}

.time-slot-button span {
    color: #2f6c39;
    font-size: 0.76rem;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.time-slot-button.busy {
    border-color: rgba(217, 95, 118, 0.42);
    background: rgba(217, 95, 118, 0.1);
}

.time-slot-button.busy span {
    color: #9a2c42;
}

.time-slot-button.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.time-slot-button.selected span {
    color: rgba(255, 255, 255, 0.86);
}

.calendar-events {
    margin-top: 16px;
}

.calendar-events h3 {
    margin-bottom: 10px;
}

.calendar-event-card {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--paper);
    margin-bottom: 8px;
}

.calendar-event-card span {
    color: var(--muted);
    font-size: 0.86rem;
}

.selected-slots-panel {
    margin: 18px 0;
}

.selected-slot-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.selected-slot {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(95, 155, 104, 0.34);
    border-radius: 16px;
    background: rgba(95, 155, 104, 0.1);
}

.selected-slot.busy {
    border-color: rgba(217, 95, 118, 0.42);
    background: rgba(217, 95, 118, 0.1);
}

.selected-slot span {
    display: block;
    color: var(--muted);
    font-size: 0.86rem;
}

.form-warning {
    margin: 0;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(217, 95, 118, 0.13);
    color: #9a2c42;
    font-weight: 850;
}

.public-header,
.manage-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 28px;
}

.public-header h1,
.manage-header h1 {
    font-size: clamp(2rem, 4vw, 4.2rem);
}

.confirmed-banner {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(95, 155, 104, 0.16);
    color: #2f6c39;
    font-weight: 850;
}

.vote-layout,
.manage-grid {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.slot-vote-list,
.result-list,
.participant-list,
.booking-days {
    display: grid;
    gap: 14px;
}

.slot-vote-card,
.result-row,
.participant-card,
.availability-row,
.integration-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.48);
}

.slot-vote-card {
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
}

.slot-vote-card span,
.result-row span,
.participant-card span {
    display: block;
    color: var(--muted);
}

.vote-toggles {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.vote-toggles label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper);
    font-size: 0.9rem;
}

.vote-toggles input {
    width: auto;
}

.share-box {
    min-width: min(430px, 100%);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: end;
}

.share-box span {
    grid-column: 1 / -1;
    color: var(--muted);
    font-weight: 850;
}

.result-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
}

.result-row.selected {
    border-color: rgba(95, 155, 104, 0.6);
    background: rgba(95, 155, 104, 0.12);
}

.result-counts {
    display: flex;
    gap: 8px;
}

.result-counts span {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(12, 124, 123, 0.1);
    color: var(--primary-dark);
    font-weight: 850;
}

.input-prefix {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
    overflow: hidden;
}

.input-prefix span {
    padding-left: 14px;
    color: var(--muted);
    font-weight: 850;
}

.input-prefix input {
    border: 0;
    border-radius: 0;
}

.availability-list {
    display: grid;
    gap: 10px;
    margin: 20px 0;
}

.availability-row {
    grid-template-columns: 1fr 150px 150px;
    align-items: center;
}

.check-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.check-label input {
    width: auto;
}

.host-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 6px 0 16px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 253, 247, 0.74);
    font-weight: 850;
}

.host-chip img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.booking-form {
    max-height: none;
}

.booking-day {
    display: grid;
    gap: 10px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.time-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
    gap: 10px;
}

.time-option {
    margin: 0;
}

.time-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.time-option span {
    display: grid;
    place-items: center;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--paper);
    cursor: pointer;
    font-weight: 850;
}

.time-option input:checked + span {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.integration-card {
    grid-template-columns: auto 1fr auto;
    align-items: center;
}

.debug-box {
    max-width: 100%;
    overflow: auto;
    padding: 16px;
    border-radius: 14px;
    background: #18221f;
    color: #ffffff;
}

.empty-state {
    max-width: 680px;
    margin: 80px auto;
    text-align: center;
}

@media (max-width: 900px) {
    .hero-grid,
    .auth-wrap,
    .editor-layout,
    .poll-create-layout,
    .public-booking,
    .vote-layout,
    .manage-grid,
    .section-grid,
    .calendar-workspace {
        grid-template-columns: 1fr;
    }

    .auth-panel,
    .editor-panel {
        max-width: none;
        margin-left: 0;
    }

    .public-header,
    .manage-header {
        display: grid;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .shell {
        width: min(100% - 20px, 1180px);
        padding-top: 12px;
    }

    .topbar {
        align-items: flex-start;
        gap: 14px;
    }

    .nav {
        justify-content: flex-end;
        gap: 10px;
        font-size: 0.92rem;
    }

    h1 {
        font-size: 2.35rem;
        line-height: 1;
    }

    .panel {
        padding: 18px;
        border-radius: 18px;
    }

    .two-cols,
    .three-cols,
    .slot-vote-card,
    .result-row,
    .availability-row,
    .integration-card,
    .selected-slot {
        grid-template-columns: 1fr;
    }

    .share-box {
        grid-template-columns: 1fr;
    }

    .calendar-weekdays,
    .calendar-grid {
        gap: 5px;
    }

    .calendar-day {
        min-height: 56px;
        padding: 7px;
        border-radius: 13px;
    }

    .calendar-day small {
        font-size: 0.66rem;
    }
}
