/* ============================================
   DESIGN SYSTEM VARIABLES
   ============================================ */

:root {
    /* Primary Colors */
    --anthropic-black: #141413;
    --terracotta-brand: #c96442;
    --coral-accent: #d97757;

    /* Surfaces & Background */
    --parchment: #f5f4ed;
    --ivory: #faf9f5;
    --pure-white: #ffffff;
    --warm-sand: #e8e6dc;
    --dark-surface: #30302e;
    --deep-dark: #141413;

    /* Neutrals & Text */
    --charcoal-warm: #4d4c48;
    --olive-gray: #5e5d59;
    --stone-gray: #87867f;
    --dark-warm: #3d3d3a;
    --warm-silver: #b0aea5;

    /* Borders & Rings */
    --border-cream: #f0eee6;
    --border-warm: #e8e6dc;
    --border-dark: #30302e;
    --ring-warm: #d1cfc5;
    --ring-subtle: #dedc01;
    --ring-deep: #c2c0b6;

    /* Focus */
    --focus-blue: #3898ec;

    /* Typography */
    --font-serif: Georgia, serif;
    --font-sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
    --font-mono: monospace;

    /* Spacing */
    --spacing-xs: 3px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    /* Shadows */
    --shadow-ring: 0px 0px 0px 1px;
    --shadow-whisper: rgba(0, 0, 0, 0.05) 0px 4px 24px;

    /* Theme-ready UI aliases */
    --auth-panel-top: #f8f7f1;
    --auth-panel-bottom: #f3f1e7;
    --badge-neutral-bg: #ece9df;
    --badge-cloud-bg: #ddeedb;
    --badge-cloud-border: #95bc8f;
    --badge-cloud-text: #2f6a2f;
    --badge-local-bg: #efe7d8;
    --badge-local-border: #d4b37c;
    --badge-local-text: #805a20;
    --carousel-text: #111111;
    --card-yellow-bg: #f0e040;
    --card-purple-bg: #c8a0e0;
    --card-blue-bg: #60a8e8;
    --card-green-bg: #70d0a0;
    --indicator-bg: #cccccc;
    --indicator-active-bg: #111111;
    --indicator-hover-bg: #777777;
    --slide-editor-bg: rgba(250, 249, 245, 0.95);
}

html.night-mode {
    --parchment: #161614;
    --ivory: #1f1f1d;
    --pure-white: #272724;
    --warm-sand: #2e2d2a;
    --anthropic-black: #f2f0e9;
    --charcoal-warm: #e0ddd4;
    --olive-gray: #bcb8ad;
    --stone-gray: #a39f94;
    --dark-warm: #ece8df;
    --warm-silver: #9f9a8f;
    --border-cream: #3a3934;
    --border-warm: #4a4943;
    --ring-warm: #6a675d;
    --ring-subtle: #8f8747;
    --ring-deep: #68645a;
    --shadow-whisper: rgba(0, 0, 0, 0.45) 0px 8px 28px;
    --auth-panel-top: #262521;
    --auth-panel-bottom: #1f1e1b;
    --badge-neutral-bg: #34322d;
    --badge-cloud-bg: #284735;
    --badge-cloud-border: #4f8466;
    --badge-cloud-text: #d2efdd;
    --badge-local-bg: #4c3a23;
    --badge-local-border: #9a7443;
    --badge-local-text: #f0d4ac;
    --carousel-text: #f0eee7;
    --card-yellow-bg: #8f7b20;
    --card-purple-bg: #6f4f8b;
    --card-blue-bg: #3a6ea0;
    --card-green-bg: #3c7f65;
    --indicator-bg: #5d5a53;
    --indicator-active-bg: #f0eee7;
    --indicator-hover-bg: #8f8b82;
    --slide-editor-bg: rgba(34, 33, 30, 0.95);
}

