/* EventDot Control — dotplanner-inspired design system */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --ed-bg: #08080a;
    --ed-bg-elevated: #0f0f12;
    --ed-surface: #141418;
    --ed-surface-hover: #1a1a20;
    --ed-surface-muted: #101014;
    --ed-border: #26262e;
    --ed-border-strong: #34343f;
    --ed-text: #f4f4f5;
    --ed-text-muted: #a1a1aa;
    --ed-text-soft: #71717a;
    --ed-accent: #a3e635;
    --ed-accent-hover: #bef264;
    --ed-accent-muted: rgba(163, 230, 53, 0.14);
    --ed-accent-text: #0a0a0a;
    --ed-danger: #f87171;
    --ed-danger-bg: rgba(248, 113, 113, 0.12);
    --ed-warning: #fbbf24;
    --ed-warning-bg: rgba(251, 191, 36, 0.12);
    --ed-success: #4ade80;
    --ed-success-bg: rgba(74, 222, 128, 0.12);
    --ed-info: #60a5fa;
    --ed-radius-sm: 0.5rem;
    --ed-radius: 0.75rem;
    --ed-radius-lg: 1rem;
    --ed-radius-xl: 1.25rem;
    --ed-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    --ed-shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.28);
    --ed-header-h: 4.25rem;
    --ed-max-w: 80rem;
    --ed-font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --ed-transition: 0.2s ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--ed-font);
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--ed-text);
    background: var(--ed-bg);
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--ed-accent);
    text-decoration: none;
    transition: color var(--ed-transition);
}

a:hover {
    color: var(--ed-accent-hover);
}

button,
input,
select,
textarea {
    font: inherit;
}

/* Ambient background */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    isolation: isolate;
}

.app-bg {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background:
        radial-gradient(ellipse 80% 50% at 10% -10%, rgba(163, 230, 53, 0.08), transparent 55%),
        radial-gradient(ellipse 60% 40% at 90% 0%, rgba(96, 165, 250, 0.06), transparent 50%),
        linear-gradient(180deg, var(--ed-bg) 0%, #0a0a0e 100%);
}

.app-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(180deg, black 0%, transparent 85%);
    opacity: 0.35;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Layout */
.ed-main {
    flex: 1;
    width: 100%;
    max-width: var(--ed-max-w);
    margin-inline: auto;
    padding: 1.25rem 1rem 2rem;
}

@media (min-width: 640px) {
    .ed-main {
        padding: 1.5rem 1.5rem 2.5rem;
    }
}

@media (min-width: 1024px) {
    .ed-main {
        padding: 2rem 1.5rem 3rem;
    }
}

.ed-layout-split {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .ed-layout-split {
        grid-template-columns: minmax(0, 1.15fr) minmax(280px, 400px);
    }

    .ed-layout-split--wide {
        grid-template-columns: minmax(0, 1.7fr) minmax(300px, 380px);
    }

    .ed-layout-split--form {
        grid-template-columns: minmax(0, 1.25fr) minmax(260px, 340px);
    }

    .ed-layout-split--admin {
        grid-template-columns: minmax(0, 1.7fr) minmax(300px, 420px);
    }
}

.ed-grid-2 {
    display: grid;
    gap: 1rem;
}

@media (min-width: 768px) {
    .ed-grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.ed-grid-3 {
    display: grid;
    gap: 1rem;
}

@media (min-width: 768px) {
    .ed-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .ed-grid-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.ed-grid-4 {
    display: grid;
    gap: 1rem;
}

@media (min-width: 768px) {
    .ed-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .ed-grid-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.ed-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ed-stack-lg {
    gap: 1.25rem;
}

.ed-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.ed-row-between {
    justify-content: space-between;
}

.ed-gap-sm {
    gap: 0.5rem;
}

.ed-mb-4 {
    margin-bottom: 1rem;
}

.ed-mb-6 {
    margin-bottom: 1.5rem;
}

.ed-mt-6 {
    margin-top: 1.5rem;
}

.ed-w-full {
    width: 100%;
}

.ed-center {
    text-align: center;
}

.ed-max-form {
    max-width: 28rem;
    margin-inline: auto;
}

.ed-max-hero {
    max-width: 64rem;
    margin-inline: auto;
}

/* Typography */
.ed-kicker {
    margin: 0;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ed-text-soft);
}

.ed-kicker-accent {
    color: var(--ed-accent);
}

.ed-heading-xl {
    margin: 0.75rem 0 0;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--ed-text);
}

.ed-heading-lg {
    margin: 0.5rem 0 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ed-text);
}

.ed-heading-md {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--ed-text);
}

.ed-lead {
    margin: 1rem 0 0;
    max-width: 42rem;
    color: var(--ed-text-muted);
    line-height: 1.65;
}

.ed-text-muted {
    color: var(--ed-text-muted);
}

.ed-text-soft {
    color: var(--ed-text-soft);
}

.ed-text-sm {
    font-size: 0.875rem;
}

/* Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--ed-border);
    background: rgba(8, 8, 10, 0.88);
    backdrop-filter: blur(16px);
    transition: box-shadow var(--ed-transition), border-color var(--ed-transition);
}

.app-header.is-scrolled {
    border-color: var(--ed-border-strong);
    box-shadow: var(--ed-shadow-soft);
}

.app-header-inner {
    display: flex;
    max-width: var(--ed-max-w);
    margin-inline: auto;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    min-height: var(--ed-header-h);
}

@media (min-width: 1024px) {
    .app-header-inner {
        padding: 0.75rem 1.5rem;
    }
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--ed-text);
    flex-shrink: 0;
}

.app-brand:hover {
    color: var(--ed-text);
}

.app-brand img {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--ed-radius-sm);
    object-fit: cover;
}

.app-brand-mark {
    display: inline-flex;
    width: 2.25rem;
    height: 2.25rem;
    align-items: center;
    justify-content: center;
    border-radius: var(--ed-radius-sm);
    background: linear-gradient(135deg, var(--ed-accent), #65a30d);
    color: var(--ed-accent-text);
    font-weight: 800;
    font-size: 1rem;
}

.app-brand-title {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.app-brand-sub {
    display: block;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ed-text-soft);
}

.app-header-toggle {
    display: inline-flex;
    margin-left: auto;
    padding: 0.5rem;
    border: 1px solid var(--ed-border);
    border-radius: var(--ed-radius-sm);
    background: var(--ed-surface);
    color: var(--ed-text);
    cursor: pointer;
}

.app-header-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
}

@media (min-width: 1024px) {
    .app-header-toggle {
        display: none;
    }
}

.app-header-panel {
    display: none;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    padding: 0 1rem 1rem;
    border-top: 1px solid var(--ed-border);
}

.app-header-panel.is-open {
    display: flex;
}

@media (min-width: 1024px) {
    .app-header-panel {
        display: flex !important;
        flex: 1;
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
        gap: 1rem;
        width: auto;
        padding: 0;
        border-top: none;
        opacity: 1 !important;
        transform: none !important;
        pointer-events: auto !important;
    }
}

.app-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.app-nav::-webkit-scrollbar {
    display: none;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ed-text-muted);
    white-space: nowrap;
    transition: background var(--ed-transition), color var(--ed-transition);
}

.nav-link:hover {
    background: var(--ed-surface-hover);
    color: var(--ed-text);
}

.nav-link-active {
    background: var(--ed-accent-muted);
    color: var(--ed-accent);
}

.nav-link-accent {
    border: 1px solid rgba(163, 230, 53, 0.35);
    background: rgba(163, 230, 53, 0.08);
    color: var(--ed-accent);
}

.nav-link-accent:hover {
    background: rgba(163, 230, 53, 0.16);
    color: var(--ed-accent-hover);
}

.app-session {
    border: 1px solid var(--ed-border);
    border-radius: var(--ed-radius);
    background: var(--ed-surface);
    padding: 0.5rem 0.85rem;
    font-size: 0.75rem;
    color: var(--ed-text-muted);
}

.app-session strong {
    display: block;
    color: var(--ed-text);
    font-weight: 600;
}

/* Footer */
.app-footer {
    margin-top: auto;
    border-top: 1px solid var(--ed-border);
    background: var(--ed-bg-elevated);
}

.app-footer-features {
    display: grid;
    gap: 1.25rem;
    max-width: var(--ed-max-w);
    margin-inline: auto;
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--ed-border);
}

@media (min-width: 768px) {
    .app-footer-features {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .app-footer-features {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        padding: 1.75rem 1.5rem;
    }
}

.app-footer-feature {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.app-footer-feature-icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ed-radius-sm);
    background: var(--ed-accent-muted);
    color: var(--ed-accent);
    font-size: 0.875rem;
    font-weight: 800;
}

.app-footer-feature h3 {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--ed-accent);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.app-footer-feature p {
    margin: 0.25rem 0 0;
    font-size: 0.8125rem;
    color: var(--ed-text-muted);
    line-height: 1.45;
}

.app-footer-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: var(--ed-max-w);
    margin-inline: auto;
    padding: 1rem 1rem 1.25rem;
    font-size: 0.8125rem;
    color: var(--ed-text-muted);
}

@media (min-width: 1024px) {
    .app-footer-bar {
        padding: 1rem 1.5rem 1.5rem;
    }
}

.app-footer-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.app-footer-brand img {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.35rem;
}

.app-footer-tagline {
    color: var(--ed-accent);
    font-weight: 600;
    font-size: 0.75rem;
}

/* Cards */
.glass-card {
    border: 1px solid var(--ed-border);
    border-radius: var(--ed-radius-lg);
    background: var(--ed-surface);
    box-shadow: var(--ed-shadow-soft);
}

.hero-card {
    background:
        linear-gradient(145deg, rgba(163, 230, 53, 0.06) 0%, transparent 45%),
        var(--ed-surface);
    border-color: rgba(163, 230, 53, 0.2);
}

.glass-card.pad-lg {
    padding: 1.75rem;
}

@media (min-width: 640px) {
    .glass-card.pad-lg {
        padding: 2rem;
    }
}

.glass-card.pad-md {
    padding: 1.25rem;
}

.glass-card.pad-sm {
    padding: 1rem;
}

.ed-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: var(--ed-accent-muted);
    color: var(--ed-accent);
    border: 1px solid rgba(163, 230, 53, 0.25);
}

.ed-inset {
    border: 1px solid var(--ed-border);
    border-radius: var(--ed-radius);
    background: var(--ed-surface-muted);
    padding: 0.85rem 1rem;
}

.ed-stat-value {
    margin: 0.35rem 0 0;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    color: var(--ed-text);
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border: none;
    border-radius: var(--ed-radius);
    font-size: 0.875rem;
    font-weight: 700;
    padding: 0.65rem 1.15rem;
    cursor: pointer;
    transition: transform 0.15s ease, background var(--ed-transition), border-color var(--ed-transition), box-shadow var(--ed-transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--ed-accent);
    color: var(--ed-accent-text);
    box-shadow: 0 4px 20px rgba(163, 230, 53, 0.25);
}

.btn-primary:hover {
    background: var(--ed-accent-hover);
    color: var(--ed-accent-text);
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(163, 230, 53, 0.32);
}

.btn-secondary {
    border: 1px solid var(--ed-border-strong);
    background: var(--ed-surface-muted);
    color: var(--ed-text);
}

.btn-secondary:hover {
    border-color: var(--ed-text-soft);
    background: var(--ed-surface-hover);
    color: var(--ed-text);
}

