:root {
  --primary: #106152;
  --primary-dark: #0d5043;
  --primary-light: #e0f2f1;
  --accent: #BD9E5E;
  --accent-light: #fffcf5;
  --text-main: #1f2937;
  --text-sec: #4b5563;
  --bg-body: #f3f5f7;
  --surface: #ffffff;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --radius: 12px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'IBM Plex Sans Thai', sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  margin: 0;
  padding: 10px;
  line-height: 1.5;
}

body.om-modal-open {
  overflow: hidden;
}

.container {
  max-width: 1080px;
  width: 100%;
  min-height: 600px;
  margin: 0 auto;
  padding: 20px 20px 100px;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
  position: relative;
}

/* Logo */
.logo-web {
  display: block;
  margin: 0 auto 12px;
  max-width: 100%;
  width: 280px;
  height: auto;
}

.logo-desktop {
  display: block;
  height: 85px;
  width: auto;
}

.logo-mobile {
  display: none;
  height: 55px;
  width: auto;
}

@media (max-width: 768px) {
  .logo-desktop {
    display: none;
  }

  .logo-mobile {
    display: block;
  }
}

@media (min-width: 600px) {
  body {
    padding: 20px;
  }

  .container {
    padding: 32px 32px 100px;
  }

  .logo-web {
    width: 350px;
  }
}

h1 {
  margin: 0;
  color: var(--primary);
  font-weight: 600;
  font-size: 22px;
  text-align: center;
}

.subtitle {
  text-align: center;
  color: var(--text-sec);
  font-size: 13px;
  margin-top: 6px;
  margin-bottom: 24px;
  font-weight: 300;
}

/* Header */
.om-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0 20px;
}

.om-logo-group {
  display: flex;
  align-items: center;
  gap: 15px;
}

.menu-icon {
  color: var(--primary);
  font-size: 28px;
  cursor: pointer;
}

.om-title-section {
  text-align: center;
  margin-bottom: 25px;
}

.om-main-title {
  color: var(--accent);
  font-size: 32px;
  font-weight: 700;
  margin: 0;
}

.om-sub-title {
  color: var(--primary);
  font-size: 22px;
  font-weight: 600;
  margin: 8px 0;
}

.highlight-underline {
  position: relative;
  display: inline-block;
  padding-bottom: 2px;
}

.highlight-underline::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--primary);
  border-radius: 2px;
}

/* Stepper */
.stepper-wrapper {
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
  position: relative;
  padding: 0 5px;
}

.stepper-wrapper::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 15px;
  right: 15px;
  height: 2px;
  background: #e5e7eb;
  z-index: 0;
}

.stepper-item {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.step-counter {
  width: 30px;
  height: 30px;
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 600;
  font-size: 14px;
  color: #9ca3af;
  transition: all 0.3s;
}

.stepper-item.active .step-counter {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 4px var(--primary-light);
}

.stepper-item.completed .step-counter {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.step-name {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 4px;
  font-weight: 500;
  text-align: center;
}

.stepper-item.active .step-name {
  color: var(--primary);
  font-weight: 600;
}

/* Step visibility */
.step-content {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.step-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Step 1: Cancer Grouping */
.group-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  margin: 20px 0 8px 0;
  padding-left: 4px;
  border-left: 4px solid var(--accent);
  line-height: 1.2;
}

.group-label:first-child {
  margin-top: 0;
}

.cancer-group-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

@media (min-width: 500px) {
  .cancer-group-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
}

.cancer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.cancer-item:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-2px);
}

.cancer-item.selected {
  border-color: var(--primary);
  background-color: var(--primary-light);
  box-shadow: 0 2px 8px rgba(16, 97, 82, 0.15);
}

.cancer-item .label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.3;
}

.cancer-item .check-icon {
  margin-left: auto;
  font-size: 18px;
  color: var(--primary);
  opacity: 0;
  transition: 0.2s;
}

.cancer-item.selected .check-icon {
  opacity: 1;
}

/* Step 2 & 3 */
.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 600px) {
  .options-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.card-opt {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 80px;
  padding: 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.card-opt:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-2px);
}

.card-opt.selected {
  border-color: var(--primary);
  background-color: var(--primary-light);
  box-shadow: 0 2px 8px rgba(16, 97, 82, 0.15);
}

.card-opt input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
}

.card-desc {
  font-size: 11px;
  color: var(--text-sec);
  line-height: 1.3;
}

