:root {
  color-scheme: light;
  --ink: #163e36;
  --text: #354d46;
  --muted: #52695f;
  --accent: #17624d;
  --accent-hover: #104b3b;
  --canvas: #f5f8f7;
  --surface: #ffffff;
  --soft: #eaf3ee;
  --line: #d9e4de;
  --warning-bg: #fff5df;
  --warning-ink: #805819;
  --error-bg: #fff0ed;
  --error-ink: #9b3524;
  --radius: 12px;
  --ease: cubic-bezier(.22,1,.36,1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--canvas); color: var(--text); font: 400 16px/1.75 'Noto Sans Thai',Tahoma,sans-serif; }
button,input,select { font: inherit; }
button,a,label,input,select { -webkit-tap-highlight-color: transparent; }
button,label.file-button { cursor: pointer; }
button { transition: background 180ms var(--ease), box-shadow 180ms var(--ease), transform 180ms var(--ease); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { cursor: not-allowed; color: #627369; background: #e4ebe7; border-color: #d4dfd8; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible { outline: 3px solid #387fe4; outline-offset: 4px; }
a { color: var(--accent); text-underline-offset: 5px; }
[hidden] { display: none!important; }
h1,h2,h3,p { margin: 0; }
h1,h2,h3 { color: var(--ink); text-wrap: balance; }
p { text-wrap: pretty; }
svg { flex-shrink: 0; }
.skip-link { position: fixed; top: -90px; left: 20px; z-index: 30; background: var(--ink); color: white; padding: 12px 20px; border-radius: 6px; }
.skip-link:focus { top: 14px; }
.topbar { height: 78px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 max(28px,calc((100vw - 1184px)/2)); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font-family: 'Noto Sans Thai',sans-serif; font-size: 25px; font-weight: 700; line-height: 1.15; }
.brand small { display: block; margin-top: 6px; font: 500 11px/1.2 Arial,sans-serif; letter-spacing: 1.6px; color: var(--muted); }
.brand-mark { height: 43px; width: 43px; border-radius: 12px; background: var(--accent); color: white; display: flex; align-items: center; justify-content: center; font: 700 30px/1 Arial,sans-serif; letter-spacing: -3px; padding-right: 5px; }
.brand-mark span { font-size: 18px; align-self: flex-start; margin-top: 5px; }
.toplinks { display: flex; align-items: center; gap: 28px; }
.toplinks>a { min-height: 44px; display: inline-flex; align-items: center; font-size: 14px; text-decoration: none; color: var(--text); }
.toplinks>a:hover { color: var(--accent); text-decoration: underline; }
.privacy-pill { display: inline-flex; align-items: center; gap: 9px; color: #335a43; background: var(--soft); padding: 7px 14px; border-radius: 100px; font-size: 13px; }
.privacy-pill i,.dot { height: 7px; width: 7px; display: inline-block; border-radius: 50%; background: #397b51; }
main { max-width: 1184px; padding: 0 28px; margin: auto; }
.hero { position: relative; padding: 36px 0 30px; min-height: 288px; }
.eyebrow { color: var(--accent); font-size: 14px; font-weight: 600; }
.hero>.eyebrow { display: flex; gap: 14px; align-items: center; font-family: Arial,sans-serif; font-size: 12px; letter-spacing: 1px; }
.hero>.eyebrow>span { color: var(--muted); font-family: 'Noto Sans Thai',sans-serif; font-size: 13px; font-weight: 400; letter-spacing: 0; }
h1 { font-size: 36px; line-height: 1.6; font-weight: 700; letter-spacing: -.02em; margin: 13px 0 10px; max-width: 760px; }
h1 em { font-style: normal; color: var(--accent); }
.intro { color: var(--muted); font-size: 15px; line-height: 1.9; max-width: 66ch; }
.hero-note { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 13px; color: #40654e; }
.hero-note svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.7; fill: none; }
.format-preview { position: absolute; width: 278px; right: 12px; top: 40px; border-radius: 12px; border: 1px solid #c9ded2; background: white; box-shadow: 0 12px 30px #173e3608; overflow: hidden; transform: rotate(2deg); }
.format-top { padding: 14px 18px; background: var(--soft); display: flex; align-items: center; gap: 11px; }
.format-top>span { width: 32px; height: 35px; background: var(--accent); color: white; font: 600 20px/35px Arial,sans-serif; text-align: center; border-radius: 5px; }
.format-top b { display: block; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.6; }
.format-top small { font-size: 11px; color: var(--muted); }
.format-preview ul { list-style: none; padding: 6px 18px; margin: 0; }
.format-preview li { display: flex; align-items: center; justify-content: space-between; font-size: 13px; padding: 8px 0; color: var(--text); border-bottom: 1px solid #edf2ef; }
.format-preview li:last-child { border: 0; }
.format-preview li>span { color: #74877a; font: 11px Arial,sans-serif; }
.format-bottom { font-size: 11px; color: var(--muted); padding: 8px 18px 12px; }
.steps { list-style: none; margin: 0 0 30px; padding: 0; display: flex; gap: 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.steps li { display: flex; align-items: center; flex: 1; gap: 12px; padding: 17px 0; color: #66796e; font-size: 14px; position: relative; }
.steps li>span { height: 28px; width: 28px; border: 1px solid #cbd9d0; border-radius: 50%; font: 500 11px/26px Arial,sans-serif; text-align: center; }
.steps li.active { color: var(--ink); font-weight: 600; }
.steps li.active>span { color: white; border-color: var(--accent); background: var(--accent); }
.steps li.active:before { content: ''; height: 2px; background: var(--accent); position: absolute; top: -1px; right: 0; left: 0; }
.section-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
h2 { font-size: 24px; font-weight: 600; line-height: 1.6; letter-spacing: -.01em; }
.section-top p { color: var(--muted); font-size: 14px; margin-top: 5px; max-width: 75ch; }
.section-top .eyebrow { margin-bottom: 4px; }
.text-button { color: var(--accent); background: transparent; border: 0; min-height: 44px; padding: 9px 8px; border-radius: 6px; font-size: 14px; white-space: nowrap; }
.text-button:hover:not(:disabled) { background: #e5eee7; }
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dropzone { position: relative; min-height: 274px; padding: 27px 24px 20px; text-align: center; border: 1.5px dashed #b8cdbf; border-radius: var(--radius); background: var(--surface); transition: border-color 180ms var(--ease), background 180ms var(--ease), box-shadow 180ms var(--ease); }
.dropzone:hover { border-color: #629679; background: #fcfefd; }
.dropzone:focus-within { box-shadow: 0 0 0 3px #387fe435; border-color: #387fe4; }
.dropzone.dragging { background: #e5f2e7; border-color: var(--accent); box-shadow: 0 0 0 3px #17624d20; }
.dropzone.loaded { border: 1.5px solid #77a68a; background: #f5fcf6; }
.file-type { position: absolute; left: 18px; top: 13px; font-size: 12px; color: var(--muted); }
.dropzone svg { width: 39px; height: 39px; fill: none; stroke: var(--accent); stroke-width: 1.5; margin-top: 17px; }
.dropzone h3 { font: 600 21px/1.5 'Noto Sans Thai',sans-serif; margin-top: 5px; letter-spacing: .02em; }
.dropzone p { font-size: 14px; color: var(--muted); margin: 6px 0 15px; overflow-wrap: anywhere; }
.file-button { display: inline-flex; gap: 28px; min-height: 44px; align-items: center; justify-content: center; padding: 8px 17px; border-radius: 7px; background: var(--soft); color: var(--accent); font-size: 14px; font-weight: 500; border: 1px solid #d5e3da; transition: background 180ms var(--ease); }
.file-button:hover { background: #dcecdf; }
.file-button>span { font-size: 19px; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; left: 50%; bottom: 50px; }
.drop-hint { display: block; font-size: 12px; margin-top: 12px; color: var(--muted); }
.upload-actions { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 18px; }
.upload-actions>div { display: flex; align-items: center; gap: 20px; }
.encoding-note { color: var(--muted); font-size: 12px; }
.primary { border: 1px solid var(--accent); color: white; background: var(--accent); display: inline-flex; align-items: center; justify-content: space-between; gap: 30px; min-height: 48px; padding: 10px 21px; border-radius: 8px; font-size: 15px; font-weight: 500; }
.primary>span { font-size: 20px; }
.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); box-shadow: 0 4px 10px #17624d15; }
.status { margin-top: 18px; padding: 14px 18px; color: #2d5e3b; background: #e8f4e9; border: 1px solid #c9e1ce; border-radius: 8px; font-size: 14px; white-space: pre-line; }
.status.error { color: var(--error-ink); background: var(--error-bg); border-color: #edc9c1; }
.results { padding-top: 44px; scroll-margin-top: 25px; }
.ready-label { color: #356840; background: #e5f0e3; border-radius: 100px; padding: 6px 12px; font-size: 13px; white-space: nowrap; }
.stats { display: grid; grid-template-columns: repeat(4,1fr); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 24px; }
.stats>div { padding: 22px 24px; border-right: 1px solid var(--line); }
.stats>div:last-child { border: 0; }
.stats>div>span { color: var(--muted); font-size: 14px; }
.stats strong { display: block; font-size: 34px; font-weight: 600; color: var(--ink); line-height: 1.5; margin: 4px 0; font-variant-numeric: tabular-nums; }
.stats small { font-size: 13px; color: var(--muted); }
.dot { margin-right: 4px; }
.amber { background: #a57825; }
.results-body { display: grid; grid-template-columns: minmax(0,1fr) 310px; gap: 24px; align-items: start; }
.preview { min-width: 0; background: var(--surface); border-radius: 10px; border: 1px solid var(--line); overflow: hidden; }
.preview-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px; }
.preview h3 { font-size: 16px; font-weight: 600; }
.preview label { font-size: 13px; color: var(--muted); }
select { min-height: 40px; border: 1px solid #c8d7cc; border-radius: 6px; padding: 5px 8px; color: var(--ink); background: white; font-size: 13px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; font-size: 12px; }
th { background: #eff5f1; color: #455f50; font-weight: 500; text-align: left; padding: 12px 10px; }
td { padding: 14px 10px; border-bottom: 1px solid #e7efe9; color: var(--text); font-variant-numeric: tabular-nums; }
tbody tr:hover { background: #f7faf8; }
.amount { text-align: right; }
.badge { display: inline-block; padding: 3px 7px; color: #376746; background: #e8f2e7; border-radius: 5px; font-size: 11px; }
.badge.c { background: var(--warning-bg); color: var(--warning-ink); }
.preview-footer { display: flex; justify-content: space-between; gap: 15px; padding: 14px 16px; font-size: 11px; color: var(--muted); }
.warnings { padding: 0 16px 16px; }
.warnings p { margin-top: 8px; font-size: 12px; color: var(--warning-ink); background: var(--warning-bg); padding: 11px 12px; border-radius: 6px; }
.download-card { padding: 24px; border-radius: 12px; background: #e9f2eb; border: 1px solid #c7ddcc; }
.download-card h3 { font-size: 23px; font-weight: 600; line-height: 1.5; margin-top: 6px; }
.download-card>p { font-size: 13px; color: #47654f; margin-top: 7px; }
.download-card .eyebrow { color: #40694c; font-size: 13px; font-weight: 500; }
.download-card label { display: block; margin: 20px 0 6px; font-size: 14px; font-weight: 500; color: var(--ink); }
.download-card input { width: 100%; min-height: 45px; background: white; border: 1px solid #b9d0bf; border-radius: 7px; color: var(--ink); padding: 8px 11px; font-size: 14px; }
.download-card input[aria-invalid="true"] { border-color: var(--error-ink); background: #fff7f5; }
.download-card small { display: block; margin-top: 6px; font-size: 12px; line-height: 1.8; color: #47654f; }
.selected-pass { border-top: 1px solid #c6daca; margin-top: 20px; padding-top: 16px; font-size: 13px; font-weight: 500; color: #345d40; }
.download-card .primary { width: 100%; margin-top: 18px; justify-content: center; gap: 12px; }
.download-card .download-note { font-size: 12px; margin-top: 13px; }
.sheet-section { padding: 52px 0 32px; }
.section-aside { color: var(--muted); font-size: 13px; }
.sheet-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 28px; padding: 23px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sheet-grid article>span { display: inline-block; color: var(--accent); background: #e7efea; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.sheet-grid h3 { font-size: 16px; font-weight: 600; margin: 12px 0 7px; line-height: 1.7; }
.sheet-grid p { color: var(--muted); font-size: 14px; line-height: 1.9; }
.guide { padding: 28px 0 44px; display: grid; grid-template-columns: 1fr 1.65fr; gap: 70px; }
.guide h2 { font-size: 28px; margin-top: 7px; }
.guide>div>a { display: inline-block; min-height: 44px; padding: 10px 0; margin-top: 13px; font-size: 14px; }
.guide-steps article { display: flex; gap: 18px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.guide-steps article:first-child { padding-top: 0; }
.guide-steps article>span { display: flex; align-items: center; justify-content: center; height: 30px; width: 30px; flex-shrink: 0; color: var(--accent); background: #e5eee7; border-radius: 50%; font-size: 13px; font-weight: 600; margin-top: 2px; }
.guide h3 { font-size: 16px; font-weight: 600; }
.guide p { color: var(--muted); font-size: 14px; margin-top: 6px; line-height: 1.9; }
footer { padding: 30px 0; border-top: 1px solid var(--line); }
.footer-main { display: flex; justify-content: space-between; gap: 32px; }
.footer-brand { color: var(--accent); font: 600 13px/1.5 Arial,sans-serif; letter-spacing: .5px; text-decoration: none; display: inline-flex; min-height: 30px; align-items: center; }
.footer-main>div:first-child { max-width: 46ch; }
.footer-main p { color: var(--muted); font-size: 13px; margin-top: 7px; }
.designer { padding-left: 25px; border-left: 1px solid var(--line); color: var(--ink); min-width: 300px; }
.designer>span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.designer strong { display: block; font-size: 17px; font-weight: 600; }
.designer p { margin-top: 4px; font-size: 13px; }
.footer-bottom { border-top: 1px solid var(--line); margin-top: 23px; padding-top: 15px; color: var(--muted); font-size: 12px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.footer-bottom>span:last-child { color: var(--accent); font-size: 12px; }
@media (max-width: 1100px) {
  .format-preview { width: 237px; right: 0; top: 47px; }
  h1 { font-size: 32px; max-width: 690px; }
  .hero>.eyebrow>span { display: none; }
  .results-body { grid-template-columns: minmax(0,1fr) 290px; gap: 18px; }
  .stats>div { padding: 20px 18px; }
  .sheet-grid { gap: 22px; }
  .preview-footer { flex-direction: column; gap: 3px; }
}
@media (max-width: 900px) {
  .format-preview { display: none; }
  .hero { min-height: 0; padding: 30px 0; }
  .hero>.eyebrow>span { display: inline; }
  .results-body { grid-template-columns: minmax(0,1fr); }
  .download-card { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
  .download-card>.eyebrow,.download-card>h3,.download-card>p,.selected-pass { grid-column: 1/-1; }
  .download-card>input,.download-card>small { grid-column: 1/-1; }
  .download-card>label { grid-column: 1/-1; }
  .download-card .primary { grid-column: 1/-1; }
  .sheet-grid { grid-template-columns: 1fr 1fr; gap: 28px 36px; }
  .guide { gap: 34px; grid-template-columns: 1fr 1.6fr; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .topbar { height: 70px; padding: 0 20px; }
  .brand { font-size: 22px; gap: 9px; }
  .brand-mark { width: 36px; height: 38px; font-size: 26px; border-radius: 10px; }
  .brand-mark span { font-size: 15px; }
  .brand small { font-size: 9px; letter-spacing: 1.3px; }
  .toplinks>a { display: none; }
  .privacy-pill { font-size: 11px; padding: 6px 9px; gap: 6px; }
  main { padding: 0 20px; }
  .hero { padding: 26px 0 23px; }
  .hero>.eyebrow { font-size: 11px; }
  .hero>.eyebrow>span { display: none; }
  h1 { font-size: 27px; line-height: 1.65; margin: 13px 0 9px; letter-spacing: -.015em; }
  .intro { font-size: 14px; line-height: 1.9; }
  .desktop { display: none; }
  .hero-note { font-size: 12px; margin-top: 14px; }
  .steps { gap: 8px; margin-bottom: 25px; }
  .steps li { font-size: 12px; gap: 7px; padding: 14px 0; }
  .steps li>span { width: 23px; height: 23px; font-size: 10px; line-height: 21px; flex-shrink: 0; }
  h2 { font-size: 21px; }
  .section-top { align-items: flex-start; gap: 9px; margin-bottom: 18px; }
  .section-top p { font-size: 13px; }
  .section-top .text-button { padding: 6px; font-size: 12px; }
  .section-top .eyebrow { font-size: 13px; }
  .upload-grid { grid-template-columns: 1fr; gap: 15px; }
  .dropzone { min-height: 273px; padding: 27px 20px 20px; }
  .dropzone p { font-size: 14px; }
  .dropzone svg { margin-top: 17px; }
  .file-type,.drop-hint { font-size: 12px; }
  .file-button { font-size: 14px; min-height: 48px; }
  .upload-actions { flex-direction: column; align-items: stretch; gap: 10px; margin-top: 16px; }
  .encoding-note { font-size: 12px; }
  .upload-actions>div { justify-content: space-between; gap: 10px; }
  .upload-actions .text-button { font-size: 13px; padding-left: 0; }
  .primary { font-size: 14px; gap: 17px; padding: 10px 16px; }
  .status { font-size: 14px; padding: 13px 15px; }
  .results { padding-top: 32px; }
  .ready-label { font-size: 11px; white-space: normal; max-width: 115px; text-align: center; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats>div { padding: 16px; }
  .stats>div:nth-child(2) { border-right: 0; }
  .stats>div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .stats>div>span { font-size: 13px; }
  .stats strong { font-size: 31px; }
  .stats small { font-size: 12px; }
  .preview-top { padding: 15px; }
  .preview h3 { font-size: 14px; }
  .preview label { font-size: 12px; }
  select { min-height: 44px; font-size: 13px; }
  table { font-size: 13px; }
  td,th { padding: 13px 12px; }
  .preview-footer { font-size: 12px; }
  .warnings p { font-size: 13px; }
  .download-card { padding: 21px; display: block; }
  .download-card h3 { font-size: 23px; }
  .download-card>p,.download-card small,.download-card .download-note { font-size: 13px; }
  .download-card label { font-size: 14px; }
  .download-card input { min-height: 48px; font-size: 16px; }
  .selected-pass { font-size: 14px; }
  .sheet-section { padding: 38px 0 22px; }
  .section-aside { display: none; }
  .sheet-grid { grid-template-columns: 1fr; gap: 24px; padding: 22px 0; }
  .sheet-grid article { display: grid; grid-template-columns: 90px 1fr; column-gap: 17px; align-items: start; }
  .sheet-grid article>span { font-size: 11px; text-align: center; margin-top: 2px; padding: 4px 6px; }
  .sheet-grid h3 { font-size: 16px; margin: 0 0 6px; }
  .sheet-grid p { font-size: 14px; grid-column: 2; }
  .guide { grid-template-columns: 1fr; gap: 27px; padding: 20px 0 34px; }
  .guide h2 { font-size: 24px; }
  .guide h2 br { display: none; }
  .guide>div>a { margin-top: 8px; font-size: 14px; }
  .guide-steps article { gap: 13px; padding: 18px 0; }
  .guide h3 { font-size: 16px; }
  .guide p { font-size: 14px; }
  .footer-main { flex-direction: column; gap: 22px; }
  .designer { border-left: 0; border-top: 1px solid var(--line); padding: 20px 0 0; min-width: 0; }
  .designer strong { font-size: 18px; }
  .designer p { font-size: 14px; }
  .footer-main p { font-size: 13px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 10px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  button,.file-button,.dropzone { transition: none; }
}