.btn-secondary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-danger {
    border: 1px solid rgba(248, 113, 113, 0.35);
    background: var(--ed-danger-bg);
    color: var(--ed-danger);
}

.btn-danger:hover {
    background: rgba(248, 113, 113, 0.2);
    color: #fca5a5;
}

.btn-primary.w-full,
.btn-secondary.w-full,
.btn-danger.w-full {
    width: 100%;
}

.btn-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ed-accent);
}

.btn-link:hover {
    color: var(--ed-accent-hover);
}

.btn-link-danger {
    color: var(--ed-danger);
}

.btn-link-danger:hover {
    color: #fca5a5;
}

/* Forms */
label.block,
.ed-field {
    display: block;
}

.ed-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ed-text-muted);
}

.input-modern,
select.input-modern,
textarea.input-modern {
    width: 100%;
    border-radius: var(--ed-radius);
    border: 1px solid var(--ed-border-strong);
    background: var(--ed-surface-muted);
    padding: 0.62rem 0.85rem;
    color: var(--ed-text);
    transition: border-color var(--ed-transition), box-shadow var(--ed-transition);
}

.input-modern::placeholder {
    color: var(--ed-text-soft);
}

.input-modern:focus {
    outline: none;
    border-color: var(--ed-accent);
    box-shadow: 0 0 0 3px var(--ed-accent-muted);
}

textarea.input-modern {
    min-height: 6rem;
    resize: vertical;
}

/* Alerts */
.ed-alert {
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--ed-radius);
    border: 1px solid transparent;
    font-size: 0.875rem;
}

.ed-alert--success {
    border-color: rgba(74, 222, 128, 0.35);
    background: var(--ed-success-bg);
    color: var(--ed-success);
}

.ed-alert--error {
    border-color: rgba(248, 113, 113, 0.35);
    background: var(--ed-danger-bg);
    color: #fecaca;
}

.ed-alert--warning {
    border-color: rgba(251, 191, 36, 0.35);
    background: var(--ed-warning-bg);
    color: #fde68a;
}

.ed-alert.hidden {
    display: none;
}

.ed-alert-list {
    margin: 0;
    padding-left: 1.15rem;
}

/* Status chips */
.status-chip {
    display: inline-flex;
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.status-draft {
    background: rgba(161, 161, 170, 0.2);
    color: #d4d4d8;
}

.status-review {
    background: rgba(251, 191, 36, 0.18);
    color: #fde68a;
}

.status-approved {
    background: rgba(74, 222, 128, 0.18);
    color: #86efac;
}

.status-archived {
    background: rgba(113, 113, 122, 0.2);
    color: #a1a1aa;
}

/* Tables */
.ed-table-wrap {
    overflow: hidden;
}

.ed-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.ed-table thead {
    background: var(--ed-surface-muted);
    color: var(--ed-text-muted);
}

.ed-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ed-table td {
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--ed-border);
    color: var(--ed-text-muted);
}

.ed-table tbody tr {
    transition: background var(--ed-transition);
}

.ed-table tbody tr:hover {
    background: var(--ed-surface-hover);
}

.ed-table td strong,
.ed-table .ed-cell-title {
    color: var(--ed-text);
    font-weight: 600;
}

.ed-table-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.ed-table-empty {
    padding: 2.5rem 1rem !important;
    text-align: center;
    color: var(--ed-text-soft);
}

.ed-org-card {
    display: block;
    border: 1px solid var(--ed-border);
    border-radius: var(--ed-radius-lg);
    background: var(--ed-surface-muted);
    padding: 1.25rem;
    color: inherit;
    transition: border-color var(--ed-transition), background var(--ed-transition), transform 0.15s ease;
}

.ed-org-card:hover {
    border-color: rgba(163, 230, 53, 0.35);
    background: var(--ed-surface-hover);
    color: inherit;
    transform: translateY(-2px);
}

.ed-empty-state {
    border: 1px dashed var(--ed-border-strong);
    border-radius: var(--ed-radius-lg);
    background: var(--ed-surface-muted);
    padding: 2rem 1rem;
    text-align: center;
    color: var(--ed-text-soft);
}

.ed-collab-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border: 1px solid var(--ed-border);
    border-radius: var(--ed-radius);
    background: var(--ed-surface-muted);
    padding: 0.85rem 1rem;
}

/* Mobile / desktop record lists */
.mobile-record-list {
    display: none;
}

.desktop-record-table {
    display: block;
}

.ed-record-card h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ed-text);
}

.ed-record-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 1rem;
}

/* Page header block */
.ed-page-header {
    margin-bottom: 1.5rem;
}

/* Auth layout */
.ed-auth-intro {
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Planner workspace (map editor) */
.map-stage {
    position: relative;
    min-height: 560px;
    cursor: default;
    border-radius: var(--ed-radius-lg);
    background: #0a0a0c;
    border: 1px solid var(--ed-border);
    user-select: none;
    -webkit-user-select: none;
}

.planner-map-chrome {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    left: 4.25rem;
    z-index: 30;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    pointer-events: none;
}

.planner-map-chrome > * {
    pointer-events: auto;
}

.planner-map-chrome-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0.35rem 0.65rem;
    border: 1px solid var(--ed-border-strong);
    border-radius: var(--ed-radius);
    background: rgba(20, 20, 24, 0.94);
    color: var(--ed-text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--ed-shadow-soft);
}

.planner-map-chrome-btn:hover {
    color: var(--ed-text);
    border-color: var(--ed-text-soft);
}

.planner-map-chrome-btn-icon {
    width: 2rem;
    min-width: 2rem;
    padding: 0.35rem;
}

.planner-map-chrome-btn-icon svg {
    width: 1rem;
    height: 1rem;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
}

