[hidden] { display: none !important; }
/* SiteInspect — MonzWorks look (IBM Plex Sans Thai, orange accent, dark bar) on a light work area: easy to read on site, in sun */
:root {
  --bg: #f3f4f6; --panel: #fff; --panel-2: #f8f9fb; --ink: #14181f; --muted: #5f6b7a; --line: #e1e5ea; --line-2: #cfd5dc;
  --accent: #ff7a2f; --accent-ink: #14100c; --accent-soft: #fff1e8; --dark: #0b0f15; --dark-2: #151b24;
  --open: #e5484d; --progress: #f5a623; --closed: #30a46c;
  --r: 12px; --shadow: 0 1px 2px #0000000d, 0 4px 14px #0000000f;
  --thai: 'IBM Plex Sans Thai', 'Leelawadee UI', 'Segoe UI', Tahoma, 'Noto Sans Thai', sans-serif;
  --display: 'Space Grotesk', 'IBM Plex Sans Thai', system-ui, sans-serif;
  font-family: var(--thai); font-size: 15px; color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body { display: flex; flex-direction: column; overflow: hidden; }
body.editing > header, body.editing > nav, body.editing > main, body.editing > .home { display: none !important; }
body.viewer .ed { display: none !important; }
button, select, input, textarea, .btn { font: inherit; color: inherit; }
button, .btn { background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 14px; min-height: 38px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; white-space: nowrap; touch-action: manipulation; font-weight: 500; transition: background .12s, border-color .12s; }
button:hover, .btn:hover { border-color: #aab3bf; }
button:disabled { opacity: .4; cursor: default; }
.primary { background: var(--accent) !important; color: var(--accent-ink) !important; border-color: var(--accent) !important; font-weight: 700; }
.primary:hover { filter: brightness(1.05); }
.big { min-height: 48px; font-size: 16px; }
.danger { color: #c62828; }
button.ghost { border-color: transparent; background: transparent; }
button.on { background: var(--accent-soft); border-color: var(--accent); }
select, input[type=text], input[type=search], input[type=number], input[type=password], input:not([type]), textarea { border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; background: #fff; max-width: 100%; min-height: 38px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #ffb98f; outline-offset: 0; border-color: var(--accent); }
textarea { width: 100%; resize: vertical; }
label { display: block; margin: 6px 0; }
label > input:not([type=checkbox]):not([type=radio]):not([type=range]), label > select, label > textarea { display: block; width: 100%; margin-top: 3px; }
label.chk, label.chk > input { display: inline-flex; width: auto; align-items: center; gap: 4px; margin: 0 8px 0 0; }
.grow { flex: 1; } .muted { color: var(--muted); } .small { font-size: 12.5px; }
.pad { padding: 16px; overflow: auto; height: 100%; max-width: 920px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 6px 0; }
.sticky { position: sticky; top: 0; background: var(--bg); padding: 10px 14px; margin: 0; z-index: 2; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin: 10px 0; box-shadow: var(--shadow); }
.okc { border-color: var(--closed); background: #effaf3; } .warnc { border-color: var(--progress); background: #fff8eb; }
.warn { color: #b45309; } .ok { color: #1e7d4a; }
code { background: #eef1f5; padding: 1px 5px; border-radius: 4px; }
h2, h3 { font-family: var(--display); letter-spacing: -.01em; }

/* the bar */
.bar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; padding-top: max(8px, env(safe-area-inset-top)); background: var(--dark); color: #e8edf2; border-bottom: 1px solid #1f2a37; }
.brand { display: inline-flex; align-items: center; gap: 9px; background: none !important; border: 0 !important; padding: 2px 4px; color: #fff; font-family: var(--display); font-weight: 700; font-size: 18px; }
.logo { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font: 700 13px var(--display); }
.logo.big { width: 56px; height: 56px; border-radius: 14px; font-size: 22px; }
.crumb { color: #b4c0cd; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.crumb .sep { color: #4b5866; margin-right: 6px; }
.bar select { background: var(--dark-2); color: #fff; border-color: #2a3646; max-width: 40vw; min-height: 34px; }
.who { color: #9aa7b5; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.who button { color: #e8edf2; min-height: 30px; padding: 4px 8px; }
.banner { background: #fff1c2; padding: 6px 14px; font-size: 13px; }

/* tabs: on top here, a bottom bar on a phone */
.tabs { display: flex; gap: 2px; background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; padding: 0 8px; }
.tabs button { border: none; border-radius: 0; padding: 11px 14px; min-height: 0; background: transparent; border-bottom: 3px solid transparent; color: var(--muted); gap: 6px; }
.tabs button i { font-style: normal; }
.tabs button.on { border-bottom-color: var(--accent); color: var(--ink); font-weight: 700; background: transparent; }
.tabs .n { background: var(--open); color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; margin-left: 4px; font-weight: 700; }
.tabs .n:empty { display: none; }
main { flex: 1; min-height: 0; position: relative; }
main > section { height: 100%; overflow: auto; }

/* login */
.center { flex: 1; display: grid; place-items: center; padding: 20px; overflow: auto; background: radial-gradient(circle at 30% 0%, #1a2330 0, var(--dark) 60%); }
.loginbox { width: min(400px, 100%); background: #fff; border-radius: 18px; padding: 28px 24px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 60px #0008; text-align: center; align-items: stretch; }
.loginbox .logo { align-self: center; }
.loginbox h2 { margin: 0; }
.loginbox p { margin: 0; }

/* the projects */
.home { flex: 1; overflow: auto; padding: 18px 16px 40px; }
.homehead { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; max-width: 1200px; margin: 0 auto 14px; }
.homehead h2 { margin: 0; font-size: 26px; }
.homehead input { width: 220px; }
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; max-width: 1200px; margin: 0 auto; }
.pcard { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; padding: 0; overflow: hidden; border-radius: 14px; border: 1px solid var(--line); background: #fff; text-align: left; box-shadow: var(--shadow); white-space: normal; min-height: 0; }
.pcard:hover { border-color: var(--accent); transform: translateY(-1px); }
.pcard .cover { aspect-ratio: 16 / 9; background: linear-gradient(135deg, #1a2330, #2a3646); display: grid; place-items: center; font-size: 34px; overflow: hidden; }
.pcard .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.pc-name { font-weight: 700; font-size: 16px; }
.pc-meta { display: flex; gap: 10px; font-size: 13px; color: var(--muted); }
.pc-meta .open { color: var(--open); font-weight: 700; }
.pcard.new { align-items: center; justify-content: center; min-height: 200px; border: 2px dashed var(--line-2); background: transparent; box-shadow: none; color: var(--muted); font-weight: 600; gap: 4px; }
.pcard.new span { font-size: 36px; color: var(--accent); line-height: 1; }

/* plan */
.split { display: flex; height: 100%; }
.side { width: 300px; padding: 12px; overflow: auto; border-right: 1px solid var(--line); background: var(--panel-2); }
.src { display: flex; gap: 8px; align-items: center; padding: 8px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; margin: 4px 0; }
.src.on { border-color: var(--accent); background: var(--accent-soft); }
.src .ic { font-size: 20px; }
.planview { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ptools { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px 8px; align-items: center; background: #fff; border-bottom: 1px solid var(--line); }
.ptools label { display: inline-flex; gap: 4px; align-items: center; margin: 0; }
.pcwrap { flex: 1; position: relative; min-height: 300px; }
.plancv, .pcanvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
.hint { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); background: #000b; color: #fff; padding: 5px 12px; border-radius: 14px; font-size: 13px; pointer-events: none; max-width: 92%; text-align: center; }
.hint:empty { display: none; }

/* photos */
.actions { display: grid; grid-template-columns: repeat(3, minmax(0, 220px)); gap: 10px; padding: 14px 14px 4px; }
.act { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; font-weight: 600; cursor: pointer; margin: 0; box-shadow: var(--shadow); }
.act i { font-style: normal; font-size: 20px; }
.row.sub { padding: 2px 14px; }
.seg { display: inline-flex; background: #e7eaee; border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; min-height: 30px; padding: 4px 10px; font-size: 13px; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px #0002; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; padding: 10px 14px 30px; }
.thumb { position: relative; background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); cursor: pointer; box-shadow: var(--shadow); }
.thumb:hover { border-color: var(--accent); }
.thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: #ddd; }
.thumb .p360 { position: absolute; left: 8px; top: 8px; background: #000c; color: #fff; font: 700 11px var(--display); padding: 2px 7px; border-radius: 8px; }
.thumb .cap { padding: 6px 10px 8px; font-size: 12.5px; }
.badges { position: absolute; top: 6px; right: 6px; display: flex; gap: 3px; }
.badges span { background: #fffd; border-radius: 10px; padding: 0 6px; font-size: 13px; }
.badges .cnt { background: var(--open); color: #fff; font-weight: 700; }
.empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 50px 20px; text-align: center; }
.empty > div { font-size: 44px; opacity: .5; }

/* issues */
#issueList { padding: 4px 14px 30px; }
.irow { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; margin: 8px 0; cursor: pointer; box-shadow: var(--shadow); }
.irow:hover { border-color: var(--accent); }
.irow img, .irow .noimg { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; background: #ddd; flex: none; display: grid; place-items: center; color: #777; }
.irow select { flex: none; border-width: 2px; font-weight: 600; }
.st-open { border-color: var(--open); } .st-progress { border-color: var(--progress); } .st-closed { border-color: var(--closed); }
.exps { display: flex; flex-direction: column; gap: 8px; max-width: 480px; }
.exps .btn { justify-content: flex-start; min-height: 46px; }
.help table { border-collapse: collapse; width: 100%; margin: 8px 0 16px; background: #fff; }
.help td, .help th { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; font-size: 14px; }
.help .yes { color: #1e7d4a; } .help .no { color: #c62828; }

/* the photo editor */
.editor { position: fixed; inset: 0; display: flex; flex-direction: column; background: #111; color: #eee; z-index: 50; }
.editor button, .editor .btn { background: #2b2e34; border-color: #3a3e45; color: #eee; }
.editor button.on { background: #1f6feb; border-color: #1f6feb; color: #fff; }
.editor select, .editor input, .editor textarea { background: #1d1f23; color: #eee; border-color: #3a3e45; }
.etop { display: flex; gap: 6px; align-items: center; padding: 6px; padding-top: max(6px, env(safe-area-inset-top)); background: #1d1f23; }
.modes { display: flex; gap: 4px; overflow-x: auto; }
.ebody { flex: 1; display: flex; min-height: 0; }
.cwrap { flex: 1; position: relative; min-width: 0; }
.pside { width: 330px; overflow: auto; padding: 10px 12px; background: #1d1f23; border-left: 1px solid #2b2e34; }
.editor.noside .pside { display: none; }
.pside h4 { margin: 10px 0 6px; }
.pside .muted { color: #9aa0a8; }
.tools { display: flex; gap: 6px; overflow-x: auto; padding: 8px; padding-bottom: max(8px, env(safe-area-inset-bottom)); background: #1d1f23; align-items: center; }
.tools .sep { width: 1px; align-self: stretch; background: #3a3e45; margin: 0 4px; }
.sw { display: inline-flex; gap: 4px; }
.swatch { width: 26px; height: 26px; padding: 0 !important; border-radius: 50% !important; border: 2px solid #555 !important; }
.swatch.on { border-color: #fff !important; outline: 2px solid #1f6feb; }
.ino { font-size: 20px; font-weight: 700; margin: 4px 0; }
.snap { width: 100%; border-radius: 6px; margin-top: 8px; }
.hist { font-size: 12px; color: #9aa0a8; margin-top: 8px; }
.mlist .mrow { display: flex; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px solid #2b2e34; }
.mlist .mrow span { flex: 1; }
.pside label.il { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pside label.il > input, .pside label.il > select { display: inline-block; width: auto; margin: 0; }
.axc { font-size: 13px; border-left: 4px solid; padding: 4px 6px; background: #26292f; border-radius: 4px; display: flex; align-items: center; justify-content: space-between; }
.caminfo { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.editor .warn { color: #ffb74d; } .editor .ok { color: #6ee7a0; }

/* AR */
.xroverlay { position: fixed; inset: 0; z-index: 100; color: #fff; font-size: 16px; pointer-events: none; }
.xroverlay button { pointer-events: auto; background: #000a; color: #fff; border-color: #fff6; padding: 10px 14px; font-size: 16px; }
.xroverlay button.on { background: #1f6feb; }
.xrtop { position: absolute; top: 0; left: 0; right: 0; padding: 12px; padding-top: max(12px, env(safe-area-inset-top)); background: linear-gradient(#000a, #0000); display: flex; flex-direction: column; gap: 2px; }
.xrbar { position: absolute; bottom: 0; left: 0; right: 0; display: flex; gap: 8px; justify-content: center; padding: 14px; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
.xrlabels span { position: absolute; transform: translate(-50%, -50%); background: #ff2bd6; color: #fff; padding: 2px 8px; border-radius: 10px; font-weight: 700; font-size: 15px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1d1f23; color: #fff; padding: 9px 16px; border-radius: 20px; z-index: 200; max-width: 90vw; box-shadow: 0 6px 20px #0005; }

/* panoramas: the menu, the capture, the stitch, the 360° viewer */
.pmodal { position: fixed; inset: 0; background: #0008; z-index: 120; display: grid; place-items: center; padding: 12px; }
.pbox { background: #fff; border-radius: 12px; padding: 14px 16px; width: min(560px, 100%); max-height: 92vh; overflow: auto; box-shadow: 0 10px 40px #0006; }
.pmodes { display: flex; flex-direction: column; gap: 2px; margin: 8px 0; }
.pbox label.il { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pbox label.il > input { display: inline-block; width: auto; margin: 0; }
.ppick { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; margin: 8px 0; max-height: 40vh; overflow: auto; }
.ppick .pp { position: relative; margin: 0; }
.ppick .pp img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; display: block; }
.ppick .pp input { position: absolute; top: 4px; left: 4px; }
.pprog { height: 8px; background: #e6e8ec; border-radius: 4px; overflow: hidden; margin: 8px 0 4px; }
.pprog i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.presult { width: 100%; border-radius: 6px; margin: 8px 0; background: #222; }
.pwarns { color: #b45309; padding-left: 18px; margin: 6px 0; font-size: 13px; }
.pcap { position: fixed; inset: 0; z-index: 110; background: #000; color: #fff; overflow: hidden; touch-action: none; user-select: none; }
.pcap .psrc { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pcap .pgl { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ptop { position: absolute; top: 0; left: 0; right: 0; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); background: linear-gradient(#000b, #0000); }
.pmsg { font-size: 17px; font-weight: 600; text-shadow: 0 1px 3px #000; margin-top: 2px; }
.pwarn { background: #b45309e6; border-radius: 8px; padding: 6px 10px; margin-top: 6px; font-size: 14px; }
.pbar { position: absolute; bottom: 0; left: 0; right: 0; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); background: linear-gradient(#0000, #000b); }
.pbar button { background: #000a; color: #fff; border-color: #fff6; padding: 10px 14px; }
.pbar button.on { background: #1f6feb; }
.preticle { position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; transform: translate(-50%, -50%); pointer-events: none; }
.preticle svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.preticle .bg { fill: none; stroke: #fffa; stroke-width: 4; }
.preticle .fg { fill: none; stroke: #30a46c; stroke-width: 8; stroke-linecap: round; }
.preticle .dot { fill: #fff; }
.preticle.on .bg { stroke: #ffb020; }
.parrow { position: absolute; left: 0; top: 0; font-size: 44px; color: #ffb020; text-shadow: 0 0 6px #000; pointer-events: none; }
.pflash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.pflash.go { animation: pflash .35s ease-out; }
@keyframes pflash { from { opacity: .8; } to { opacity: 0; } }
.pview .cwrap { touch-action: none; cursor: grab; }
.ppins { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.ppin { position: absolute; transform: translate(-50%, -100%); pointer-events: auto; cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.ppin i { font-style: normal; font-weight: 700; font-size: 12px; color: #fff; background: var(--c); border: 2px solid #fff; border-radius: 50%; width: 26px; height: 26px; display: grid; place-items: center; box-shadow: 0 2px 6px #0007; position: relative; margin-bottom: 9px; }
.ppin i::after { content: ''; position: absolute; left: 50%; top: 100%; transform: translateX(-50%); border: 7px solid transparent; border-top: 10px solid #fff; margin-top: 0; }
.ppin span { order: -1; background: #000b; color: #fff; padding: 1px 6px; border-radius: 8px; font-size: 12px; margin-bottom: 4px; white-space: nowrap; display: none; }
.ppin:hover span, .ppin.on span { display: block; }
.ppin.on i { outline: 3px solid #ffd60a; }
.ptitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 30vw; }

@media (max-width: 760px) {
  .split { flex-direction: column; }
  .side { width: auto; max-height: 34vh; border-right: none; border-bottom: 1px solid var(--line); }
  .ebody { flex-direction: column; }
  .pside { width: auto; max-height: 40vh; border-left: none; border-top: 1px solid #2b2e34; }
  .bname { display: none; }
  .bar select { max-width: 34vw; }
  /* the tabs: a bottom bar for the thumb */
  body > .tabs { order: 9; position: relative; border-bottom: 0; border-top: 1px solid var(--line); padding: 0 0 env(safe-area-inset-bottom); justify-content: space-around; overflow: visible; box-shadow: 0 -4px 14px #0000000d; }
  .tabs button { flex: 1; flex-direction: column; gap: 0; padding: 7px 2px 6px; font-size: 11px; border-bottom: 0; border-top: 3px solid transparent; position: relative; }
  .tabs button i { font-size: 20px; line-height: 1.2; }
  .tabs button.on { border-top-color: var(--accent); }
  .tabs button span { display: block; white-space: nowrap; }
  .tabs .n { position: absolute; top: 3px; left: calc(50% + 6px); margin: 0; }
  .tabs [data-tab=help] { display: none; }
  .actions { grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 12px 2px; }
  .act { flex-direction: column; gap: 2px; min-height: 76px; font-size: 13px; }
  .act i { font-size: 26px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 8px 12px 24px; }
  .irow img { width: 72px; height: 54px; }
  .homehead input { width: 100%; order: 3; }
  .pcards { grid-template-columns: 1fr; }
  .pcard { flex-direction: row; }
  .pcard .cover { width: 120px; aspect-ratio: auto; flex: none; font-size: 26px; }
  .pcard.new { min-height: 70px; flex-direction: row; }
}
@media (max-width: 760px) { .bar:has(#projPick:not([hidden])) .crumb { display: none; } }