/* ============================================
   GLOBAL STYLES
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--parchment);
    color: var(--anthropic-black);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.page-title {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 40;
    margin: 0;
    font-family: var(--font-serif);
    font-size: clamp(24px, 3.2vw, 38px);
    line-height: 1.1;
    color: var(--anthropic-black);
    letter-spacing: 0.08em;
    pointer-events: none;
}

html.app-mode-public .auth-panel,
html.app-mode-public .waypoint-controls,
html.app-mode-public .waypoint-status,
html.app-mode-public .slide-editor {
    display: none !important;
}

html.app-mode-public,
html.app-mode-public body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

html.app-mode-public body {
    margin: 0;
}

html.app-mode-public .waypoint-lab {
    width: 100vw;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

html.app-mode-public .waypoint-canvas {
    margin-top: 0;
    margin-bottom: 12px;
    width: min(calc(100vw - 8px), calc(100dvh - 24px));
    height: min(calc(100vw - 8px), calc(100dvh - 24px));
    max-width: none;
    max-height: none;
}

/* ============================================
   WAYPOINT LAB
   ============================================ */

.waypoint-lab {
    width: min(80%, calc(100vw - 40px));
    margin: auto;
    padding: 20px;
    background-color: var(--ivory);
    border: 1px solid var(--border-cream);
    border-radius: 18px;
    box-shadow: var(--shadow-whisper);
    max-width: 1280px;
   
}

.waypoint-lab.logged-out .waypoint-controls,
.waypoint-lab.logged-out .waypoint-canvas,
.waypoint-lab.logged-out #waypoint-status,
.waypoint-lab.logged-out #carousel-container,
.waypoint-lab.logged-out .carousel-backdrop,
.waypoint-lab.logged-out .waypoint-header {
    display: none;
}

.waypoint-header h1 {
    font-family: var(--font-serif);
    font-size: 34px;
    line-height: 1.15;
    margin-bottom: 6px;
}

.waypoint-header p {
    color: var(--olive-gray);
    font-size: 14px;
}

.auth-panel {
    margin-top: 14px;
    padding: 12px;
    border: 1px solid var(--border-warm);
    border-radius: 12px;
    background: linear-gradient(180deg, var(--auth-panel-top) 0%, var(--auth-panel-bottom) 100%);
}

.auth-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.auth-row label {
    font-size: 13px;
    color: var(--stone-gray);
}

.auth-row input {
    height: 38px;
    min-width: 170px;
    padding: 0 10px;
    border: 1px solid var(--border-warm);
    border-radius: 10px;
    background: var(--pure-white);
    color: var(--anthropic-black);
    font-size: 14px;
}

.auth-row input:focus {
    outline: 2px solid var(--focus-blue);
    outline-offset: 1px;
}

.auth-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.auth-actions button {
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border-warm);
    border-radius: 10px;
    background: var(--warm-sand);
    color: var(--charcoal-warm);
    cursor: pointer;
    transition: box-shadow 0.2s ease;
}

.auth-actions button:hover {
    box-shadow: var(--shadow-ring) var(--ring-warm);
}

.auth-actions button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.auth-storage-badge {
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 26px;
    font-weight: 700;
    letter-spacing: 0.04em;
    border: 1px solid var(--border-warm);
    background: var(--badge-neutral-bg);
    color: var(--charcoal-warm);
}

.auth-storage-badge[data-mode="cloud"] {
    background: var(--badge-cloud-bg);
    border-color: var(--badge-cloud-border);
    color: var(--badge-cloud-text);
}

.auth-storage-badge[data-mode="local"] {
    background: var(--badge-local-bg);
    border-color: var(--badge-local-border);
    color: var(--badge-local-text);
}

.auth-status {
    min-height: 20px;
    margin-top: 8px;
    font-size: 13px;
    color: var(--stone-gray);
}

.waypoint-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(76px, max-content));
    column-gap: 10px;
    row-gap: 10px;
    align-items: center;
    justify-content: start;
    margin-top: 14px;
}

.waypoint-controls label {
    font-size: 13px;
    color: var(--stone-gray);
    white-space: nowrap;
}

.word-select-control {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: max-content minmax(140px, 240px);
    gap: 10px;
    align-items: center;
}

.waypoint-controls input {
    height: 40px;
    text-align: center;
    font-size: 16px;
    border: 1px solid var(--border-warm);
    border-radius: 10px;
    background: var(--pure-white);
    color: var(--anthropic-black);
}