/* Step 4 */
input[type="text"],
input[type="tel"],
input[type="email"] {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  font-family: 'IBM Plex Sans Thai', sans-serif;
  font-size: 15px;
  outline: none;
  transition: 0.2s;
  background: #fafafa;
}

input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px var(--primary-light);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--primary);
}

.om-step4-header {
  padding: 14px;
  margin: 0 0 16px 0;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.02);
}

.om-step4-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

.om-step4-subtitle {
  margin: 4px 0 0 0;
  font-size: 12px;
  opacity: 0.75;
}

/* Buttons */
.btn-row {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 48px), 1080px);
  padding: 16px 20px;
  background: #ffffff;
  box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.08);
  border-top: 1px solid #eef0f2;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
}

@media (max-width: 700px) {
  .btn-row {
    max-width: 100%;
    border-radius: 0;
  }
}

button {
  font-family: 'IBM Plex Sans Thai', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 50px;
  cursor: pointer;
  border: none;
  transition: 0.2s;
}

.btn-primary {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(16, 97, 82, 0.2);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-outline {
  background: #fff;
  border: 1px solid #d1d5db;
  color: var(--text-main);
}

.btn-outline:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.btn-text {
  background: transparent;
  color: #6b7280;
}

.btn-text:hover {
  color: var(--text-main);
  background: #f3f4f6;
}

/* Privacy Modal */
.privacy-link {
  margin-left: 6px;
  color: var(--primary);
  text-decoration: underline;
  font-size: 13px;
}

.om-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.om-modal.is-open {
  display: flex;
}

.om-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.om-modal__dialog {
  position: relative;
  z-index: 10000;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
}

.om-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}

.om-modal__header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--primary);
}

.om-modal__close {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
  color: #6b7280;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.om-modal__close:hover {
  color: #111827;
}

.om-modal__body {
  padding: 20px;
  overflow-y: auto;
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.6;
}

.om-modal__footer {
  padding: 14px 20px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  background: #fafafa;
  border-radius: 0 0 14px 14px;
}

/* Sidebar */
.om-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: 0.3s;
}

.om-sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

.om-sidebar {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100vh;
  background: #fff;
  z-index: 9999;
  transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.om-sidebar.active {
  right: 0;
}

.sidebar-header {
  padding: 20px 24px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  border-bottom: none;
}

.sidebar-header .close-btn {
  cursor: pointer;
  color: #1f2937;
  font-size: 32px;
  transition: 0.2s;
}

.sidebar-header .close-btn:hover {
  color: var(--primary);
  transform: scale(1.1);
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
  overflow-y: auto;
}

.sidebar-menu a {
  width: 80%;
  padding: 20px;
  text-decoration: none;
  color: #1f2937;
  font-size: 16px;
  font-weight: 500;
  border-bottom: 1px solid #f3f4f6;
  transition: all 0.2s ease;
  text-align: center;
  border-radius: 12px;
}

.sidebar-menu a:last-child {
  border-bottom: none;
}

.sidebar-menu a:hover {
  color: var(--primary);
  background: #f9fafb;
}

.sidebar-menu a.is-current {
  color: var(--primary);
  background: #f9fafb;
  font-weight: 700;
}

/* Role Selector */
.role-selector {
  display: flex;
  gap: 10px;
  width: 100%;
}

.role-opt {
  flex: 1;
  text-align: center;
  border: 1px solid #e5e7eb;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  background: #fff;
  transition: 0.2s;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
}

.role-opt input {
  display: none;
}

.role-opt:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

/* Result Header */
.result-header {
  background: #fff;
  border-left: 5px solid var(--primary);
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.res-h-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
}

.res-h-sub {
  font-size: 14px;
  color: #6b7280;
  margin-top: 4px;
}

/* Result Page - Profile Card */
.patient-profile-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.profile-icon {
  width: 50px;
  height: 50px;
  background: #f9fafb;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 24px;
  flex-shrink: 0;
}

.profile-info {
  flex: 1;
}

.p-name {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 4px;
}

.p-relation {
  font-size: 13px;
  color: #6b7280;
  font-weight: 400;
}

.p-cancer {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 12px;
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

/* Tech Cards */
.tech-card {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  padding: 24px 0;
  margin-bottom: 0;
  position: relative;
}

.tech-card:last-of-type {
  border-bottom: none;
}

.tech-card.wellness {
  background: #fffdf5;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--accent);
  margin-top: 10px;
}

.tech-rank {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #f3f4f6;
  color: var(--text-sec);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.tech-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
  padding-right: 60px;
}

.tech-desc {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.5;
}

.tech-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px dotted var(--accent);
}

/* Doctor Cards - current final version */
.doctor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.doctor-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 20px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: 0.2s;
}

