:root {
  --bg: #f4ece0;
  --card: #fffaf2;
  --ink: #2b2118;
  --muted: #6f604f;
  --muted-soft: #a79782;
  --line: #dcd0bd;
  --line-soft: #eee5d7;
  --accent: #6f804d;
  --accent-deep: #4f6336;
  --accent-soft: #edf0e2;
  --rose: #9f6251;
  --rose-deep: #8b5142;
  --rest: #8a775d;
  --rest-deep: #65543f;
  --rest-soft: #f1eadf;
  --blue: #7d6b52;
  --gold: #6f804d;
  --gold-deep: #4f6336;
  --focus: #3f5f2f;
  --shadow: 0 12px 34px -28px rgba(43, 33, 24, .5);
}

/* Heat Process Log family — readable screen layout; print rules stay in each tool */
@media screen {
  body.workflow-heat-log {
    padding: 30px 16px 52px;
  }

  body.workflow-heat-log .sheet {
    width: min(100%, 820px);
    max-width: none;
    margin-inline: auto;
  }

  body.workflow-heat-log header {
    max-width: 720px;
    margin: 0 auto 26px;
    text-align: center;
  }

  body.workflow-heat-log header h1 {
    font-size: clamp(38px, 6vw, 54px);
  }

  body.workflow-heat-log header .sub {
    max-width: 700px;
    margin: 10px auto 0;
    color: #62584b;
    font-size: 16px;
    line-height: 1.72;
  }

  body.workflow-heat-log .block,
  body.workflow-heat-log .batchbar {
    border-color: #d8cebe;
    border-radius: 20px;
    background: #fffdf9;
    box-shadow: 0 18px 38px -34px rgba(43, 33, 24, .62);
  }

  body.workflow-heat-log .block {
    padding: 21px;
  }

  body.workflow-heat-log .block-t {
    margin-bottom: 15px;
    font-size: 16px;
    letter-spacing: 0;
    text-transform: none;
  }

  body.workflow-heat-log .block-t .n {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    font-size: 16px;
  }

  body.workflow-heat-log .fld label,
  body.workflow-heat-log .batchbar label {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
  }

  body.workflow-heat-log .fld input,
  body.workflow-heat-log .fld select,
  body.workflow-heat-log .fld textarea,
  body.workflow-heat-log .batchbar select {
    min-height: 46px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff;
    font-size: 16px;
  }

  body.workflow-heat-log .fld textarea {
    min-height: 86px;
  }

  body.workflow-heat-log .mode-btn,
  body.workflow-heat-log .prog-opt .nm {
    font-size: 16px;
    line-height: 1.5;
  }

  body.workflow-heat-log .mode-btn,
  body.workflow-heat-log .prog-opt {
    min-height: 52px;
    padding: 13px 15px;
    border-radius: 14px;
  }

  body.workflow-heat-log .prog-opt .meta {
    font-size: 13.5px;
  }

  body.workflow-heat-log .prog-hint,
  body.workflow-heat-log .prog-cat,
  body.workflow-heat-log .crit,
  body.workflow-heat-log .prog-note,
  body.workflow-heat-log .cool-lock,
  body.workflow-heat-log .nextread,
  body.workflow-heat-log .note,
  body.workflow-heat-log #heatBlock > div[style],
  body.workflow-heat-log .quick span[style] {
    font-size: 14px !important;
    line-height: 1.65 !important;
  }

  body.workflow-heat-log .crit,
  body.workflow-heat-log .prog-note,
  body.workflow-heat-log .cool-lock {
    padding: 12px 14px;
    border-radius: 13px;
  }

  body.workflow-heat-log .btn,
  body.workflow-heat-log .bbtn,
  body.workflow-heat-log .quick .sub-b,
  body.workflow-heat-log .et-ok {
    min-height: 44px;
    font-size: 14.5px;
    font-weight: 700;
  }

  body.workflow-heat-log .btn.big {
    min-height: 50px;
  }

  body.workflow-heat-log .quick .qb,
  body.workflow-heat-log .quick input {
    min-height: 46px;
    font-size: 16px;
  }

  body.workflow-heat-log .statusbar {
    padding: 15px;
    border-radius: 16px;
    font-size: 15px;
  }

  body.workflow-heat-log .statusbar .sm,
  body.workflow-heat-log .statusbar .ph,
  body.workflow-heat-log .step,
  body.workflow-heat-log .step .tm,
  body.workflow-heat-log .prog {
    font-size: 13px;
  }

  body.workflow-heat-log table,
  body.workflow-heat-log .events {
    font-size: 14px;
    line-height: 1.6;
  }

  body.workflow-heat-log th {
    font-size: 13px;
  }

  body.workflow-heat-log th,
  body.workflow-heat-log td {
    padding: 9px 10px;
  }

  body.workflow-heat-log .summary {
    font-size: 15px;
    line-height: 1.72;
  }

  body.workflow-heat-log .summary .verdict {
    font-size: 21px;
  }

  body.workflow-heat-log .btn.danger {
    border-color: #e3c4cb;
    background: #fff7f8;
    color: var(--rose-deep);
  }

  body.workflow-heat-log .btn.danger:hover {
    border-color: var(--rose-deep);
    background: var(--rose-deep);
    color: #fff;
  }

  body.workflow-heat-5batch {
    min-width: 0 !important;
    padding: 28px 16px 48px;
  }

  body.workflow-heat-5batch .sheet {
    width: min(100%, 1480px);
    max-width: none;
    margin-inline: auto;
  }

  body.workflow-heat-5batch header {
    max-width: 900px;
    margin: 0 auto 25px;
    text-align: center;
  }

  body.workflow-heat-5batch header h1 {
    font-size: clamp(38px, 5vw, 54px);
  }

  body.workflow-heat-5batch header .sub {
    margin-top: 10px;
    color: #62584b;
    font-size: 16px;
    line-height: 1.7;
  }

  body.workflow-heat-5batch .toolbar {
    padding: 15px 17px;
    border-color: #d8cebe;
    border-radius: 18px;
    background: #fffdf9;
  }

  body.workflow-heat-5batch .toolbar-title {
    font-size: 15px;
  }

  body.workflow-heat-5batch .toolbar-note {
    font-size: 14px;
    line-height: 1.6;
  }

  body.workflow-heat-5batch .save-status {
    font-size: 13px;
  }

  body.workflow-heat-5batch .count-btn {
    min-width: 44px;
    min-height: 44px;
    font-size: 15px;
  }

  body.workflow-heat-5batch .matrix-hint {
    display: none;
  }

  body.workflow-heat-5batch .matrix-wrap {
    max-width: 100%;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  body.workflow-heat-5batch .matrix thead .corner,
  body.workflow-heat-5batch .row-label {
    font-size: 14px !important;
    line-height: 1.5 !important;
  }

  body.workflow-heat-5batch .row-label small,
  body.workflow-heat-5batch .section-row td,
  body.workflow-heat-5batch .criteria,
  body.workflow-heat-5batch .status-card,
  body.workflow-heat-5batch .summary,
  body.workflow-heat-5batch .reading,
  body.workflow-heat-5batch .empty {
    font-size: 12.5px !important;
    line-height: 1.55;
  }

  body.workflow-heat-5batch .section-row th {
    font-size: 13.5px;
  }

  body.workflow-heat-5batch .matrix input,
  body.workflow-heat-5batch .matrix select,
  body.workflow-heat-5batch .matrix textarea {
    min-height: 42px;
    font-size: 14px;
    line-height: 1.5;
  }

  body.workflow-heat-5batch .mini-btn,
  body.workflow-heat-5batch .event-btn {
    min-height: 40px;
    font-size: 13px;
  }

  body.workflow-heat-5batch .status-card strong,
  body.workflow-heat-5batch .summary strong {
    font-size: 14px;
  }

  body.workflow-heat-5batch .btn {
    min-height: 46px;
    padding: 10px 18px;
    border-radius: 14px;
    font-size: 14px;
  }

  body.workflow-heat-5batch .btn.danger {
    border-color: #e3c4cb;
    background: #fff7f8;
    color: var(--rose-deep);
  }

  body.workflow-heat-5batch .btn.danger:hover {
    border-color: var(--rose-deep);
    background: var(--rose-deep);
    color: #fff;
  }

  body.workflow-heat-5batch .note {
    font-size: 13.5px;
    line-height: 1.7;
  }

  body.guide-heat-log .card .lead,
  body.guide-heat-5batch .card .lead {
    font-size: 16px;
    line-height: 1.78;
  }

  body.guide-heat-log .step-t,
  body.guide-heat-5batch .step-t {
    font-size: 16px;
    line-height: 1.5;
  }

  body.guide-heat-log .step-d,
  body.guide-heat-5batch .step-d,
  body.guide-heat-log ul.notes li,
  body.guide-heat-5batch ul.notes li {
    color: #4e463d;
    font-size: 15px;
    line-height: 1.78;
  }

  body.guide-heat-log .chip,
  body.guide-heat-5batch .chip,
  body.guide-heat-5batch .state {
    font-size: 13.5px;
  }

  body.guide-heat-log .tip,
  body.guide-heat-5batch .tip,
  body.guide-heat-5batch .warning {
    font-size: 14.5px;
    line-height: 1.72;
  }
}

@media screen and (max-width: 640px) {
  body.workflow-heat-log,
  body.workflow-heat-5batch {
    padding: 22px 12px 42px;
  }

  body.workflow-heat-log .topbar,
  body.workflow-heat-5batch .topbar {
    flex-wrap: wrap;
    margin-bottom: 20px !important;
  }

  body.workflow-heat-log .topbar > .sound-toggle {
    width: 100%;
    order: 2;
    justify-content: center;
    margin: 0 !important;
  }

  body.workflow-heat-log header h1,
  body.workflow-heat-5batch header h1 {
    font-size: clamp(35px, 11vw, 44px);
  }

  body.workflow-heat-log .grid {
    grid-template-columns: 1fr;
  }

  body.workflow-heat-log .block {
    padding: 18px 15px;
    border-radius: 18px;
  }

  body.workflow-heat-log .stepper {
    overflow-x: auto;
    padding: 5px 0 8px;
  }

  body.workflow-heat-log .stepper .step {
    min-width: 76px;
  }

  body.workflow-heat-log .actions .btn,
  body.workflow-heat-5batch .actions .btn {
    width: 100%;
  }

  body.workflow-heat-5batch .toolbar {
    align-items: stretch;
  }

  body.workflow-heat-5batch .toolbar-title,
  body.workflow-heat-5batch .toolbar-note,
  body.workflow-heat-5batch .save-status {
    width: 100%;
  }

  body.workflow-heat-5batch .count-buttons {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
  }

  body.workflow-heat-5batch .matrix-hint {
    display: block;
    margin: 0 0 8px;
    padding: 9px 12px;
    border: 1px solid #cdd6b7;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent-deep);
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.55;
    text-align: center;
  }
}

@media screen and (max-width: 640px) {
  body.workflow-class-timer .topbar > .sound-toggle {
    width: 100% !important;
    max-width: none !important;
    flex: 0 0 100% !important;
    margin: 0 !important;
  }
}

/* Process selectors, class timer, and their guides */
@media screen {
  body.tools-layout-workflow,
  body.tools-layout-guide {
    padding: 30px 16px 52px;
    background-color: #f6f1e8;
    background-image:
      radial-gradient(circle at 10% 3%, rgba(220, 229, 200, .58), transparent 34%),
      radial-gradient(circle at 92% 96%, rgba(201, 120, 98, .10), transparent 36%);
  }

  body.tools-layout-workflow .container {
    width: min(100%, 920px);
    max-width: none;
  }

  body.workflow-class-timer .container {
    width: min(100%, 720px);
  }

  body.tools-layout-guide .container {
    width: min(100%, 820px);
    max-width: none;
  }

  body.tools-layout-workflow .topbar,
  body.tools-layout-guide .topbar {
    display: flex !important;
    width: 100%;
    min-height: 44px;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px;
    margin: 0 auto 25px !important;
  }

  body.tools-layout-workflow .topbar .tools-nav-group,
  body.tools-layout-guide .topbar .tools-nav-group {
    margin-left: auto;
  }

  body.tools-layout-workflow header,
  body.tools-layout-guide header {
    max-width: 760px;
    margin: 0 auto 32px;
    text-align: center;
  }

  body.tools-layout-workflow header h1,
  body.tools-layout-guide header h1 {
    margin-bottom: 12px;
    font-size: clamp(38px, 6vw, 54px);
    line-height: 1.04;
  }

  body.tools-layout-workflow header .subtitle,
  body.tools-layout-guide header .subtitle {
    max-width: 680px;
    margin-inline: auto;
    color: #62584b !important;
    font-size: 15px;
    line-height: 1.78;
  }

  body.tools-layout-workflow .eyebrow,
  body.tools-layout-guide .eyebrow {
    margin-bottom: 9px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .18em !important;
  }

  body.tools-layout-workflow .opt,
  body.workflow-class-timer .preset {
    min-height: 68px;
    border-color: #d9cfbf;
    background: #fffdf8;
    box-shadow: 0 12px 28px -26px rgba(43, 33, 24, .58);
  }

  body.tools-layout-workflow .opt:hover,
  body.workflow-class-timer .preset:hover {
    border-color: #91a58f;
    background: #fff;
    box-shadow: 0 16px 30px -24px rgba(43, 33, 24, .60);
  }

  body.workflow-pbt .step {
    margin-bottom: 18px;
    padding: 21px;
    border: 1px solid var(--line);
    border-radius: 21px;
    background: rgba(255, 250, 242, .78);
    box-shadow: 0 16px 34px -31px rgba(43, 33, 24, .62);
  }

  body.workflow-pbt .step-head {
    align-items: center;
    margin-bottom: 16px;
  }

  body.workflow-pbt .step-num {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-deep);
    color: #fff;
    font-size: 16px;
  }

  body.workflow-pbt .step-q {
    font-size: 17px;
    line-height: 1.5;
  }

  body.workflow-pbt .opt {
    padding: 17px 18px;
    border-radius: 15px;
  }

  body.workflow-pbt .opt .opt-sub {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
  }

  body.workflow-pbt .opt .opt-eg {
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.6;
  }

  body.workflow-pbt .opt.selected,
  body.workflow-process .opt.sel {
    border-color: var(--accent-deep);
    background: var(--accent-soft);
    box-shadow: inset 4px 0 0 var(--accent-deep), 0 15px 30px -25px rgba(63, 95, 47, .58);
  }

  body.workflow-pbt .result-card {
    border-color: #aab99b;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 24px 48px -38px rgba(43, 60, 34, .66);
  }

  body.workflow-pbt .metric .lbl {
    font-size: 13px;
  }

  body.workflow-pbt .btn-reset {
    font-size: 14.5px;
  }

  body.workflow-pbt .pst-cta-sub,
  body.workflow-pbt .pt-hint {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
  }

  body.workflow-pbt .pt-unit,
  body.workflow-pbt .pt-endat,
  body.workflow-pbt .pt-dots {
    font-size: 13px;
  }

  body.workflow-pbt .pt-tlr {
    font-size: 12.5px;
  }

  body.workflow-pbt .prompt,
  body.workflow-process .prompt {
    margin: 14px 0;
    padding: 15px 17px;
    border: 1px solid #d5ddc7;
    border-radius: 15px;
    background: rgba(237, 240, 226, .78);
    color: var(--accent-deep);
    font-family: 'Sarabun', sans-serif;
    font-style: normal;
    font-weight: 600;
    line-height: 1.6;
  }

  body.workflow-pbt .timer-open-btn,
  body.workflow-process .timer-open-btn {
    min-height: 48px;
    padding: 12px 22px;
    border-radius: 14px;
  }

  body.workflow-pbt .btn-reset,
  body.workflow-process .btn,
  body.workflow-class-timer .btn {
    min-height: 46px;
  }

  body.workflow-process .setup {
    padding: 24px;
    border-color: #d7ccbb;
    border-radius: 24px;
    background: rgba(255, 250, 242, .92);
    box-shadow: 0 20px 40px -34px rgba(43, 33, 24, .62);
  }

  body.workflow-process .q {
    margin-bottom: 0;
    padding: 19px 0;
    border-bottom: 1px solid var(--line-soft);
  }

  body.workflow-process .q:first-child {
    padding-top: 0;
  }

  body.workflow-process .q:last-child,
  body.workflow-process #homeExtra .q:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }

  body.workflow-process .q-label {
    margin-bottom: 12px;
    font-size: 16px;
    line-height: 1.55;
  }

  body.workflow-process .q-label .en,
  body.workflow-process .q-hint {
    font-size: 13.5px;
    line-height: 1.55;
  }

  body.workflow-process .opt {
    min-height: 72px;
    padding: 14px 15px;
    border-radius: 14px;
    font-size: 16px;
    line-height: 1.5;
  }

  body.workflow-process .opt .s {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
  }

  body.workflow-process .risky-grp {
    font-size: 14px;
    line-height: 1.55;
  }

  body.workflow-process .chart-links {
    margin-top: 18px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(255, 253, 248, .72);
  }

  body.workflow-process .chart-links .cl-label,
  body.workflow-process .chart-links .cl-btn {
    font-size: 14px;
    line-height: 1.55;
  }

  body.workflow-process #result > .step {
    padding: 22px 23px;
    border-radius: 20px;
    background: #fff;
  }

  body.workflow-process #result > .step .step-n {
    display: grid;
    width: 36px;
    height: 36px;
    min-width: 36px;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-deep);
    font-size: 18px;
  }

  body.workflow-process .step-body p,
  body.workflow-process .step-body li {
    font-size: 15px;
    line-height: 1.7;
  }

  body.workflow-process .sub-t,
  body.workflow-process .sub li,
  body.workflow-process .sub p,
  body.workflow-process .ftable {
    font-size: 14px;
    line-height: 1.65;
  }

  body.workflow-process .ftable th {
    font-size: 13.5px;
  }

  body.workflow-process .branch-tag,
  body.workflow-process .badge {
    font-size: 13px;
  }

  body.workflow-process .callout {
    font-size: 15px;
    line-height: 1.7;
  }

  body.workflow-process .pst-cta-sub,
  body.workflow-process .pt-hint {
    font-size: 14px;
    line-height: 1.65;
  }

  body.workflow-process .printset {
    border-radius: 18px;
    background: #fff;
  }

  body.workflow-process .actions {
    flex-wrap: wrap;
    gap: 9px;
  }

  body.workflow-process .actions .btn {
    padding-inline: 21px;
    border-radius: 13px;
    background: #fffdf8;
    font-weight: 700;
  }

  body.workflow-class-timer .day-title {
    margin: 24px 0 11px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
    color: var(--accent-deep);
    font-family: 'Sarabun', sans-serif;
    font-size: 15px;
    font-weight: 700;
    text-align: left;
  }

  body.workflow-class-timer .preset {
    min-height: 76px;
    padding: 17px 18px;
    border-radius: 17px;
    background: #fff;
  }

  body.workflow-class-timer .preset .nm {
    font-size: 18px;
  }

  body.workflow-class-timer .preset .meta {
    padding: 5px 11px;
    background: var(--accent-soft);
  }

  body.workflow-class-timer .tcard {
    padding: 28px 24px;
    border-color: #d3c8b7;
    border-radius: 25px;
    background: #fff;
    box-shadow: 0 25px 48px -39px rgba(43, 33, 24, .68);
  }

  body.workflow-class-timer .sound-toggle {
    min-height: 40px !important;
    padding-inline: 13px !important;
    border-radius: 12px;
    background: #fff !important;
    font-weight: 700 !important;
  }

  body.tools-layout-guide .card {
    margin-bottom: 15px;
    padding: 25px 26px;
    border: 1px solid #d8cebe;
    border-radius: 21px;
    background: #fffdf9;
    box-shadow: 0 18px 38px -34px rgba(43, 33, 24, .62);
  }

  body.tools-layout-guide .card h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 13px;
    color: var(--accent-deep);
    font-family: 'Sarabun', sans-serif;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.35;
  }

  body.tools-layout-guide .card h2::before {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-radius: 50%;
    background: var(--accent-deep);
    content: '';
  }

  body.tools-layout-guide .card p,
  body.tools-layout-guide .card li,
  body.guide-process .step-d {
    color: #4e463d;
    font-size: 14px;
    line-height: 1.78;
  }

  body.tools-layout-guide .card li + li {
    margin-top: 9px;
  }

  body.tools-layout-guide .tip,
  body.tools-layout-guide .warning {
    padding: 14px 15px;
    border-radius: 14px;
    border-left-width: 4px;
  }

  body.tools-layout-guide .links {
    gap: 10px;
    margin-top: 20px;
  }

  body.tools-layout-guide .links a,
  body.guide-process .cta a {
    min-height: 52px;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
  }

  body.tools-layout-guide .links a:first-child,
  body.guide-process .cta a {
    border-color: var(--accent-deep);
    background: var(--accent-deep);
    color: #fff;
  }

  body.guide-process .step {
    gap: 15px;
    padding: 16px 0;
  }

  body.guide-process .step-n {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  body.tools-layout-workflow footer,
  body.tools-layout-guide .site-footer {
    margin-top: 34px;
    padding-top: 17px;
    border-top: 1px solid var(--line);
  }
}