.waypoint-controls input[type="range"] {
    width: 100%;
    min-width: 110px;
    height: 40px;
    padding: 0;
    accent-color: var(--terracotta-brand);
}

.flip-speed-control {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 180px;
}

.waypoint-controls output {
    flex: 0 0 42px;
    color: var(--olive-gray);
    font-size: 13px;
    font-weight: 600;
}

#char-input {
    width: 56px;
    font-size: 24px;
}

#station-count {
    width: 86px;
    padding: 0 8px;
}

#visible-station-count {
    width: 86px;
    padding: 0 8px;
}

#frontend-visible-station-count {
    width: 86px;
    padding: 0 8px;
}

.waypoint-controls input:focus {
    outline: 2px solid var(--focus-blue);
    outline-offset: 1px;
}

.waypoint-controls input:disabled {
    color: var(--stone-gray);
    background: var(--warm-sand);
    cursor: not-allowed;
}

.waypoint-controls select {
    height: 40px;
    padding: 0 10px;
    font-size: 14px;
    border: 1px solid var(--border-warm);
    border-radius: 10px;
    background: var(--pure-white);
    color: var(--anthropic-black);
    font-family: var(--font-sans);
}

.prop-asset-browser-control {
    grid-column: 1 / -1;
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--border-warm);
    border-radius: 10px;
    background: color-mix(in srgb, var(--pure-white) 82%, var(--parchment) 18%);
}

.prop-asset-browser-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.prop-asset-browser-row select {
    flex: 1 1 180px;
    height: 40px;
    padding: 0 10px;
    font-size: 14px;
    border: 1px solid var(--border-warm);
    border-radius: 10px;
    background: var(--pure-white);
    color: var(--anthropic-black);
    font-family: var(--font-sans);
}

.prop-asset-browser-row button {
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border-warm);
    border-radius: 9px;
    background: var(--warm-sand);
    color: var(--charcoal-warm);
    cursor: pointer;
    white-space: nowrap;
}

.prop-asset-browser-row button:hover {
    box-shadow: var(--shadow-ring) var(--ring-warm);
}

.prop-asset-status {
    min-height: 18px;
    margin: 0;
    font-size: 13px;
    color: var(--stone-gray);
}

/* ── Public auth panel ─────────────────────────────── */
.public-auth-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    font-family: var(--font-sans, 'Noto Sans TC', sans-serif);
}

