@font-face { font-family: "Noto Sans Thai"; src: url("/fonts/NotoSansThai-VF.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
:root, .theme-yht { --brand:#007A33; --brand-accent:#00A044; --brand-soft:#E8F8ED; --bg:#EEF6F0; --line:#D5E6DA; --muted:#4E6254; }
.theme-ymk { --brand:#CC0818; --brand-accent:#F4A0BC; --brand-soft:#FEC8D8; --bg:#FFF5F8; --line:#F3D0DA; --muted:#8A4A58; }
:root { --paper:#fff; --ink:#122016; --danger:#b42318; --danger-soft:#fde4e1; --warn:#b45309; --warn-soft:#fef3c7; --ok:#0c7a4d; --ok-soft:#e5f6ee;
  --font:"Noto Sans Thai","Noto Sans CJK SC","Noto Sans SC","PingFang SC","Microsoft YaHei",system-ui,sans-serif; }
* { box-sizing: border-box; }
html, body { margin:0; padding:0; background:var(--bg); color:var(--ink); font-family:var(--font); -webkit-font-smoothing:antialiased; font-size:15px; }
button, input, select, textarea { font-family: var(--font); font-size: 16px; }
.wrap { max-width: 520px; margin: 0 auto; min-height: 100vh; display:flex; flex-direction:column; }
.wide .wrap { max-width: 980px; }
header.appbar { background: var(--brand); color:#fff; padding: 14px 16px 10px; position: sticky; top:0; z-index:5; }
header.appbar h1 { margin:0; font-size: 18px; font-weight: 700; line-height:1.3; display:flex; align-items:center; gap:10px; }
header.appbar h1 img { width: 34px; height: 34px; border-radius: 8px; background:#fff; }
header.appbar .sub { margin-top: 3px; font-size: 13px; opacity: .93; line-height:1.4; }
main { flex:1; padding: 10px 12px 28px; display:flex; flex-direction:column; gap:10px; }
.card { background: var(--paper); border:1px solid var(--line); border-radius: 12px; padding: 12px; }
.card h2 { margin: 0 0 8px; font-size: 15px; font-weight: 700; }
.label { display:block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 6px; }
.req { color: var(--danger); }
.field { width:100%; min-height: 44px; border:1px solid var(--line); border-radius: 10px; background:#fff; padding: 8px 12px; color: var(--ink); }
textarea.field { min-height: 70px; resize: vertical; }
.field:focus { outline: 2px solid var(--brand-accent); border-color: var(--brand); }
.field.err { border-color: var(--danger); background: var(--danger-soft); }
.errmsg { color: var(--danger); font-size: 13px; font-weight: 600; margin-top: 5px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 5px; line-height:1.45; }
.grid3 { display:grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid2 { display:grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.total { margin-top: 8px; font-weight: 700; color: var(--brand); font-size: 17px; }
.btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height: 46px; padding: 0 16px; border-radius: 10px; border:1px solid var(--line);
  background:#fff; color: var(--ink); font-weight: 700; cursor: pointer; text-decoration:none; }
.btn.primary { background: var(--brand); color:#fff; border-color: var(--brand); width:100%; font-size: 17px; }
.btn.line { background:#06C755; color:#fff; border-color:#06C755; }
.btn.small { min-height: 34px; font-size: 14px; padding: 0 10px; }
.btn:disabled { opacity: .55; cursor: default; }
.row { display:flex; gap: 8px; flex-wrap: wrap; }
.row > .btn { flex: 1; }
.shopchip { display:flex; align-items:center; gap:8px; background: var(--brand-soft); border:1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-weight:700; }
.dot { width:10px; height:10px; border-radius:50%; background: var(--brand); flex-shrink:0; }
.banner { border-radius: 10px; padding: 10px 12px; font-size: 14px; font-weight: 600; line-height:1.5; }
.banner.warn { background: var(--warn-soft); color: #7a3b05; border:1px solid #f3d38a; }
.banner.err { background: var(--danger-soft); color: var(--danger); border:1px solid #f5b5ad; }
.banner.ok { background: var(--ok-soft); color: var(--ok); border:1px solid #a9dcc3; }
.badge { display:inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.edit { background: var(--warn-soft); color: #92400e; }
.badge.late { background: #ffe8d6; color: #9a3412; }
.badge.over { background: var(--danger-soft); color: var(--danger); }
.badge.wait { background: #eef2f7; color: #475467; }
.badge.off { background: #f2f4f7; color: #667085; }
.photo-prev { margin-top: 8px; border-radius: 10px; overflow:hidden; border:1px solid var(--line); max-height: 320px; display:flex; justify-content:center; background:#f6f6f6; }
.photo-prev img { max-width:100%; max-height: 320px; object-fit: contain; display:block; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); display:flex; align-items:flex-end; justify-content:center; z-index: 50; }
.modal { background:#fff; width: 100%; max-width: 560px; max-height: 92vh; overflow:auto; border-radius: 16px 16px 0 0; padding: 16px; }
@media (min-width: 700px) { .modal-bg { align-items: center; } .modal { border-radius: 16px; } }
.modal h3 { margin: 0 0 10px; font-size: 17px; }
pre.summary { white-space: pre-wrap; font-family: var(--font); background: var(--brand-soft); border:1px solid var(--line); border-radius:10px; padding:10px 12px; font-size: 14px; line-height:1.6; margin: 0 0 10px; }
table { width:100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align:left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 700; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.click { cursor: pointer; } tr.click:hover { background: #fafafa; }
.muted { color: var(--muted); font-size: 13px; }
.toast { position: fixed; left:50%; bottom: 24px; transform: translateX(-50%); background:#122016; color:#fff; padding: 10px 16px; border-radius: 10px; font-size:14px; z-index: 60; max-width: 90vw; }
.center { text-align:center; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
