:root {
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --brand-primary: #22c55f;
  --brand-primary-hover: #16a34a;
  --brand-primary-soft: #dcfce7;
  --brand-primary-shadow: rgba(34, 197, 95, 0.35);
  --dark: #042f2c;
  --dark-soft: #0a423d;
  --bg: #e4ded6;
  --surface: #efeeeb;
  --surface-2: rgba(255, 255, 255, 0.74);
  --text: #111827;
  --muted: #6b7280;
  --font-primary: 'M PLUS 1p', sans-serif;
  --font-heading: 'Exo 2', sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root { color-scheme: light; }
  body { background: var(--bg); color: var(--text); }
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-primary);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(circle at 14% 8%, rgba(34,197,95,.12), transparent 30%),
    radial-gradient(circle at 88% 16%, rgba(4,47,44,.13), transparent 26%),
    linear-gradient(to right, rgba(255,255,255,.18) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.18) 1px, transparent 1px);
  background-size: auto, auto, 42px 42px, 42px 42px;
  mask-image: linear-gradient(to bottom, black 0%, black 82%, transparent 100%);
}

h1, h2, h3, .page-title, .hero-title { font-family: var(--font-heading); }
button, input, textarea { font-family: inherit; }
button { border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }

.hidden { display: none !important; }
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.app-shell { padding-top: var(--safe-area-top); }

.topbar {
  border-radius: 22px;
  padding: 12px 14px;
  background: rgba(239, 238, 235, .86);
  border: 1px solid rgba(255,255,255,.72);
  box-shadow: 0 10px 28px rgba(0,0,0,.055);
  backdrop-filter: saturate(1.2) blur(18px);
  -webkit-backdrop-filter: saturate(1.2) blur(18px);
}

.brand-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  background: transparent;
  color: var(--text);
  padding: 0;
  text-align: left;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--dark);
  color: var(--brand-primary);
  font-family: var(--font-heading);
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(4,47,44,.14);
  flex: 0 0 auto;
}

.icon-btn,
.balance-pill {
  min-width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(255,255,255,.85);
  color: #263238;
  box-shadow: 0 4px 14px rgba(0,0,0,.035);
  transition: transform .08s ease, background .18s ease, color .18s ease;
}
.icon-btn:active,
.balance-pill:active,
.primary-btn:active,
.option-tile:active,
.history-card:active,
.tab-btn:active,
.chat-cta-btn:active {
  transform: translateY(1px) scale(.992);
}
.balance-pill {
  gap: 7px;
  padding: 0 13px;
  min-width: auto;
  font-weight: 800;
  color: var(--dark);
}
.balance-pill i { color: var(--brand-primary-hover); }

.page-view { animation: page-in .18s ease both; }
@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  padding: 28px 22px;
  min-height: 320px;
  background: var(--dark);
  box-shadow: 0 24px 58px rgba(4, 47, 44, .22);
}
.hero-glow {
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: rgba(34,197,95,.12);
  filter: blur(54px);
  pointer-events: none;
}
.hero-glow-right { top: -70px; right: -90px; }
.hero-glow-left { bottom: -95px; left: -85px; }
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(255,255,255,.09);
  color: rgba(255,255,255,.72);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.ping-dot {
  position: relative;
  width: 9px;
  height: 9px;
  display: inline-flex;
}
.ping-dot::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--brand-primary);
  animation: ping 1.4s cubic-bezier(0,0,.2,1) infinite;
}
.ping-dot span {
  position: relative;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--brand-primary);
}
@keyframes ping {
  75%, 100% { transform: scale(2.2); opacity: 0; }
}
.hero-title {
  color: #fff;
  font-size: clamp(34px, 9vw, 48px);
  line-height: .98;
  font-weight: 500;
  letter-spacing: -.04em;
  margin: 0;
}
.hero-text {
  max-width: 420px;
  margin: 14px 0 0;
  color: #8faea5;
  font-size: 14px;
  line-height: 1.55;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 26px;
}
.hero-stats div {
  min-width: 0;
  border-radius: 20px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.08);
  padding: 12px 10px;
}
.hero-stats b {
  display: block;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}
.hero-stats span {
  display: block;
  margin-top: 6px;
  color: rgba(255,255,255,.48);
  font-size: 10.5px;
  line-height: 1.25;
}