@media screen and (max-width: 640px) {
  body.tools-layout-workflow,
  body.tools-layout-guide {
    padding: 22px 12px 42px;
  }

  body.tools-layout-workflow .topbar,
  body.tools-layout-guide .topbar {
    flex-wrap: wrap;
    margin-bottom: 20px !important;
  }

  body.tools-layout-workflow .topbar .tools-nav-group,
  body.tools-layout-guide .topbar .tools-nav-group {
    width: 100%;
    justify-content: stretch;
  }

  body.tools-layout-workflow .topbar .tools-nav-group > *,
  body.tools-layout-guide .topbar .tools-nav-group > * {
    flex: 1 1 0;
  }

  body.workflow-class-timer .topbar > .sound-toggle {
    width: 100%;
    order: 2;
    justify-content: center;
    margin: 0 !important;
  }

  body.tools-layout-workflow header,
  body.tools-layout-guide header {
    margin-bottom: 25px;
  }

  body.tools-layout-workflow header h1,
  body.tools-layout-guide header h1 {
    font-size: clamp(35px, 11vw, 44px);
  }

  body.tools-layout-workflow header .subtitle,
  body.tools-layout-guide header .subtitle {
    font-size: 14px;
    line-height: 1.72;
  }

  body.workflow-pbt .step,
  body.workflow-process .setup,
  body.tools-layout-guide .card {
    padding: 18px 15px;
    border-radius: 18px;
  }

  body.workflow-pbt .step-head {
    align-items: flex-start;
  }

  body.workflow-pbt .opts,
  body.workflow-process .opts,
  body.workflow-process .opts.c3 {
    grid-template-columns: 1fr;
  }

  body.workflow-pbt .result-card,
  body.workflow-class-timer .tcard {
    padding: 22px 15px;
  }

  body.workflow-pbt .result-main {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.workflow-pbt .metric {
    padding-inline: 8px;
  }

  body.workflow-pbt .metric .big {
    font-size: 38px;
  }

  body.workflow-process .chart-links {
    align-items: stretch;
  }

  body.workflow-process .chart-links .cl-label {
    width: 100%;
    text-align: center;
  }

  body.workflow-process .chart-links .cl-btn {
    flex: 1 1 140px;
    justify-content: center;
  }

  body.workflow-process #result > .step {
    padding: 18px 15px;
  }

  body.workflow-process .step-h {
    align-items: center;
  }

  body.workflow-process .step-body {
    padding-left: 0;
  }

  body.workflow-process .actions .btn,
  body.workflow-pbt .timer-open-btn {
    width: 100%;
  }

  body.workflow-class-timer .preset {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  body.workflow-class-timer .preset .meta {
    white-space: normal;
  }

  body.tools-layout-guide .links {
    grid-template-columns: 1fr;
  }

  body.guide-process .step {
    align-items: flex-start;
  }
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  line-height: 1.55;
  accent-color: var(--accent-deep);
}

button,
input,
select,
textarea {
  font-family: 'Sarabun', sans-serif;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

input,
select,
textarea {
  color: var(--ink) !important;
  border-color: var(--line) !important;
  border-radius: 12px !important;
  background-color: #fffdf8 !important;
}

input::placeholder,
textarea::placeholder {
  color: #9b8d7c;
  opacity: 1;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(79, 99, 54, .25) !important;
  outline-offset: 2px !important;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--focus) !important;
  box-shadow: 0 0 0 3px rgba(79, 99, 54, .12) !important;
}

.container,
.wrap {
  width: min(100%, 780px);
}

.eyebrow {
  color: var(--muted) !important;
  letter-spacing: .2em !important;
}

.subtitle,
.note,
.hint,
.sub,
.tool-desc {
  color: var(--muted) !important;
}

.back-link,
.guide-link,
.sound-toggle,
.tool-guide-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  margin-bottom: 20px !important;
}

