:root {
  --yon-navy: #001850;
  --on-blue: #0068f8;
  --trust-blue: #003090;
  --ink: #071b45;
  --muted-ink: #4b5e83;
  --inverse-ink: #ffffff;
  --background: #ffffff;
  --surface: #f7faff;
  --surface-raised: #ffffff;
  --line: #d8e4f5;
  --success: #0f9f6e;
  --warning: #d98a00;
  --danger: #d92d20;
  --info: #0068f8;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;
  --shadow-card: 0 12px 32px rgba(0, 24, 80, 0.08);
  --shadow-popover: 0 16px 44px rgba(0, 24, 80, 0.14);
  --font-ui: "Pretendard", "Noto Sans KR", "Inter", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 1px 1px, rgba(0, 48, 144, 0.055) 1px, transparent 0) 0 0 / 28px 28px,
    var(--surface);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
a,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(0, 104, 248, 0.35);
  outline-offset: 3px;
}

img {
  display: block;
  max-width: 100%;
}

.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;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: white;
  background: var(--yon-navy);
  border-radius: var(--radius-md);
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px clamp(20px, 4vw, 72px);
  border-bottom: 1px solid rgba(216, 228, 245, 0.92);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-logo-frame {
  display: grid;
  place-items: center;
  width: 120px;
  height: 38px;
  overflow: hidden;
}

.brand-logo-frame img {
  width: 120px;
  height: auto;
  object-fit: contain;
}

.brand-product {
  display: grid;
  padding-left: 18px;
  border-left: 1px solid var(--line);
  line-height: 1.25;
}

.brand-product strong {
  font-size: 14px;
  letter-spacing: 0.01em;
}