.public-auth-toggle {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-warm, #d4c9b8);
    background: var(--surface-primary, #faf8f5);
    color: var(--font-primary, #2a2520);
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transition: background 0.15s;
}

.public-auth-toggle:hover {
    background: var(--surface-secondary, #f0ece6);
}

.public-auth-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--surface-primary, #faf8f5);
    border: 1px solid var(--border-warm, #d4c9b8);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.14);
    min-width: 240px;
}

.public-auth-form[hidden] {
    display: none;
}

.public-auth-form label {
    font-size: 12px;
    color: var(--stone-gray, #87867f);
    margin-bottom: 0;
}

.public-auth-form input[type="email"],
.public-auth-form input[type="password"] {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--border-warm, #d4c9b8);
    border-radius: 6px;
    background: var(--surface-secondary, #f0ece6);
    font-size: 13px;
    box-sizing: border-box;
}

.public-auth-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.public-auth-actions button {
    flex: 1 1 auto;
    padding: 7px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-warm, #d4c9b8);
    background: var(--surface-primary, #faf8f5);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.public-auth-actions button:hover:not(:disabled) {
    background: var(--surface-secondary, #f0ece6);
}

.public-auth-actions button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.public-auth-status {
    font-size: 12px;
    color: var(--stone-gray, #87867f);
    margin: 2px 0 0;
    min-height: 16px;
}

.waypoint-control-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.waypoint-control-actions button {
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--border-warm);
    border-radius: 10px;
    background: var(--warm-sand);
    color: var(--charcoal-warm);
    cursor: pointer;
    transition: box-shadow 0.2s ease;
}

.waypoint-control-actions button:hover {
    box-shadow: var(--shadow-ring) var(--ring-warm);
}

.waypoint-status {
    min-height: 22px;
    margin-top: 10px;
    font-size: 13px;
    color: var(--stone-gray);
}

.waypoint-canvas {
    margin-top: 6px;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--parchment);
}

.waypoint-canvas text {
    font-family: var(--font-sans);
}

.waypoint-canvas[data-prop-editing="false"] [data-decorative-layer] {
    pointer-events: none;
}

.waypoint-canvas[data-prop-editing="true"] [data-decorative-prop="1"] {
    cursor: grab;
}

.waypoint-canvas[data-prop-editing="true"] [data-decorative-prop="1"][data-prop-selected="1"] {
    filter: drop-shadow(0 0 8px rgba(201, 100, 66, 0.45));
}

#prop-scale-down:disabled,
#prop-scale-up:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

/* ============================================
   PAGE CONTENT
   ============================================ */

.page-content {
    min-height: 100vh;
    padding: var(--spacing-2xl) var(--spacing-md);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.hero {
    display: flex;
    align-items: center;
    min-height: 60vh;
    padding: var(--spacing-2xl) 0;
}

.hero h1 {
    font-family: var(--font-serif);
    font-size: 64px;
    font-weight: 500;
    line-height: 1.1;
    margin-bottom: var(--spacing-lg);
    color: var(--anthropic-black);
}

.hero .body-large {
    font-size: 20px;
    line-height: 1.6;
    color: var(--olive-gray);
    max-width: 600px;
}

.feature-section {
    padding: var(--spacing-2xl) 0;
}

.feature-section h2 {
    font-family: var(--font-serif);
    font-size: 52px;
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: var(--spacing-xl);
    color: var(--anthropic-black);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
}

.card {
    background-color: var(--ivory);
    border: 1px solid var(--border-cream);
    border-radius: 8px;
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-whisper);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-ring) var(--ring-warm), var(--shadow-whisper);
}

.card h3 {
    font-family: var(--font-serif);
    font-size: 25.6px;
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    color: var(--anthropic-black);
}

.card p {
    font-size: 16px;
    line-height: 1.6;
    color: var(--olive-gray);
}

/* ============================================
   CAROUSEL STYLES
   ============================================ */

.carousel-container {
    position: fixed;
    bottom: var(--spacing-xl);
    left: 0;
    right: 0;
    width: 100vw;
    z-index: 1000;
    font-family: var(--font-sans);
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.42s ease, transform 0.42s ease;
}

.carousel-container.is-entering {
    opacity: 0;
    transform: translateY(18px);
    pointer-events: none;
}

.carousel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    z-index: 990;
    opacity: 1;
    transition: opacity 0.35s ease;
}

.carousel-backdrop.is-entering {
    opacity: 0;
}

.carousel-close {
    position: absolute;
    top: -14px;
    right: 0;
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--border-warm);
    border-radius: 10px;
    background: var(--ivory);
    color: var(--charcoal-warm);
    cursor: pointer;
    z-index: 1010;
    font-size: 13px;
}

.carousel-close:hover {
    box-shadow: var(--shadow-ring) var(--ring-warm);
}

.carousel-wrapper {
    width: 100%;
    overflow: hidden;
    padding: 20px 0;
    cursor: grab;
    user-select: none;
}

.carousel-wrapper:active {
    cursor: grabbing;
}

.waypoint-canvas {
    transition: filter 0.82s ease;
}

.waypoint-canvas.is-blurred {
    filter: blur(5px) saturate(0.9);
}

body.carousel-open .carousel-container {
    top: 50%;
    left: 0;
    right: 0;
    bottom: auto;
    transform: translateY(-50%);
    width: 100vw;
}

.carousel-track {
    display: flex;
    align-items: center;
    width: max-content;
    will-change: transform;
}

.carousel-item {
    width: 340px;
    height: 255px;
    margin-right: 24px;
    border-radius: 16px;
    flex-shrink: 0;
    position: relative;
    transition: filter 0.5s ease, transform 0.5s ease, opacity 0.5s ease;
    overflow: hidden;
}

.carousel-item::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background-image: radial-gradient(circle at 1px 1px, rgba(0, 0, 0, 0.07) 1px, transparent 0);
    background-size: 12px 12px;
    pointer-events: none;
    z-index: 0;
}

.carousel-item.is-blurred {
    filter: blur(3px);
    opacity: 0.5;
    transform: scale(0.94);
}

.carousel-item.is-focused {
    filter: blur(0px);
    opacity: 1;
    transform: scale(1);
    z-index: 2;
}

.carousel-content {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 1;
    text-align: right;
    padding: 20px 22px;
    max-width: 85%;
}

.carousel-text {
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--carousel-text);
    font-family: var(--font-sans);
    width: 100%;
}

.carousel-item:first-child .carousel-content {
    inset: 0;
    max-width: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.carousel-item:first-child .carousel-text {
    margin: 0;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.station-slide-title {
    display: inline-block;
    font-weight: 800;
    font-size: 17px;
    line-height: 1.25;
    letter-spacing: 0.02em;
    border-bottom: 0;
    padding-bottom: 0;
}

.card-yellow {
    background: var(--card-yellow-bg);
}

.card-purple {
    background: var(--card-purple-bg);
}

.card-blue {
    background: var(--card-blue-bg);
}

.card-green {
    background: var(--card-green-bg);
}

.carousel-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 16px 0 24px;
}

.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--indicator-bg);
    border: none;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
    padding: 0;
}