.tools-nav-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  margin-left: auto;
}

.topbar .tools-home-link,
.topbar .tools-return-link,
.topbar .tool-guide-link {
  min-height: 36px !important;
  margin: 0 !important;
  padding: 6px 11px !important;
  gap: 6px;
  border: 1px solid var(--line) !important;
  border-radius: 999px !important;
  background: rgba(255, 250, 242, .86) !important;
  color: var(--muted) !important;
  box-shadow: 0 7px 20px -18px rgba(43, 33, 24, .65);
  text-decoration: none !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  white-space: nowrap;
  transform: none !important;
  transition: color .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease !important;
}

.topbar .tool-guide-link {
  border-color: #cdd6b7 !important;
  background: var(--accent-soft) !important;
  color: var(--accent-deep) !important;
}

.topbar .tools-home-link:hover,
.topbar .tools-return-link:hover,
.topbar .tool-guide-link:hover {
  border-color: var(--accent) !important;
  background: #fffdf8 !important;
  color: var(--accent-deep) !important;
  box-shadow: 0 9px 22px -17px rgba(43, 33, 24, .75);
}

.tools-nav-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--line-soft);
  color: var(--accent-deep);
  font-family: 'Sarabun', sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.tools-guide-icon {
  background: var(--accent-deep);
  color: #fff;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 13px;
  font-style: italic;
}

