:root {
  --blue: #3182f6;
  --blue-dark: #1b64da;
  --ink: #191f28;
  --muted: #6b7684;
  --soft: #f2f4f6;
  --line: #e5e8eb;
  --white: #fff;
  --danger: #e5484d;
  --green: #00a88f;
  font-family: Inter, Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f7f8fa;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: #f7f8fa; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { border: 0; }

.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.88); border-bottom: 1px solid rgba(229,232,235,.8); backdrop-filter: blur(16px); }
.nav-shell { max-width: 1180px; height: 72px; margin: 0 auto; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 750; letter-spacing: -.5px; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: #fff; background: var(--blue); box-shadow: 0 7px 18px rgba(49,130,246,.25); }
.brand-mark svg { width: 20px; fill: currentColor; }
.nav-action, .text-button { background: none; color: var(--muted); cursor: pointer; font-weight: 650; }
.nav-action { padding: 10px 12px; border-radius: 10px; }
.nav-action:hover { background: var(--soft); color: var(--ink); }

.page-shell { width: min(1120px, calc(100% - 48px)); margin: 0 auto; padding: 86px 0 120px; }
.hero { padding: 28px 0 72px; }
.eyebrow, .step-number { color: var(--blue); font-size: 13px; line-height: 1; font-weight: 800; letter-spacing: 1.2px; }
.hero h1 { margin: 20px 0 22px; max-width: 760px; font-size: clamp(44px, 6.2vw, 76px); line-height: 1.12; letter-spacing: -4px; }
.hero h1, .login-card h1 { word-break: keep-all; }
.hero > p:last-child { margin: 0; color: var(--muted); font-size: 19px; line-height: 1.75; letter-spacing: -.3px; }

.panel { background: var(--white); border: 1px solid rgba(229,232,235,.85); border-radius: 28px; box-shadow: 0 12px 36px rgba(16,24,40,.055); }
.search-panel { padding: 38px; }
.panel-heading, .section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.panel-heading h2, .section-heading h2 { margin: 10px 0 0; font-size: 28px; line-height: 1.2; letter-spacing: -1.1px; }
.panel-heading > p { margin: 0; color: var(--muted); font-size: 14px; }
.route-form { margin-top: 32px; display: grid; grid-template-columns: .8fr 1fr 1fr; gap: 22px 16px; }
.field { min-width: 0; }
.field label { display: block; margin: 0 0 9px 3px; color: #4e5968; font-size: 14px; font-weight: 700; }
.field input, .field select, .locked-input { width: 100%; height: 56px; padding: 0 16px; border: 1px solid var(--line); border-radius: 15px; outline: none; color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s; }
.field input:focus, .field select:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(49,130,246,.11); }
.field input::placeholder { color: #b0b8c1; }
.field small { display: block; margin: 7px 3px 0; color: #8b95a1; font-size: 12px; }
.locked-input { display: flex; align-items: center; gap: 9px; background: var(--soft); }
.locked-input strong { font-size: 18px; }
.locked-input span { color: var(--muted); }
.date-field { grid-column: span 1; }
.date-range { display: flex; align-items: center; gap: 8px; }
.date-range input { min-width: 0; padding: 0 12px; }
.date-range span { color: #b0b8c1; }
.form-action { display: flex; align-items: flex-end; }
.button { min-height: 54px; padding: 0 24px; border-radius: 15px; cursor: pointer; font-weight: 750; transition: transform .15s, background .15s, opacity .15s; }
.button.primary { color: #fff; background: var(--blue); box-shadow: 0 10px 20px rgba(49,130,246,.2); }
.button.primary:hover { background: var(--blue-dark); transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .5; transform: none; }
.button.full { width: 100%; }
.form-message { margin-top: 20px; padding: 15px 18px; border-radius: 13px; font-size: 14px; }
.form-message.success { color: #087f6d; background: #e8f8f4; }
.form-message.error, .inline-alert { color: #c9363e; background: #fff0f1; }

.routes-section { padding-top: 94px; }
.route-count { padding: 7px 12px; border-radius: 999px; color: var(--muted); background: var(--soft); font-size: 14px; font-weight: 700; }
.route-grid { margin-top: 28px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.route-card { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 24px; transition: transform .18s, box-shadow .18s; }
.route-card:hover { transform: translateY(-3px); box-shadow: 0 16px 38px rgba(16,24,40,.08); }
.card-main { display: block; padding: 26px 26px 20px; }
.card-topline { display: flex; align-items: center; justify-content: space-between; }
.arrow { color: #8b95a1; font-size: 20px; }
.status-badge { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; color: #4e5968; background: var(--soft); font-size: 12px; font-weight: 750; }
.status-success { color: #087f6d; background: #e8f8f4; }
.status-running { color: #1b64da; background: #eaf2ff; }
.status-partial { color: #9a6700; background: #fff7d6; }
.status-failed { color: #c9363e; background: #fff0f1; }
.route-name { margin-top: 28px; display: flex; align-items: center; gap: 13px; font-size: 30px; font-weight: 800; letter-spacing: -1px; }
.route-name i, .detail-hero h1 i { width: 34px; height: 1px; position: relative; display: inline-block; background: #b0b8c1; }
.route-name i::after, .detail-hero h1 i::after { content: ""; position: absolute; right: 0; top: -3px; width: 7px; height: 7px; border-top: 1px solid #b0b8c1; border-right: 1px solid #b0b8c1; transform: rotate(45deg); }
.route-dates { min-height: 44px; margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.price-block { margin-top: 26px; padding-top: 22px; border-top: 1px solid #eef0f2; }
.price-block > span, .hero-price > span { display: block; color: var(--muted); font-size: 13px; }
.price-block strong { display: inline-block; margin-top: 7px; font-size: 27px; letter-spacing: -1px; }
.price-block small { margin-left: 7px; color: #8b95a1; }
.price-block .muted-price { color: #8b95a1; font-size: 21px; }
.ai-summary { margin: 18px 0 0; padding: 15px; border-radius: 14px; color: #4e5968; background: #f7f9fc; font-size: 13px; line-height: 1.6; }
.card-actions { display: flex; gap: 18px; padding: 16px 26px 20px; border-top: 1px solid #f2f4f6; }
.text-button { padding: 6px 0; font-size: 13px; }
.text-button:hover { color: var(--blue); }
.text-button.danger:hover { color: var(--danger); }
.confirm-dialog { width: min(440px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 24px; color: var(--ink); box-shadow: 0 24px 80px rgba(16,24,40,.24); }
.confirm-dialog::backdrop { background: rgba(25,31,40,.46); backdrop-filter: blur(3px); }
.dialog-body { padding: 32px; }
.dialog-body h2 { margin: 12px 0 10px; font-size: 25px; letter-spacing: -1px; }
.dialog-body > p:last-of-type { margin: 0; color: var(--muted); line-height: 1.65; }
.dialog-actions { margin-top: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.button.secondary { color: #4e5968; background: var(--soft); }
.button.danger { color: #fff; background: var(--danger); }
.empty-state { grid-column: 1 / -1; padding: 76px 24px; text-align: center; border: 1px dashed #d8dde3; border-radius: 24px; background: rgba(255,255,255,.5); }
.empty-icon { width: 52px; height: 52px; margin: 0 auto; display: grid; place-items: center; border-radius: 17px; color: var(--blue); background: #eaf2ff; font-size: 23px; }
.empty-state h3 { margin: 18px 0 8px; font-size: 20px; }
.empty-state p, .muted-copy { margin: 0; color: var(--muted); line-height: 1.65; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; background: radial-gradient(circle at 50% 0%, #eef5ff 0, #f7f8fa 42%); }
.login-card { width: min(470px, 100%); padding: 44px; border: 1px solid rgba(229,232,235,.8); border-radius: 30px; background: rgba(255,255,255,.92); box-shadow: 0 24px 70px rgba(16,24,40,.09); }
.brand-login { margin-bottom: 45px; }
.login-card h1 { margin: 14px 0 14px; font-size: 38px; line-height: 1.22; letter-spacing: -2px; }
.login-copy { margin: 0; color: var(--muted); line-height: 1.65; }
.login-form { margin-top: 34px; }
.login-form label { display: block; margin-bottom: 9px; color: #4e5968; font-size: 14px; font-weight: 700; }
.login-form input { width: 100%; height: 56px; margin-bottom: 12px; padding: 0 16px; border: 1px solid var(--line); border-radius: 15px; outline: 0; }
.login-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(49,130,246,.11); }
.inline-alert { margin: 22px 0 -16px; padding: 13px 15px; border-radius: 12px; font-size: 13px; }
.flash-stack { position: fixed; z-index: 50; top: 88px; left: 50%; transform: translateX(-50%); }
.flash { padding: 13px 17px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.1); background: #fff; }
.flash.error { color: var(--danger); }

.detail-page { padding-top: 58px; }
.back-link { display: inline-block; margin-bottom: 34px; color: var(--muted); font-size: 14px; font-weight: 700; }
.back-link:hover { color: var(--blue); }
.detail-hero { min-height: 250px; display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; padding: 46px; border-radius: 30px; color: #fff; background: linear-gradient(135deg, #1d4ed8 0%, #3182f6 55%, #5b9dff 100%); box-shadow: 0 24px 50px rgba(49,130,246,.2); }
.detail-hero .status-badge { color: #fff; background: rgba(255,255,255,.18); }
.detail-hero h1 { margin: 18px 0 12px; display: flex; align-items: center; gap: 15px; font-size: clamp(38px, 6vw, 62px); letter-spacing: -2px; }
.detail-hero h1 i, .detail-hero h1 i::after { border-color: rgba(255,255,255,.65); background: rgba(255,255,255,.65); }
.detail-hero > div > p { margin: 0; color: rgba(255,255,255,.75); line-height: 1.65; }
.hero-price { text-align: right; flex: 0 0 auto; }
.hero-price > span, .hero-price small { color: rgba(255,255,255,.7); }
.hero-price strong { display: block; margin: 6px 0; font-size: clamp(30px, 4vw, 47px); letter-spacing: -2px; }
.metric-grid { margin: 20px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.metric-grid article { padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.metric-grid span { color: var(--muted); font-size: 13px; }
.metric-grid strong { display: block; margin-top: 9px; font-size: 22px; letter-spacing: -.7px; }
.metric-grid .positive { color: var(--blue); }
.detail-grid { margin-top: 20px; display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr); gap: 20px; align-items: stretch; }
.chart-panel, .ai-panel, .history-panel { padding: 32px; }
.panel-heading.compact { align-items: flex-start; }
.panel-heading.compact h2 { font-size: 24px; }
.chart-wrap { height: 350px; margin-top: 30px; }
.chart-empty { min-height: 320px; display: grid; place-content: center; text-align: center; }
.chart-empty p { margin: 8px 0; color: var(--muted); }
.ai-panel { color: #fff; border: 0; background: #191f28; }
.ai-panel .step-number { color: #7eb2ff; }
.ai-panel h2 { margin: 10px 0 28px; font-size: 24px; }
.ai-panel p { font-size: 17px; line-height: 1.75; letter-spacing: -.3px; }
.ai-panel small { color: #8b95a1; }
.ai-panel .muted-copy { color: #b0b8c1; }
.verdict { display: inline-flex; padding: 7px 11px; border-radius: 10px; color: #9fc4ff; background: rgba(49,130,246,.18); font-size: 13px; font-weight: 750; }
.error-detail { margin-top: 20px; padding: 20px 24px; border-radius: 16px; }
.error-detail p { margin: 8px 0 0; white-space: pre-line; color: #8f2d33; font-size: 13px; line-height: 1.55; }
.history-panel { margin-top: 20px; }
.alert-list { margin-top: 24px; }
.alert-list > div { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; padding: 17px 0; border-top: 1px solid #eef0f2; }
.alert-list span, .alert-list small { color: var(--muted); }

@media (max-width: 900px) {
  .route-form { grid-template-columns: 1fr 1fr; }
  .form-action { grid-column: span 2; }
  .form-action .button { width: 100%; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .nav-shell { height: 64px; padding: 0 18px; }
  .page-shell { width: min(100% - 32px, 1120px); padding: 54px 0 80px; }
  .hero { padding: 18px 4px 48px; }
  .hero h1 { margin-top: 16px; font-size: 42px; line-height: 1.16; letter-spacing: -2.5px; }
  .hero > p:last-child { font-size: 16px; }
  .desktop-only { display: none; }
  .search-panel { padding: 25px 20px; border-radius: 22px; }
  .panel-heading, .section-heading { align-items: flex-start; }
  .panel-heading > p { display: none; }
  .panel-heading h2, .section-heading h2 { font-size: 24px; }
  .route-form { grid-template-columns: 1fr; gap: 17px; }
  .field, .date-field, .form-action { grid-column: 1; }
  .date-range { gap: 6px; }
  .date-range input { font-size: 13px; }
  .routes-section { padding-top: 68px; }
  .route-grid { grid-template-columns: 1fr; }
  .route-card { border-radius: 20px; }
  .login-card { padding: 32px 24px; border-radius: 24px; }
  .login-card h1 { font-size: 32px; }
  .detail-page { padding-top: 34px; }
  .detail-hero { min-height: 320px; padding: 30px 24px; align-items: flex-start; flex-direction: column; }
  .detail-hero h1 { font-size: 42px; }
  .hero-price { text-align: left; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-grid article { padding: 19px; }
  .metric-grid strong { font-size: 18px; }
  .chart-panel, .ai-panel, .history-panel { padding: 24px 20px; border-radius: 22px; }
  .chart-wrap { height: 290px; }
  .alert-list > div { grid-template-columns: 1fr 1fr; }
  .alert-list small { grid-column: 1 / -1; }
}