.indicator.active {
    background: var(--indicator-active-bg);
    transform: scale(1.3);
}

.indicator:hover {
    background: var(--indicator-hover-bg);
}

.slide-editor {
    width: min(900px, calc(100vw - 24px));
    margin: 0 auto;
    padding: 12px;
    border: 1px solid var(--border-cream);
    border-radius: 14px;
    background: var(--slide-editor-bg);
    box-shadow: var(--shadow-whisper);
}

.slide-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.slide-editor-header h3 {
    font-size: 15px;
    color: var(--charcoal-warm);
}

.slide-editor-actions {
    display: flex;
    gap: 8px;
}

.station-name-editor {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.station-name-editor label {
    font-size: 12px;
    color: var(--stone-gray);
}

.station-name-editor input {
    height: 32px;
    width: 200px;
    border: 1px solid var(--border-warm);
    border-radius: 9px;
    padding: 0 10px;
    font-size: 13px;
    background: var(--pure-white);
    color: var(--charcoal-warm);
}

.slide-editor-actions button {
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--border-warm);
    border-radius: 9px;
    background: var(--warm-sand);
    color: var(--charcoal-warm);
    cursor: pointer;
}

.slide-editor-actions button:hover {
    box-shadow: var(--shadow-ring) var(--ring-warm);
}

.slide-editor-status {
    min-height: 18px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--stone-gray);
}

.slide-editor-list {
    margin-top: 8px;
    display: grid;
    gap: 8px;
    max-height: 220px;
    overflow: auto;
    padding-right: 4px;
}

.slide-editor-item {
    display: grid;
    grid-template-columns: 1fr 122px auto;
    gap: 8px;
    align-items: start;
    padding: 8px;
    border: 1px solid var(--border-cream);
    border-radius: 10px;
    background: var(--pure-white);
}

.slide-editor-item textarea {
    min-height: 72px;
    resize: vertical;
    border: 1px solid var(--border-warm);
    border-radius: 8px;
    padding: 8px;
    font-size: 13px;
    font-family: var(--font-sans);
}

.slide-editor-item select {
    height: 34px;
    border: 1px solid var(--border-warm);
    border-radius: 8px;
    padding: 0 8px;
    font-size: 13px;
    background: var(--pure-white);
}

.slide-editor-row-actions {
    display: flex;
    gap: 6px;
}

.slide-editor-row-actions button {
    height: 30px;
    min-width: 30px;
    border: 1px solid var(--border-warm);
    border-radius: 8px;
    background: var(--ivory);
    cursor: pointer;
    color: var(--charcoal-warm);
}