.topbar > .sound-toggle {
  min-height: 36px !important;
  margin-right: auto;
  padding-block: 6px !important;
  font-size: 12.5px !important;
}

.tool-guide-link {
  gap: 6px;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--accent-deep);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.tools-bottom-nav {
  width: min(calc(100% - 24px), 420px);
  margin: 38px auto 0;
}

.tools-bottom-home {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 13px;
  padding: 12px 13px;
  overflow: hidden;
  border: 1px solid #cfd8ba;
  border-radius: 18px;
  background: linear-gradient(135deg, #fffdf8 0%, var(--accent-soft) 100%);
  box-shadow: 0 18px 34px -27px rgba(43, 33, 24, .62);
  color: var(--ink);
  text-decoration: none;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.tools-bottom-home::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent-deep);
}

.tools-bottom-home:hover {
  transform: translateY(-2px);
  border-color: #aebd8e;
  box-shadow: 0 21px 38px -25px rgba(43, 33, 24, .7);
}

.tools-bottom-icon,
.tools-bottom-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.tools-bottom-icon {
  width: 46px;
  height: 46px;
  background: var(--accent-deep);
  color: #fff;
  box-shadow: 0 9px 20px -13px rgba(79, 99, 54, .85);
  font-size: 22px;
  line-height: 1;
}

.tools-bottom-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.tools-bottom-copy strong {
  color: var(--accent-deep);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.tools-bottom-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tools-bottom-arrow {
  width: 30px;
  height: 30px;
  border: 1px solid #ccd6b6;
  background: rgba(255, 255, 255, .64);
  color: var(--accent-deep);
  font-size: 16px;
  transition: transform .22s ease, background .22s ease;
}

.tools-bottom-home:hover .tools-bottom-arrow {
  transform: translateX(2px);
  background: #fff;
}

.tools-bottom-nav + .site-footer {
  margin-top: 18px !important;
}

body.cap .tools-bottom-nav {
  display: none !important;
}

.tools-notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: -4px 0 16px;
  padding: 11px 13px;
  border: 1px solid #d8dfc6;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 12.5px;
  line-height: 1.5;
}

.tools-notice strong {
  font-weight: 700;
}

.batchbar {
  border-color: var(--line) !important;
  background: var(--card) !important;
  box-shadow: var(--shadow);
}

