:root {
  --scan-blue: #0d5eaf;
  --scan-light-blue: #34b5e5;
  --scan-dark: #13263d;
  --scan-orange: #ff6b2c;
  --scan-bg: #f4f8fb;
  --scan-card: #ffffff;
  --scan-text: #17324d;
  --scan-muted: #5e7388;
  --scan-border: rgba(13, 94, 175, 0.12);
  --shadow-soft: 0 10px 30px rgba(16, 59, 102, 0.08);
  --shadow-strong: 0 18px 45px rgba(16, 59, 102, 0.14);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: var(--scan-bg);
  color: var(--scan-text);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.container {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

.idim-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(19,38,61,.06);
  min-height: 74px;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.idim-brand {
  font-family: "Montserrat", sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--scan-blue);
}

.idim-page {
  padding-bottom: 124px;
}

.scanmap-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 74px;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(19,38,61,.06);
}

.scanmap-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.scanmap-logo-shell {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(13,94,175,.16);
  flex-shrink: 0;
}

.scanmap-logo-shell img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanmap-brand {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.scanmap-brand strong {
  font-family: "Montserrat", sans-serif;
  font-size: 1rem;
  color: var(--scan-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scanmap-brand span {
  color: var(--scan-muted);
  font-size: .82rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scanmap-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.scanmap-icon-btn {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--scan-border);
  background: #fff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--scan-dark);
  box-shadow: 0 10px 22px rgba(16,59,102,.08);
}

.scanmap-icon-btn img {
  width: 22px;
  height: 16px;
  object-fit: cover;
  border-radius: 3px;
  display: block;
}

.idim-hero {
  padding: 48px 0 24px;
  background: linear-gradient(135deg, #eaf6ff 0%, #f8fcff 100%);
}

.idim-hero.compact {
  padding: 40px 0 20px;
}

.eyebrow {
  display: inline-block;
  background: rgba(13,94,175,.10);
  color: var(--scan-blue);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  margin-bottom: 12px;
}

.idim-hero h1 {
  margin: 0 0 10px;
  font-family: "Montserrat", sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.06;
}

.idim-hero p {
  margin: 0;
  color: var(--scan-muted);
  max-width: 780px;
  line-height: 1.7;
}

.idim-card {
  background: #fff;
  border: 1px solid var(--scan-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 24px;
  margin-top: 20px;
}

.idim-form .form-group {
  margin-bottom: 20px;
}

.idim-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.idim-form input,
.idim-form select,
.idim-form textarea {
  width: 100%;
  border: 1px solid rgba(19,38,61,.12);
  border-radius: 14px;
  padding: 14px 16px;
  background: #fff;
}

.form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.top-gap { margin-top: 18px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 20px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  font-weight: 700;
}

.btn-primary {
  background: var(--scan-orange);
  color: #fff;
}

.btn-secondary {
  background: #eef6fd;
  color: var(--scan-blue);
  border: 1px solid rgba(13,94,175,.12);
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip input {
  display: none;
}

.chip span {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 999px;
  background: #f6fbff;
  border: 1px solid rgba(13,94,175,.10);
  cursor: pointer;
}

.chip input:checked + span {
  background: var(--scan-blue);
  color: #fff;
}

.status-box {
  margin-top: 14px;
  color: var(--scan-muted);
  line-height: 1.6;
}

.ai-layout,
.results-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 20px;
  align-items: start;
}

.prompt-list {
  display: grid;
  gap: 12px;
}

.prompt-card {
  border: 1px solid var(--scan-border);
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.chat-box {
  min-height: 380px;
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.chat-message {
  padding: 14px 16px;
  border-radius: 16px;
  line-height: 1.6;
}

.chat-message.bot {
  background: #f6fbff;
  border: 1px solid rgba(13,94,175,.08);
}

.chat-message.user {
  background: var(--scan-blue);
  color: #fff;
  align-self: flex-end;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
}

.summary-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  line-height: 1.7;
}

.response-box {
  min-height: 200px;
  line-height: 1.75;
  color: var(--scan-text);
}

.category-grid-page {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.category-card {
  min-height: 140px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: center;
  align-items: center;
  background: #fff;
  border: 1px solid var(--scan-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  font-size: 1.15rem;
  font-weight: 700;
}

.category-card.accent {
  background: linear-gradient(135deg, var(--scan-blue), var(--scan-light-blue));
  color: #fff;
}

.list-grid {
  display: grid;
  gap: 12px;
}

.list-item {
  display: grid;
  gap: 6px;
  background: #f8fcff;
  border: 1px solid rgba(13,94,175,.08);
  border-radius: 16px;
  padding: 16px;
}

.lang-switcher {
  position: relative;
}

.lang-switcher__current {
  min-width: 84px;
  padding: 10px 14px;
  border: 1px solid var(--scan-border);
  background: #fff;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--scan-dark);
}

.lang-switcher__menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 180px;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-strong);
  border: 1px solid var(--scan-border);
  overflow: hidden;
}

.lang-switcher__menu.is-open {
  display: block;
}

.lang-option {
  width: 100%;
  border: 0;
  background: #fff;
  text-align: left;
  padding: 12px 14px;
  cursor: pointer;
}

.lang-option:hover {
  background: #f4f9ff;
}

.lang-option.is-active {
  background: #eef6fd;
  color: var(--scan-blue);
  font-weight: 700;
}

.field-help {
  margin-top: 10px;
}

.field-help .btn {
  width: auto;
}

.scanmap-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  background: rgba(255,255,255,.98);
  border-top: 1px solid rgba(19,38,61,.08);
  box-shadow: 0 -10px 30px rgba(16,59,102,.10);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
}

.scanmap-bottom-nav__track {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  width: min(1120px, calc(100% - 8px));
  margin: 0 auto;
}

.scanmap-bottom-link {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 8px 4px;
  border-radius: 16px;
  color: var(--scan-muted);
  transition: background .2s ease, color .2s ease, transform .2s ease;
}

.scanmap-bottom-link img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.scanmap-bottom-link span {
  font-size: .72rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.1;
}

.scanmap-bottom-link.is-active {
  background: linear-gradient(135deg, rgba(13,94,175,.12), rgba(52,181,229,.16));
  color: var(--scan-blue);
}

.scanmap-bottom-link:hover {
  transform: translateY(-1px);
}

@media (max-width: 900px) {
  .ai-layout,
  .results-layout,
  .category-grid-page {
    grid-template-columns: 1fr;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .scanmap-topbar {
    min-height: 68px;
    padding: 10px 14px;
  }

  .scanmap-brand span {
    white-space: normal;
  }

  .scanmap-icon-btn {
    min-height: 40px;
    padding: 0 12px;
  }

  .scanmap-bottom-nav__track {
    gap: 4px;
  }

  .scanmap-bottom-link {
    padding: 8px 2px;
  }

  .scanmap-bottom-link span {
    font-size: .66rem;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(100% - 24px, 1100px);
  }

  .scanmap-brand strong {
    font-size: .95rem;
  }

  .scanmap-brand span {
    font-size: .76rem;
    max-width: 170px;
  }

  .form-row {
    flex-direction: column;
  }

  .form-row .btn {
    width: 100%;
  }

  .field-help .btn {
    width: 100%;
  }

  .scanmap-bottom-nav__track {
    overflow-x: auto;
    grid-template-columns: repeat(7, 76px);
    justify-content: start;
    width: 100%;
    padding-bottom: 2px;
  }
}