.planner-map-chrome-pdf {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.planner-map-chrome-pdf.hidden,
.planner-map-chrome-pdf[hidden] {
    display: none !important;
}

.map-stage.map-stage-sidebar-open .planner-map-chrome {
    right: 0.65rem;
}

.map-stage.map-stage-sidebar-open .map-legend {
    right: calc(min(100%, 22rem) + 1rem);
}

.map-viewport,
.map-viewport .map-surface,
#mapImage,
#pdfCanvas {
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

.map-stage-tool-pan {
    cursor: grab;
}

.map-stage-tool-pan.map-stage-panning,
.map-stage-panning {
    cursor: grabbing;
}

.map-stage-tool-select {
    cursor: default;
}

.map-stage-tool-dot,
.map-stage-tool-zone,
.map-stage-tool-asset,
.map-stage-tool-calibration {
    cursor: crosshair;
}

.map-stage-tool-view {
    cursor: default;
}

.planner-tool-rail {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.35rem;
    border: 1px solid var(--ed-border-strong);
    border-radius: var(--ed-radius-lg);
    background: rgba(20, 20, 24, 0.96);
    box-shadow: var(--ed-shadow-soft);
    transform: translateY(-50%);
}

.planner-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    border: 1px solid transparent;
    border-radius: var(--ed-radius);
    background: transparent;
    color: var(--ed-text-muted);
    cursor: pointer;
    padding: 0;
    transition: background var(--ed-transition), border-color var(--ed-transition), color var(--ed-transition);
}

.planner-tool-btn:hover {
    background: var(--ed-surface-muted);
    color: var(--ed-text);
}

.planner-tool-btn-active {
    border-color: rgba(163, 230, 53, 0.45);
    background: var(--ed-accent-muted);
    color: var(--ed-accent);
}

.planner-tool-btn svg {
    width: 1.15rem;
    height: 1.15rem;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.planner-tool-divider {
    height: 1px;
    margin: 0.15rem 0.2rem;
    background: var(--ed-border-strong);
}

.planner-tool-hint {
    position: absolute;
    left: 4.25rem;
    top: 50%;
    z-index: 20;
    max-width: min(220px, calc(100% - 5rem));
    transform: translateY(-50%);
    border: 1px solid var(--ed-border-strong);
    border-radius: var(--ed-radius);
    background: rgba(20, 20, 24, 0.94);
    padding: 0.45rem 0.65rem;
    font-size: 0.72rem;
    line-height: 1.35;
    color: var(--ed-text-muted);
    pointer-events: none;
}

.planner-tool-hint strong {
    display: block;
    margin-bottom: 0.15rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--ed-text);
}

@media (max-width: 640px) {
    .planner-tool-hint {
        left: 0.75rem;
        top: auto;
        bottom: 0.75rem;
        transform: none;
        max-width: calc(100% - 1.5rem);
    }
}

/* Map properties drawer */
.planner-map-sidebar {
    position: absolute;
    top: 3.5rem;
    right: 0;
    bottom: 0;
    z-index: 24;
    display: flex;
    flex-direction: column;
    width: min(100%, 22rem);
    border-left: 1px solid var(--ed-border-strong);
    background: rgba(16, 16, 20, 0.98);
    box-shadow: -12px 0 32px rgba(0, 0, 0, 0.35);
    visibility: hidden;
    pointer-events: none;
    transform: translateX(100%);
    transition: transform 0.22s ease, visibility 0.22s ease;
}

.planner-map-sidebar.is-open {
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
}

.planner-sidebar-toggle {
    position: absolute;
    top: 50%;
    right: 0;
    z-index: 28;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 3.75rem;
    border: 1px solid var(--ed-border-strong);
    border-right: none;
    border-radius: var(--ed-radius) 0 0 var(--ed-radius);
    background: rgba(20, 20, 24, 0.96);
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.25);
    color: var(--ed-text-muted);
    cursor: pointer;
    padding: 0;
    transform: translateY(-50%);
    transition: color var(--ed-transition), border-color var(--ed-transition), background var(--ed-transition), right 0.22s ease;
}

.planner-sidebar-toggle:hover {
    color: var(--ed-accent);
    border-color: rgba(163, 230, 53, 0.35);
    background: rgba(24, 24, 28, 0.98);
}

.planner-sidebar-toggle.is-panel-open {
    right: min(100%, 22rem);
    color: var(--ed-accent);
    border-color: rgba(163, 230, 53, 0.35);
    border-right: 1px solid var(--ed-border-strong);
    border-radius: var(--ed-radius) 0 0 var(--ed-radius);
}

.planner-sidebar-toggle svg {
    width: 1rem;
    height: 1rem;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.planner-map-sidebar-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 0.9rem 0.65rem;
    border-bottom: 1px solid var(--ed-border);
}

.planner-map-sidebar-heading {
    min-width: 0;
}

.planner-map-sidebar-title {
    margin: 0.15rem 0 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ed-text);
}

.planner-map-sidebar-close {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid var(--ed-border-strong);
    border-radius: 999px;
    background: var(--ed-surface-muted);
    color: var(--ed-text-muted);
    cursor: pointer;
}

.planner-map-sidebar-close svg {
    display: block;
    width: 0.9rem;
    height: 0.9rem;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
}

.planner-map-sidebar-close:hover {
    color: var(--ed-text);
    border-color: var(--ed-text-soft);
}

.planner-map-sidebar-tabs {
    display: flex;
    gap: 0.35rem;
    padding: 0.55rem 0.75rem 0;
}

.planner-map-sidebar-tab {
    flex: 1;
    border: 1px solid var(--ed-border-strong);
    border-radius: 999px;
    background: transparent;
    color: var(--ed-text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.4rem 0.65rem;
    cursor: pointer;
    transition: all var(--ed-transition);
}

.planner-map-sidebar-tab:hover {
    color: var(--ed-text);
    border-color: var(--ed-text-soft);
}

.planner-map-sidebar-tab.is-active {
    border-color: rgba(163, 230, 53, 0.45);
    background: var(--ed-accent-muted);
    color: var(--ed-accent);
}

.planner-map-sidebar-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 0.75rem;
}