.batchbar::before {
  content: 'ข้อมูลแต่ละ Batch แยกจากกันและบันทึกอัตโนมัติในเครื่องนี้';
  flex-basis: 100%;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.batchbar label {
  color: var(--ink) !important;
  font-weight: 700 !important;
}

.batchbar select {
  min-height: 44px;
  font-size: 16px !important;
}

.batchbar .bbtn,
.actions .btn,
.tbl-actions .btn,
.tbtns .btn {
  min-height: 44px;
}

.bbtn.new,
.btn.main,
.btn.done,
.btn.print,
.btn.big,
.start1,
.start2 {
  background: var(--accent-deep) !important;
  border-color: var(--accent-deep) !important;
  color: #fff !important;
}

.bbtn.del,
.btn.stopRec {
  background: #fff8f4 !important;
  color: var(--rose-deep) !important;
  border-color: #d9b9ae !important;
}

.block,
.card,
.panel,
.result,
.tcard,
.tool-card,
.preset {
  border-color: var(--line) !important;
  box-shadow: var(--shadow) !important;
}

.block-t,
.block-t.p1,
.block-t.p2,
.block-t.pst,
.block-t.pss,
.sec-title,
.result-title {
  color: var(--accent-deep) !important;
}

.block-t .tag,
.block-t.p1 .tag,
.block-t.p2 .tag,
.block-t.pst .tag,
.block-t.pss .tag {
  background: var(--accent-deep) !important;
  color: #fff !important;
}

.tcard.p-rest {
  background: var(--rest-soft) !important;
  border-color: #cdbfae !important;
}

.phase-chip.rest,
.p-rest .endat {
  background: #e9dfd1 !important;
  color: var(--rest-deep) !important;
  border-color: #cdbfae !important;
}

.tl-seg.rest {
  background: #e7ded2 !important;
  outline-color: #cdbfae !important;
}

.p-rest .ring-fg,
.tl-seg.rest .fl {
  stroke: var(--rest) !important;
  background: var(--rest) !important;
}

.p-rest .bigtime,
.p-rest .tl-rounds .tlr.cur,
.p-rest .round-dots .d.cur {
  color: var(--rest-deep) !important;
}

.p-rest .btn.main,
.btn.main.pause {
  background: var(--rest-deep) !important;
  border-color: var(--rest-deep) !important;
}

.pst-timer.rest {
  background: var(--rest-soft) !important;
  border-color: #cdbfae !important;
}

.pt-chip.rest,
.pst-timer.rest .pt-endat {
  background: #e9dfd1 !important;
  color: var(--rest-deep) !important;
  border-color: #cdbfae !important;
}

.pt-seg.rest {
  background: #e7ded2 !important;
  outline-color: #cdbfae !important;
}

.pst-timer.rest .pt-ring-fg {
  stroke: var(--rest) !important;
}

.pt-seg.rest .fl {
  background: var(--rest) !important;
}

.pst-timer.rest .pt-time,
.pst-timer.rest .pt-dots .d.cur,
.pst-timer.rest .pt-tlr span.cur {
  color: var(--rest-deep) !important;
}

.pst-timer.rest .pt-btn.pt-start {
  background: var(--rest-deep) !important;
  border-color: var(--rest-deep) !important;
}

#heatBlock .block-t,
.block-t.pst {
  color: var(--accent-deep) !important;
}

#heatBlock .block-t .n,
.block-t.pst .tag,
#pstEvents .evrow.logged .stepnum,
#pstEvents .sub-b {
  background: var(--accent-deep) !important;
  border-color: var(--accent-deep) !important;
}

#coolBlock .block-t,
.block-t.pss,
#pssEvents .evrow.next .stepnum,
#pssEvents .evres .sch {
  color: var(--rest-deep) !important;
}

#coolBlock .block-t .n,
.block-t.pss .tag,
#pssEvents .evrow.logged .stepnum,
#pssEvents .sub-b {
  background: var(--rest-deep) !important;
  border-color: var(--rest-deep) !important;
}

#heatBlock .quick .qb {
  border-color: #a9b78b !important;
  background: var(--accent-soft) !important;
  color: var(--accent-deep) !important;
}

#heatBlock .quick .sub-b,
#heatBlock .prog .pbar i,
.block-t.pst .prog .pbar i {
  background: var(--accent-deep) !important;
}

#coolBlock .prog .pbar i,
.block-t.pss .prog .pbar i {
  background: var(--rest-deep) !important;
}

.statusbar.hold,
.countdown,
.nextread {
  background: var(--rest-soft) !important;
  border-color: #cdbfae !important;
  color: var(--rest-deep) !important;
}

.countdown .big,
.countdown.p2 .big,
.nextread b,
.wat {
  color: var(--rest-deep) !important;
}

.ed-t,
.clr {
  color: var(--accent-deep) !important;
}

table input,
table select {
  font-family: 'Sarabun', sans-serif !important;
  font-style: normal !important;
}

.site-footer {
  color: var(--muted) !important;
}

.site-footer a {
  color: var(--accent-deep) !important;
}

@media screen and (max-width: 640px) {
  body {
    padding: 22px 12px 38px !important;
    background-image: radial-gradient(circle at 15% 0%, rgba(220, 229, 200, .46) 0%, transparent 36%) !important;
  }

  header {
    margin-bottom: 22px !important;
  }

  h1 {
    font-size: clamp(30px, 9vw, 40px) !important;
  }

  .subtitle {
    font-size: 14px !important;
    line-height: 1.65 !important;
  }

  .topbar {
    flex-wrap: wrap;
    gap: 8px !important;
    margin-bottom: 18px !important;
  }

  .tools-nav-group {
    gap: 6px;
  }

  .topbar .tools-home-link,
  .topbar .tools-return-link,
  .topbar .tool-guide-link {
    min-height: 40px !important;
    padding: 7px 10px !important;
  }

  .topbar > .sound-toggle {
    min-height: 40px !important;
  }

  input,
  select,
  textarea {
    font-size: 16px !important;
    min-height: 46px;
  }

  textarea {
    min-height: 92px;
  }

  button,
  .btn,
  .bbtn,
  .back-link,
  .guide-link,
  .tool-guide-link {
    min-height: 44px;
  }

  .block,
  .card,
  .panel,
  .result,
  .tcard {
    border-radius: 17px !important;
    padding: 18px 14px !important;
  }

  .grid,
  .fields,
  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .batchbar {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px !important;
    padding: 13px !important;
    border-radius: 16px !important;
  }

  .batchbar::before,
  .batchbar label,
  .batchbar select {
    grid-column: 1 / -1;
  }

  .batchbar .bbtn {
    width: 100%;
    padding: 10px 8px !important;
    white-space: normal;
  }

  .actions,
  .tbl-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 9px !important;
  }

  .actions .btn,
  .tbl-actions .btn {
    width: 100%;
    margin: 0 !important;
  }

  table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  th,
  td {
    font-size: 13px !important;
  }

  table input,
  table select {
    min-width: 92px;
  }

  .ringwrap {
    width: min(218px, 68vw) !important;
  }

  .bigtime {
    font-size: clamp(58px, 18vw, 76px) !important;
  }

  .phase-chip {
    min-height: 40px;
    font-size: 17px !important;
  }

  .site-footer {
    margin-top: 26px !important;
    padding-inline: 8px !important;
    font-size: 12px !important;
  }

  .tools-bottom-nav {
    width: min(calc(100% - 8px), 420px);
    margin-top: 30px;
  }
}

