/* ตัวสร้างเมนู — ฟอร์มที่เจ้าของร้านกรอกเอง */
:root {
  --bg: #faf7f2; --surface: #fffdfa; --line: #e7dfd3; --line2: #d8cec0;
  --text: #221f1b; --muted: #7d7466; --faint: #b5aa9b;
  --ink: #2b2721; --on-ink: #fdfbf7; --hot: #b4462f; --ok: #3f7d51;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: "IBM Plex Sans Thai", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased;
  padding-bottom: 96px;
}
h1, h2 { font-family: "Noto Serif Thai", Georgia, serif; font-weight: 500; letter-spacing: -0.015em; }

.top { border-bottom: 1px solid var(--line); background: var(--surface); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; }
.top h1 { font-size: 17px; }
.top a { color: var(--muted); font-size: 13px; text-decoration: none; }

.wrap { max-width: 640px; margin: 0 auto; padding: 0 20px; }

.intro { padding: 26px 0 6px; }
.intro h2 { font-size: 22px; }
.intro p { color: var(--muted); font-size: 14.5px; margin-top: 8px; }

fieldset { border: 0; padding: 26px 0; border-top: 1px solid var(--line); }
legend { font-family: "Noto Serif Thai", Georgia, serif; font-size: 18px; padding: 0; margin-bottom: 4px; }
.hint { color: var(--muted); font-size: 13.5px; margin-bottom: 16px; }

label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 12px 0 5px; }
label span { font-weight: 400; color: var(--faint); }

input[type=text], input[type=tel], input[type=url], input[type=number], input[type=time], select, textarea {
  width: 100%; padding: 10px 12px; font: inherit; font-size: 15px;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--line2); border-radius: 8px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { resize: vertical; min-height: 54px; }

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

.check { display: flex; align-items: center; gap: 9px; margin: 10px 0; font-size: 14.5px; font-weight: 400; color: var(--text); }
.check input { width: 17px; height: 17px; accent-color: var(--ink); flex: 0 0 auto; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 6px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block; padding: 6px 12px; border-radius: 999px; font-size: 13px;
  border: 1px solid var(--line2); background: var(--surface); cursor: pointer;
}
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.chip input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

.block {
  background: var(--surface); border: 1px solid var(--line); border-radius: 11px;
  padding: 14px 16px; margin-bottom: 10px;
}
.block__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.block__n { font-size: 12px; font-weight: 600; color: var(--faint); letter-spacing: .04em; }
.del { font-size: 13px; color: var(--hot); background: none; border: 0; cursor: pointer; padding: 4px; font-family: inherit; }
.move { font-size: 15px; color: var(--muted); background: none; border: 0; cursor: pointer; padding: 2px 5px; font-family: inherit; }

.add-btn {
  width: 100%; padding: 11px; margin-top: 4px; font: inherit; font-size: 14.5px; font-weight: 600;
  color: var(--text); background: transparent; border: 1px dashed var(--line2); border-radius: 9px; cursor: pointer;
}
.add-btn:active { background: var(--surface); }

.days { display: grid; gap: 8px; }
.day { display: grid; grid-template-columns: 74px 1fr 1fr auto; gap: 8px; align-items: center; }
.day > b { font-size: 13.5px; font-weight: 500; }
.day input[type=time] { padding: 8px 9px; font-size: 14px; }
.day.is-closed input[type=time] { opacity: .35; pointer-events: none; }
.day label { margin: 0; font-size: 12px; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.day label input { width: 16px; height: 16px; accent-color: var(--ink); }

.variants { display: grid; gap: 8px; margin-top: 8px; }
.variant { display: grid; grid-template-columns: 1fr 110px auto; gap: 8px; align-items: center; }

.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 11px 20px calc(11px + env(safe-area-inset-bottom));
}
.bar__in { max-width: 640px; margin: 0 auto; display: flex; align-items: center; gap: 9px; }
.bar__status { flex: 1; font-size: 12.5px; color: var(--muted); min-width: 0; }
.bar__status b { display: block; color: var(--text); font-size: 13.5px; font-weight: 600; }
.btn {
  padding: 11px 16px; border-radius: 9px; font: inherit; font-size: 14px; font-weight: 600;
  background: var(--ink); color: var(--on-ink); border: 1px solid var(--ink); cursor: pointer;
  text-decoration: none; display: inline-block; white-space: nowrap;
}
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line2); }

.problems { margin-top: 14px; }
.problems li { list-style: none; font-size: 13.5px; color: var(--hot); padding: 3px 0 3px 16px; position: relative; }
.problems li::before { content: "•"; position: absolute; left: 3px; }
.problems.is-ok li { color: var(--ok); }

dialog {
  border: 0; border-radius: 14px; padding: 0; max-width: 480px; width: calc(100% - 32px);
  background: var(--bg); color: var(--text);
}
dialog::backdrop { background: rgba(0,0,0,.45); }
.dlg { padding: 22px; }
.dlg h2 { font-size: 19px; margin-bottom: 8px; }
.dlg p { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.dlg ol { margin: 0 0 16px 18px; font-size: 14px; }
.dlg ol li { margin-bottom: 6px; }
.dlg .cta { display: flex; flex-wrap: wrap; gap: 8px; }
.dlg textarea { font-family: ui-monospace, Menlo, monospace; font-size: 11px; height: 120px; margin-bottom: 12px; }