.planner-map-sidebar-panel-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.planner-map-sidebar-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.planner-map-sidebar-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.planner-map-sidebar-hint {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--ed-text-soft);
}

.planner-map-sidebar-notice {
    margin: 0;
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: var(--ed-radius);
    background: rgba(56, 189, 248, 0.08);
    padding: 0.65rem 0.75rem;
    font-size: 0.8125rem;
    color: #bae6fd;
}

.planner-map-sidebar-fields {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.planner-map-sidebar-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.planner-map-sidebar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.planner-map-sidebar-actions .btn-secondary,
.planner-map-sidebar-actions .btn-danger,
.planner-map-sidebar-callout .btn-secondary {
    min-height: 2rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
}

.planner-map-sidebar-callout {
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: var(--ed-radius);
    background: rgba(245, 158, 11, 0.08);
    padding: 0.65rem 0.75rem;
}

.planner-map-sidebar-callout-muted {
    border-color: var(--ed-border-strong);
    background: var(--ed-surface-muted);
    color: var(--ed-text-muted);
    font-size: 0.8125rem;
}

.planner-map-sidebar-callout-title {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fde68a;
}

.planner-map-sidebar-callout-meta {
    margin: 0.25rem 0 0;
    font-size: 0.75rem;
    color: rgba(253, 230, 138, 0.85);
}

.planner-map-sidebar-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.planner-summary-stack {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-top: 0.85rem;
}

.planner-summary-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 0.45rem;
}

.planner-color-input {
    height: 2.5rem;
    padding: 0.25rem;
}

.planner-color-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

@media (max-width: 768px) {
    .planner-sidebar-toggle {
        top: auto;
        bottom: 5rem;
        right: 0;
        width: 3.25rem;
        height: 2rem;
        border-right: 1px solid var(--ed-border-strong);
        border-bottom: none;
        border-radius: var(--ed-radius) var(--ed-radius) 0 0;
        transform: none;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.25);
    }

    .planner-sidebar-toggle.is-panel-open {
        right: 0;
        bottom: min(72vh, 520px);
    }

    .planner-map-sidebar {
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        max-height: min(72vh, 520px);
        border-left: none;
        border-top: 1px solid var(--ed-border-strong);
        transform: translateY(100%);
        box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.35);
    }

    .planner-map-sidebar.is-open {
        transform: translateY(0);
    }

    .map-stage.map-stage-sidebar-open .map-legend {
        right: 0.65rem;
    }
}

.map-viewport {
    position: relative;
    display: inline-block;
    max-width: 100%;
    vertical-align: top;
    transform-origin: top left;
    transition: transform 0.12s ease-out;
}

.map-marker-layer {
    position: absolute;
    inset: auto;
    z-index: 11;
    pointer-events: none;
    overflow: visible;
}

.map-marker-layer > .planner-dot,
.map-marker-layer > .planner-asset,
.map-marker-layer > .planner-zone,
.map-marker-layer > .planner-zone-polygon,
.map-marker-layer > .planner-calibration-line,
.map-marker-layer > .planner-calibration-preview-line {
    pointer-events: auto;
}

.planner-zone-polygon-fill,
.planner-zone-draft-layer-fill {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.planner-zone-polygon svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

.planner-zone-polygon polygon {
    pointer-events: auto;
}

.planner-zone-vertex {
    pointer-events: auto;
}

.map-surface {
    display: block;
    max-width: 100%;
    height: auto;
}

.planner-dot {
    position: absolute;
    z-index: 14;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    border-radius: 9999px;
    border: 3px solid rgba(255, 255, 255, 0.95);
    padding: 0;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.45);
    cursor: grab;
}

.planner-dot-selected {
    outline: 3px solid var(--ed-accent);
    outline-offset: 1px;
}

.planner-summary-stat,
.planner-mini-stat {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--ed-border);
    border-radius: var(--ed-radius);
    background: var(--ed-surface-muted);
    padding: 0.8rem;
}

.planner-mini-stat strong {
    font-size: 1.35rem;
    line-height: 1;
    color: var(--ed-text);
}

.planner-mini-stat span {
    margin-top: 0.3rem;
    font-size: 0.8rem;
    color: var(--ed-text-soft);
}

.planner-workspace {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.planner-workflow-panel {
    margin-bottom: 1.5rem;
}

.planner-workflow-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.planner-workflow-summary::-webkit-details-marker {
    display: none;
}

.planner-workflow-summary-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ed-text-soft);
    margin-right: 0.25rem;
}

.planner-workflow-summary-meta {
    font-size: 0.8125rem;
    color: var(--ed-text-muted);
}

.planner-workflow-summary-stats {
    font-size: 0.8125rem;
    color: var(--ed-text-soft);
    margin-left: auto;
}

.planner-workflow-chevron {
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid var(--ed-text-soft);
    border-bottom: 2px solid var(--ed-text-soft);
    transform: rotate(45deg);
    transition: transform 0.15s ease;
    flex: 0 0 auto;
}

.planner-workflow-panel[open] .planner-workflow-chevron {
    transform: rotate(-135deg);
    margin-top: 0.2rem;
}

.planner-workflow-body {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--ed-border);
}

.planner-status-strip {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.planner-status-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ed-text-soft);
}

.planner-map-card {
    overflow: hidden;
}

.planner-map-heading {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ed-text);
}

.planner-map-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
}

.planner-map-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--ed-border);
}

.planner-map-header-copy {
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 0.5rem;
}

.planner-save-cluster {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
    flex: 0 0 auto;
}