@media screen and (max-width: 390px) {
  .topbar {
    align-items: flex-start !important;
  }

  .topbar > .sound-toggle {
    max-width: calc(100% - 174px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar .tools-home-link,
  .topbar .tools-return-link,
  .topbar .tool-guide-link {
    font-size: 12px !important;
  }

  .tools-bottom-home {
    grid-template-columns: 42px minmax(0, 1fr) 30px;
    gap: 11px;
    padding: 11px 12px;
    border-radius: 16px;
  }

  .tools-bottom-icon {
    width: 42px;
    height: 42px;
    font-size: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media print {
  .block,
  .card,
  .panel,
  .result,
  .tcard,
  .tool-card,
  .preset,
  .batchbar {
    box-shadow: none !important;
  }

  .tool-guide-link,
  .tools-nav-group,
  .tools-bottom-nav,
  .tools-notice {
    display: none !important;
  }

  input,
  select,
  textarea {
    box-shadow: none !important;
  }
}

/* UI v2 pilot: opt-in shared design system */
body.tools-ui-v2 {
  --bg: #f6f1e7;
  --card: #fff;
  --ink: #22281f;
  --muted: #53604f;
  --muted-soft: #879283;
  --line: #c8d2c4;
  --line-soft: #e6ebe3;
  --accent: #3f704a;
  --accent-deep: #2f5d3a;
  --accent-soft: #e7efe3;
  --rose: #c7435d;
  --rose-deep: #a92f4b;
  --focus: #2f5d3a;
  min-height: 100vh;
  padding: 34px 18px 52px;
  background:
    radial-gradient(circle at 10% 0%, rgba(231, 239, 227, .95), transparent 34%),
    radial-gradient(circle at 95% 42%, rgba(199, 67, 93, .045), transparent 30%),
    var(--bg);
  color: var(--ink);
  font-family: 'Sarabun', sans-serif;
  line-height: 1.6;
}

body.tools-ui-v2 .container,
body.tools-ui-v2 .wrap {
  width: min(100%, 820px);
  margin-inline: auto;
}

body.tools-ui-v2 header {
  margin-bottom: 28px;
  text-align: center;
}

body.tools-ui-v2 .eyebrow {
  margin-bottom: 10px;
  color: var(--accent-deep) !important;
  font-size: 15px !important;
  font-weight: 700;
  letter-spacing: .01em !important;
  text-transform: none;
}

body.tools-ui-v2 h1 {
  margin-bottom: 10px;
  color: var(--accent-deep);
  font-family: 'Sarabun', sans-serif;
  font-size: clamp(36px, 7vw, 54px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.035em;
}

body.tools-ui-v2 h1 em {
  color: var(--rose);
  font-style: normal;
  font-weight: 700;
}

body.tools-ui-v2 .subtitle {
  max-width: 620px;
  color: var(--muted) !important;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.7;
}

body.tools-ui-v2 .formula {
  min-height: 48px;
  margin-top: 18px;
  padding: 10px 18px;
  border-color: var(--line);
  background: var(--card);
  color: var(--ink);
  font-family: 'Sarabun', sans-serif;
  font-size: 14px;
  box-shadow: 0 12px 30px -26px rgba(34, 40, 31, .5);
}

body.tools-ui-v2 .formula-label,
body.tools-ui-v2 .formula-expression {
  font-family: 'Sarabun', sans-serif;
  font-style: normal;
}

body.tools-ui-v2 .detail-entry {
  min-height: 84px;
  border-color: var(--line);
  background: linear-gradient(135deg, #fff 0%, var(--accent-soft) 100%);
  color: var(--ink);
  box-shadow: 0 14px 30px -25px rgba(34, 40, 31, .52);
}

body.tools-ui-v2 .detail-icon {
  background: var(--accent-deep);
  font-family: 'Sarabun', sans-serif;
  font-style: normal;
  font-weight: 700;
}

body.tools-ui-v2 .detail-copy strong {
  color: var(--accent-deep);
  font-size: 16px;
}

body.tools-ui-v2 .detail-copy small {
  color: var(--muted);
  font-size: 14px;
}

body.tools-ui-v2 .calculator {
  border-color: var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 14px 32px -25px rgba(34, 40, 31, .52);
}

body.tools-ui-v2 .calculator-head {
  padding: 20px 22px 16px;
  border-color: var(--line);
}

body.tools-ui-v2 .calculator-head h2 {
  color: var(--accent-deep);
  font-family: 'Sarabun', sans-serif;
  font-size: 22px;
  font-weight: 700;
}

body.tools-ui-v2 .calculator-head p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

body.tools-ui-v2 .fields {
  gap: 16px;
  padding: 22px;
}

body.tools-ui-v2 .field label {
  min-height: 48px;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.55;
}

body.tools-ui-v2 .weight-input input {
  height: 56px;
  border-color: var(--line) !important;
  background: #fff !important;
  color: var(--ink) !important;
  font-family: 'Sarabun', sans-serif;
  font-size: 22px;
  font-weight: 600;
}

body.tools-ui-v2 .weight-input span {
  color: var(--muted);
  font-size: 14px;
}

body.tools-ui-v2 .result-panel {
  padding: 20px 22px;
  border-color: var(--line);
  background: var(--accent-soft);
}

body.tools-ui-v2 .result-label strong {
  color: var(--ink);
  font-size: 16px;
}

body.tools-ui-v2 .result-label span {
  color: var(--muted);
  font-size: 14px;
}

body.tools-ui-v2 .result-value {
  color: var(--accent-deep);
  font-family: 'Sarabun', sans-serif;
  font-weight: 700;
}

body.tools-ui-v2 .result-value.placeholder {
  color: var(--muted-soft);
}

body.tools-ui-v2 .result-value.warning,
body.tools-ui-v2 .message.warning {
  color: var(--rose-deep);
}

body.tools-ui-v2 .message {
  min-height: 48px;
  padding: 13px 22px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

body.tools-ui-v2 .actions {
  padding: 10px 22px 22px;
}

body.tools-ui-v2 .btn {
  min-height: 48px;
  padding: 10px 24px;
  border-color: var(--line);
  background: #fff;
  color: var(--accent-deep);
  font-size: 15px;
  font-weight: 700;
}

body.tools-ui-v2 .btn:hover {
  border-color: var(--accent-deep);
  background: var(--accent-deep);
  color: #fff;
}

body.tools-ui-v2 .measurement-note {
  margin-top: 18px;
  padding: 15px 17px;
  border-color: var(--line);
  background: rgba(255, 255, 255, .54);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  text-align: left;
}

body.tools-ui-v2 .tools-bottom-nav {
  margin-top: 34px;
}

body.tools-ui-v2 .tools-bottom-home {
  border-color: var(--line);
  background: linear-gradient(135deg, #fff 0%, var(--accent-soft) 100%);
}

body.tools-ui-v2 .site-footer {
  color: var(--muted) !important;
}

body.tools-ui-v2 .site-footer a {
  color: var(--accent-deep) !important;
}

body.tools-ui-v2.high-contrast {
  --bg: #fffdf7;
  --card: #fff;
  --ink: #11160f;
  --muted: #30392d;
  --muted-soft: #596456;
  --line: #82917f;
  --line-soft: #d7ded4;
  --accent: #23502e;
  --accent-deep: #173f23;
  --accent-soft: #dcebd8;
  --rose: #a92242;
  --rose-deep: #83152f;
  --focus: #173f23;
}

body.tools-ui-v2.high-contrast .weight-input input,
body.tools-ui-v2.high-contrast .btn {
  border-width: 2px !important;
}

body.tools-ui-v2.reading-large .subtitle,
body.tools-ui-v2.reading-large .detail-copy strong,
body.tools-ui-v2.reading-large .calculator-head p,
body.tools-ui-v2.reading-large .field label,
body.tools-ui-v2.reading-large .result-label strong,
body.tools-ui-v2.reading-large .message,
body.tools-ui-v2.reading-large .measurement-note,
body.tools-ui-v2.reading-large .tools-bottom-copy strong {
  font-size: 17px !important;
}

body.tools-ui-v2.reading-large .detail-copy small,
body.tools-ui-v2.reading-large .result-label span,
body.tools-ui-v2.reading-large .tools-bottom-copy small {
  font-size: 15px !important;
}

body.tools-ui-v2.reading-large .weight-input input {
  height: 60px;
  font-size: 25px !important;
}

body.tools-ui-v2.reading-large .btn {
  min-height: 52px;
  font-size: 17px;
}

@media screen and (max-width: 640px) {
  body.tools-ui-v2 {
    padding: 22px 12px 46px !important;
  }

  body.tools-ui-v2 .eyebrow {
    font-size: 14px !important;
  }

  body.tools-ui-v2 h1 {
    font-size: clamp(34px, 10vw, 42px) !important;
  }

  body.tools-ui-v2 .subtitle {
    font-size: 16px !important;
  }

  body.tools-ui-v2 .formula {
    width: 100%;
    border-radius: 15px;
  }

  body.tools-ui-v2 .fields {
    padding: 18px 14px !important;
  }

  body.tools-ui-v2 .field label {
    min-height: 0;
  }

  body.tools-ui-v2 .weight-input input {
    font-size: 22px !important;
  }

  body.tools-ui-v2 .result-panel {
    padding: 18px 14px !important;
  }

  body.tools-ui-v2 .message {
    padding-inline: 14px;
  }

  body.tools-ui-v2 .actions {
    display: flex !important;
    padding: 10px 14px 18px;
  }

  body.tools-ui-v2 .actions .btn {
    width: min(100%, 220px);
  }
}

@media print {
  body.tools-ui-v2 {
    background: #fff !important;
    color: #000 !important;
  }
}

/* Sensory suite: readable form layout aligned with the redesigned homepage */
@media screen {
  body.tools-layout-sensory {
    padding-top: 30px;
  }

  body.tools-layout-sensory .container {
    width: min(100%, 980px);
  }

  body.tools-layout-sensory .topbar {
    display: grid !important;
    grid-template-columns: auto minmax(280px, 420px);
    align-items: center;
    justify-content: space-between !important;
    gap: 10px;
    width: 100%;
    margin: 0 auto 24px;
  }

  body.tools-layout-sensory .topbar .tools-nav-group {
    order: -1;
  }

  body.tools-layout-sensory .page-help {
    display: flex;
    width: 100%;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 11px 16px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #fff;
    color: var(--accent-deep);
    box-shadow: 0 12px 28px -24px rgba(34, 40, 31, .52);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
  }

  body.tools-layout-sensory .page-help:hover {
    border-color: #91a58f;
    background: var(--accent-soft);
  }

  body.tools-layout-sensory .page-help span:first-child {
    display: grid;
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-deep);
    color: #fff;
    font-size: 13px;
  }

  body.tools-layout-sensory .page-help span.info-icon {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 18px;
    font-style: italic;
    font-weight: 700;
  }

  body.tools-layout-sensory header {
    max-width: 790px;
    margin: 0 auto 30px;
  }

  body.tools-layout-sensory .subtitle {
    max-width: 720px;
    margin-inline: auto;
  }

  body.sensory-acceptance h1 em,
  body.sensory-triangle h1 em,
  body.sensory-ranking h1 em {
    display: inline-block;
    white-space: nowrap;
  }

  body.tools-layout-sensory .save-status {
    min-height: 34px;
    margin-top: 14px;
    padding: 7px 12px;
    border-color: var(--line);
    background: rgba(255, 255, 255, .76);
    color: var(--accent-deep);
    font-size: 13px;
  }

  body.tools-layout-sensory .scope-note {
    margin: -8px 0 20px;
    padding: 15px 17px;
    border: 1px solid var(--line);
    border-left: 5px solid var(--accent-deep);
    border-radius: 15px;
    background: var(--accent-soft);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.7;
  }

  body.tools-layout-sensory .scope-note strong {
    color: var(--accent-deep);
  }

  body.tools-layout-sensory .section {
    margin-bottom: 18px;
    border-color: var(--line);
    border-radius: 20px;
    background: var(--card);
    box-shadow: 0 14px 32px -26px rgba(34, 40, 31, .48);
  }

  body.tools-layout-sensory .section-head {
    gap: 13px;
    min-height: 68px;
    padding: 15px 20px;
    border-color: var(--line);
    background: var(--accent-soft);
  }

  body.tools-layout-sensory .section-number {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    background: var(--accent-deep);
    font-family: 'Sarabun', sans-serif;
    font-size: 16px;
    font-style: normal;
    font-weight: 700;
  }

  body.tools-layout-sensory .section-head h2 {
    color: var(--accent-deep);
    font-family: 'Sarabun', sans-serif;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.35;
  }

  body.tools-layout-sensory .section-body {
    padding: 22px;
  }

  body.tools-layout-sensory .section-note {
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.75;
  }

  body.tools-layout-sensory .grid,
  body.tools-layout-sensory .product-grid,
  body.tools-layout-sensory .default-groups,
  body.tools-layout-sensory .custom-grid,
  body.tools-layout-sensory .question-grid,
  body.tools-layout-sensory .guide-rule-grid {
    gap: 16px;
  }

  body.tools-layout-sensory .field label {
    min-height: 0;
    margin-bottom: 7px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
  }

  body.tools-layout-sensory input,
  body.tools-layout-sensory select,
  body.tools-layout-sensory textarea {
    min-height: 50px;
    padding: 12px 14px;
    border-color: var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    font-size: 16px;
    line-height: 1.45;
  }

  body.tools-layout-sensory textarea {
    min-height: 104px;
    line-height: 1.65;
  }

  body.tools-layout-sensory input:focus,
  body.tools-layout-sensory select:focus,
  body.tools-layout-sensory textarea:focus {
    border-color: var(--accent-deep);
    outline: 3px solid rgba(47, 93, 58, .16);
    outline-offset: 1px;
  }

  body.tools-layout-sensory .hint {
    margin-top: 7px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
  }

  body.tools-layout-sensory .private-note,
  body.tools-layout-sensory .balance-note,
  body.tools-layout-sensory .print-note {
    padding: 13px 15px;
    border-color: var(--line);
    border-radius: 14px;
    background: var(--accent-soft);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.7;
  }

  body.tools-layout-sensory .private-note strong,
  body.tools-layout-sensory .balance-note strong,
  body.tools-layout-sensory .print-note strong {
    color: var(--accent-deep);
  }

  body.tools-layout-sensory .subsection-label,
  body.tools-layout-sensory .question-subhead {
    color: var(--accent-deep);
    font-family: 'Sarabun', sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.45;
  }

  body.tools-layout-sensory .sample-code-field,
  body.tools-layout-sensory .product-card,
  body.tools-layout-sensory .default-group,
  body.tools-layout-sensory .custom-card,
  body.tools-layout-sensory .question-card,
  body.tools-layout-sensory .guide-rule,
  body.tools-layout-sensory .fixed-question {
    border-color: var(--line);
    border-radius: 15px;
    background: #fbfcfa;
  }

  body.tools-layout-sensory .sample-code-field,
  body.tools-layout-sensory .product-card,
  body.tools-layout-sensory .default-group,
  body.tools-layout-sensory .custom-card,
  body.tools-layout-sensory .question-card {
    padding: 15px;
  }

  body.tools-layout-sensory .sample-code-field h3,
  body.tools-layout-sensory .product-card h3,
  body.tools-layout-sensory .default-group h3,
  body.tools-layout-sensory .custom-card-head strong,
  body.tools-layout-sensory .question-head strong {
    color: var(--accent-deep);
    font-family: 'Sarabun', sans-serif;
    font-size: 15px;
    font-weight: 700;
  }

  body.tools-layout-sensory .check-item {
    min-height: 34px;
    gap: 10px;
    padding: 6px 0;
    font-size: 14px;
    line-height: 1.55;
  }

  body.tools-layout-sensory .check-item input {
    width: 20px;
    min-height: 20px;
    flex-basis: 20px;
    padding: 0;
  }

  body.tools-layout-sensory .answer-lock,
  body.tools-layout-sensory .fixed-question {
    min-height: 48px;
    padding: 11px 13px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
  }

  body.tools-layout-sensory .question-guide {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fbfcfa;
  }

  body.tools-layout-sensory .question-guide summary {
    min-height: 52px;
    padding: 14px 16px;
    background: var(--accent-soft);
    color: var(--accent-deep);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
  }

  body.tools-layout-sensory .question-guide-body {
    padding: 16px;
  }

  body.tools-layout-sensory .guide-rule {
    padding: 13px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.65;
  }

  body.tools-layout-sensory .guide-rule strong {
    color: var(--ink);
  }

  body.tools-layout-sensory .actionbar {
    gap: 10px;
  }

  body.tools-layout-sensory .btn {
    min-height: 48px;
    padding: 11px 18px;
    border-color: var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--accent-deep);
    font-size: 15px;
    font-weight: 700;
  }

  body.tools-layout-sensory .btn.primary {
    border-color: var(--accent-deep);
    background: var(--accent-deep);
    color: #fff;
  }

  body.tools-layout-sensory .btn.danger {
    color: var(--rose-deep);
  }

  body.tools-layout-sensory .btn.danger:hover {
    border-color: var(--rose-deep);
    background: var(--rose-deep);
    color: #fff;
  }

  body.tools-layout-sensory .section-head:has(.section-print) {
    flex-wrap: wrap;
  }

  body.tools-layout-sensory .section-head:has(.section-print) h2 {
    min-width: 220px;
    flex: 1 1 320px;
  }

  body.tools-layout-sensory .section-actions {
    display: flex;
    flex: 0 1 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
  }

  body.tools-layout-sensory .section-print {
    min-height: 42px;
    margin-left: auto;
    padding: 8px 13px;
    border-radius: 12px;
    background: #fff;
    font-size: 13px;
    white-space: nowrap;
  }

  body.tools-layout-sensory .section-actions .section-print {
    margin-left: 0;
  }

  body.tools-layout-sensory .section-print:disabled,
  body.tools-layout-sensory .section-print:disabled:hover {
    border-color: var(--line);
    background: rgba(255, 255, 255, .62);
    color: var(--muted);
    cursor: not-allowed;
    opacity: .58;
  }

  body.tools-layout-sensory .empty-preview {
    min-height: 130px;
    padding: 36px 20px;
    border-color: var(--line);
    background: #fbfcfa;
    color: var(--muted);
    font-size: 14px;
  }

  body.tools-layout-sensory .preview-summary {
    padding: 12px 15px;
    border-color: var(--line);
    background: var(--accent-soft);
    color: var(--accent-deep);
    font-size: 14px;
  }

  body.tools-layout-sensory dialog {
    border-color: var(--line);
    border-radius: 20px;
    background: var(--card);
  }

  body.tools-layout-sensory .dialog-head {
    min-height: 66px;
    padding: 14px 18px;
    border-color: var(--line);
    background: rgba(255, 255, 255, .97);
  }

  body.tools-layout-sensory .dialog-head h2 {
    color: var(--accent-deep);
    font-family: 'Sarabun', sans-serif;
    font-size: 21px;
    font-weight: 700;
  }

  body.tools-layout-sensory .dialog-close {
    width: 44px;
    height: 44px;
    border-color: var(--line);
    background: #fff;
  }

  body.tools-layout-sensory .dialog-body {
    padding: 20px;
  }

  body.tools-layout-sensory .guide-step {
    gap: 14px;
    padding: 15px 0;
    border-color: var(--line-soft);
  }

  body.tools-layout-sensory .guide-n {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    background: var(--accent-deep);
    font-family: 'Sarabun', sans-serif;
    font-weight: 700;
  }

  body.tools-layout-sensory .guide-copy strong {
    margin-bottom: 4px;
    color: var(--ink);
    font-size: 15px;
  }

  body.tools-layout-sensory .guide-copy p,
  body.tools-layout-sensory .guide-copy li {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.75;
  }

  body.tools-layout-sensory .site-footer {
    font-size: 13px;
  }

  body.tools-layout-sensory.reading-large .field label,
  body.tools-layout-sensory.reading-large .section-note,
  body.tools-layout-sensory.reading-large .check-item,
  body.tools-layout-sensory.reading-large .private-note,
  body.tools-layout-sensory.reading-large .scope-note,
  body.tools-layout-sensory.reading-large .guide-copy p,
  body.tools-layout-sensory.reading-large .guide-copy li {
    font-size: 17px !important;
  }

  body.tools-layout-sensory.reading-large input,
  body.tools-layout-sensory.reading-large select,
  body.tools-layout-sensory.reading-large textarea,
  body.tools-layout-sensory.reading-large .btn {
    font-size: 18px !important;
  }
}

@media screen and (max-width: 720px) {
  body.tools-layout-sensory {
    padding: 22px 12px 44px !important;
  }

  body.tools-layout-sensory .topbar {
    grid-template-columns: 1fr;
    margin-bottom: 22px;
  }

  body.tools-layout-sensory .topbar .tools-nav-group {
    grid-column: 1;
    justify-self: start;
  }

  body.tools-layout-sensory .page-help {
    justify-content: flex-start;
    text-align: left;
  }

  body.tools-layout-sensory header {
    margin-bottom: 24px;
  }

  body.tools-layout-sensory .scope-note {
    margin-top: -4px;
  }

  body.tools-layout-sensory .section-head {
    min-height: 62px;
    padding: 13px 15px;
  }

  body.tools-layout-sensory .section-number {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  body.tools-layout-sensory .section-head h2 {
    font-size: 19px;
  }

  body.tools-layout-sensory .section-head:has(.section-print) h2 {
    min-width: 0;
    flex-basis: calc(100% - 49px);
  }

  body.tools-layout-sensory .section-print {
    width: calc(100% - 49px);
    flex: 0 0 calc(100% - 49px);
    margin: 3px 0 0 49px;
  }

  body.tools-layout-sensory .section-actions {
    display: grid;
    width: calc(100% - 49px);
    flex: 0 0 calc(100% - 49px);
    grid-template-columns: 1fr;
    margin: 3px 0 0 49px;
  }

  body.tools-layout-sensory .section-actions .section-print {
    width: 100%;
    margin: 0;
  }

  body.tools-layout-sensory .section-body {
    padding: 17px 15px;
  }

  body.tools-layout-sensory .grid,
  body.tools-layout-sensory .product-grid,
  body.tools-layout-sensory .default-groups,
  body.tools-layout-sensory .custom-grid,
  body.tools-layout-sensory .question-grid,
  body.tools-layout-sensory .guide-rule-grid {
    gap: 13px;
  }

  body.tools-layout-sensory .actionbar {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  body.tools-layout-sensory .actionbar .btn,
  body.tools-layout-sensory .actionbar .file-label {
    width: 100% !important;
  }

  body.tools-layout-sensory .dialog-body {
    padding: 16px;
  }

  body.tools-layout-sensory .dialog-head {
    flex-wrap: wrap;
  }

}