.section-card {
  border-radius: 28px;
  background: rgba(239,238,235,.88);
  border: 1px solid rgba(255,255,255,.78);
  box-shadow: 0 7px 20px rgba(0,0,0,.035);
}
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.section-title {
  font-family: var(--font-heading);
  font-size: 23px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -.02em;
  color: #111827;
}
.section-subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12.5px;
}
.page-title {
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: 1;
  color: #111827;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 5px;
  border-radius: 20px;
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(255,255,255,.75);
}
.mode-btn {
  min-height: 42px;
  border-radius: 16px;
  background: transparent;
  color: #6b7280;
  font-size: 12.5px;
  font-weight: 800;
  transition: background .2s ease, color .2s ease, transform .08s ease;
}
.mode-btn.active {
  background: var(--dark);
  color: #fff;
  box-shadow: 0 10px 18px rgba(4,47,44,.12);
}

.upload-zone {
  aspect-ratio: 16 / 10;
  width: 100%;
  border: 1.8px dashed rgba(4,47,44,.20);
  border-radius: 24px;
  background: rgba(255,255,255,.52);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: background .18s ease, border-color .18s ease, transform .08s ease;
}
.upload-zone:active { transform: scale(.995); }
.upload-zone:hover { background: rgba(255,255,255,.78); border-color: rgba(34,197,95,.60); }
.upload-icon {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-primary-soft);
  color: var(--brand-primary-hover);
  font-size: 22px;
}
.preview-img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 24px;
  background: rgba(255,255,255,.48);
  border: 1px solid rgba(255,255,255,.82);
}
.floating-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(4,47,44,.72);
  color: #fff;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.classification-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  max-width: calc(100% - 60px);
  padding: 7px 10px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(0,0,0,.08);
}
.classification-badge.good { background: var(--brand-primary-soft); color: #166534; }
.classification-badge.bad { background: #fee2e2; color: #991b1b; }

.field-label {
  display: block;
  font-size: 13px;
  color: #4b5563;
  font-weight: 700;
  margin-bottom: 10px;
}
.app-textarea {
  width: 100%;
  min-height: 132px;
  resize: none;
  outline: none;
  border: 1px solid rgba(255,255,255,.92);
  border-radius: 22px;
  padding: 14px 15px;
  background: rgba(255,255,255,.70);
  color: #111827;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.03);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.app-textarea:focus {
  background: #fff;
  border-color: rgba(34,197,95,.50);
  box-shadow: 0 0 0 4px rgba(34,197,95,.11);
}

.option-list { display: grid; gap: 9px; }
.option-tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  min-height: 72px;
  border-radius: 22px;
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(255,255,255,.86);
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .08s ease;
}
.option-tile input { position: absolute; opacity: 0; pointer-events: none; }
.option-icon {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: rgba(4,47,44,.06);
  color: var(--dark);
}
.option-body { display: block; min-width: 0; flex: 1; }
.option-body b {
  display: block;
  font-size: 14px;
  line-height: 1.15;
  color: #111827;
}
.option-body small {
  display: block;
  margin-top: 5px;
  font-size: 11.5px;
  line-height: 1.25;
  color: #6b7280;
}
.option-check {
  width: 25px;
  height: 25px;
  border-radius: 999px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  background: rgba(4,47,44,.10);
  opacity: .7;
}
.option-tile:has(input:checked) {
  background: #fff;
  border-color: rgba(34,197,95,.70);
  box-shadow: 0 0 0 3px rgba(34,197,95,.10), 0 10px 26px rgba(0,0,0,.04);
}
.option-tile:has(input:checked) .option-icon {
  background: var(--dark);
  color: var(--brand-primary);
}
.option-tile:has(input:checked) .option-check {
  background: var(--brand-primary);
  opacity: 1;
}
.option-tile.disabled {
  opacity: .62;
  cursor: not-allowed;
}
.soon-badge {
  position: absolute;
  right: 12px;
  top: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 10px;
  font-weight: 900;
}

.disclaimer {
  margin-top: 12px;
  padding: 13px;
  border-radius: 20px;
  border: 1px solid rgba(245,158,11,.45);
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  box-shadow: 0 12px 20px rgba(245,158,11,.12);
}
.disclaimer-icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: rgba(255,255,255,.55);
  color: #b45309;
}