.brand-product span {
  margin-top: 3px;
  color: var(--muted-ink);
  font-size: 11px;
  font-weight: 600;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-chip,
.model-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 5px 10px;
  color: var(--muted-ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: currentColor;
  border-radius: 50%;
}

.status-success,
.model-status.ready {
  color: #087552;
  background: #eefbf6;
  border-color: #bcebd9;
}

.model-status.busy,
.status-warning {
  color: #9a6000;
  background: #fff8e7;
  border-color: #f4d58c;
}

.model-status.offline,
.status-danger {
  color: #b42318;
  background: #fff3f1;
  border-color: #f5c5bf;
}

.account-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 5px 12px 5px 5px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.account-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: white;
  background: var(--yon-navy);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.product-intro {
  display: grid;
  grid-template-columns: minmax(360px, 1.1fr) minmax(320px, 0.9fr) auto;
  align-items: end;
  gap: clamp(24px, 4vw, 64px);
  max-width: 1780px;
  margin: 0 auto;
  padding: clamp(36px, 5vw, 72px) clamp(20px, 4vw, 72px) clamp(28px, 3vw, 44px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--on-blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.product-intro h1 {
  margin: 0;
  color: var(--yon-navy);
  font-size: clamp(34px, 3.3vw, 54px);
  font-weight: 800;
  line-height: 1.15;
}

.product-intro h1 span {
  color: var(--on-blue);
}

.intro-copy {
  max-width: 620px;
  margin: 0;
  color: var(--muted-ink);
  font-size: 15px;
  line-height: 1.75;
}

.intro-summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 14px;
  color: var(--yon-navy);
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.summary-divider {
  width: 1px;
  height: 14px;
  background: var(--line);
}

.simulation-stage {
  display: grid;
  grid-template-columns: minmax(330px, 0.85fr) minmax(390px, 1fr) minmax(350px, 0.92fr);
  align-items: start;
  gap: clamp(22px, 2.4vw, 42px);
  max-width: 1780px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 72px) 64px;
}

.device-column,
.intelligence-column {
  min-width: 0;
}

.section-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  color: var(--muted-ink);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.section-kicker strong {
  color: var(--yon-navy);
  font-size: 12px;
  letter-spacing: 0;
}

.interaction-hint {
  margin: 14px 0 0;
  color: var(--muted-ink);
  font-size: 12px;
  text-align: center;
}

.interaction-hint span {
  color: var(--on-blue);
  font-weight: 800;
}

.intelligence-column {
  display: grid;
  gap: 16px;
}

.ai-panel,
.control-panel,
.event-panel {
  padding: 22px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.panel-heading.compact {
  align-items: center;
}

.panel-heading h2 {
  margin: 0;
  color: var(--yon-navy);
  font-size: 21px;
  line-height: 1.25;
}

.panel-description {
  margin: 12px 0 16px;
  color: var(--muted-ink);
  font-size: 13px;
}

.conversation-history-control {
  min-height: 62px;
  margin: 0 0 16px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
}

.conversation-history-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.conversation-history-copy > span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.conversation-history-copy strong {
  color: var(--yon-navy);
  font-size: 13px;
  line-height: 1.4;
}

.conversation-history-copy em {
  padding: 2px 6px;
  border-radius: 999px;
  background: #eaf8f3;
  color: #087653;
  font-size: 9px;
  line-height: 1.4;
  font-style: normal;
  font-weight: 800;
}

.conversation-history-copy em[data-status="disabled"] {
  background: #edf1f7;
  color: var(--muted-ink);
}

.conversation-history-copy small {
  color: var(--muted-ink);
  font-size: 10px;
  line-height: 1.45;
}

.conversation-history-switch {
  position: relative;
  flex: 0 0 42px;
  width: 42px;
  height: 24px;
}

.conversation-history-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.conversation-history-switch i {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #aebdd2;
  transition: background 160ms ease;
}

.conversation-history-switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 5px rgba(0, 24, 80, 0.22);
  transition: transform 160ms ease;
}

.conversation-history-switch input:checked + i {
  background: var(--on-blue);
}

.conversation-history-switch input:checked + i::after {
  transform: translateX(18px);
}

.conversation-history-switch input:focus-visible + i {
  outline: 3px solid rgba(0, 104, 248, 0.35);
  outline-offset: 3px;
}

.conversation-history-control:has(input:disabled) {
  cursor: wait;
  opacity: 0.68;
}

.ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 16px;
}

.ai-suggestions button {
  min-height: 34px;
  padding: 7px 10px;
  color: var(--trust-blue);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.ai-suggestions button:hover {
  border-color: #9fc4ff;
  background: #edf5ff;
}

.ai-conversation {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 150px;
  max-height: 300px;
  padding: 15px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  scrollbar-width: thin;
}

.ai-message {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.ai-message.user {
  flex-direction: row-reverse;
}

.message-avatar {
  display: grid;
  flex: 0 0 28px;
  place-items: center;
  width: 28px;
  height: 28px;
  color: white;
  background: var(--yon-navy);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
}

.ai-message.user .message-avatar {
  background: var(--on-blue);
}

.ai-message > div {
  max-width: calc(100% - 40px);
  padding: 9px 11px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 4px 12px 12px;
}

.ai-message.user > div {
  color: white;
  background: var(--trust-blue);
  border-color: var(--trust-blue);
  border-radius: 12px 4px 12px 12px;
}

.ai-message strong {
  display: block;
  margin-bottom: 3px;
  font-size: 11px;
}

.ai-message p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.ai-message.pending p {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-ink);
  font-weight: 700;
}

.ai-message.pending p::before {
  content: "";
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  border: 2px solid #c8d7ec;
  border-top-color: var(--on-blue);
  border-radius: 50%;
  animation: ai-thinking-spin 760ms linear infinite;
}

@keyframes ai-thinking-spin { to { transform: rotate(360deg); } }

.ai-composer {
  display: grid;
  grid-template-columns: 1fr 40px;
  gap: 8px;
  margin-top: 10px;
}

.ai-composer textarea {
  width: 100%;
  min-height: 50px;
  max-height: 120px;
  padding: 11px 12px;
  resize: vertical;
  color: var(--ink);
  background: white;
  border: 1px solid #b8cae4;
  border-radius: var(--radius-md);
  font-size: 12px;
  line-height: 1.5;
}

.ai-composer button {
  align-self: stretch;
  color: white;
  background: var(--on-blue);
  border: 0;
  border-radius: var(--radius-md);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

.ai-composer button:disabled {
  background: #a9bbd5;
  cursor: not-allowed;
}

.composer-guide {
  margin: 7px 0 0;
  color: var(--muted-ink);
  font-size: 10px;
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 15px;
}

.scenario-grid button {
  position: relative;
  display: grid;
  gap: 1px;
  min-height: 68px;
  padding: 11px 11px 9px 42px;
  overflow: hidden;
  text-align: left;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.scenario-grid button:hover {
  border-color: #9fc4ff;
  background: #edf5ff;
}

.scenario-grid span {
  position: absolute;
  top: 12px;
  left: 11px;
  color: var(--on-blue);
  font-size: 11px;
  font-weight: 800;
}

.scenario-grid strong {
  font-size: 13px;
}

.scenario-grid small {
  color: var(--muted-ink);
  font-size: 10px;
}

.text-button {
  padding: 5px 2px;
  color: var(--on-blue);
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.control-toggles {
  display: grid;
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.control-toggles label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.control-toggles label > span {
  display: grid;
}

.control-toggles strong {
  font-size: 13px;
}

.control-toggles small {
  color: var(--muted-ink);
  font-size: 10px;
}

.control-toggles input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.control-toggles i {
  position: relative;
  width: 38px;
  height: 22px;
  background: #bac8dc;
  border-radius: 999px;
  transition: background 160ms ease;
}

.control-toggles i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 24, 80, 0.2);
  transition: transform 160ms ease;
}

.control-toggles input:checked + i {
  background: var(--on-blue);
}

.control-toggles input:checked + i::after {
  transform: translateX(16px);
}

.control-toggles input:focus-visible + i {
  outline: 3px solid rgba(0, 104, 248, 0.35);
  outline-offset: 3px;
}

.event-list {
  display: grid;
  gap: 0;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.event-list li {
  position: relative;
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 8px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.event-list li::before {
  content: "";
  width: 8px;
  height: 8px;
  margin: 7px 0 0 2px;
  background: var(--on-blue);
  border: 3px solid #dceaff;
  border-radius: 50%;
}

.event-list strong {
  display: block;
  font-size: 12px;
}

.event-list p {
  margin: 1px 0 0;
  color: var(--muted-ink);
  font-size: 10px;
}

.event-list time {
  color: var(--muted-ink);
  font-size: 10px;
  white-space: nowrap;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  max-width: 1780px;
  margin: 0 auto;
  padding: 24px clamp(20px, 4vw, 72px) 38px;
  color: var(--muted-ink);
  border-top: 1px solid var(--line);
  font-size: 11px;
}

.site-footer p {
  margin: 0;
}

.login-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 16, 58, 0.78);
}

.login-overlay[hidden] {
  display: none;
}

.login-card {
  width: min(100%, 440px);
  padding: 34px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-popover);
}

.login-brand {
  display: flex;
  align-items: center;
  width: 132px;
  height: 42px;
  margin-bottom: 24px;
  overflow: hidden;
}

.login-brand img {
  width: 132px;
  height: auto;
  object-fit: contain;
}

.login-card h2 {
  margin: 0;
  color: var(--yon-navy);
  font-size: 27px;
  line-height: 1.3;
}

.login-card > p:not(.eyebrow, .security-note) {
  margin: 10px 0 24px;
  color: var(--muted-ink);
  font-size: 13px;
}

.login-card form {
  display: grid;
  gap: 8px;
}

.login-card label {
  margin-top: 4px;
  color: var(--yon-navy);
  font-size: 12px;
  font-weight: 700;
}

.login-card input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #b8cae4;
  border-radius: var(--radius-md);
}

.primary-button {
  min-height: 48px;
  margin-top: 8px;
  color: white;
  background: var(--on-blue);
  border: 0;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
}

.primary-button:disabled {
  background: #9bacc4;
  cursor: wait;
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 12px;
}

.security-note {
  margin: 18px 0 0;
  color: var(--muted-ink);
  font-size: 11px;
}

.security-note span {
  color: var(--success);
}

.toast {
  position: fixed;
  z-index: 150;
  right: 24px;
  bottom: 24px;
  max-width: min(380px, calc(100vw - 40px));
  padding: 13px 16px;
  color: white;
  background: var(--yon-navy);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-popover);
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1280px) {
  .product-intro {
    grid-template-columns: 1fr 1fr;
  }

  .intro-summary {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .simulation-stage {
    grid-template-columns: minmax(320px, 0.85fr) minmax(390px, 1fr);
  }

  .intelligence-column {
    grid-column: 1 / -1;
    grid-template-columns: 1.1fr 0.9fr;
  }

  .event-panel {
    grid-column: 2;
  }
}

@media (max-width: 820px) {
  .site-header {
    position: relative;
    padding: 10px 16px;
  }

  .brand-product,
  .header-status > .status-chip {
    display: none;
  }

  .product-intro,
  .simulation-stage,
  .intelligence-column {
    grid-template-columns: 1fr;
  }

  .product-intro {
    gap: 18px;
    padding: 34px 18px 28px;
  }

  .product-intro h1 {
    font-size: 36px;
  }

  .intro-summary,
  .event-panel {
    grid-column: auto;
  }

  .simulation-stage {
    gap: 42px;
    padding: 0 16px 48px;
  }

  .intelligence-column {
    gap: 14px;
  }

  .phone-column {
    order: 1;
  }

  .watch-column {
    order: 2;
  }

  .intelligence-column {
    order: 3;
  }

  .site-footer {
    display: grid;
    padding: 20px 18px 32px;
  }
}

@media (max-width: 480px) {
  .brand-logo-frame {
    width: 102px;
  }

  .account-button {
    padding-right: 8px;
  }

  .account-button > span:last-child {
    display: none;
  }

  .product-intro h1 {
    font-size: 32px;
  }

  .intro-summary {
    flex-wrap: wrap;
    white-space: normal;
  }

  .ai-panel,
  .control-panel,
  .event-panel,
  .login-card {
    padding: 20px;
  }

  .scenario-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
