@font-face {
  font-family: "Pretendard Variable";
  src: url("./assets/fonts/PretendardVariable.woff2") format("woff2-variations");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

body,
button,
input,
textarea,
select {
  font-family: inherit;
  font-optical-sizing: auto;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.app-shell { grid-template-columns: 260px minmax(0, 1fr); }

.sidebar {
  width: 260px;
  padding: 28px 18px 22px;
}

.brand { padding: 0 10px 38px; }
.brand strong { letter-spacing: -.025em; }
.brand small { letter-spacing: .055em; }

.sidebar nav { gap: 8px; }
.nav-item { min-height: 50px; padding-inline: 15px; }
.nav-item span { font-size: 14px; letter-spacing: -.01em; }

.sidebar-note {
  padding: 19px 10px 0;
  gap: 6px;
}

.sidebar-note strong {
  font-size: 12px;
  letter-spacing: -.01em;
}

.sidebar-note span {
  display: block;
  min-width: 0;
  max-width: 100%;
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: -.025em;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.topbar {
  height: 78px;
  gap: 16px;
}

.search {
  max-width: 820px;
  min-width: 0;
}

.search input { letter-spacing: -.01em; }
.top-import { flex: 0 0 auto; white-space: nowrap; }

.cloud-sync-status {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: rgba(255,255,255,.8);
  color: #64748b;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}
.cloud-sync-status.ready { color: #18734a; border-color: #b9e1ca; background: #eaf8f0; }
.cloud-sync-status.syncing,
.cloud-sync-status.pending { color: #0b63ce; border-color: #bdd7f8; background: #eaf3ff; }
.cloud-sync-status.error { color: #a33a3a; border-color: #efc0c0; background: #fff2f2; }

.view {
  width: 100%;
  max-width: 1500px;
  padding-top: clamp(40px, 4vw, 56px);
}

.page-heading { gap: 36px; }
.page-heading > div { min-width: 0; }
.page-heading h1,
.section-title h2,
.license-hero h2,
.template-card h2,
.drawer h2 {
  word-break: keep-all;
  text-wrap: balance;
}

.next-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.drawer-danger-zone {
  margin-top: 26px;
  padding: 18px;
  border: 1px solid #f0c7c7;
  border-radius: 12px;
  background: #fff7f7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.drawer-danger-zone[hidden] { display: none; }
.drawer-danger-zone > div { display: grid; gap: 4px; }
.drawer-danger-zone strong { font-size: 13px; color: #7d2020; }
.drawer-danger-zone span { color: #8e5a5a; font-size: 11px; line-height: 1.5; }
.danger-button { flex: 0 0 auto; color: #a12424; border-color: #e7b0b0; }
.danger-button:hover { background: #fff0f0; border-color: #d78d8d; }

.consultation-form {
  margin-top: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.consultation-form[hidden] { display: none; }

.consultation-form-heading {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
}

.consultation-form-heading h3 {
  margin: 2px 0;
  font-size: 20px;
}

.consultation-form-heading > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.consultation-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.consultation-form label {
  display: grid;
  gap: 7px;
  font-size: 12px;
  font-weight: 750;
}

.consultation-form label small {
  color: var(--muted);
  font-weight: 500;
}

.consultation-form select,
.consultation-form input,
.consultation-form textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcfe;
  color: var(--text);
  font: inherit;
}

.consultation-form select,
.consultation-form input { min-height: 44px; }
.consultation-form textarea { resize: vertical; line-height: 1.55; }
.consultation-note { grid-column: 1 / -1; }

.consultation-form select:focus,
.consultation-form input:focus,
.consultation-form textarea:focus {
  outline: 0;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.consultation-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.consultation-ai-tools {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #c9dcf7;
  border-radius: 11px;
  background: linear-gradient(135deg, #f4f8ff, #eef5ff);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.consultation-ai-tools[hidden],
.consultation-ai-result[hidden] { display: none; }
.consultation-ai-tools > div { display: grid; gap: 4px; }
.consultation-ai-tools strong { font-size: 13px; color: #174d8f; }
.consultation-ai-tools span { color: #58708e; font-size: 11px; line-height: 1.45; }
.consultation-ai-tools button { flex: 0 0 auto; color: var(--blue); border-color: #b8d4f6; }
.consultation-ai-tools button:disabled { opacity: .65; cursor: wait; }

.consultation-ai-result {
  margin-top: 10px;
  padding: 15px;
  border: 1px solid #b9d5f7;
  border-radius: 11px;
  background: #f8fbff;
  display: grid;
  gap: 11px;
}
.consultation-ai-result-heading { display: flex; justify-content: space-between; gap: 10px; }
.consultation-ai-result-heading strong { font-size: 13px; }
.consultation-ai-result-heading span { color: var(--blue); font-size: 11px; font-weight: 750; }
.consultation-ai-result small { color: #58708e; font-size: 11px; line-height: 1.45; }
.timeline-ai-summary {
  grid-column: 2;
  margin-top: 4px;
  padding: 9px 11px;
  border-radius: 8px;
  background: #f0f6ff;
  color: #315a87;
  font-size: 11px;
  line-height: 1.5;
}
.timeline-ai-summary b { display: block; margin-bottom: 2px; color: var(--blue); }

.timeline p { white-space: pre-line; }
.timeline small {
  grid-column: 2;
  color: var(--blue);
  font-size: 12px;
  font-weight: 750;
}

@media (max-width: 850px) {
  .consultation-form-grid { grid-template-columns: 1fr; }
  .consultation-note { grid-column: auto; }
  .next-card-actions > * { width: 100%; }
  .drawer-danger-zone { align-items: stretch; flex-direction: column; }
  .drawer-danger-zone button { width: 100%; }
  .consultation-ai-tools { align-items: stretch; flex-direction: column; }
  .consultation-ai-tools button { width: 100%; }
}

.page-heading p,
.section-title p,
.license-hero p,
.license-notice p,
.automation-card p {
  word-break: keep-all;
}

.page-heading h1 {
  font-weight: 780;
  letter-spacing: -.05em;
}

.eyebrow {
  font-weight: 820;
  letter-spacing: .13em;
}

.summary-grid strong,
.message-stats strong,
.license-hero > strong {
  font-variant-numeric: tabular-nums;
  letter-spacing: -.035em;
}

.summary-grid article,
.section-card,
.message-stats article,
.template-card,
.license-grid article,
.upload-card,
.mapping-card {
  border-color: rgba(204, 214, 226, .82);
}

.section-title { min-height: 88px; }
.customer-main strong,
.vehicle strong,
.next-action strong,
.message-reason strong,
.license-grid strong {
  word-break: keep-all;
}

.license-status {
  flex: 0 0 auto;
  max-width: min(310px, 42vw);
}

.license-account-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.license-account-actions > .secondary {
  min-height: 40px;
  white-space: nowrap;
}

.license-status > span { min-width: 0; }
.account-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.license-hero { min-height: 210px; }
.license-grid article { min-height: 104px; align-content: center; }

.primary,
.secondary,
.segmented button,
.nav-item,
.customer-row {
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 236px minmax(0, 1fr); }
  .sidebar { width: 236px; padding-inline: 14px; }
  .sidebar-note span { font-size: 10.5px; }
  .view { padding-inline: 28px; }
  .license-hero { padding: 30px; }
}

@media (max-width: 850px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { width: 264px; padding: 24px 16px 20px; }
  .sidebar-note span { font-size: 11px; }
  .view { padding: 30px 16px 76px; }
  .topbar { height: 68px; }
  .cloud-sync-status { padding: 7px 9px; font-size: 10px; }
  .search { max-width: none; }
  .page-heading { gap: 18px; }
  .license-status { max-width: 54vw; }
  .license-account-actions { align-items: flex-end; flex-direction: column; }
}

@media (max-width: 560px) {
  .cloud-sync-status { display: none; }
  .page-heading { flex-direction: column; }
  .license-status { max-width: 100%; }
  .license-account-actions { width: 100%; align-items: stretch; }
  .license-hero { min-height: 0; padding: 26px 22px; }
  .license-grid article { min-height: 0; }
}

@media (prefers-contrast: more) {
  .section-card,
  .summary-grid article,
  .message-stats article,
  .template-card,
  .license-grid article { border-color: #9aa6b5; }
}
