/* Mapflex brand system — derived from the supplied logo assets. */
:root {
    --ink: #25273a;
    --paper: #f3f4f9;
    --paper-light: #ffffff;
    --sprout: #b9bbd5;
    --clay: #bd626c;
    --muted: #70738a;
    --line: rgba(67, 70, 96, .14);
    --brand-mid: #62657d;
    --brand-soft: #eceef6;
    --brand-mist: #f7f7fb;
    --brand-accent: #b9bbd5;
    --font-ui: "Noto Sans KR", "Malgun Gothic", sans-serif;
    --font-display: "Manrope", "Noto Sans KR", sans-serif;
    --hero-title-size: clamp(42px, 5.2vw, 50px);
    --soft-shadow: 0 24px 70px rgba(52, 54, 79, .11);
}

.close-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
}
.close-icon-button:hover {
    color: var(--brand);
    background: var(--paper);
}
.close-icon-button:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
}
.close-icon {
    display: block;
    flex: none;
    width: 20px;
    height: 20px;
    background: currentColor;
    -webkit-mask: url("/static/images/close.svg") center / contain no-repeat;
    mask: url("/static/images/close.svg") center / contain no-repeat;
    pointer-events: none;
}

html { color-scheme: light; }
body,
.project-page,
.admin-page {
    color: var(--ink);
     background:
        radial-gradient(circle at 88% 4%, rgba(125, 128, 164, .14), transparent 26rem),
        linear-gradient(120deg, rgba(67,70,96,.025) 1px, transparent 1px),
        linear-gradient(30deg, rgba(67,70,96,.025) 1px, transparent 1px),
        var(--paper);
    background-size: auto, 68px 68px, 68px 68px, auto;
    font-family: var(--font-ui);
}

