* { box-sizing: border-box; }
body {
    margin: 0;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand b, .brand small { display: block; }
.brand b { font-size: 16px; }
.brand small { color: var(--muted); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.top-actions a { font-size: 12px; font-weight: 600; text-decoration: none; transition: color .18s ease; }
.system-state, .service-badge { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 600; }
.system-state i, .service-badge i { width: 7px; height: 7px; border-radius: 50%; background: #9a7e70; }
.system-state.online i, .service-badge.online i { background: var(--sprout); box-shadow: 0 0 0 4px rgba(184,217,64,.15); }
.system-state.running i, .service-badge.running i,
.tool-live-state.running .live-dot {
    background: #ef9f3d;
    box-shadow: 0 0 0 5px rgba(239,159,61,.16);
    animation: status-pulse 1.2s ease-in-out infinite;
}
main { width: min(1380px, calc(100% - 48px)); margin: 0 auto; }
.hero { min-height: 500px; padding: 80px 0 64px; display: flex; flex-direction: column; justify-content: center; }
.overline { margin: 0 0 22px; color: var(--brand); font-size: 10px; font-weight: 700; letter-spacing: .18em; }
.hero-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 8vw; align-items: end; }
.hero h1 { margin: 0; font: 700 clamp(56px, 7vw, 100px)/1.04 "Gowun Batang", serif; letter-spacing: -.065em; }
.hero h1 em { color: var(--brand); font-style: normal; }
.hero-grid > div { padding-bottom: 8px; }
.hero-grid > div p { margin: 0 0 24px; color: #4f5a54; font-size: 17px; line-height: 1.8; word-break: keep-all; }
.hero-grid > div span { color: var(--clay); font-size: 10px; font-weight: 700; letter-spacing: .13em; }
.featured > a { min-height: 390px; display: grid; grid-template-columns: 1.05fr .95fr; color: white; background: var(--brand-deep); text-decoration: none; overflow: hidden; }
.feature-copy { padding: 54px; display: flex; flex-direction: column; align-items: flex-start; }
.feature-copy .overline { color: var(--sprout); }
.feature-copy h2 { margin: 0; font: 700 clamp(40px, 5vw, 67px)/1.1 "Gowun Batang", serif; letter-spacing: -.04em; }
.feature-copy > p:not(.overline) { max-width: 590px; margin: 22px 0 30px; color: rgba(255,255,255,.65); line-height: 1.75; }
.launch { margin-top: auto; padding-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,.5); font-size: 12px; font-weight: 700; }
.launch b { margin-left: 16px; color: var(--sprout); }
.feature-graphic { position: relative; min-height: 390px; overflow: hidden; background: #286348; }
.field-lines { position: absolute; inset: -20%; background: repeating-linear-gradient(104deg, transparent 0 21px, rgba(184,217,64,.22) 22px 25px); transform: rotate(-9deg); }
.field-lines::after { content: ""; position: absolute; inset: 20% 15%; border: 1px solid rgba(255,255,255,.36); transform: rotate(5deg); }
.spectrum { position: absolute; left: 28px; right: 28px; bottom: 28px; display: grid; grid-template-columns: repeat(5, 1fr); box-shadow: 0 14px 40px rgba(0,0,0,.2); }
.spectrum span { height: 50px; display: grid; place-items: center; color: white; font-size: 10px; font-weight: 700; }
.spectrum span:nth-child(1) { background: #4774aa; }
.spectrum span:nth-child(2) { background: #3d8756; }
.spectrum span:nth-child(3) { background: #a94a3f; }
.spectrum span:nth-child(4) { background: #8d6747; }
.spectrum span:nth-child(5) { background: #3a3936; }
.feature-graphic .service-badge { position: absolute; top: 28px; right: 28px; padding: 9px 13px; color: white; background: rgba(18,58,41,.76); backdrop-filter: blur(8px); }
.services { padding-bottom: 90px; }
.section-head { margin-bottom: 24px; padding-bottom: 22px; display: flex; justify-content: space-between; align-items: end; gap: 30px; border-bottom: 1px solid var(--ink); }
.section-head h2 { margin: 0; font: 700 clamp(34px, 4vw, 52px)/1.1 "Gowun Batang", serif; }
.section-head > p { max-width: 530px; margin: 0; color: var(--muted); font-size: 13px; }
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.service-card { min-height: 310px; padding: 25px; display: flex; flex-direction: column; color: var(--ink); background: rgba(251,250,245,.74); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-decoration: none; transition: transform .2s, background .2s, box-shadow .2s; }
.service-card:hover { z-index: 2; transform: translateY(-5px); background: var(--paper-light); box-shadow: 0 20px 55px rgba(23,42,32,.12); }
.service-card header { display: flex; justify-content: space-between; color: var(--muted); font: 600 10px/1 monospace; }
.service-card > div { margin: auto 0; }
.service-card small { color: var(--brand); font-size: 10px; font-weight: 700; letter-spacing: .14em; }
.service-card h3 { margin: 11px 0 12px; font: 700 25px/1.25 "Gowun Batang", serif; }
.service-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.service-card em { color: var(--clay); font-size: 10px; font-style: normal; font-weight: 700; }
.service-card.forest { box-shadow: inset 0 4px 0 #2e7650; }
.service-card.forest-light { box-shadow: inset 0 4px 0 #78a45f; }
.service-card.vision { box-shadow: inset 0 4px 0 #4774aa; }
.service-card.facility { box-shadow: inset 0 4px 0 #c96638; }
.service-card.spatial { box-shadow: inset 0 4px 0 #8d6747; }
.service-card.spatial-light { box-shadow: inset 0 4px 0 #6e6b65; }
footer { padding: 28px 0 44px; display: flex; justify-content: space-between; border-top: 1px solid var(--ink); color: var(--muted); font-size: 10px; }
footer span { color: var(--brand); font-weight: 700; letter-spacing: .15em; }
footer p { margin: 0; }

@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; gap: 30px; }
    .featured > a { grid-template-columns: 1fr; }
    .feature-graphic { min-height: 280px; }
    .service-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
    main{ width: min(100% - 24px, 560px); }
    .hero { min-height: 430px; padding: 54px 0; }
    .hero h1 { font-size: clamp(47px, 15vw, 64px); }
    .feature-copy { padding: 32px 24px; }
    .section-head, footer { align-items: flex-start; }
    .service-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* Shared analysis workspace */
.back-link {
    padding-bottom: 4px;
    color: var(--brand);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}
.tool-hero {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 40px;
    align-items: end;
    color: white;
    background:
        linear-gradient(112deg, rgba(255,255,255,.04), transparent 46%),
        var(--brand-deep);
    overflow: hidden;
    position: relative;
}
.tool-hero::after {
    content: "";
    position: absolute;
    width: 430px;
    height: 430px;
    right: -170px;
    top: -210px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 50%;
    box-shadow: 0 0 0 48px rgba(255,255,255,.025), 0 0 0 96px rgba(255,255,255,.02);
}
.tool-hero .overline { color: var(--sprout); }
.tool-hero h1 {
    margin: 0;
    font: 700 clamp(43px, 5vw, 72px)/1.08 "Gowun Batang", serif;
}
.tool-hero > div > p:last-child {
    max-width: 720px;
    margin: 20px 0 0;
    color: rgba(255,255,255,.7);
    line-height: 1.8;
}
.tool-live-state {
    z-index: 1;
    min-width: 260px;
    padding: 17px 19px;
    display: flex;
    align-items: center;
    gap: 13px;
    border: 1px solid rgba(255,255,255,.15);
    background: rgba(10,30,22,.35);
    backdrop-filter: blur(10px);
}
.live-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #9a7e70;
}
.tool-live-state.online .live-dot { background: var(--sprout); box-shadow: 0 0 0 5px rgba(184,217,64,.14); }
.tool-live-state b, .tool-live-state small { display: block; }
.tool-live-state b { font-size: 12px; }
.tool-live-state small { margin-top: 4px; color: rgba(255,255,255,.55); font-size: 10px; }
.tool-layout {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    border: 1px solid var(--line);
    border-top: 0;
}
.upload-panel { border-right: 1px solid var(--line); }
.panel-number {
    margin-bottom: 15px;
    color: var(--clay);
    font: 700 13px/1 "IBM Plex Sans KR", sans-serif;
    letter-spacing: .18em;
}
.upload-panel h2, .progress-panel h2, .results-head h2 {
    margin: 0;
    font: 700 31px/1.2 "Gowun Batang", serif;
}
.upload-panel > p {
    max-width: 650px;
   margin:8px 0 17px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.75;
}
.drop-zone:hover { border-color: var(--brand); background-color: rgba(184,217,64,.11); }
.drop-zone.is-dragging { border-color: var(--brand); background-color: rgba(184,217,64,.18); }
.drop-mark { margin-bottom: 9px; font: 300 30px/1 sans-serif; }
.drop-zone strong { font-size: 13px; }
.drop-zone small { margin-top: 7px; color: var(--muted); font-size: 10px; }
.file-list {
    max-height: 155px;
    margin: 14px 0;
    overflow: auto;
    border-top: 1px solid var(--line);
}
.file-list > span {
    min-height: 37px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    font-size: 12px;
    padding-right: 10px;
}
.file-list b { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list small { flex: none; }
.inline-error {
    margin: 12px 0;
    padding: 13px 15px;
    color: #882f28;
    border-left: 3px solid #b84b40;
    background: rgba(184,75,64,.08);
    font-size: 13px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}
.primary-action {
    width: 100%;
    min-height: 49px;
    margin-top: 7px;
    color: white;
    border: 0;
    background: var(--brand);
    font: 700 11px/1 "IBM Plex Sans KR", sans-serif;
    cursor: pointer;
}
.primary-action:hover { background: var(--brand-deep); }
.primary-action:disabled { cursor: wait; opacity: .5; }
.progress-head { display: flex; justify-content: space-between; align-items: start; gap: 20px; }
.processing #elapsed { white-space: nowrap; font-variant-numeric: tabular-nums; }
.progress-steps { margin: 39px 0 0; padding: 0; list-style: none;}
.progress-steps li {
    min-height: 74px;
    display: grid;
    grid-template-columns: 37px 1fr;
    gap: 15px;
    align-items: start;
    position: relative;
}
.progress-steps li:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 17px;
    top: 34px;
    bottom: 0;
    width: 1px;
    background: var(--line);
}
.progress-steps i {
    width: 35px;
    height: 35px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    font: 700 11px / 1 "IBM Plex Sans KR", sans-serif;
    font-style: normal;
    background: #fff;
}
.progress-steps span { padding-top: 5px; font-size: 11px; line-height: 1.65; }
.progress-steps li.active { color: var(--brand); font-weight: 700; }
.progress-steps li.active i { color: white; border-color: var(--brand); background: var(--brand); }
.progress-steps li.error { color: #a23931; }
.progress-steps li.error i { color: white; border-color: #a23931; background: #a23931; }
.progress-foot {
    padding: 15px 0 0;
    color: var(--muted);
    font-size: 13px;
}
.progress-foot.is-error { color: #a23931; }
.tool-page .analysis-actions { margin-top:7px; }
.tool-page .analysis-actions > .primary-action { margin-top:0; }
.tool-page .analysis-actions > [hidden] { display:none; }
.tool-page .processing { margin:0; padding:18px; border-radius:14px; color:#fff; background:radial-gradient(circle at 100% 0%,rgba(185,187,213,.2),transparent 20rem),var(--brand-deep); }
.tool-page .processing-heading { display:flex; align-items:center; gap:20px; }
.tool-page .processing-copy { min-width:0; flex:1; }
.tool-page .processing h3 { margin:0; color:inherit; font:700 14px/1.7 var(--font-ui); overflow-wrap:anywhere; }
.tool-page .processing .progress-foot { margin:6px 0 0; padding:0; color:rgba(255,255,255,.8); font-size:12px; line-height:1.7; overflow-wrap:anywhere; }
.tool-page .processing-visual { display:grid; grid-template-columns:repeat(5,1fr); align-items:end; flex:none; width:70px; height:24px; gap:4px; }
.tool-page .processing-visual span { display:block; background:#aeb1d0; }
.tool-page .processing-visual span:nth-child(1) { height:38%; animation-delay:-.2s; }
.tool-page .processing-visual span:nth-child(2) { height:72%; animation-delay:-.5s; }
.tool-page .processing-visual span:nth-child(3) { height:100%; animation-delay:-.8s; }
.tool-page .processing-visual span:nth-child(4) { height:58%; animation-delay:-1.1s; }
.tool-page .processing-visual span:nth-child(5) { height:86%; animation-delay:-1.3s; }
.tool-page .processing.is-running .processing-visual span { animation-name:processing-scan; animation-duration:1.4s; animation-timing-function:ease-in-out; animation-iteration-count:infinite; animation-direction:alternate; }
.tool-page .processing:not(.is-running) .processing-visual { display:none; }
@keyframes processing-scan { to { height:24%; opacity:.45; } }
@media(prefers-reduced-motion:reduce) {
    .tool-page .processing.is-running .processing-visual span { animation:none; }
}
.results-panel {
    margin-top: 40px;
    padding: 42px;
    border: 1px solid var(--line);
    scroll-margin-top: 20px;
}
.results-head {
    margin-bottom: 26px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
}
.results-head .overline { margin-bottom: 9px; }
.text-action {
    padding: 9px 0 5px;
    color: var(--brand);
    border: 0;
    border-bottom: 1px solid var(--brand);
    background: transparent;
    font: 700 10px/1 "IBM Plex Sans KR", sans-serif;
    text-decoration: none;
    cursor: pointer;
}
.result-summary {
    margin-bottom: 18px;
    padding: 17px 19px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    color: white;
    background: var(--brand-deep);
    font-size: 11px;
}
.result-summary span { color: rgba(255,255,255,.65); }
.result-card { margin-top: 18px; padding: 21px; border: 1px solid var(--line); background: var(--paper-light); }
.result-card__head { margin-bottom: 17px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.result-card__head h3 { margin: 3px 0 0; font-size: 13px; }
.result-card__head strong { color: var(--brand); font-size: 12px; }
.result-index { color: var(--muted); font-size: 10px; letter-spacing: .12em; }
.image-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.image-pair > div, .image-pair figure { min-width: 0; margin: 0; }
.image-pair h3, .image-pair figcaption {
    min-height: 34px;
    margin: 0;
    padding: 10px 12px;
    color: white;
    background: var(--brand-deep);
    font-size: 10px;
    font-weight: 600;
}
.image-pair img {
    width: 100% !important;
    height: min(420px, 32vw);
    display: block;
    border: 1px solid var(--line);
    object-fit: contain;
    background: #101713;
}
.image-pair ul { font-size: 11px; line-height: 1.8; }
.viewer-shell {
    min-height: 580px;
    position: relative;
    display: block;
    overflow: hidden;
    color: rgba(255,255,255,.5);
    background: #16231d;
    font-size: 11px;
}
.viewer-stage { position: absolute; inset: 0; }
.viewer-stage canvas { width: 100%; height: 100%; display: block; }
.viewer-status {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-content: center;
    gap: 8px;
    text-align: center;
    pointer-events: none;
}
.viewer-status i {
    width: 18px;
    height: 18px;
    margin: 0 auto;
    border: 2px solid rgba(255,255,255,.18);
    border-top-color: var(--sprout);
    border-radius: 50%;
    animation: viewer-spin .8s linear infinite;
}
.viewer-status.error { color: #f0c5bb; }
.viewer-status[hidden] { display: none; }
.viewer-status.error i { display: none; }
.viewer-status small { display: block; color: rgba(255,255,255,.45); }
.viewer-controls {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    z-index: 3;
    min-height: 48px;
    padding: 9px 11px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,.76);
    background: rgba(11,25,19,.82);
    border: 1px solid rgba(255,255,255,.12);
    backdrop-filter: blur(9px);
}
.viewer-controls[hidden] { display: none; }
.viewer-metadata { margin-right: auto; font-size: 10px; }
.viewer-controls label { display: flex; align-items: center; gap: 8px; font-size: 10px; white-space: nowrap; }
.viewer-controls input { width: 90px; accent-color: var(--sprout); }
.viewer-controls button {
    padding: 8px 10px;
    color: white;
    border: 1px solid rgba(255,255,255,.22);
    background: transparent;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
}
.viewer-controls button:hover { color: var(--brand-deep); background: var(--sprout); border-color: var(--sprout); }
.viewer-error { text-align: center; color: #f0c5bb; }
.viewer-error small { display: block; margin-top: 8px; color: rgba(255,255,255,.45); }

@keyframes viewer-spin { to { transform: rotate(360deg); } }
@keyframes status-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(.78); }
}
@media (max-width: 900px) {
    .tool-hero, .tool-layout { grid-template-columns: 1fr; }
    .tool-live-state { min-width: 0; }
    .upload-panel { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 620px) {
    .tool-hero, .upload-panel, .progress-panel, .results-panel { padding: 28px 20px; }
    .image-pair { grid-template-columns: 1fr; }
    .image-pair img { height: 300px; }
    .result-summary, .results-head { align-items: flex-start; flex-direction: column; }
    .viewer-shell { min-height: 420px; }
    .viewer-controls { align-items: stretch; flex-wrap: wrap; }
    .viewer-metadata { width: 100%; }
}

/* 2026 interface refresh */
:root {
    --clay: #d46d45;
    --soft-shadow: 0 20px 60px rgba(20, 53, 36, .08);
}

html { scroll-behavior: smooth; }
body {
    line-height: 1.6;
}
button, input, select, textarea { font-family: inherit; }
.brand b { font-family: var(--font-display); font-weight: 800; letter-spacing: -.02em; }
.brand small { font-family: var(--font-display); }

.top-actions .admin-link {
    padding: 8px 11px;
    border-radius: 999px;
}
 .local-only {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    color: #155b40;
    border: 1px solid rgba(21, 91, 64, .15);
    border-radius: 999px;
    background: #edf8f1;
    font-size: 11px;
    font-weight: 700;
}
.local-only i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #38b875;
    box-shadow: 0 0 4px rgba(16, 185, 129, .6);
}

/* Shared tool workspaces */
.tool-page main { width: min(1240px, calc(100% - 48px)); }
.tool-main { padding: 38px 0 82px; }
.tool-hero {
    min-height: 210px;
    padding: 45px;
    border-radius: 21px 21px 0 0;
}
.tool-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(39px, 5vw, 62px);
    font-weight: 800;
    letter-spacing: -.05em;
}
.tool-hero > div > p:last-child { font-size: 13px; }
.tool-live-state { border-radius: 13px; }
.tool-layout {
    border-radius: 0 0 21px 21px;
    background: white;
    overflow: hidden;
    box-shadow: var(--soft-shadow);
}
.upload-panel, .progress-panel { min-height: 460px; padding: 25px 30px; }
.progress-panel { background: #f7f9f7; }
.upload-panel h2, .progress-panel h2, .results-head h2 {
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: -.035em;
}
.drop-zone { border-radius: 14px; background-color: #f5faf7; }
.primary-action { border-radius: 11px; transition: background .18s ease, transform .18s ease; }
.progress-steps i { border-radius: 11px; }
.results-panel {
    border-radius: 20px;
    background: white;
    box-shadow: var(--soft-shadow);
}
.result-summary, .result-card, .viewer-shell { border-radius: 13px; }
.back-link { border-bottom: 0; }

@media (max-width: 640px) {
    .top-actions > a:not(.admin-link) { display: none; }
    .tool-page main { width: min(100% - 24px, 560px); }
    .tool-hero, .upload-panel, .progress-panel, .results-panel { padding: 27px 20px; }
    .upload-panel h2, .progress-panel h2, .results-panel h2 {font-size: clamp(26px, 7vw, 36px); }
}

.tool-page .progress-foot{
    font-size:13px;
}
.tool-page .overline,
.tool-page .tool-live-state small,
.tool-page .drop-zone small,
.tool-page .result-index { font-size:12px; line-height:1.55; }
.tool-page .tool-hero > div > p:last-child,
.tool-page .upload-panel > p,
.tool-page .progress-steps span,
.tool-page .file-list,
.tool-page .result-card p,
.tool-page .viewer-metadata { font-size:13px; line-height:1.75; }
.tool-page .drop-zone strong,
.tool-page .primary-action,
.tool-page .text-action,
.tool-page .tool-live-state b,
.tool-page .viewer-controls label { font-size:14px; }
.tool-page .inline-error { font-size:13px; line-height:1.65; }

.tool-page .file-list small,
.tool-page .result-card__head strong,
.tool-page .viewer-shell span { font-size:12px; }