.planner-save-state {
    margin: 0;
    text-align: right;
    font-size: 0.75rem;
    color: var(--ed-text-soft);
    line-height: 1.35;
}

.planner-save-state--dirty {
    color: #fbbf24;
}

.planner-map-upload {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 1rem;
    margin-bottom: 1.25rem;
    padding: 0.6rem 0.9rem;
    border: 1px dashed var(--ed-border-strong);
    border-radius: var(--ed-radius);
    background: var(--ed-surface-muted);
}

.planner-map-upload-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.45rem 0.75rem;
    min-width: 0;
    flex: 1 1 auto;
}

.planner-map-upload-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ed-text-soft);
}

.planner-map-upload-filename {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ed-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: min(100%, 28rem);
}

.planner-map-upload-filename--empty {
    font-style: italic;
    color: var(--ed-text-soft);
}

.planner-map-upload-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
}

.planner-map-upload-file input[type="file"] {
    max-width: 11rem;
    font-size: 0.75rem;
    color: var(--ed-text-muted);
}

.planner-map-upload-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
}

.planner-map-upload-note {
    font-size: 0.75rem;
    color: var(--ed-text-soft);
}

.planner-map-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.planner-map-empty {
    display: flex;
    min-height: 420px;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--ed-border-strong);
    border-radius: var(--ed-radius-lg);
    background: var(--ed-surface-muted);
    padding: 2rem 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--ed-text-soft);
}

.planner-map-footnote {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--ed-text-soft);
}

.planner-map-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border: 1px solid var(--ed-border);
    border-radius: var(--ed-radius);
    background: var(--ed-surface-muted);
    padding: 0.85rem 1rem;
}

.planner-panel-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.planner-tab-btn {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--ed-border-strong);
    border-radius: 999px;
    background: var(--ed-surface);
    color: var(--ed-text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 0.85rem;
    cursor: pointer;
    transition: all var(--ed-transition);
}

.planner-tab-btn:hover {
    border-color: var(--ed-text-soft);
    color: var(--ed-text);
}

.planner-tab-btn-active {
    border-color: rgba(163, 230, 53, 0.4);
    background: var(--ed-accent-muted);
    color: var(--ed-accent);
}

.planner-admin-panel {
    margin-top: 1.25rem;
}

.planner-role-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border: 1px solid var(--ed-border);
    border-radius: var(--ed-radius);
    background: var(--ed-surface-muted);
    padding: 0.85rem 1rem;
}

.planner-role-row-main {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.planner-role-swatch {
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    border-radius: 999px;
    background-color: var(--role-color, #64748b);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 1px var(--ed-border-strong);
}

.planner-role-name {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ed-text);
}

.planner-role-meta {
    margin: 0.15rem 0 0;
    font-size: 0.75rem;
    color: var(--ed-text-soft);
}

.planner-role-remove {
    border: none;
    background: transparent;
    color: #fca5a5;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.planner-role-remove:hover {
    color: #fecaca;
}

.planner-role-form {
    border: 1px solid var(--ed-border);
    border-radius: var(--ed-radius);
    background: var(--ed-surface-muted);
    padding: 1rem;
}

.planner-summary-kicker {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ed-text-soft);
}

.planner-summary-value {
    margin-top: 0.3rem;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--ed-text);
}

.planner-summary-caption {
    margin-top: 0.2rem;
    font-size: 0.82rem;
    color: var(--ed-text-soft);
}

.planner-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border: 1px solid var(--ed-border);
    border-radius: var(--ed-radius);
    background: var(--ed-surface-muted);
    padding: 0.65rem 0.8rem;
}

.planner-summary-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.4rem;
}

.planner-summary-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: rgba(96, 165, 250, 0.2);
    color: #93c5fd;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
}

.planner-summary-pill-muted {
    background: rgba(161, 161, 170, 0.2);
    color: #d4d4d8;
}

.map-legend {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    z-index: 10;
    min-width: 180px;
    max-width: min(260px, calc(100% - 2rem));
    border: 1px solid var(--ed-border-strong);
    border-radius: var(--ed-radius);
    background: rgba(20, 20, 24, 0.96);
    box-shadow: var(--ed-shadow-soft);
    padding: 0.75rem;
}

.map-legend-title {
    margin: 0 0 0.55rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ed-text-soft);
}

.legend-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    color: var(--ed-text-muted);
    font-size: 0.8125rem;
}

.legend-dot {
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 9999px;
    border: 2px solid var(--ed-border-strong);
}

.legend-count {
    min-width: 2rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ed-text-muted);
}

