.llq-app {
  --llq-primary: #0f766e;
  --llq-primary-dark: var(--llq-primary);
  --llq-ink: #16302d;
  --llq-muted: #667a77;
  --llq-border: #dce8e6;
  --llq-bg: #f4f9f8;
  width: min(100%, 720px);
  margin: 24px auto;
  color: var(--llq-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Thai", Tahoma, sans-serif;
  line-height: 1.55;
}

.llq-app *, .llq-app *::before, .llq-app *::after { box-sizing: border-box; }
.llq-app [hidden] { display: none !important; }

.llq-hero {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 24px;
  color: #fff;
  background: linear-gradient(135deg, var(--llq-primary), var(--llq-primary-dark));
  border-radius: 20px 20px 0 0;
  box-shadow: 0 14px 34px rgba(20, 70, 64, .16);
}

.llq-hero h1 { margin: 0; color: inherit; font-size: clamp(1.25rem, 4vw, 1.75rem); line-height: 1.25; }
.llq-hero p { margin: 3px 0 0; opacity: .9; }
.llq-hero .llq-eyebrow { margin: 0 0 2px; font-size: .72rem; font-weight: 800; letter-spacing: .12em; opacity: .78; }
.llq-logo-mark { display: grid; flex: 0 0 64px; width: 64px; height: 64px; overflow: hidden; place-items: center; background: #fff; border: 2px solid rgba(255,255,255,.72); border-radius: 18px; box-shadow: 0 7px 18px rgba(5, 42, 39, .2); }
.llq-logo-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }

.llq-loading, .llq-main, .llq-alert { background: #fff; }
.llq-loading { display: flex; gap: 12px; align-items: center; justify-content: center; min-height: 170px; padding: 30px; border-radius: 0 0 20px 20px; border: 1px solid var(--llq-border); border-top: 0; }
.llq-main { padding: 22px; border: 1px solid var(--llq-border); border-top: 0; border-radius: 0 0 20px 20px; box-shadow: 0 14px 34px rgba(20, 70, 64, .1); }

.llq-spinner { width: 22px; height: 22px; border: 3px solid #d9e7e5; border-top-color: var(--llq-primary); border-radius: 50%; animation: llq-spin .75s linear infinite; }
.llq-spinner-light { display: inline-block; width: 18px; height: 18px; border-color: rgba(255,255,255,.35); border-top-color: #fff; vertical-align: middle; }
@keyframes llq-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .llq-spinner { animation-duration: 1.8s; } }

.llq-profile { display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: var(--llq-bg); border: 1px solid var(--llq-border); border-radius: 14px; }
.llq-profile img, .llq-avatar-fallback { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.llq-avatar-fallback { display: grid; place-items: center; color: #fff; background: var(--llq-primary); font-weight: 800; }
.llq-profile span { display: block; color: var(--llq-muted); font-size: .78rem; }
.llq-profile strong { display: block; font-size: 1rem; }

.llq-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 18px 0; padding: 5px; background: #edf5f4; border-radius: 12px; }
.llq-tab { padding: 10px 12px; color: var(--llq-muted); background: transparent; border: 0; border-radius: 9px; font: inherit; font-weight: 700; cursor: pointer; }
.llq-tab.is-active { color: var(--llq-primary-dark); background: #fff; box-shadow: 0 2px 8px rgba(18, 73, 67, .1); }
.llq-tab:focus-visible, .llq-app button:focus-visible, .llq-app input:focus-visible, .llq-app select:focus-visible, .llq-app textarea:focus-visible { outline: 3px solid rgba(15, 118, 110, .35); outline-offset: 2px; }

.llq-panel, .llq-success { padding-top: 4px; }
.llq-section-heading { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.llq-section-heading h2 { margin: 0; color: var(--llq-ink); font-size: 1.2rem; }
.llq-section-heading p { margin: 1px 0 0; color: var(--llq-muted); font-size: .88rem; }
.llq-step { display: grid; flex: 0 0 32px; width: 32px; height: 32px; place-items: center; color: #fff; background: var(--llq-primary); border-radius: 10px; font-weight: 800; }

.llq-field { margin-bottom: 17px; }
.llq-field > label:first-child { display: block; margin-bottom: 6px; font-weight: 750; }
.llq-field > label span { color: #b42318; }
.llq-field > label .llq-optional-label { color: var(--llq-muted); font-size: .8rem; font-weight: 500; }
.llq-field input[type="text"], .llq-field input[type="tel"], .llq-field input[type="number"], .llq-field select, .llq-field textarea { display: block; width: 100%; min-height: 48px; padding: 10px 13px; color: var(--llq-ink); background: #fff; border: 1px solid #bacdca; border-radius: 10px; font: inherit; }
.llq-field textarea { min-height: 108px; resize: vertical; }
.llq-field input:hover, .llq-field select:hover, .llq-field textarea:hover { border-color: var(--llq-primary); }
.llq-field small { display: block; margin-top: 5px; color: var(--llq-muted); font-size: .78rem; }
#llq-amount { font-size: 1.12rem; font-variant-numeric: tabular-nums; font-weight: 750; letter-spacing: .01em; }

.llq-file-input { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; overflow: hidden; clip: rect(0,0,0,0); border: 0 !important; }
.llq-file-picker { display: flex !important; gap: 12px; align-items: center; min-height: 76px; padding: 14px; background: var(--llq-bg); border: 1.5px dashed #96b6b1; border-radius: 12px; cursor: pointer; }
.llq-file-picker:hover { border-color: var(--llq-primary); background: #f1faf8; }
.llq-file-picker svg { flex: 0 0 30px; width: 30px; height: 30px; fill: none; stroke: var(--llq-primary); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.llq-file-picker strong, .llq-file-picker small { display: block; overflow-wrap: anywhere; }

.llq-privacy-section { margin: 7px 0 18px; padding: 14px; background: #f7fbfa; border: 1px solid var(--llq-border); border-radius: 13px; }
.llq-privacy-heading { margin-bottom: 10px; }
.llq-privacy-heading strong, .llq-privacy-heading small { display: block; }
.llq-privacy-heading strong { color: var(--llq-ink); font-size: .94rem; }
.llq-privacy-heading small { margin-top: 2px; color: var(--llq-muted); font-size: .78rem; }
.llq-privacy-notice { color: #445b57; background: #fff; border: 1px solid #dce8e6; border-radius: 10px; font-size: .8rem; }
.llq-privacy-notice > summary { padding: 11px 12px; color: var(--llq-primary-dark); font-weight: 750; cursor: pointer; }
.llq-privacy-notice > div { max-height: 300px; padding: 0 12px 13px; overflow-y: auto; line-height: 1.65; overscroll-behavior: contain; }
.llq-consent { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 0; padding: 13px; color: #445b57; background: #fffdf4; border: 1px solid #eee3b9; border-radius: 11px; font-size: .82rem; cursor: pointer; }
.llq-consent input { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--llq-primary); }
.llq-consent strong { display: block; margin-bottom: 3px; color: #694c00; }

.llq-submit, .llq-secondary-button { width: 100%; min-height: 50px; padding: 11px 16px; border-radius: 11px; font: inherit; font-weight: 800; cursor: pointer; }
.llq-submit { color: #fff; background: var(--llq-primary); border: 0; box-shadow: 0 8px 20px rgba(15, 118, 110, .24); }
.llq-submit:hover { background: var(--llq-primary-dark); }
.llq-submit:disabled { opacity: .65; cursor: wait; }
.llq-secondary-button { color: var(--llq-primary-dark); background: #fff; border: 1px solid var(--llq-primary); }
.llq-text-button { width: 100%; margin-top: 8px; padding: 9px; color: var(--llq-muted); background: transparent; border: 0; font: inherit; cursor: pointer; }

.llq-alert { margin: 14px 0; padding: 12px 14px; border-radius: 10px; font-size: .9rem; }
.llq-alert-error { color: #8b251d; background: #fff1ef; border: 1px solid #ffc9c4; }
.llq-app > .llq-alert { border-radius: 0 0 20px 20px; margin: 0; padding: 24px; }

.llq-inline-loading, .llq-empty { padding: 30px 15px; color: var(--llq-muted); text-align: center; }
.llq-history-list { display: grid; gap: 11px; }
.llq-history-card { padding: 15px; background: #fff; border: 1px solid var(--llq-border); border-radius: 12px; }
.llq-history-top { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.llq-history-top strong { color: var(--llq-primary-dark); letter-spacing: .02em; }
.llq-history-type { margin: 9px 0 5px; font-weight: 650; }
.llq-history-member { margin: 8px 0 -4px; color: var(--llq-muted); font-size: .8rem; }
.llq-history-meta { display: flex; justify-content: space-between; color: var(--llq-muted); font-size: .8rem; }
.llq-calculation-details { margin-top: 14px; border-top: 1px solid var(--llq-border); }
.llq-calculation-details > summary { display: flex; gap: 10px; align-items: center; justify-content: space-between; min-height: 48px; margin-top: 12px; padding: 10px 12px; color: #065f46; background: #ecfdf3; border: 1px solid #a7f3d0; border-radius: 10px; cursor: pointer; list-style: none; }
.llq-calculation-details > summary::-webkit-details-marker { display: none; }
.llq-calculation-details > summary::after { content: "+"; flex: 0 0 auto; width: 25px; height: 25px; color: #fff; background: #07835c; border-radius: 50%; font-size: 1.1rem; font-weight: 800; line-height: 24px; text-align: center; }
.llq-calculation-details[open] > summary::after { content: "−"; }
.llq-calculation-details > summary:focus-visible { outline: 3px solid rgba(15, 118, 110, .35); outline-offset: 2px; }
.llq-result-count { margin-left: auto; color: #087554; font-size: .76rem; font-weight: 750; white-space: nowrap; }
.llq-calculation-list { display: grid; gap: 12px; padding-top: 12px; }
.llq-calculation-result { padding: 14px; background: #f8fbfa; border: 1px solid var(--llq-border); border-radius: 11px; }
.llq-result-heading { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; }
.llq-result-heading strong { color: var(--llq-primary-dark); }
.llq-result-heading span { flex: 0 0 auto; color: var(--llq-muted); font-size: .75rem; }
.llq-result-message { margin: 10px 0 0; color: var(--llq-ink); overflow-wrap: anywhere; white-space: pre-wrap; }
.llq-result-image { margin-top: 12px; color: var(--llq-muted); font-size: .82rem; }
.llq-result-image-loading { min-height: 64px; padding: 20px 12px; background: #eef6f5; border-radius: 9px; text-align: center; }
.llq-result-figure { margin: 0; }
.llq-result-image-view { display: block; width: 100%; padding: 0; overflow: hidden; background: #e9f1f0; border: 1px solid var(--llq-border); border-radius: 10px; cursor: zoom-in; }
.llq-result-figure img { display: block; width: 100%; max-height: 560px; object-fit: contain; }
.llq-result-figure figcaption { margin-top: 5px; color: var(--llq-muted); font-size: .75rem; text-align: center; }
.llq-result-image-error { margin: 0 0 8px; color: #8b251d; }
.llq-result-image-open, .llq-result-image-retry { min-height: 42px; padding: 8px 12px; color: var(--llq-primary-dark); background: #fff; border: 1px solid var(--llq-primary); border-radius: 9px; font: inherit; font-weight: 750; cursor: pointer; }
.llq-result-image-open { width: 100%; }
.llq-status { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; font-size: .72rem; font-weight: 750; white-space: nowrap; }
.llq-status-new { color: #175cd3; background: #eff8ff; }
.llq-status-reviewing { color: #854a0e; background: #fffaeb; }
.llq-status-need_documents { color: #93370d; background: #fff4ed; }
.llq-status-approved, .llq-status-completed { color: #067647; background: #ecfdf3; }
.llq-status-rejected, .llq-status-cancelled { color: #b42318; background: #fef3f2; }

body.llq-image-viewer-open { overflow: hidden !important; }
.llq-image-viewer { position: fixed; inset: 0; z-index: 2147483000; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px; padding: 14px; padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); color: #fff; background: rgba(3, 19, 18, .96); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Thai", Tahoma, sans-serif; }
.llq-image-viewer-header { display: flex; gap: 14px; align-items: center; justify-content: space-between; width: min(100%, 1100px); margin: 0 auto; }
.llq-image-viewer-header strong { font-size: 1.05rem; }
.llq-image-viewer-close { min-width: 88px; min-height: 48px; padding: 9px 15px; color: #123a36; background: #fff; border: 0; border-radius: 10px; font: inherit; font-size: 1rem; font-weight: 800; cursor: pointer; }
.llq-image-viewer-close:focus-visible { outline: 3px solid #5eead4; outline-offset: 3px; }
.llq-image-viewer-stage { display: flex; min-width: 0; min-height: 0; overflow: auto; align-items: center; justify-content: center; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.llq-image-viewer-image { display: block; width: auto; max-width: 100%; height: auto; max-height: 100%; margin: auto; object-fit: contain; touch-action: pan-x pan-y pinch-zoom; user-select: none; -webkit-user-select: none; }
.llq-image-viewer-hint { margin: 0; color: #d5e7e4; font-size: .82rem; line-height: 1.45; text-align: center; }

.llq-success { padding: 18px 4px 4px; text-align: center; }
.llq-success-icon { display: grid; width: 58px; height: 58px; margin: 0 auto 11px; place-items: center; color: #fff; background: #079455; border-radius: 50%; font-size: 1.8rem; font-weight: 900; }
.llq-success > p { margin: 3px 0; color: var(--llq-muted); }
.llq-success h2 { margin: 4px 0 14px; color: var(--llq-primary-dark); font-size: clamp(1.5rem, 6vw, 2.2rem); letter-spacing: .03em; }
.llq-success dl { margin: 0 0 14px; padding: 5px 14px; background: var(--llq-bg); border-radius: 12px; text-align: left; }
.llq-success dl div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--llq-border); }
.llq-success dl div:last-child { border-bottom: 0; }
.llq-success dt { color: var(--llq-muted); }
.llq-success dd { margin: 0; font-weight: 700; text-align: right; }
.llq-success .llq-success-note { margin: 10px 0 16px; font-size: .85rem; }

@media (max-width: 600px) {
  .llq-app { margin: 0 auto; }
  .llq-hero, .llq-main { border-radius: 0; }
  .llq-main { padding: 17px 14px; }
  .llq-hero { padding: 19px 15px; }
  .llq-logo-mark { flex-basis: 56px; width: 56px; height: 56px; border-radius: 15px; }
  .llq-history-top { align-items: flex-start; }
  .llq-history-meta { gap: 5px; flex-direction: column; }
  .llq-result-heading { gap: 4px; flex-direction: column; }
  .llq-calculation-details > summary { align-items: center; }
}