.slide-editor-row-actions button:hover {
    box-shadow: var(--shadow-ring) var(--ring-warm);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    html.app-mode-public,
    html.app-mode-public body {
        height: 100%;
        overflow: hidden;
        overscroll-behavior: none;
        touch-action: manipulation;
    }

    .waypoint-lab {
        width: calc(100vw - 24px);
        margin: 12px;
        padding: 16px;
    }

    html.app-mode-public .waypoint-lab {
        width: 100vw;
        min-height: 100dvh;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    html.app-mode-public .waypoint-canvas {
        margin-top: 0;
        margin-bottom: 12px;
        width: min(calc(100vw - 8px), calc(100dvh - 24px));
        height: min(calc(100vw - 8px), calc(100dvh - 24px));
        max-width: none;
        max-height: none;
    }

    .waypoint-header h1 {
        font-size: 28px;
    }

    .auth-row {
        gap: 8px;
    }

    .auth-row input {
        min-width: 140px;
    }

    .carousel-container {
        width: 100vw;
        bottom: var(--spacing-md);
        left: 0;
        right: 0;
    }

    body.carousel-open .carousel-container {
        width: 100vw;
    }

    .carousel-item {
        width: 300px;
        height: 225px;
    }

    .carousel-content {
        padding: 16px 18px;
    }

    .slide-editor {
        width: calc(100vw - 24px);
    }

    .slide-editor-header {
        flex-wrap: wrap;
    }

    .station-name-editor {
        width: 100%;
    }

    .station-name-editor input {
        flex: 1;
        min-width: 0;
    }

    .slide-editor-item {
        grid-template-columns: 1fr;
    }

    .slide-editor-row-actions {
        justify-content: flex-end;
    }

    .carousel-text {
        font-size: 18px;
        line-height: 1.7;
    }

    .hero h1 {
        font-size: 36px;
    }

    .feature-section h2 {
        font-size: 32px;
    }
}

@media (max-width: 480px) {
    .waypoint-lab {
        width: calc(100vw - 16px);
        margin: 8px;
        padding: 12px;
    }

    html.app-mode-public .waypoint-lab {
        padding: 0;
    }

    html.app-mode-public .waypoint-canvas {
        margin-bottom: 12px;
        width: min(calc(100vw - 8px), calc(100dvh - 24px));
        height: min(calc(100vw - 8px), calc(100dvh - 24px));
        max-width: none;
        max-height: none;
    }

    .waypoint-controls {
        grid-template-columns: repeat(auto-fit, minmax(68px, max-content));
        column-gap: 8px;
        row-gap: 8px;
    }

    .word-select-control {
        grid-template-columns: max-content minmax(0, 1fr);
    }

    .auth-panel {
        padding: 10px;
    }

    .auth-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .auth-row input {
        width: 100%;
        min-width: 0;
        height: 36px;
    }

    .auth-actions button {
        height: 34px;
    }

    .auth-storage-badge {
        height: 24px;
        line-height: 24px;
        padding: 0 8px;
    }

    .waypoint-controls input {
        height: 36px;
        font-size: 16px;
    }

    #char-input {
        width: 50px;
        font-size: 22px;
    }

    #station-count {
        width: 76px;
    }

    #visible-station-count {
        width: 76px;
    }

    #frontend-visible-station-count {
        width: 76px;
    }

    .flip-speed-control {
        min-width: 150px;
    }

    .waypoint-control-actions button {
        height: 36px;
    }

    .prop-asset-browser-row select {
        height: 36px;
    }

    .prop-asset-browser-row button {
        height: 36px;
    }

    .carousel-container {
        width: 100vw;
        bottom: auto;
        top: 50%;
        left: 0;
        right: 0;
        transform: translateY(-50%);
    }

    .carousel-text {
        font-size: 18px;
        line-height: 1.75;
    }

    body.carousel-open .carousel-container {
        left: 0;
        right: 0;
        transform: translateY(-50%);
        width: 100vw;
    }

    .carousel-item {
        width: 260px;
        height: 195px;
    }

    .carousel-content {
        padding: 14px 14px;
    }

    .slide-editor {
        width: calc(100vw - 16px);
        padding: 10px;
    }

    .slide-editor-actions button {
        height: 30px;
    }

    .carousel-text {
        font-size: 11px;
    }

    .hero h1 {
        font-size: 25px;
    }
}