.primary-btn {
  width: 100%;
  min-height: 58px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--brand-primary);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 16px 30px var(--brand-primary-shadow);
  transition: background .18s ease, opacity .18s ease, transform .08s ease;
}
.primary-btn:not(.disabled):hover { background: var(--brand-primary-hover); }
.primary-btn.disabled {
  background: var(--dark);
  opacity: .42;
  box-shadow: none;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-wrap i {
  position: absolute;
  left: 14px;
  color: #9ca3af;
  font-size: 13px;
}
.search-wrap input {
  width: 100%;
  height: 46px;
  border: 1px solid rgba(255,255,255,.88);
  border-radius: 999px;
  background: rgba(255,255,255,.68);
  outline: none;
  padding: 0 16px 0 38px;
  font-size: 13px;
  color: #111827;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.search-wrap input:focus {
  background: #fff;
  border-color: rgba(34,197,95,.45);
  box-shadow: 0 0 0 4px rgba(34,197,95,.10);
}

.history-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 86px;
  padding: 12px;
  border-radius: 24px;
  background: rgba(239,238,235,.90);
  border: 1px solid rgba(255,255,255,.78);
  box-shadow: 0 7px 20px rgba(0,0,0,.035);
  transition: transform .08s ease, box-shadow .18s ease, background .18s ease;
  cursor: pointer;
}
.history-card:hover { background: rgba(255,255,255,.72); box-shadow: 0 12px 26px rgba(0,0,0,.05); }
.history-card.is-waiting {
  border-color: rgba(217,119,6,.22);
  background: rgba(255,251,235,.76);
}
.history-card.is-waiting .history-thumb,
.history-card.is-waiting .history-placeholder {
  opacity: .82;
}
.mini-spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(15,76,67,.18);
  border-top-color: var(--dark);
  display: inline-block;
  animation: spin .8s linear infinite;
}
.mini-spinner.tiny {
  width: 12px;
  height: 12px;
  border-width: 1.7px;
  margin-right: 5px;
  vertical-align: -2px;
}
.history-thumb,
.history-placeholder {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.90);
  background: rgba(255,255,255,.62);
}
.history-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-primary-hover);
}
.history-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 800;
  font-size: 14px;
  line-height: 1.28;
  color: #111827;
}
.history-meta {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: #6b7280;
}
.mini-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(4,47,44,.07);
  color: #4b5563;
  font-size: 10.5px;
  font-weight: 800;
}
.mini-badge.good { background: var(--brand-primary-soft); color: #166534; }
.mini-badge.bad { background: #fee2e2; color: #991b1b; }
.mini-badge.wait { background: #fef3c7; color: #92400e; }

.empty-state {
  min-height: 260px;
  border-radius: 28px;
  background: rgba(239,238,235,.78);
  border: 1px solid rgba(255,255,255,.78);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 26px;
}
.empty-icon {
  width: 68px;
  height: 68px;
  border-radius: 999px;
  background: rgba(255,255,255,.74);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 28px;
  margin-bottom: 12px;
}

.profile-avatar {
  width: 62px;
  height: 62px;
  border-radius: 21px;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 8px 20px rgba(0,0,0,.08);
}
.profile-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin-top: 18px;
}
.profile-stats div {
  border-radius: 20px;
  padding: 13px;
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(255,255,255,.86);
}
.profile-stats b {
  display: block;
  color: #111827;
  font-size: 20px;
  line-height: 1;
  font-weight: 900;
}
.profile-stats span {
  display: block;
  color: #6b7280;
  font-size: 11.5px;
  margin-top: 7px;
}
.profile-limit-panel {
  margin-top: 12px;
  border-radius: 18px;
  padding: 12px;
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(255,255,255,.86);
}
.profile-limit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: #4b5563;
  font-weight: 700;
}
.profile-limit-head b {
  color: #0f172a;
  font-size: 14px;
}
.profile-limit-track {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: rgba(148,163,184,.25);
  margin-top: 9px;
  overflow: hidden;
}
.profile-limit-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
  transition: width .24s ease;
}
.profile-limit-caption {
  margin-top: 8px;
  font-size: 12px;
  color: #6b7280;
}
.menu-row {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 17px;
  background: transparent;
  color: #111827;
  border-bottom: 1px solid rgba(255,255,255,.72);
  font-size: 14px;
  font-weight: 700;
}
.menu-row:last-child { border-bottom: 0; }
.menu-row span { display: inline-flex; align-items: center; gap: 10px; }
.menu-row span i { width: 18px; color: var(--brand-primary-hover); }
.menu-row > i { color: #9ca3af; font-size: 12px; }

.bottom-nav {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: max(14px, min(calc(var(--safe-area-bottom) + 6px), 20px));
  transform: translateX(-50%);
  width: min(calc(100% - 24px), 536px);
  height: 66px;
  box-sizing: border-box;
  padding: 6px;
  border-radius: 24px;
  background: rgba(239, 238, 235, .86);
  border: 1px solid rgba(255,255,255,.80);
  box-shadow: 0 18px 45px rgba(0,0,0,.12);
  backdrop-filter: saturate(1.2) blur(18px);
  -webkit-backdrop-filter: saturate(1.2) blur(18px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}
.tab-btn {
  min-width: 0;
  min-height: 0;
  height: 100%;
  border-radius: 17px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #6b7280;
  font-size: 16px;
  font-weight: 800;
  transition: background .18s ease, color .18s ease, transform .08s ease;
}
.tab-btn span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9.5px;
  line-height: 1;
}
.tab-btn.active {
  background: var(--dark);
  color: var(--brand-primary);
  box-shadow: 0 12px 24px rgba(4,47,44,.13);
}

.detail-view {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: var(--bg);
  overflow: hidden;
  animation: detail-in .2s ease both;
}
@keyframes detail-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
.detail-panel {
  position: relative;
  width: min(100%, 560px);
  height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: calc(12px + var(--safe-area-top)) 12px calc(12px + var(--safe-area-bottom));
}
.detail-header {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-radius: 24px;
  background: rgba(239,238,235,.92);
  border: 1px solid rgba(255,255,255,.78);
  padding: 10px;
  box-shadow: 0 10px 28px rgba(0,0,0,.055);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.detail-title {
  font-size: 14px;
  line-height: 1.2;
  font-weight: 900;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}
.detail-date {
  margin-top: 4px;
  font-size: 11px;
  color: #6b7280;
}
.detail-content {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: grid;
  gap: 10px;
  align-content: start;
  padding-bottom: 86px;
}
.detail-image {
  width: 100%;
  max-height: 390px;
  object-fit: contain;
  border-radius: 28px;
  background: rgba(239,238,235,.86);
  border: 1px solid rgba(255,255,255,.80);
  box-shadow: 0 10px 26px rgba(0,0,0,.05);
}
.result-card {
  border-radius: 26px;
  background: rgba(239,238,235,.90);
  border: 1px solid rgba(255,255,255,.80);
  box-shadow: 0 7px 20px rgba(0,0,0,.035);
  padding: 16px;
}
.result-label {
  color: #6b7280;
  font-size: 11px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 900;
  margin-bottom: 10px;
}
.result-text { color: #111827; font-size: 13.5px; line-height: 1.55; }
.score-row { display: flex; align-items: center; gap: 12px; }
.score-circle {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: var(--dark);
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 900;
  flex: 0 0 auto;
}
.result-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.result-list li {
  position: relative;
  padding: 10px 12px 10px 34px;
  border-radius: 18px;
  background: rgba(255,255,255,.58);
  border: 1px solid rgba(255,255,255,.82);
  color: #111827;
  font-size: 13px;
  line-height: 1.45;
}
.result-list li::before {
  position: absolute;
  left: 13px;
  top: 10px;
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 11px;
}
.result-list.positive li::before { content: "\f00c"; color: #059669; }
.result-list.negative li::before { content: "\f00d"; color: #dc2626; }
.result-list.recommend li::before { content: "\f0eb"; color: #d97706; }
.requirement-card {
  padding: 12px;
  border-radius: 18px;
  background: rgba(255,255,255,.58);
  border: 1px solid rgba(255,255,255,.82);
}
.requirement-card b {
  display: block;
  color: #111827;
  font-size: 13px;
  margin-bottom: 5px;
}
.requirement-card p { color: #4b5563; font-size: 12.5px; line-height: 1.45; margin: 0; }
.detail-chat-cta {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(12px + var(--safe-area-bottom));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  padding: 0;
  background: transparent;
  box-shadow: none;
  z-index: 4;
}
.chat-cta-btn {
  width: 100%;
  min-height: 52px;
  padding: 8px 10px;
  border-radius: 18px;
  background: var(--dark);
  color: #fff;
  box-shadow: 0 14px 30px rgba(4,47,44,.24);
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.chat-cta-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--brand-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-shadow: 0 10px 20px var(--brand-primary-shadow);
}
.chat-cta-btn b {
  display: block;
  color: #fff;
  font-size: 12.5px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-cta-btn small { display: none; }

.sheet-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.36);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.sheet-card {
  position: relative;
  width: min(100%, 560px);
  max-height: calc(88vh - var(--safe-area-top));
  overflow: hidden;
  border-radius: 30px 30px 0 0;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.82);
  box-shadow: 0 -18px 50px rgba(0,0,0,.18);
  padding: 10px 14px calc(14px + var(--safe-area-bottom));
  animation: sheet-in .22s ease both;
}
@keyframes sheet-in {
  from { transform: translateY(24px); opacity: .7; }
  to { transform: translateY(0); opacity: 1; }
}
.sheet-grip {
  width: 44px;
  height: 5px;
  border-radius: 999px;
  margin: 0 auto 10px;
  background: rgba(4,47,44,.18);
}
.sheet-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0 12px;
}
.sheet-body {
  overflow: auto;
  max-height: 68vh;
  display: grid;
  gap: 10px;
}
.info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(255,255,255,.82);
  font-size: 13px;
}
.info-row b { color: #4b5563; }
.info-row span { color: #111827; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chat-sheet-card { height: min(720px, 86vh); display: flex; flex-direction: column; }
.chat-messages {
  flex: 1;
  min-height: 260px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0 12px;
}
.message {
  max-width: 86%;
  border-radius: 20px;
  padding: 11px 13px;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.message.bot {
  align-self: flex-start;
  width: 100%;
  max-width: 100%;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 8px 2px;
  color: #111827;
}
.message.user {
  align-self: flex-end;
  max-width: 86%;
  background: var(--dark);
  color: #fff;
}
.message p {
  margin: 0 0 8px;
  white-space: pre-wrap;
}
.message p:last-child { margin-bottom: 0; }
.message h4 {
  margin: 8px 0 6px;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 900;
}
.message ul,
.message ol {
  margin: 6px 0 8px;
  padding-left: 18px;
  display: grid;
  gap: 5px;
}
.message li { padding-left: 2px; }
.message code {
  padding: 1px 4px;
  border-radius: 6px;
  background: rgba(4,47,44,.08);
  font-size: .92em;
}
.message.user code { background: rgba(255,255,255,.16); }
.message-attachment {
  display: block;
  margin-bottom: 8px;
  overflow: hidden;
}
.message-attachment.image img {
  display: block;
  width: min(220px, 100%);
  max-height: 180px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.72);
}
.message-attachment.file {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  max-width: 230px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(255,255,255,.76);
  color: inherit;
  text-decoration: none;
}
.message.user .message-attachment.file { background: rgba(255,255,255,.12); }
.message-attachment.file span,
.file-preview-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(4,47,44,.10);
  color: var(--dark);
}
.message.user .message-attachment.file span {
  background: rgba(255,255,255,.16);
  color: #fff;
}
.message-attachment.file b {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.message-attachment.file small {
  display: block;
  color: #6b7280;
  font-size: 10.5px;
  margin-top: 2px;
}
.message.user .message-attachment.file small { color: rgba(255,255,255,.62); }
.typing-dots {
  min-width: 40px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.typing-dots i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #6b7280;
  animation: typing-dot 1s infinite ease-in-out;
}
.typing-dots i:nth-child(2) { animation-delay: .15s; }
.typing-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes typing-dot {
  0%, 80%, 100% { opacity: .35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}
.chat-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.70);
}
.chat-attachment-preview {
  padding: 8px 0 0;
}
.chat-attachment-pill {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 34px;
  gap: 9px;
  align-items: center;
  border-radius: 18px;
  background: rgba(255,255,255,.68);
  border: 1px solid rgba(255,255,255,.84);
  padding: 7px;
}
.chat-attachment-pill img {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  object-fit: cover;
}
.chat-attachment-pill b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: #111827;
}
.chat-attachment-pill small {
  display: block;
  margin-top: 2px;
  color: #6b7280;
  font-size: 10.5px;
}
.chat-attachment-pill button {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(4,47,44,.08);
  color: var(--dark);
}
.chat-form textarea {
  flex: 1;
  min-height: 48px;
  max-height: 112px;
  resize: none;
  overflow-y: auto;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,.88);
  background: rgba(255,255,255,.70);
  outline: none;
  padding: 14px 15px;
  color: #111827;
  font-size: 13px;
  line-height: 1.35;
}
.chat-form textarea:focus {
  background: #fff;
  box-shadow: 0 0 0 4px rgba(34,197,95,.10);
  border-color: rgba(34,197,95,.45);
}
.chat-form button {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: var(--brand-primary);
  color: #fff;
  flex: 0 0 auto;
  box-shadow: 0 10px 20px var(--brand-primary-shadow);
}
.chat-form textarea:disabled,
.chat-form button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.guide-card {
  padding: 14px;
  border-radius: 24px;
  background: rgba(255,255,255,.68);
  border: 1px solid rgba(255,255,255,.88);
  box-shadow: 0 10px 26px rgba(15,23,42,.06);
}
.guide-cover {
  width: 100%;
  display: block;
  border-radius: 16px;
  object-fit: cover;
  aspect-ratio: 16 / 9;
  margin-bottom: 12px;
  border: 1px solid rgba(255,255,255,.88);
}
.guide-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.guide-icon {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(34,197,94,.12);
  color: var(--brand-primary);
  flex: 0 0 auto;
}
.guide-title {
  font-size: 15px;
  font-weight: 900;
  color: #111827;
  line-height: 1.2;
}
.guide-date {
  font-size: 12px;
  color: #6b7280;
  margin-top: 3px;
}
.guide-preview {
  margin-top: 10px;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.guide-actions .secondary-mini-btn {
  flex: 1 1 calc(50% - 4px);
  justify-content: center;
}
.guide-modal-cover {
  width: 100%;
  display: block;
  border-radius: 20px;
  object-fit: cover;
  aspect-ratio: 16 / 9;
  margin-bottom: 10px;
  border: 1px solid rgba(255,255,255,.86);
}
.secondary-mini-btn {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(255,255,255,.9);
  color: #12302b;
  font-size: 12px;
  font-weight: 900;
}
@media (max-width: 420px) {
  .guide-card {
    padding: 12px;
    border-radius: 20px;
  }
  .guide-actions .secondary-mini-btn {
    flex: 1 1 100%;
  }
}
.severity-list {
  display: grid;
  gap: 8px;
}
.severity-item {
  padding: 11px 12px;
  border-radius: 18px;
  background: rgba(255,255,255,.58);
  border: 1px solid rgba(255,255,255,.86);
}
.severity-item b {
  display: inline-flex;
  margin-bottom: 5px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.severity-item p {
  color: #111827;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
}
.severity-item span {
  display: block;
  color: #4b5563;
  font-size: 12px;
  line-height: 1.4;
  margin-top: 4px;
}
.severity-item.critical b { color: #b91c1c; }
.severity-item.high b { color: #c2410c; }
.severity-item.medium b { color: #a16207; }
.severity-item.low b { color: #047857; }
.disclaimer-card {
  background: rgba(255,255,255,.52);
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(4,47,44,.52);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #fff;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.loader {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 4px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.overlay p { margin: 0; font-weight: 800; font-size: 14px; }

.toast {
  position: fixed;
  z-index: 110;
  top: calc(14px + var(--safe-area-top));
  left: 50%;
  transform: translate(-50%, -12px);
  max-width: min(92vw, 420px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast span {
  display: block;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(4,47,44,.92);
  color: #fff;
  box-shadow: 0 16px 30px rgba(0,0,0,.20);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,.48);
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.65) 50%, transparent 100%);
  animation: shimmer 1.25s ease-in-out infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

@media (max-width: 380px) {
  #app { padding-left: 10px; padding-right: 10px; }
  .hero-card { padding: 24px 18px; border-radius: 28px; }
  .hero-stats { grid-template-columns: 1fr; }
  .section-title { font-size: 21px; }
  .bottom-nav {
    width: calc(100% - 14px);
    height: 60px;
    padding: 5px;
    border-radius: 20px;
    gap: 3px;
  }
  .tab-btn {
    border-radius: 15px;
    font-size: 14px;
  }
  .tab-btn span { font-size: 8.5px; }
  .detail-title { max-width: 220px; }
}