.doctor-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.doc-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  background: #f9fafb;
  margin-bottom: 12px;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.doc-info {
  flex: 1;
  min-width: 0;
}

.doc-info h4 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  white-space: normal;
}

.doc-info p {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
  white-space: normal;
}

.doc-btn {
  display: none;
}

/* Processing */
#processingScreen {
  display: none;
  text-align: center;
  padding: 60px 20px;
}

.ai-loader {
  width: 60px;
  height: 60px;
  margin: 0 auto 24px;
  border-radius: 50%;
  border: 4px solid #f3f4f6;
  border-top-color: var(--primary);
  border-right-color: var(--accent);
  animation: spin 1.2s linear infinite;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

/* Alerts */
.warning-box {
  background: #fef2f2;
  border-left: 4px solid #ef4444;
  padding: 12px;
  font-size: 12px;
  color: #991b1b;
  margin-top: 16px;
  border-radius: 4px;
}

.disclaimer-box {
  background: #f8fafc;
  border-left: 4px solid #94a3b8;
  padding: 12px;
  font-size: 11px;
  color: #64748b;
  margin-top: 16px;
  border-radius: 4px;
}

/* Next Steps */
.next-step-section {
  margin-top: 40px;
  margin-bottom: 100px;
  border-top: 1px solid #e5e7eb;
  padding-top: 30px;
}

.step-item {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  align-items: flex-start;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

/* Inline cleanup from index.html */
.sidebar-header-end {
  justify-content: flex-end;
}

.step-note {
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-sec);
}

.form-block {
  margin-bottom: 20px;
}

.form-field {
  margin-bottom: 16px;
}

.field-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
}

.field-label-strong {
  font-weight: 600;
  color: var(--text-main);
}

.role-selector-gap {
  margin-top: 8px;
}

.consent-wrap {
  margin-top: 20px;
}

.consent-label {
  display: flex;
  gap: 8px;
  cursor: pointer;
  align-items: flex-start;
}

.consent-checkbox {
  margin-top: 4px;
}

.consent-text {
  font-size: 13px;
  color: var(--text-sec);
}

.privacy-link-inline {
  margin-left: 4px;
}

.btn-hidden {
  visibility: hidden;
}

.result-wrap {
  display: none;
  animation: fadeIn 0.5s;
}

.capture-area {
  background: #fff;
  padding: 4px;
}

.btn-row-result {
  flex-direction: column;
  border-top: none;
  margin-top: 10px;
}

.result-actions-top {
  display: flex;
  gap: 5px;
  width: 100%;
  justify-content: center;
}

.result-actions-bottom {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}

.btn-line-main {
  background: #06c755;
  width: 60%;
  justify-content: center;
  padding: 12px;
}

.btn-action-small {
  flex: 1;
  justify-content: center;
  font-size: 13px;
}

.btn-icon-sm {
  font-size: 16px;
  margin-right: 4px;
}

.btn-flex-1 {
  flex: 1;
}

.btn-text-sm {
  font-size: 13px;
}

.btn-danger {
  color: #ef4444;
}

.privacy-note {
  font-size: 12px;
  color: var(--text-sec);
  margin-top: 10px;
}

/* Recommended Technology Grid */
.recommended-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 12px;
}

@media (min-width: 900px) {
  .recommended-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.recommended-grid .tech-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px;
  margin: 0;
  height: 100%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.recommended-grid .tech-card:last-of-type {
  border-bottom: 1px solid #e5e7eb;
}

.recommended-grid .tech-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.tech-card-media {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 12px;
  display: block;
}

.recommended-grid .tech-rank {
  position: static;
  display: inline-block;
  margin-bottom: 10px;
  background: #f3f4f6;
  color: var(--text-sec);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
}

.recommended-grid .tech-title {
  padding-right: 0;
  margin-bottom: 8px;
  font-size: 17px;
  line-height: 1.4;
}

.recommended-grid .tech-desc {
  font-size: 13px;
  line-height: 1.6;
}

.recommended-grid .tech-link {
  margin-top: 14px;
}

