@font-face {
    font-family: 'Ridley Grotesk';
    src: url("../fonts/Ridley Grotesk Light.d466b13fc3b4.otf") format('opentype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Ridley Grotesk';
    src: url("../fonts/Ridley Grotesk Regular.7de1b9aad6de.otf") format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Ridley Grotesk';
    src: url("../fonts/Ridley Grotesk Italic.8a72749ef51c.otf") format('opentype');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Ridley Grotesk';
    src: url("../fonts/Ridley Grotesk SemiBold.639aec3050bc.otf") format('opentype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Ridley Grotesk';
    src: url("../fonts/Ridley Grotesk Bold.2f2316783475.otf") format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --kg-bg: #F8F7F2;
    --kg-ink: #29352F;
    --kg-ink-soft: #4a564f;
    --kg-accent: #94BF8B;
    --kg-accent-deep: #6fa466;
    --kg-on-ink: #F8F7F2;
    --kg-shadow: 0 8px 24px rgba(41, 53, 47, 0.08);
    --kg-radius: 14px;
    --kg-font: 'Ridley Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--kg-bg);
    color: var(--kg-ink);
    font-family: var(--kg-font);
    font-weight: 400;
    /* Lock to viewport height so kiosk pages never scroll. dvh accounts for
       mobile browser chrome appearing/disappearing; vh is the fallback. */
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

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

body {
    display: flex;
    flex-direction: column;
}

/* Dashboard is staff-facing — allow it to grow and scroll naturally so
   tables and panels aren't clipped on shorter screens. */
body.page--dashboard {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
}

.brand-bar {
    background: var(--kg-ink);
    color: var(--kg-on-ink);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand-bar__home {
    display: inline-flex;
    text-decoration: none;
}

.brand-bar__logo {
    height: 44px;
    width: auto;
    display: block;
}

.brand-bar__title {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--kg-on-ink);
}

.page {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    min-height: 0;  /* allows flex children to shrink instead of overflowing */
}

/* Home / location list */
.home {
    width: 100%;
    max-width: 640px;
    text-align: center;
}

.home__heading {
    font-size: 2rem;
    margin: 0 0 24px;
    color: var(--kg-ink);
}

.home__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 14px;
}

.home__link {
    display: block;
    padding: 18px 24px;
    background: white;
    border-radius: var(--kg-radius);
    color: var(--kg-ink);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.15rem;
    box-shadow: var(--kg-shadow);
    border: 2px solid transparent;
    transition: border-color 120ms ease, transform 120ms ease;
}

.home__link:hover,
.home__link:focus {
    border-color: var(--kg-accent);
    outline: none;
    transform: translateY(-1px);
}

.home__empty {
    color: var(--kg-ink-soft);
}

/* Kiosk */
.page--kiosk {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    overscroll-behavior: contain;
}

.kiosk {
    width: 100%;
    max-width: clamp(920px, 72vw, 2400px);
    margin: 0 auto;
    text-align: center;
}

.kiosk__question {
    /* Sized larger than the button digits so the question reads as the
       primary visual element. Wraps to 2 lines on most screens - accepted
       trade-off for a stronger hierarchy. text-wrap: balance keeps the
       line break roughly symmetrical. */
    font-size: clamp(1.5rem, 3.6vw, 5.5rem);
    font-weight: 600;
    margin: 0 auto clamp(28px, 2.4vw, 56px);
    max-width: 95%;
    color: var(--kg-ink);
    line-height: 1.15;
    text-wrap: balance;
    text-shadow: 0 2px 4px rgba(41, 53, 47, 0.18);
}

.kiosk__form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(14px, 1.4vw, 28px);
    width: 100%;
}

.kiosk__scale {
    display: grid;
    grid-template-columns: repeat(11, minmax(0, 1fr));
    gap: clamp(6px, 0.8vw, 20px);
    width: 100%;
}

.kiosk__btn {
    appearance: none;
    border: 2px solid var(--kg-ink);
    background: white;
    color: var(--kg-ink);
    font-size: clamp(1rem, 2.2vw, 3.5rem);
    font-weight: 700;
    aspect-ratio: 1 / 1;
    border-radius: clamp(8px, 1vw, 28px);
    cursor: pointer;
    box-shadow: var(--kg-shadow);
    transition:
        background 180ms ease,
        color 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease,
        transform 80ms ease;
    -webkit-tap-highlight-color: transparent;
    min-width: 0;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kiosk__btn:hover,
.kiosk__btn:focus {
    background: var(--kg-accent);
    color: var(--kg-ink);
    outline: none;
}

.kiosk__btn:active {
    background: var(--kg-accent-deep);
    color: var(--kg-on-ink);
    transform: scale(0.97);
}

.kiosk__btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.kiosk__btn--chosen,
.kiosk__btn--chosen:disabled {
    background: var(--kg-accent-deep);
    color: var(--kg-on-ink);
    border-color: var(--kg-accent-deep);
    opacity: 1;
    box-shadow: 0 0 0 4px rgba(148, 191, 139, 0.35);
}

.kiosk__legend {
    width: 100%;
    display: flex;
    justify-content: space-between;
    color: var(--kg-ink-soft);
    font-size: clamp(0.85rem, 1vw, 1.4rem);
    letter-spacing: 0.02em;
    padding: 0 4px;
}

/* Thank you */
.thanks {
    text-align: center;
    width: 100%;
    max-width: clamp(640px, 80vw, 1800px);
    margin: 0 auto;
}

.thanks__badge {
    width: clamp(220px, 30vmin, 520px);
    height: auto;
    display: block;
    margin: 0 auto clamp(28px, 3vmin, 56px);
}

.thanks__heading {
    font-size: clamp(3.5rem, 10vw, 12rem);
    font-weight: 700;
    margin: 0 0 clamp(16px, 2vmin, 36px);
    color: var(--kg-ink);
    line-height: 1;
    letter-spacing: -0.01em;
}

.thanks__sub {
    font-size: clamp(1.4rem, 2.8vw, 3rem);
    color: var(--kg-ink-soft);
    margin: 0;
    line-height: 1.2;
}

.thanks__progress {
    margin: clamp(36px, 5vmin, 80px) auto clamp(16px, 1.6vmin, 32px);
    width: min(640px, 70%);
    height: clamp(8px, 1vmin, 16px);
    background: rgba(41, 53, 47, 0.12);
    border-radius: 999px;
    overflow: hidden;
}

.thanks__progress-bar {
    height: 100%;
    width: 0;
    background: var(--kg-accent-deep);
    border-radius: inherit;
    animation: kg-thanks-fill var(--thanks-duration, 10s) linear forwards;
}

@keyframes kg-thanks-fill {
    to { width: 100%; }
}

.thanks__countdown {
    margin: 0;
    color: var(--kg-ink-soft);
    font-size: clamp(1.1rem, 1.6vw, 1.8rem);
    letter-spacing: 0.04em;
}

.thanks__countdown-seconds {
    color: var(--kg-accent-deep);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    min-width: 2ch;
    display: inline-block;
    text-align: right;
}

/* Dashboard */
.page--dashboard .page {
    align-items: flex-start;
}

.dashboard {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.dashboard__topline {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.dashboard__heading {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--kg-ink);
}

.dashboard__back {
    color: var(--kg-ink-soft);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

.dashboard__back:hover {
    color: var(--kg-ink);
}

.dashboard__hero {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 2fr;
    gap: 20px;
}

.nps-card {
    background: white;
    border-radius: var(--kg-radius);
    box-shadow: var(--kg-shadow);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-left: 6px solid var(--kg-ink-soft);
}

.nps-card--low { border-left-color: #B5573B; }
.nps-card--mid { border-left-color: #d6a64b; }
.nps-card--good { border-left-color: var(--kg-accent); }
.nps-card--great { border-left-color: var(--kg-accent-deep); }
.nps-card--na { border-left-color: var(--kg-ink-soft); }

.nps-card__label {
    color: var(--kg-ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.8rem;
    font-weight: 600;
}

.nps-card__value {
    font-size: clamp(2.6rem, 5vw, 3.6rem);
    font-weight: 700;
    color: var(--kg-ink);
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
}

.nps-card__sub {
    color: var(--kg-ink-soft);
    font-size: 0.95rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.stat {
    background: white;
    border-radius: var(--kg-radius);
    box-shadow: var(--kg-shadow);
    padding: 20px;
    border-top: 4px solid var(--kg-ink-soft);
}

.stat--promoter { border-top-color: var(--kg-accent-deep); }
.stat--passive { border-top-color: #d6a64b; }
.stat--detractor { border-top-color: #B5573B; }

.stat__label {
    color: var(--kg-ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.75rem;
    font-weight: 600;
}

.stat__value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--kg-ink);
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}

.stat__sub {
    color: var(--kg-ink-soft);
    font-size: 0.9rem;
}

.dashboard__panel {
    background: white;
    border-radius: var(--kg-radius);
    box-shadow: var(--kg-shadow);
    padding: 22px 24px;
}

.dashboard__panel-title {
    margin: 0 0 16px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--kg-ink);
}

.dashboard__empty {
    color: var(--kg-ink-soft);
    margin: 0;
}

/* Distribution chart */
.distribution {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.distribution__row {
    display: grid;
    grid-template-columns: 36px 1fr 64px;
    align-items: center;
    gap: 12px;
}

.distribution__score {
    text-align: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--kg-ink);
    padding: 4px 0;
    border-radius: 6px;
    background: rgba(41, 53, 47, 0.06);
}

.distribution__score--promoter { color: var(--kg-accent-deep); background: rgba(148, 191, 139, 0.18); }
.distribution__score--passive { color: #a87f1f; background: rgba(214, 166, 75, 0.18); }
.distribution__score--detractor { color: #8E3F26; background: rgba(181, 87, 59, 0.15); }

.distribution__bar-track {
    height: 14px;
    background: rgba(41, 53, 47, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.distribution__bar {
    display: block;
    height: 100%;
    background: var(--kg-ink-soft);
    border-radius: inherit;
    transition: width 240ms ease;
}

.distribution__bar--promoter { background: var(--kg-accent-deep); }
.distribution__bar--passive { background: #d6a64b; }
.distribution__bar--detractor { background: #B5573B; }

.distribution__count {
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--kg-ink);
    font-weight: 600;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(41, 53, 47, 0.08);
}

.data-table th {
    color: var(--kg-ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.75rem;
    font-weight: 600;
}

.data-table td {
    color: var(--kg-ink);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.data-table__chip {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(41, 53, 47, 0.08);
    color: var(--kg-ink-soft);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.nps-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
    background: rgba(41, 53, 47, 0.08);
    color: var(--kg-ink);
}

.nps-pill--low { background: rgba(181, 87, 59, 0.15); color: #8E3F26; }
.nps-pill--mid { background: rgba(214, 166, 75, 0.18); color: #a87f1f; }
.nps-pill--good { background: rgba(148, 191, 139, 0.22); color: var(--kg-accent-deep); }
.nps-pill--great { background: var(--kg-accent-deep); color: var(--kg-on-ink); }
.nps-pill--na { background: rgba(41, 53, 47, 0.08); color: var(--kg-ink-soft); }

.cat-chip {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.8rem;
}

.cat-chip--promoter { background: rgba(148, 191, 139, 0.22); color: var(--kg-accent-deep); }
.cat-chip--passive { background: rgba(214, 166, 75, 0.18); color: #a87f1f; }
.cat-chip--detractor { background: rgba(181, 87, 59, 0.15); color: #8E3F26; }

@media (max-width: 720px) {
    .dashboard__hero {
        grid-template-columns: 1fr;
    }
    .stat-grid {
        grid-template-columns: 1fr;
    }
    .data-table {
        font-size: 0.85rem;
    }
}