/* Motion system */
@keyframes ed-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes ed-enter {
    from {
        opacity: 0;
        transform: translateY(22px) scale(0.976);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes ed-enter-soft {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ed-fade-down {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ed-alert-in {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes ed-spin {
    to {
        transform: rotate(360deg);
    }
}

.ed-main.ed-motion-pending .ed-motion-target {
    opacity: 0;
    transform: translateY(22px) scale(0.976);
}

.ed-animate-in,
.ed-enter {
    animation: ed-enter 0.78s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: var(--ed-enter-delay, 0ms);
}

.ed-enter-soft {
    animation: ed-enter-soft 0.62s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: var(--ed-enter-delay, 0ms);
}

.ed-animate-in-delay {
    --ed-enter-delay: 0.12s;
}

.ed-reveal {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
    transition:
        opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.65s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.65s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--ed-reveal-delay, 0ms);
    filter: blur(3px);
    will-change: opacity, transform, filter;
}

.ed-reveal.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.app-header.ed-reveal {
    transform: translateY(-10px);
    filter: blur(2px);
}

.app-header.ed-reveal.is-visible {
    transform: translateY(0);
    filter: blur(0);
}

.app-nav .nav-link {
    animation: ed-enter-soft 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(0.18s + var(--ed-nav-index, 0) * 0.06s);
}

.app-footer-feature {
    animation: ed-enter-soft 0.62s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(0.25s + var(--ed-footer-index, 0) * 0.09s);
}

.ed-table tbody tr {
    animation: ed-enter-soft 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: var(--ed-row-delay, 0ms);
}

.ed-stack-motion > .ed-inset,
.ed-stack-motion > .ed-collab-row {
    animation: ed-enter-soft 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: var(--ed-enter-delay, 0ms);
}

.ed-alert-motion {
    animation: ed-alert-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.glass-card,
.ed-org-card {
    transition:
        transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
        border-color var(--ed-transition),
        box-shadow 0.25s ease;
}

@media (hover: hover) {
    .glass-card:hover,
    .ed-org-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    }
}

.btn-primary,
.btn-secondary,
.btn-danger {
    position: relative;
    overflow: hidden;
}

.btn-primary:active:not(:disabled),
.btn-secondary:active:not(:disabled),
.btn-danger:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-primary.is-loading,
.btn-secondary.is-loading,
.btn-danger.is-loading {
    pointer-events: none;
    opacity: 0.88;
}

.btn-primary.is-loading::after,
.btn-secondary.is-loading::after,
.btn-danger.is-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 1rem;
    height: 1rem;
    border: 2px solid transparent;
    border-radius: 50%;
    animation: ed-spin 0.65s linear infinite;
}

.btn-primary.is-loading::after {
    border-top-color: var(--ed-accent-text);
}

.btn-secondary.is-loading::after,
.btn-danger.is-loading::after {
    border-top-color: currentColor;
}

.ed-table tbody tr {
    transition: background var(--ed-transition), transform 0.2s ease;
}

.nav-link {
    transition:
        background var(--ed-transition),
        color var(--ed-transition),
        transform 0.2s ease;
}

.app-header-panel {
    transition: opacity 0.25s ease, transform 0.25s ease;
}

@media (max-width: 1023px) {
    .app-header-panel:not(.is-open) {
        opacity: 0;
        transform: translateY(-4px);
        pointer-events: none;
    }

    .app-header-panel.is-open {
        opacity: 1;
        transform: translateY(0);
    }
}

.ed-no-motion:not(.planner-map-sidebar):not(.planner-sidebar-toggle),
.ed-no-motion:not(.planner-map-sidebar):not(.planner-sidebar-toggle) * {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-record-list {
        display: block;
    }

    .desktop-record-table {
        display: none;
    }

    .planner-status-strip {
        grid-template-columns: 1fr;
    }

    .planner-workflow-summary-stats {
        margin-left: 0;
        width: 100%;
    }

    .planner-map-header {
        flex-direction: column;
    }

    .planner-save-cluster {
        align-items: stretch;
        width: 100%;
    }

    .planner-save-state {
        text-align: left;
    }

    .planner-map-upload {
        flex-direction: column;
        align-items: stretch;
    }

    .planner-map-upload-form {
        width: 100%;
    }

    .planner-map-upload-file input[type="file"] {
        max-width: 100%;
    }

    .planner-map-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .planner-panel-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.25rem;
        scrollbar-width: none;
    }

    .planner-panel-tabs::-webkit-scrollbar {
        display: none;
    }

    .planner-tab-btn {
        flex: 0 0 auto;
    }

    .map-stage {
        min-height: 360px;
    }
}

@media (max-width: 1280px) {
    .planner-status-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Legacy utility compat (planner editor until fully migrated) */
.text-slate-900,
.text-slate-800 {
    color: var(--ed-text) !important;
}

.page-export .app-footer-features {
    display: none;
}

.page-export .app-footer-bar {
    padding-top: 0.75rem;
}

.page-export .export-layout .bg-white,
.page-export .export-layout .bg-white\/80,
.page-export .export-layout .bg-slate-50 {
    background: var(--ed-surface) !important;
}

.text-slate-700,
.text-slate-600,
.text-slate-500 {
    color: var(--ed-text-muted) !important;
}

.text-indigo-700,
.text-brand-700 {
    color: var(--ed-accent) !important;
}

.text-rose-700,
.text-rose-900 {
    color: var(--ed-danger) !important;
}

.text-amber-900,
.text-amber-800 {
    color: #fde68a !important;
}

.text-emerald-800 {
    color: var(--ed-success) !important;
}

.bg-white,
.bg-white\/50,
.bg-white\/60,
.bg-white\/70,
.bg-white\/80 {
    background: var(--ed-surface-muted) !important;
}

.bg-slate-50,
.bg-slate-50\/70,
.bg-slate-100\/70 {
    background: var(--ed-surface-muted) !important;
}

.border-slate-100\/80,
.border-slate-200,
.border-slate-300 {
    border-color: var(--ed-border) !important;
}

.border-dashed {
    border-style: dashed !important;
}

.border-emerald-200 {
    border-color: rgba(74, 222, 128, 0.35) !important;
}

.border-rose-200,
.border-rose-300 {
    border-color: rgba(248, 113, 113, 0.35) !important;
}

.border-amber-200 {
    border-color: rgba(251, 191, 36, 0.35) !important;
}

.bg-emerald-50\/80,
.bg-emerald-50\/90 {
    background: var(--ed-success-bg) !important;
}

.bg-rose-50\/80,
.bg-rose-50\/90,
.bg-rose-50 {
    background: var(--ed-danger-bg) !important;
}

.bg-rose-100 {
    background: rgba(248, 113, 113, 0.2) !important;
}

.bg-amber-50\/90,
.bg-amber-50 {
    background: var(--ed-warning-bg) !important;
}

.hover\:bg-slate-50\/70:hover,
.hover\:bg-rose-100:hover {
    background: var(--ed-surface-hover) !important;
}

.hover\:text-indigo-900:hover,
.hover\:text-brand-900:hover {
    color: var(--ed-accent-hover) !important;
}

.hover\:text-rose-900:hover {
    color: #fca5a5 !important;
}

.hover\:border-brand-200:hover {
    border-color: rgba(163, 230, 53, 0.35) !important;
}

.flex { display: flex !important; }
.inline-flex { display: inline-flex !important; }
.grid { display: grid !important; }
.block { display: block !important; }
.hidden { display: none !important; }
.relative { position: relative !important; }
.overflow-hidden { overflow: hidden !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-col { flex-direction: column !important; }
.items-center { align-items: center !important; }
.items-start { align-items: flex-start !important; }
.justify-center { justify-content: center !important; }
.justify-between { justify-content: space-between !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 0.75rem !important; }
.gap-4 { gap: 1rem !important; }
.gap-5 { gap: 1.25rem !important; }
.gap-6 { gap: 1.5rem !important; }
.space-y-3 > * + * { margin-top: 0.75rem !important; }
.space-y-4 > * + * { margin-top: 1rem !important; }
.space-y-4 > * + * { margin-top: 1rem !important; }
.space-y-5 > * + * { margin-top: 1.25rem !important; }
.space-y-6 > * + * { margin-top: 1.5rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 0.75rem !important; }
.mt-4 { margin-top: 1rem !important; }
.mt-6 { margin-top: 1.5rem !important; }
.mt-8 { margin-top: 2rem !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-4 { margin-bottom: 1rem !important; }
.mb-6 { margin-bottom: 1.5rem !important; }
.p-3 { padding: 0.75rem !important; }
.p-5 { padding: 1.25rem !important; }
.p-6 { padding: 1.5rem !important; }
.p-8 { padding: 2rem !important; }
.px-3 { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }
.px-4 { padding-left: 1rem !important; padding-right: 1rem !important; }
.py-1 { padding-top: 0.25rem !important; padding-bottom: 0.25rem !important; }
.py-2\.5 { padding-top: 0.625rem !important; padding-bottom: 0.625rem !important; }
.py-3 { padding-top: 0.75rem !important; padding-bottom: 0.75rem !important; }
.py-8 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
.py-10 { padding-top: 2.5rem !important; padding-bottom: 2.5rem !important; }
.rounded-lg { border-radius: var(--ed-radius) !important; }
.rounded-xl { border-radius: var(--ed-radius-lg) !important; }
.rounded-2xl { border-radius: var(--ed-radius-xl) !important; }
.rounded-full { border-radius: 999px !important; }
.text-xs { font-size: 0.75rem !important; }
.text-sm { font-size: 0.875rem !important; }
.text-lg { font-size: 1.125rem !important; }
.text-xl { font-size: 1.25rem !important; }
.text-2xl { font-size: 1.5rem !important; }
.text-3xl { font-size: 1.875rem !important; }
.font-medium { font-weight: 500 !important; }
.font-semibold { font-weight: 600 !important; }
.font-bold { font-weight: 700 !important; }
.uppercase { text-transform: uppercase !important; }
.tracking-wide { letter-spacing: 0.06em !important; }
.tracking-tight { letter-spacing: -0.02em !important; }
.leading-relaxed { line-height: 1.65 !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-left { text-align: left !important; }
.w-full { width: 100% !important; }
.min-h-\[500px\] { min-height: 500px !important; }
.list-disc { list-style-type: disc !important; }
.list-inside { list-style-position: inside !important; }
.transition-colors { transition: color var(--ed-transition), background var(--ed-transition), border-color var(--ed-transition) !important; }

@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
    .sm\:p-7 { padding: 1.75rem !important; }
    .sm\:p-8 { padding: 2rem !important; }
    .sm\:text-4xl { font-size: 2.25rem !important; }
    .sm\:flex-row { flex-direction: row !important; }
    .sm\:w-auto { width: auto !important; }
    .sm\:flex-wrap { flex-wrap: wrap !important; }
}

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .md\:col-span-2 { grid-column: span 2 / span 2 !important; }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-\[minmax\(0\,1\.2fr\)_340px\] { grid-template-columns: minmax(0, 1.2fr) 340px !important; }
    .lg\:grid-cols-\[minmax\(0\,1\.7fr\)_380px\] { grid-template-columns: minmax(0, 1.7fr) 380px !important; }
    .lg\:grid-cols-\[minmax\(0\,1\.7fr\)_420px\] { grid-template-columns: minmax(0, 1.7fr) 420px !important; }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
    .lg\:py-10 { padding-top: 2.5rem !important; padding-bottom: 2.5rem !important; }
}

@media (min-width: 1280px) {
    .xl\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .xl\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
    .xl\:grid-cols-\[minmax\(0\,1\.5fr\)_420px\] { grid-template-columns: minmax(0, 1.5fr) 420px !important; }
    .xl\:grid-cols-\[minmax\(0\,1\.7fr\)_420px\] { grid-template-columns: minmax(0, 1.7fr) 420px !important; }
}

#mapStage.bg-white {
    background: #0a0a0c !important;
}

@media (prefers-reduced-motion: reduce) {
    .ed-main.ed-motion-pending .ed-motion-target {
        opacity: 1;
        transform: none;
    }

    .ed-reveal {
        opacity: 1;
        transform: none;
        filter: none;
        transition: none;
    }

    .ed-animate-in,
    .ed-enter,
    .ed-enter-soft,
    .ed-alert-motion,
    .app-nav .nav-link,
    .app-footer-feature,
    .ed-table tbody tr,
    .ed-stack-motion > .ed-inset,
    .ed-stack-motion > .ed-collab-row {
        animation: none;
        opacity: 1;
    }

    .glass-card:hover,
    .ed-org-card:hover {
        transform: none;
    }
}
