/* CELESTIA — sale-status control panel (light CI: white paper, midnight ink, rose-gold accents) */
/* root class .sp-panel (not .sp: the menu's star sparkles use .sp) */
.sp-panel { --ink: #1A1F3D; --ink2: #5C6282; --mute: #8B90AA; --rose: #C48E77; --rose2: #D9A58F; --hair: rgba(26, 31, 61, .1);
  --av: #3F8F6B; --hold: #4B5563; --sold: #DC2626;
  display: flex; flex-direction: column; color: var(--ink); font-family: Jost, 'Noto Sans Thai', sans-serif; background: #FFFFFF; }
.sp-panel button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sp-head { display: flex; align-items: flex-start; gap: 24px; padding: 34px 40px 22px; border-bottom: 1px solid var(--hair);
  background: linear-gradient(180deg, #FBF8F6 0%, #FFFFFF 100%); }
.sp-head > div:first-child { flex: 1; }
.sp-eye { display: flex; align-items: center; gap: 12px; font-size: 12px; font-weight: 500; letter-spacing: .4em; color: var(--rose); }
.sp-eye i { width: 34px; height: 1px; background: var(--rose); }
.sp-head h2 { margin: 12px 0 0; font-family: 'Cormorant Garamond', serif; font-weight: 300; font-size: 46px; line-height: 1; letter-spacing: .02em; }
.sp-head h2 em { color: var(--rose); }
.sp-head p { margin: 8px 0 0; font-family: 'Noto Sans Thai', sans-serif; font-weight: 300; font-size: 14px; color: var(--ink2); }
.sp-conn { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; max-width: 300px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--hair); background: #FFF; }
.sp-conn i { grid-row: span 2; width: 10px; height: 10px; border-radius: 99px; background: var(--mute); }
.sp-conn b { font-size: 12px; font-weight: 500; letter-spacing: .3em; }
.sp-conn small { font-family: 'Noto Sans Thai', sans-serif; font-size: 12px; font-weight: 300; color: var(--ink2); line-height: 1.45; }
.sp-conn.m-online i { background: #2FA36B; box-shadow: 0 0 0 4px rgba(47, 163, 107, .18); animation: sp-pulse 2s ease-out infinite; }
.sp-conn.m-offline i { background: #E08A2E; box-shadow: 0 0 0 4px rgba(224, 138, 46, .2); }
.sp-conn.m-connecting i { background: var(--rose2); animation: sp-pulse 1s ease-out infinite; }
.sp-conn.m-local i { background: var(--rose); }
@keyframes sp-pulse { 0% { box-shadow: 0 0 0 0 rgba(47, 163, 107, .45); } 100% { box-shadow: 0 0 0 10px rgba(47, 163, 107, 0); } }
.sp-x { flex: none; width: 48px; height: 48px; border-radius: 99px; border: 1px solid var(--hair); background: #FFF; display: flex; align-items: center; justify-content: center; }
.sp-note { margin: 16px 40px 0; padding: 12px 16px; border-radius: 12px; background: #F6F3F1; font-family: 'Noto Sans Thai', sans-serif; font-size: 14px; font-weight: 300; line-height: 1.6; color: var(--ink2); }
.sp-note.warn { background: #FFF4E6; color: #7A4A12; }
.sp-seen { background: #EEF8F2; color: #2B5E46; }
.sp-seen b.ok { color: #2F8F68; }
.sp-seen u { text-decoration: none; font-weight: 500; }
.sp-note b { font-family: Jost, sans-serif; font-weight: 500; letter-spacing: .2em; font-size: 12px; margin-right: 8px; }
.sp-note button { margin-left: 8px; padding: 4px 12px; border-radius: 99px; border: 1px solid currentColor; background: none; font-size: 12px; }
.sp-note .sp-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sp-note .sp-btns button { margin: 0; height: 34px; padding: 0 16px; }
.sp-note .sp-btns button.pri { border-color: var(--ink); background: var(--ink); color: #F2EEF6; }
.sp-note button:disabled { opacity: .4; cursor: default; }
.sp-note.ask { border: 1px solid rgba(196, 142, 119, .45); background: #FFFBF8; color: var(--ink); }
/* may this device change the status (a status link from the Sales Console) */
.sp-acc { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 18px 40px 0; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--hair); background: #FFF;
  font-family: 'Noto Sans Thai', sans-serif; font-size: 13px; font-weight: 300; line-height: 1.55; color: var(--ink2); }
.sp-acc > i { flex: none; width: 10px; height: 10px; border-radius: 99px; background: var(--mute); }
.sp-acc > span { flex: 1; min-width: 220px; }
.sp-acc b { font-weight: 500; color: var(--ink); margin-right: 6px; }
.sp-acc.ok { border-color: rgba(47, 163, 107, .35); background: #F3FAF6; }
.sp-acc.ok > i { background: #2FA36B; }
.sp-acc.ro { border-color: rgba(196, 142, 119, .45); background: #FFFBF8; }
.sp-acc.ro > i { background: var(--rose); }
.sp-acc.bad { border-color: rgba(220, 38, 38, .35); background: #FEF4F4; }
.sp-acc.bad > i { background: var(--sold); }
.sp-acc > button { padding: 6px 14px; border-radius: 99px; border: 1px solid var(--hair); background: #FFF; font-size: 12px; }
.sp-paste { display: flex; gap: 8px; flex: 1 1 100%; }
.sp-paste input { flex: 1; min-width: 0; height: 40px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--hair); background: #FFF; font: 16px Jost, 'Noto Sans Thai', sans-serif; color: var(--ink); }
.sp-paste button { flex: none; height: 40px; padding: 0 18px; border-radius: 99px; border: 0; background: var(--ink); color: #FFF; font-size: 13px; }
.sp-paste button:disabled { opacity: .5; }
/* this device's offline switch */
.sp-dev { display: flex; align-items: center; gap: 18px; margin: 18px 40px 0; padding: 14px 16px 14px 20px; border-radius: 14px; border: 1px solid var(--hair); background: #FFF; transition: background .3s, border-color .3s; }
.sp-dev .tx { flex: 1; }
.sp-dev b { display: block; font-size: 12px; font-weight: 500; letter-spacing: .3em; }
.sp-dev b span { margin-left: 10px; font-family: 'Noto Sans Thai', sans-serif; font-size: 13px; letter-spacing: 0; color: var(--ink2); }
.sp-dev small { display: block; margin-top: 4px; font-family: 'Noto Sans Thai', sans-serif; font-size: 13px; font-weight: 300; line-height: 1.5; color: var(--ink2); }
.sp-dev.on { border-color: rgba(224, 138, 46, .5); background: #FFF8EF; }
.sp-dev.na { opacity: .6; }
.sp-sw { flex: none; position: relative; width: 64px; height: 36px; border-radius: 99px; border: 0; background: #D9DAE2; transition: background .3s; }
.sp-sw i { position: absolute; top: 4px; left: 4px; width: 28px; height: 28px; border-radius: 99px; background: #FFF; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .3s; }
.sp-dev.on .sp-sw { background: #E08A2E; }
.sp-dev.on .sp-sw i { transform: translateX(28px); }
.sp-sw:disabled { cursor: default; }
.sp-auth { margin: 16px 40px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(196, 142, 119, .45); background: #FFFBF8; }
.sp-auth b { width: 100%; font-family: 'Noto Sans Thai', sans-serif; font-weight: 500; font-size: 14px; color: var(--rose); }
.sp-auth input { flex: 1; min-width: 160px; height: 42px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--hair); font: 15px Jost, 'Noto Sans Thai', sans-serif; color: var(--ink); }
.sp-auth button { height: 42px; padding: 0 22px; border-radius: 99px; border: 0; background: var(--ink); color: #FFF; font-size: 12px; font-weight: 500; letter-spacing: .3em; }
.sp-err { width: 100%; font-size: 13px; color: var(--sold); }
.sp-user { margin: 12px 40px 0; font-family: 'Noto Sans Thai', sans-serif; font-size: 13px; color: var(--ink2); }
.sp-user button { margin-left: 8px; border: 0; background: none; color: var(--rose); text-decoration: underline; }
/* tabs stay on one line (they scroll sideways when the window is narrow) */
.sp-tabs { display: flex; gap: 2px; max-width: calc(100% - 80px); margin: 18px 40px 0; padding: 5px; border-radius: 999px; border: 1px solid var(--hair); background: #FAF8F7; align-self: flex-start;
  overflow-x: auto; scrollbar-width: none; }
.sp-tabs::-webkit-scrollbar { display: none; }
.sp-tabs button { flex: none; height: 42px; padding: 0 16px; border: 0; border-radius: 999px; background: none; font-size: 11px; font-weight: 500; letter-spacing: .22em; color: var(--ink2); white-space: nowrap; }
.sp-tabs button span { margin-left: 8px; font-family: 'Noto Sans Thai', sans-serif; font-weight: 300; font-size: 13px; letter-spacing: 0; }
.sp-tabs button.on { background: var(--ink); color: #FFF; box-shadow: 0 6px 18px rgba(26, 31, 61, .2); }
.sp-body { flex: 1; min-height: 0; overflow: auto; padding: 18px 40px 24px; -webkit-overflow-scrolling: touch; }
.sp-floors { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.sp-floors button { position: relative; min-width: 54px; height: 44px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--hair); background: #FFF; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.sp-floors button b { font-size: 15px; font-weight: 500; }
.sp-floors button i { font-style: normal; font-size: 10px; color: var(--sold); }
.sp-floors button.hid b { color: var(--mute); text-decoration: line-through; }   /* floor hidden (DISPLAY) */
.sp-floors button.on { border-color: var(--rose); background: #FFF7F3; box-shadow: 0 0 0 3px rgba(217, 165, 143, .25); }
.sp-rows { display: flex; flex-direction: column; gap: 10px; }
.sp-row { display: flex; align-items: center; gap: 20px; padding: 14px 18px; border-radius: 16px; border: 1px solid var(--hair); background: #FFF; }
.sp-id { flex: 1; min-width: 0; }
.sp-id b { display: block; font-family: 'Cormorant Garamond', serif; font-size: 28px; font-weight: 400; letter-spacing: .06em; }
.sp-id b small { font-size: 18px; color: var(--mute); }
.sp-id span { display: flex; align-items: center; gap: 8px; margin-top: 2px; font-family: 'Noto Sans Thai', sans-serif; font-size: 13px; font-weight: 300; color: var(--ink2); }
.sp-id span i { width: 10px; height: 10px; border-radius: 3px; }
.sp-seg { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: #F4F2F1; }
.sp-seg button { min-width: 96px; height: 52px; padding: 0 12px; border: 0; border-radius: 11px; background: none; display: grid; grid-template-columns: auto auto; align-items: center; justify-content: center; column-gap: 8px; color: var(--ink2); }
.sp-seg button i { grid-row: span 2; width: 12px; height: 12px; border-radius: 99px; border: 2px solid currentColor; }
.sp-seg button b { font-family: 'Noto Sans Thai', sans-serif; font-weight: 500; font-size: 14px; text-align: left; }
.sp-seg button small { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; text-align: left; opacity: .7; }
.sp-seg button.on { background: #FFF; box-shadow: 0 4px 14px rgba(26, 31, 61, .12); }
.sp-seg button.s-available.on { color: var(--av); } .sp-seg button.s-available.on i { background: var(--av); }
.sp-seg button.s-hold.on { color: var(--hold); } .sp-seg button.s-hold.on i { background: var(--hold); }
.sp-seg button.s-sold.on { color: var(--sold); } .sp-seg button.s-sold.on i { background: var(--sold); }
.sp-seg button.wait { opacity: .5; }
.sp-seg button:disabled { cursor: not-allowed; opacity: .45; }
.sp-phases { display: flex; flex-direction: column; gap: 12px; }
.sp-phase { display: flex; align-items: center; gap: 22px; padding: 20px 24px; border-radius: 18px; border: 1px solid var(--hair); background: #FFF; text-align: left; }
.sp-phase b { display: block; font-size: 15px; font-weight: 500; letter-spacing: .3em; }
.sp-phase em { display: block; margin-top: 4px; font-family: 'Noto Sans Thai', sans-serif; font-style: normal; font-size: 16px; }
.sp-phase small { display: block; margin-top: 6px; font-family: 'Noto Sans Thai', sans-serif; font-size: 13px; font-weight: 300; color: var(--ink2); }
.sp-phase .sw { flex: none; position: relative; width: 64px; height: 36px; border-radius: 99px; background: #D9DAE2; transition: background .3s; }
.sp-phase .sw i { position: absolute; top: 4px; left: 4px; width: 28px; height: 28px; border-radius: 99px; background: #FFF; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .3s; }
.sp-phase.on { border-color: rgba(196, 142, 119, .5); background: #FFFBF8; }
.sp-phase.on .sw { background: var(--rose); }
.sp-phase.on .sw i { transform: translateX(28px); }
.sp-link p { margin: 0 0 14px; font-family: 'Noto Sans Thai', sans-serif; font-size: 15px; font-weight: 300; line-height: 1.7; color: var(--ink2); }
.sp-url { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--hair); }
.sp-url code { flex: 1; font-size: 14px; word-break: break-all; }
.sp-url button { height: 40px; padding: 0 18px; border-radius: 99px; border: 0; background: var(--ink); color: #FFF; font-size: 12px; letter-spacing: .3em; }
/* DISPLAY tab: on / off chips (floors, unit plans) */
.sp-tgs { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-tgs.wide .sp-tg { min-width: 200px; justify-content: flex-start; }
.sp-tg { min-width: 62px; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px dashed rgba(26, 31, 61, .25); background: #F6F4F2; display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 14px; font-weight: 500; color: var(--mute); text-decoration: line-through; transition: background .25s, border-color .25s, color .25s; }
.sp-tg i { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid currentColor; }
.sp-tg.on { border: 1px solid rgba(47, 143, 104, .35); background: #EEF8F2; color: var(--ink); text-decoration: none; }
.sp-tg.on i { border-color: var(--av); background: var(--av) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5 L10 17 L19 7' fill='none' stroke='white' stroke-width='3'/%3E%3C/svg%3E") center / 11px no-repeat; }
.sp-tg:disabled { cursor: not-allowed; opacity: .5; }
.sp-hint { margin: 10px 0 0; font-family: 'Noto Sans Thai', sans-serif; font-size: 12px; font-weight: 300; color: var(--mute); }
.sp-phases + .sp-h { margin-top: 24px; }
.sp-hint + .sp-h { margin-top: 26px; }

/* MATRIX tab (status.html): unit-matrix.css cells + a status popover */
.sp-h { margin: 6px 0 10px; font-size: 11px; font-weight: 500; letter-spacing: .32em; color: var(--rose); }
.sp-h small { margin-left: 10px; font-family: 'Noto Sans Thai', sans-serif; font-size: 13px; font-weight: 300; letter-spacing: 0; color: var(--mute); }
.sp-body .um-villas + .sp-h { margin-top: 26px; }
.um-pop { position: fixed; z-index: 60; width: 380px; max-width: calc(100vw - 24px); box-sizing: border-box; padding: 16px 16px 18px; border-radius: 18px; background: #FFF;
  box-shadow: 0 24px 60px rgba(10, 13, 38, .22), 0 0 0 1px rgba(26, 31, 61, .08); animation: sp-pop .25s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes sp-pop { from { opacity: 0; transform: translateY(8px) scale(.97); } }
.um-pop header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.um-pop header > div { flex: 1; min-width: 0; }
.um-pop header b { display: block; font-family: 'Cormorant Garamond', serif; font-size: 30px; font-weight: 400; line-height: 1; letter-spacing: .06em; }
.um-pop header b small { font-size: 18px; color: var(--mute); }
.um-pop header span { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-family: Jost, 'Noto Sans Thai', sans-serif; font-size: 12px; color: var(--ink2); }
.um-pop header span i { flex: none; width: 10px; height: 10px; border-radius: 3px; }
.um-pop .sp-x { width: 38px; height: 38px; }
.um-lbl { margin-bottom: 8px; font-size: 10px; font-weight: 500; letter-spacing: .3em; color: var(--mute); }
.um-lbl small { margin-left: 8px; font-family: 'Noto Sans Thai', sans-serif; font-size: 12px; font-weight: 300; letter-spacing: 0; }
.um-pop .sp-seg button { flex: 1; min-width: 0; }
.sp-foot { display: flex; flex-wrap: wrap; gap: 22px; padding: 16px 40px 22px; border-top: 1px solid var(--hair); font-family: 'Noto Sans Thai', sans-serif; font-size: 13px; color: var(--ink2); }
.sp-foot span { display: flex; align-items: center; gap: 8px; }
.sp-foot i { width: 10px; height: 10px; border-radius: 99px; }
.sp-foot .c-available i { background: var(--av); } .sp-foot .c-hold i { background: var(--hold); } .sp-foot .c-sold i { background: var(--sold); }
@media (max-width: 720px) {
  .sp-head { flex-wrap: wrap; padding: 24px 18px 16px; } .sp-head h2 { font-size: 36px; }
  .sp-conn { max-width: none; width: 100%; order: 3; }
  .sp-note, .sp-auth, .sp-user, .sp-dev, .sp-acc { margin-left: 18px; margin-right: 18px; }
  .sp-tabs { margin: 14px 18px 0; align-self: stretch; overflow-x: auto; }
  .sp-tabs button { padding: 0 14px; letter-spacing: .14em; } .sp-tabs button span { display: none; }
  .sp-body { padding: 14px 18px 20px; } .sp-foot { padding: 14px 18px 18px; gap: 14px; }
  .sp-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .sp-seg button { min-width: 0; flex: 1; }
  /* phone: the matrix keeps its 4 columns, cells show the unit number and the status colour only */
  .sp-mx .um-grid { grid-template-columns: 40px repeat(var(--cols, 4), minmax(0, 1fr)); gap: 3px; }
  .sp-mx .um-fl { padding-right: 6px; font-size: 17px; }
  .sp-mx .um-fl, .sp-mx .um-u { height: 40px; }
  .sp-mx .um-u { padding: 0 3px 0 8px; border-radius: 7px; }
  .sp-mx .um-u::before { width: 4px; }
  .sp-mx .um-u b { font-size: 14px; letter-spacing: .02em; }
  .sp-mx .um-u b small, .sp-mx .um-u span, .sp-mx .um-u em { display: none; }
  .sp-mx .um-h { letter-spacing: .1em; }
  .sp-body .um-villas .um-u span { display: none; }
}