::selection { color: #fff; background: var(--brand-mid); }
a, button { transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(98, 101, 125, .28);
    outline-offset: 3px;
}

/* Shared navigation and supplied logo */
.top-actions a,
.admin-page .top-actions a,
.top-actions .back-link {
    color: rgba(255,255,255,.72);
}
.top-actions a:hover,
.admin-page .top-actions a:hover { color: #fff; }
.top-actions .admin-link,
.top-actions .project-context,
.top-actions .project-context.missing,
.workflow-nav-locked,
.local-only {
    color: rgba(255,255,255,.86);
    border: 1px solid rgba(255,255,255,.13);
    background: rgba(255,255,255,.08);
}
.top-actions .project-context,
.top-actions .project-context.missing { color: #fff; background: rgba(255,255,255,.12); }
.system-state { border-color: rgba(255,255,255,.12); }
.system-state.online i,
.service-badge.online i,
.local-only i {
    background: #38b875;
    box-shadow: 0 0 4px rgba(16, 185, 129, .6);
}

/* Project workspace */
.project-main { padding-top: 30px; }
.project-hero {
    position: relative;
    padding: 30px 40px;
    overflow: hidden;
    color: #fff;
    border: 0;
    border-radius: 30px;
    background:
        linear-gradient(132deg, rgba(255,255,255,.045), transparent 45%),
        var(--brand);
    box-shadow: var(--soft-shadow);
}
.project-hero > * { position: relative; z-index: 1; }
.project-kicker,
.workspace-section__head p { color: var(--brand-accent); }
.project-hero__copy p { color: rgba(255,255,255,.70); }
.project-hero .project-primary {
    color: var(--brand);
    background: #fff;
    box-shadow: 0 14px 34px rgba(25,27,44,.22);
}
.project-shell {
    margin-top: 20px;
    border-color: var(--line);
    background: rgba(255,255,255,.92);
    box-shadow: var(--soft-shadow);
}
.rail-head button,
.project-item.active { color: var(--brand); border-color: rgba(67,70,96,.18); box-shadow: 0 5px 10px rgba(20, 53, 36, .06); }
.project-item.active { background: #fff; }
.workspace-empty > span,
.project-tool > span,
.project-tool em,
.text-button { color: var(--brand); }
.device-note i{ background: #7a7eaa; }
.workspace-empty { background: radial-gradient(circle at 85% 15%, rgba(185,187,213,.28), transparent 20rem); }
.project-status { color: #e3e4f2; background: rgba(185,187,213,.16); }
.complete-button { color: var(--brand); }
.project-primary,
.primary-action { color: #fff; background: var(--brand); box-shadow: 0 12px 28px rgba(67,70,96,.18); }
.primary-action:hover:not(:disabled) { background: var(--brand-deep); }
.tool-page .primary-action:disabled { color:#797c8e; background:#e5e6ee; opacity:1; cursor:not-allowed; box-shadow:none; }
.project-tool.featured {
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, #535671, #34364f);
}
.project-tool.featured::after {
    content: "";
    position: absolute;
    width: 150px;
    height: 106px;
    right: -22px;
    top: 20px;
    opacity: .08;
    background: url("/static/images/mapflex-logo.svg") left center / auto 100% no-repeat;
}
.project-tool.featured > span,
.project-tool.featured em { color: #d9daea; }
.group-row:hover { background: var(--brand-mist); }

/* Analysis workspaces */
.tool-hero,
.accent-forest .tool-hero,
.accent-forest-light .tool-hero,
.accent-vision .tool-hero,
.accent-facility .tool-hero,
.accent-spatial .tool-hero,
.accent-spatial-light .tool-hero {
    position: relative;
    background-color: var(--brand);
    background-image:
        linear-gradient(120deg, rgba(255,255,255,.05), transparent 52%),
        radial-gradient(circle at 92% 0%, rgba(255,255,255,.15), transparent 19rem);
}
.tool-hero::before {
    content: "";
    position: absolute;
    right: 42px;
    bottom: 18px;
    width: 190px;
    height: 130px;
    opacity: .07;
    background: url("/static/images/mapflex-logo.svg") left center / auto 100% no-repeat;
}
.tool-hero { grid-template-columns: minmax(0, 1fr); }
.progress-panel,
.drop-zone { background: var(--brand-mist); }
.drop-zone:hover,
.drop-zone.is-dragging { border-color: var(--brand); background: #eceef6; }
.tool-page .drop-zone { padding:0; overflow:hidden; }
.tool-page .drop-zone-prompt { 
    width:100%; min-height:166px; padding:24px; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; cursor:pointer;
    overflow: hidden;
    border: 1px dashed rgba(67, 70, 96, .3);
    border-radius: 14px;
    background: var(--paper);
    transition: background .2s, border-color .2s;
 }
 .tool-page .drop-zone-prompt:hover{
    border-color:var(--muted); background:#eceef6;
 }
.tool-page .drop-zone-selection { width:100%; min-width:0; }
.tool-page .drop-zone-prompt[hidden],
.tool-page .drop-zone-selection[hidden] { display:none; }
.tool-page .drop-zone.has-selection,
.tool-page .drop-zone.has-selection:hover,
.tool-page .drop-zone.has-selection.is-dragging { min-height:0; padding:16px; border:1px solid var(--line); background:var(--brand-mist); box-shadow:none; cursor:default; }
.tool-page .file-selection-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; margin-bottom:12px; }
.tool-page .drop-zone-selection .selection-head { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; margin-bottom:8px; }
.tool-page .selection-head .selection-total { margin:0; color:var(--ink); font-size:13px; white-space:nowrap; font-weight:500; }
.tool-page .selection-total strong { font-weight:600; font-variant-numeric:tabular-nums; }
.tool-page .selection-head .file-selection-actions { flex-wrap:wrap; gap:8px; margin:0 0 0 auto; }
.tool-page .reset-files { padding:8px 4px; border:0; color:var(--muted); background:none; cursor:pointer; font:500 12px/1.7 var(--font-ui); }
.tool-page .reset-files:hover:not(:disabled) { color:var(--brand); }
.tool-page .change-files { padding:8px 13px; border:0; border-radius:11px; color:#fff; background:var(--brand); cursor:pointer; font:500 12px/1.7 var(--font-ui); }
.tool-page .change-files:disabled,
.tool-page .reset-files:disabled { opacity:.55; cursor:not-allowed; }
.tool-page .drop-zone .file-list { max-height:240px; margin:0; border-top:0; }
.tool-page .drop-zone .file-list > span { gap:12px; padding:8px 5px 8px 0; }
.tool-page .drop-zone .file-list > span:last-child { border-bottom:0; }
.tool-page .drop-zone .file-list small { margin-top:0; }
.drop-mark,
.panel-number { color: var(--brand); }

.tool-page .results-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    gap: 8px;
    min-height: 44px;
    padding: 11px 18px;
    color: #fff;
    border: 1px solid var(--brand);
    border-radius: 11px;
    background: var(--brand);
    box-shadow: 0 4px 12px rgba(67, 70, 96, .12);
    font: 600 14px/1.5 var(--font-ui);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}
.download-icon {
    display: inline-block;
    flex: none;
    width: 16px;
    height: 16px;
    background: currentColor;
    -webkit-mask: url("/static/images/download.svg") center / contain no-repeat;
    mask: url("/static/images/download.svg") center / contain no-repeat;
}
.tool-page .results-download .download-icon { width: 18px; height: 18px; }
.tool-page .results-download:hover {
    border-color: var(--brand-deep);
    background: var(--brand-deep);
    box-shadow: 0 6px 16px rgba(67, 70, 96, .20);
}
.tool-page .results-download:focus-visible {
    outline: 3px solid var(--brand-mid);
    outline-offset: 3px;
}
.tool-page .results-download:active { box-shadow: none; background: var(--brand-deep); }

.tool-page .results-guidance {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.75;
    word-break: keep-all;
}
.tool-page .results-guidance strong { color: var(--brand); font-weight: 600; }

@media (max-width: 620px) {
    .tool-page .results-download { width: 100%; }
}

/* Operations and storage */
.admin-page { color: var(--ink); }
.admin-main { padding-top: 54px; }
.admin-hero {
    margin-bottom: 28px;
    padding: 50px;
    color: #fff;
    border-radius: 28px;
    background:
        radial-gradient(circle at 92% 0%, rgba(185,187,213,.24), transparent 20rem),
        var(--brand);
    box-shadow: var(--soft-shadow);
}
.admin-hero .eyebrow { color: #d9daea; }
.admin-hero-copy > p { color: rgba(255,255,255,.68); }
.overview-card,
.admin-page .workspace { border-color: var(--line); box-shadow: 0 16px 46px rgba(52,54,79,.06); }
.overview-card:first-child { color: #fff; background: var(--brand); }
.overview-card:first-child > span,
.overview-card:first-child small { color: rgba(255,255,255,.62); }
.eyebrow,
.column code { color: var(--brand); }
.architecture-hero { background: linear-gradient(135deg, #51546f, #34364f) !important; }
.architecture-hero .overline { color: #d9daea !important; }
.flow-node.database,
.table-card header { background: var(--brand-deep) !important; }
.table-card:nth-child(2) header { background: #565b7c !important; }
.table-card:nth-child(3) header { background: #6e6179 !important; }
.table-card:nth-child(5) header { background: #4d5875 !important; }

@media (max-width: 900px) {
    .project-hero { min-height: 0; padding: 48px 36px; gap: 38px; }
    .admin-hero { padding: 38px; }
}

@media (max-width: 640px) {
    .workflow-nav-locked,
    .top-actions .admin-link,
    .admin-page .local-only { display:none; }
    .system-state {
        line-height:1.2;
    }
    .project-main { width: min(100% - 24px, 560px); padding-top: 16px; }
    .project-hero { padding: 38px 24px; border-radius: 22px; }
    .project-hero::before { width: 260px; right: -70px; opacity: .05; }
    .project-shell { border-radius: 20px; }
    .workspace-empty { padding: 48px 24px; }
    .admin-main { width: min(100% - 24px, 560px); padding-top: 22px; }
    .admin-hero { padding: 30px 22px; border-radius: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Keep every workspace hero on the project home's responsive title scale. */
.project-page .project-hero h1,
.tool-page .tool-hero h1,
.admin-page .admin-hero h1,
.architecture-hero h1 {
    font-size: var(--hero-title-size);
    line-height: 1.2;
}

@media (max-width: 640px) {
    :root { --hero-title-size: clamp(30px, 8.5vw, 38px); }
}
