:root {
  --navy-950: #0a2239;
  --navy-900: #0d2a46;
  --navy-800: #153b60;
  --blue: #1769d2;
  --blue-soft: #eaf3ff;
  --green: #39c872;
  --green-dark: #19874a;
  --green-soft: #e7f8ef;
  --page: #f4f7fb;
  --card: #ffffff;
  --line: #d8e1eb;
  --text: #102846;
  --muted: #657892;
  --shadow: 0 4px 14px rgba(16, 40, 70, .07);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: Inter, "Segoe UI", Arial, sans-serif; color: var(--text); background: var(--page); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 210px minmax(0, 1fr); }
.sidebar { background: linear-gradient(180deg, var(--navy-950), #0b2741 70%, #0a2239); color: white; display: flex; flex-direction: column; min-height: 100vh; }
.brand { display: flex; gap: 14px; align-items: center; padding: 24px 20px 22px; }
.brand-icon { font-size: 37px; line-height: 1; opacity: .92; }
.brand strong { display: block; font-size: 30px; letter-spacing: .02em; }
.brand span { display: block; font-size: 14px; opacity: .9; margin-top: 2px; }
.main-nav { padding: 8px 8px; display: flex; flex-direction: column; gap: 6px; }
.nav-item { width: 100%; display: flex; gap: 12px; align-items: center; border: 0; border-radius: 8px; padding: 13px 16px; color: #dce8f4; background: transparent; text-align: left; }
.nav-item span { width: 20px; text-align: center; font-size: 18px; }
.nav-item.active { background: linear-gradient(90deg, #14559b, #1b68b9); color: #fff; }
.nav-item.disabled { opacity: .48; }
.sidebar-user { margin-top: auto; padding: 18px 16px 22px; display: flex; gap: 10px; align-items: center; border-top: 1px solid rgba(255,255,255,.08); }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: #8397ac; font-weight: 800; flex: 0 0 auto; }
.sidebar-user-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sidebar-user-text strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-text span { font-size: 11px; opacity: .72; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-text a { color: #c8d8e7; font-size: 11px; text-decoration: none; margin-top: 3px; }

.app-main { min-width: 0; }
.app-header { height: 48px; background: linear-gradient(90deg, #eef3f7, #fff); border-bottom: 1px solid #e1e7ee; display: flex; justify-content: flex-end; align-items: center; padding: 0 28px; }
.header-title { font-weight: 700; font-size: 14px; }
.content { padding: 16px 20px 28px; }
.breadcrumbs { min-height: 26px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.crumb-link { border: 0; background: none; padding: 2px 0; color: #3477c7; }
.crumb-current { color: var(--text); font-weight: 700; }
.crumb-sep { color: #9baaba; font-size: 18px; }
.page-heading, .map-toolbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 16px; }
.eyebrow { font-size: 13px; color: var(--muted); }
h1 { font-size: 30px; line-height: 1.08; margin: 3px 0 0; color: #0d2747; }
.secondary-button { border: 1px solid #97bef1; background: #fff; color: #135da9; border-radius: 8px; padding: 10px 14px; font-weight: 700; }

.tower-grid { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 16px; max-width: 1060px; }
.tower-card { min-height: 130px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: var(--shadow); padding: 20px; display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 14px; text-align: left; color: var(--text); }
.tower-card:not(.unavailable):hover { border-color: #95bde7; box-shadow: 0 7px 22px rgba(16, 40, 70, .11); }
.tower-card-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 10px; background: var(--blue-soft); color: var(--blue); font-size: 28px; }
.tower-card-copy strong { display: block; font-size: 18px; }
.tower-card-copy small { display: block; color: var(--muted); font-size: 12px; margin-top: 6px; }
.tower-arrow { font-size: 32px; color: #4b8bd2; }
.tower-card.unavailable { opacity: .52; box-shadow: none; }

.floor-card-grid { display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 12px; }
.floor-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 16px; display: grid; grid-template-columns: 1fr auto 18px; gap: 12px; align-items: center; text-align: left; color: var(--text); }
.floor-card:hover { border-color: #8eb9ea; }
.floor-number { font-size: 21px; font-weight: 800; }
.floor-word { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.floor-card-status { text-align: right; }
.floor-card-status strong { display: block; font-size: 13px; }
.floor-card-status span { color: var(--muted); font-size: 11px; }
.floor-arrow { font-size: 24px; color: #5d94d2; }

.dashboard-grid { display: grid; grid-template-columns: 190px minmax(540px, 1fr) minmax(260px, 330px); gap: 14px; align-items: start; }
.selector-panel, .map-card, .info-card { background: var(--card); border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 2px 6px rgba(16,40,70,.035); }
.selector-panel { overflow: hidden; }
.panel-title, .info-card-header { padding: 10px 12px; font-weight: 800; background: #f7f9fc; border-bottom: 1px solid var(--line); }
.floor-list-title { border-top: 1px solid var(--line); }
.compact-list { display: flex; flex-direction: column; }
.compact-item { display: flex; justify-content: space-between; gap: 8px; align-items: center; border: 0; border-bottom: 1px solid #edf1f5; background: #fff; color: #193858; min-height: 36px; padding: 7px 12px; text-align: left; font-size: 13px; }
.compact-item:last-child { border-bottom: 0; }
.compact-item.active { background: #dcecff; color: #0d61b6; font-weight: 800; }
.compact-item:disabled { opacity: .45; }
.compact-item small { color: #6383a4; font-size: 10px; }
.floor-list { max-height: 580px; overflow: auto; }

.map-card { overflow: hidden; min-width: 0; }
.map-card-header { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.map-card-header > div:first-child { min-width: 0; }
.map-card-header strong { display: block; font-size: 16px; }
.map-card-header span { color: var(--muted); font-size: 11px; }
.status-summary { display: flex; align-items: center; gap: 15px; white-space: nowrap; font-size: 11px; }
.status-summary span { display: inline-flex; align-items: center; gap: 5px; color: var(--text); }
.status-summary strong { padding-left: 10px; border-left: 1px solid var(--line); font-size: 16px; }
.legend-dot { width: 15px; height: 15px; border-radius: 50%; display: inline-block; }
.complete-dot { background: var(--green); border: 1px solid var(--green-dark); }
.incomplete-dot { background: white; border: 1px solid #536375; }
.map-frame { position: relative; width: 100%; background: white; overflow: hidden; touch-action: manipulation; }
.map-frame img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.hotspot-layer { position: absolute; inset: 0; }

.window-hotspot {
  position: absolute;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  border: 0;
  background: transparent;
  padding: 0;
  z-index: 3;
  cursor: pointer;
  overflow: visible;
}
.window-label {
  position: absolute;
  display: inline-block;
  min-width: 16px;
  padding: 1px 2px;
  border-radius: 3px;
  font-weight: 800;
  font-size: 10px;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 1px 0 rgba(255,255,255,.95), 1px 0 0 rgba(255,255,255,.95), -1px 0 0 rgba(255,255,255,.95), 0 -1px 0 rgba(255,255,255,.95);
  transition: color .12s ease, background .12s ease, box-shadow .12s ease, transform .12s ease;
}
/* Labels sit just outside the facade while the invisible 44px button remains
   centered on the exact tick mark. */
.window-hotspot.side-top .window-label { left: 50%; top: 1px; transform: translate(-50%, -100%); }
.window-hotspot.side-bottom .window-label { left: 50%; bottom: 1px; transform: translate(-50%, 100%); }
.window-hotspot.side-left .window-label { left: 1px; top: 50%; transform: translate(-100%, -50%); }
.window-hotspot.side-right .window-label { right: 1px; top: 50%; transform: translate(100%, -50%); }
.window-hotspot.side-diag-left .window-label { left: 6px; top: 6px; transform: translate(-100%, -100%); }
.window-hotspot.side-diag-right .window-label { right: 6px; bottom: 6px; transform: translate(100%, 100%); }

.window-hotspot.complete .window-label { color: #189653; }
.window-hotspot.incomplete .window-label { color: #24384d; }
.window-hotspot.selected .window-label {
  color: #0d61b6;
  background: #eaf3ff;
  box-shadow: 0 0 0 2px rgba(23,105,210,.28);
}
@media (hover: hover) and (pointer: fine) {
  .window-hotspot:hover .window-label { background: #f2f7fc; }
}
.window-hotspot:focus-visible { outline: none; }
.window-hotspot:focus-visible .window-label { box-shadow: 0 0 0 2px rgba(23,105,210,.45); }

.right-rail { display: flex; flex-direction: column; gap: 12px; }
.info-card { overflow: hidden; }
.info-card > p { padding: 0 14px 12px; color: var(--muted); line-height: 1.45; font-size: 12px; }
.empty-state { min-height: 250px; padding: 34px 18px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 8px; color: var(--muted); }
.empty-icon { width: 54px; height: 54px; border-radius: 50%; background: #edf3fa; display: grid; place-items: center; font-size: 25px; color: #87a3bf; }
.empty-state strong { color: var(--text); font-size: 13px; }
.empty-state span { font-size: 12px; max-width: 230px; line-height: 1.45; }
#windowDetails { padding: 14px; }
.selected-number { font-size: 25px; font-weight: 850; }
.status-pill { display: inline-block; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 800; margin-top: 6px; }
.status-pill.complete { color: #126439; background: var(--green-soft); }
.status-pill.incomplete { color: #546474; background: #eef2f5; }
#windowMessage { color: var(--muted); font-size: 12px; margin: 9px 0 12px; }
.survey-loading { color: var(--muted); font-size: 12px; padding: 10px 0; }
.survey-card { border-top: 1px solid var(--line); padding-top: 12px; }
.survey-card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.survey-card-heading div { display: flex; flex-direction: column; gap: 2px; }
.survey-card-heading strong { font-size: 12px; }
.survey-card-heading span { color: var(--muted); font-size: 10px; }
.survey-open { color: #1769d2; text-decoration: none; font-size: 10px; font-weight: 800; }
.survey-image { width: 100%; display: block; border: 1px solid var(--line); border-radius: 6px; }
.not-submitted { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.not-submitted strong { font-size: 12px; }
.not-submitted span { font-size: 11px; color: var(--muted); }
.progress-content { padding: 14px; display: flex; align-items: center; gap: 16px; }
.progress-ring { --progress: 0deg; width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(#5cbf83 var(--progress), #e7edf3 0); position: relative; flex: 0 0 auto; }
.progress-ring::after { content: ''; width: 58px; height: 58px; background: white; border-radius: 50%; position: absolute; }
.progress-ring span { position: relative; z-index: 1; font-weight: 850; font-size: 15px; }
.progress-content > div:last-child { display: flex; flex-direction: column; }
.progress-content strong { font-size: 20px; }
.progress-content span { color: var(--muted); font-size: 12px; }
.error-box { background: #fff1f1; border: 1px solid #efb7b7; color: #8c2929; padding: 16px; border-radius: 8px; }

.login-body { min-width: 0; display: grid; place-items: center; min-height: 100vh; background: #edf2f6; }
.login-card { width: min(460px, calc(100% - 32px)); background: white; padding: 36px; border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 12px 34px rgba(23,58,89,.12); }
.login-card h1 { margin: 4px 0 10px; }
.login-card p { color: var(--muted); line-height: 1.5; }
.primary-button { display: inline-block; margin-top: 12px; background: var(--navy-900); color: white; text-decoration: none; padding: 12px 16px; border-radius: 9px; font-weight: 700; }
.access-code-form { display: grid; gap: 10px; margin-top: 18px; }
.access-code-form label { font-size: 13px; font-weight: 850; color: #163452; }
.access-code-input { width: 100%; box-sizing: border-box; border: 1px solid #b9c9d8; border-radius: 10px; padding: 14px 16px; font: inherit; font-size: 24px; font-weight: 850; letter-spacing: .22em; text-align: center; color: #173554; background: white; }
.access-code-input:focus { outline: 3px solid rgba(53,130,196,.18); border-color: #4b91ca; }
.access-code-message { min-height: 18px; color: #9f3039; font-size: 12px; font-weight: 750; }
.access-code-submit { width: 100%; border: 0; cursor: pointer; text-align: center; }
.access-admin-bypass { margin-top: 18px; border-top: 1px solid #dce5ec; padding-top: 14px; }
.access-admin-bypass summary { cursor: pointer; color: #60778c; font-size: 12px; font-weight: 800; }
.access-admin-password { width: 100%; box-sizing: border-box; border: 1px solid #b9c9d8; border-radius: 9px; padding: 11px 12px; font: inherit; }

@media (max-width: 1250px) {
  .dashboard-grid { grid-template-columns: 160px minmax(520px, 1fr) 270px; gap: 10px; }
  .status-summary { gap: 8px; }
  .selector-panel { font-size: 12px; }
}
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 76px minmax(0, 1fr); }
  .brand { padding: 20px 10px; justify-content: center; }
  .brand > div:last-child, .nav-item:not(.active) { font-size: 0; }
  .brand-icon { font-size: 32px; }
  .nav-item { justify-content: center; padding: 12px 8px; }
  .nav-item span { font-size: 19px; }
  .sidebar-user { justify-content: center; padding-inline: 8px; }
  .sidebar-user-text { display: none; }
  .tower-grid { grid-template-columns: 1fr; }
  .floor-card-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 140px minmax(520px, 1fr); }
  .right-rail { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); }
  .empty-state { min-height: 160px; }
}

/* V9 digital survey intake ------------------------------------------------ */
.modal-open { overflow: hidden; }
.modal-backdrop { position: fixed; inset: 0; z-index: 1000; background: rgba(12, 28, 46, .58); padding: 24px; overflow: auto; }
.modal-backdrop[hidden] { display: none; }
.survey-modal { width: min(980px, 100%); margin: 0 auto; background: #fff; border-radius: 14px; box-shadow: 0 24px 70px rgba(0,0,0,.24); border: 1px solid #cad5df; overflow: hidden; }
.survey-modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 22px 12px; border-bottom: 1px solid #e2e8ee; text-align: center; }
.survey-modal-header > div:first-child { flex: 1; }
.survey-logo-text { display: block; font-size: 10px; letter-spacing: .12em; color: #a48654; font-weight: 800; }
.survey-modal-header h2 { margin: 3px 0 0; font-size: 26px; color: #111; }
.modal-close { width: 42px; height: 42px; border: 0; border-radius: 9px; background: #f1f4f7; font-size: 28px; line-height: 1; color: #486078; cursor: pointer; }
.survey-form { padding: 18px 22px 22px; }
.survey-meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 22px; width: min(620px, 100%); margin: 0 auto 14px; }
.survey-meta-grid label, .notes-field { display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: #33475b; }
.survey-meta-grid input, .notes-field textarea { width: 100%; min-width: 0; border: 0; border-bottom: 1.5px solid #66798b; border-radius: 0; padding: 7px 4px 5px; font: inherit; background: transparent; color: #13283d; }
.survey-meta-grid input[readonly] { color: #536b82; background: #f8fafc; }

.window-survey-layout { position: relative; width: min(760px, 100%); margin: 8px auto 0; display: grid; grid-template-columns: 92px minmax(0, 1fr) 92px; grid-template-rows: 52px 1fr 52px; gap: 6px 10px; }
.survey-window-box { grid-column: 2; grid-row: 2; border: 3px solid #1b2733; min-height: 480px; padding: 18px 22px; display: flex; flex-direction: column; gap: 14px; background: #fff; }
.bite-slot { display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 2px; }
.bite-slot span { font-size: 9px; color: #789; text-align: center; white-space: nowrap; }
.bite-slot input { width: 100%; border: 0; border-bottom: 3px solid #1b2733; padding: 5px 2px; text-align: center; font-size: 16px; font-weight: 800; color: #102a44; background: #fff; }
.bite-slot input:focus { outline: 2px solid #7bb4ee; outline-offset: 2px; border-radius: 2px; }
.bite-top-left { grid-column: 2; grid-row: 1; justify-self: start; width: 95px; }
.bite-top-right { grid-column: 2; grid-row: 1; justify-self: end; width: 95px; }
.bite-left-top { grid-column: 1; grid-row: 2; align-self: start; margin-top: 38px; }
.bite-right-top { grid-column: 3; grid-row: 2; align-self: start; margin-top: 38px; }
.bite-left-bottom { grid-column: 1; grid-row: 2; align-self: end; margin-bottom: 38px; }
.bite-right-bottom { grid-column: 3; grid-row: 2; align-self: end; margin-bottom: 38px; }
.bite-bottom-left { grid-column: 2; grid-row: 3; justify-self: start; width: 95px; }
.bite-bottom-right { grid-column: 2; grid-row: 3; justify-self: end; width: 95px; }

.glass-number-row { display: grid; grid-template-columns: 62px 130px; align-items: center; gap: 6px; font-size: 14px; font-weight: 800; }
.glass-number-row input { border: 0; border-bottom: 1.5px solid #66798b; padding: 5px 3px; font: inherit; background: transparent; }
.choice-group { border: 0; padding: 0; margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.choice-group legend { float: left; width: 190px; font-size: 13px; font-weight: 800; color: #31465b; padding: 0; }
.choice-group label { cursor: pointer; }
.choice-group input { position: absolute; opacity: 0; pointer-events: none; }
.choice-group span { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; padding: 8px 13px; border: 1px solid #b8c5d1; border-radius: 8px; background: #fff; color: #263d53; font-size: 13px; font-weight: 700; }
.choice-group input:checked + span { background: #e3f1ff; border-color: #418fda; color: #0b5caa; box-shadow: inset 0 0 0 1px #418fda; }
.choice-group input:focus-visible + span { outline: 2px solid #2e7fcc; outline-offset: 2px; }
.choice-wrap legend { width: 100%; margin-bottom: 2px; }
.notes-field { grid-template-columns: 62px minmax(0, 1fr); align-items: start; margin-top: 2px; }
.notes-field textarea { resize: vertical; min-height: 90px; border: 1px solid #b7c4cf; border-radius: 7px; padding: 8px; }

.bite-helper { width: min(760px, 100%); margin: 12px auto 0; padding: 10px; border: 1px solid #dce5ed; border-radius: 9px; background: #f7fafc; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bite-helper > span { font-size: 11px; font-weight: 800; color: #536b82; margin-right: 3px; }
.bite-helper button { border: 1px solid #b9c7d3; border-radius: 7px; background: #fff; min-width: 44px; min-height: 36px; padding: 4px 8px; color: #203b55; font-weight: 800; cursor: pointer; }
.bite-helper button:hover { border-color: #6ca2d4; background: #f1f7fd; }
.bite-helper small { width: 100%; color: #71879b; font-size: 10px; }
.survey-actions { width: min(760px, 100%); margin: 12px auto 0; display: flex; justify-content: flex-end; gap: 10px; }
.submit-survey-button, .primary-inline { border: 0; border-radius: 8px; background: #1769d2; color: #fff; font-weight: 800; padding: 10px 16px; min-height: 42px; cursor: pointer; }
.submit-survey-button:disabled { opacity: .6; cursor: wait; }
.primary-inline { margin-top: 8px; align-self: flex-start; }
.survey-form-message { width: min(760px, 100%); min-height: 18px; margin: 8px auto 0; font-size: 12px; color: #526a80; }
.survey-form-message.error { color: #9d2c2c; font-weight: 700; }
.digital-summary { border-top: 1px solid var(--line); padding-top: 12px; }
.digital-summary-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-bottom: 8px; }
.digital-summary-head span { color: var(--muted); font-size: 10px; }
.digital-summary dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.digital-summary dl div { min-width: 0; }
.digital-summary dt { font-size: 9px; text-transform: uppercase; letter-spacing: .04em; color: #8192a3; }
.digital-summary dd { margin: 1px 0 0; font-size: 11px; font-weight: 800; text-transform: capitalize; }
.bite-summary { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.bite-summary li { display: flex; justify-content: space-between; gap: 6px; border-bottom: 1px dotted #d5dde5; font-size: 10px; text-transform: capitalize; }
.digital-notes { font-size: 10px; line-height: 1.4; color: #52687d; }

@media (max-width: 760px) {
  .modal-backdrop { padding: 10px; }
  .survey-form { padding: 14px 12px 18px; }
  .survey-meta-grid { grid-template-columns: 1fr; gap: 7px; }
  .window-survey-layout { grid-template-columns: 70px minmax(0, 1fr) 70px; gap: 4px 6px; }
  .survey-window-box { padding: 14px 12px; min-height: 520px; }
  .choice-group legend { width: 100%; }
  .choice-group span { min-height: 44px; padding: 8px 10px; }
  .bite-slot span { font-size: 8px; }
  .bite-slot input { font-size: 14px; }
}

/* V10 form polish + review status ---------------------------------------- */
.review-dot { background: #d64545; border: 1px solid #a92e2e; }
.window-hotspot.review .window-label { color: #c93434; font-weight: 900; }
.status-pill.review { color: #9c2727; background: #fde9e9; }
.review-alert { margin: 0 0 10px; padding: 8px 10px; border-radius: 7px; background: #fff0f0; border: 1px solid #efb4b4; color: #952d2d; font-size: 10px; font-weight: 800; line-height: 1.35; }

.survey-modal { width: min(1060px, 100%); }
.survey-form { padding: 22px 28px 26px; }
.survey-meta-grid { width: min(700px, 100%); gap: 12px 32px; margin-bottom: 20px; }
.survey-meta-grid label { grid-template-columns: 82px minmax(0, 1fr); font-size: 12px; }
.survey-meta-grid input { min-height: 38px; padding-inline: 8px; }

.window-survey-layout {
  width: min(840px, 100%);
  grid-template-columns: 105px minmax(0, 620px) 105px;
  grid-template-rows: 60px auto 60px;
  justify-content: center;
  gap: 8px 14px;
}
.survey-window-box {
  min-height: 500px;
  padding: 28px 34px 30px;
  border-width: 2px;
  border-radius: 2px;
  gap: 18px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(20,42,65,.03);
}
.glass-number-row {
  width: 260px;
  margin: 0 auto 2px;
  grid-template-columns: 74px 1fr;
  font-size: 14px;
}
.glass-number-row input { text-align: center; font-weight: 850; }

.choice-group {
  width: 100%;
  display: grid;
  grid-template-columns: 190px repeat(4, max-content);
  justify-content: center;
  align-items: center;
  column-gap: 12px;
  row-gap: 8px;
}
.choice-group legend,
.choice-wrap legend {
  float: none;
  width: auto;
  grid-column: 1;
  margin: 0;
  padding: 0;
  text-align: right;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 850;
  color: #243b52;
}
.choice-group label { margin: 0; }
.choice-group span {
  min-width: 86px;
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 12px;
}
.choice-wrap span { min-width: 78px; }
.notes-field {
  width: 100%;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 12px;
  margin-top: 2px;
  align-items: start;
}
.notes-field { text-align: right; font-size: 12px; font-weight: 850; color: #243b52; }
.notes-field textarea { text-align: left; min-height: 112px; background: #fbfcfe; }

.bite-slot input { border-bottom-width: 2px; border-bottom-color: #26394d; }
.bite-slot span { font-size: 9px; font-weight: 700; letter-spacing: .02em; }
.bite-helper { width: min(840px, 100%); justify-content: center; }
.survey-actions { width: min(840px, 100%); justify-content: center; }
.survey-form-message { width: min(840px, 100%); text-align: center; }

@media (max-width: 760px) {
  .survey-form { padding: 16px 12px 20px; }
  .window-survey-layout { grid-template-columns: 68px minmax(0, 1fr) 68px; }
  .survey-window-box { padding: 18px 12px 22px; gap: 15px; }
  .choice-group { grid-template-columns: 1fr 1fr; justify-items: stretch; gap: 8px; }
  .choice-group legend, .choice-wrap legend { grid-column: 1 / -1; text-align: left; margin-bottom: 2px; }
  .choice-group span { width: 100%; min-width: 0; }
  .choice-wrap label { min-width: 0; }
  .notes-field { grid-template-columns: 1fr; text-align: left; gap: 5px; }
  .glass-number-row { width: min(250px, 100%); }
}

/* V11 survey modal redesign ------------------------------------------------ */
.survey-modal { width: min(1240px, 100%); border: 1px solid #c8d2dc; border-radius: 16px; }
.survey-modal-header { padding: 22px 28px 18px; text-align: left; align-items: center; }
.survey-modal-header > div:first-child { flex: 1; }
.survey-logo-text { display: none; }
.survey-modal-header h2 { margin: 0; font-size: 30px; color: #0f2a4a; letter-spacing: -.02em; }
.survey-modal-header h2::after { content: "Enter the survey details for this window."; display: block; margin-top: 4px; font-size: 14px; font-weight: 500; color: #6d7f92; letter-spacing: 0; }
.modal-close { background: transparent; color: #475f78; font-size: 34px; font-weight: 300; }
.survey-form-v11 { padding: 0 28px 26px; }
.survey-meta-row { display: grid; grid-template-columns: 1.05fr .9fr .8fr 1fr .85fr; gap: 18px; padding: 18px 0 22px; border-bottom: 1px solid #dce3ea; }
.survey-meta-row label { display: grid; gap: 6px; font-size: 13px; font-weight: 800; color: #163452; }
.survey-meta-row label > span { line-height: 1; }
.survey-meta-row input { width: 100%; min-width: 0; min-height: 44px; border: 1px solid #c3cfdb; border-radius: 9px; background: #fff; padding: 0 12px; font-size: 16px; color: #18344f; }
.survey-meta-row input[readonly] { background: #f0f3f6; color: #6d7a88; }

.survey-main-grid { display: grid; grid-template-columns: minmax(240px, .9fr) minmax(420px, 1.35fr) minmax(240px, .9fr); gap: 0; padding-top: 24px; }
.survey-column { min-width: 0; padding: 0 24px; }
.survey-column + .survey-column { border-left: 1px solid #dce3ea; }
.survey-column-left { padding-left: 0; }
.survey-column-right { padding-right: 0; }
.choice-stack { display: block; margin: 0 0 30px; }
.choice-stack legend { width: auto; float: none; margin: 0 0 10px; padding: 0; text-align: left; font-size: 13px; font-weight: 850; color: #163452; }
.choice-row, .choice-grid { display: grid; gap: 10px; }
.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.two-by-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice-stack label { margin: 0; min-width: 0; }
.choice-stack span { width: 100%; min-width: 0; min-height: 50px; padding: 10px 12px; border: 1px solid #c1ccd8; border-radius: 10px; background: #fff; color: #20384f; font-size: 14px; font-weight: 750; }
.choice-stack input:checked + span { background: #e8f2ff; border-color: #3e94e6; color: #0b5fac; box-shadow: inset 0 0 0 1px #3e94e6; }

.measurement-heading { text-align: center; margin-bottom: 10px; }
.measurement-heading h3 { margin: 0; font-size: 19px; color: #163452; }
.measurement-heading h3 span { font-size: 13px; font-weight: 700; }
.measurement-heading p { margin: 4px 0 0; font-size: 12px; color: #6d7f92; }
.measurement-board { position: relative; min-height: 500px; }
.window-graphic { position: absolute; left: 50%; top: 50%; width: 122px; height: 250px; transform: translate(-50%, -50%); border: 8px solid #263646; border-radius: 3px; box-shadow: inset 0 0 0 3px #667688, 0 4px 10px rgba(19,38,57,.18); background: #dde8f2; }
.window-glass { position: absolute; inset: 9px; background: linear-gradient(135deg, #cfe0ef 0%, #edf5fb 48%, #c9dceb 49%, #e6f0f7 72%, #c4d8e8 100%); border: 1px solid #90a6b9; }
.measure-field { position: absolute; display: grid; gap: 5px; width: 108px; font-size: 11px; font-weight: 800; color: #173550; text-align: center; }
.measure-field input { width: 100%; min-height: 42px; border: 1px solid #aebdcb; border-radius: 8px; background: #fff; padding: 6px; text-align: center; font-size: 17px; font-weight: 800; color: #18344f; }
.measure-field input:focus { outline: 2px solid #3e94e6; outline-offset: 1px; }
.m-top-left { left: calc(50% - 126px); top: 12px; }
.m-top-right { right: calc(50% - 126px); top: 12px; }
.m-left-top { left: 0; top: 146px; }
.m-right-top { right: 0; top: 146px; }
.m-left-bottom { left: 0; bottom: 102px; }
.m-right-bottom { right: 0; bottom: 102px; }
.m-bottom-left { left: calc(50% - 126px); bottom: 10px; }
.m-bottom-right { right: calc(50% - 126px); bottom: 10px; }
.measure-field::after { content: ""; position: absolute; background: #9babb9; }
.m-left-top::after, .m-left-bottom::after { right: -38px; top: 33px; width: 38px; height: 1px; }
.m-right-top::after, .m-right-bottom::after { left: -38px; top: 33px; width: 38px; height: 1px; }
.m-top-left::after { right: 8px; bottom: -28px; width: 1px; height: 30px; transform: rotate(-43deg); transform-origin: bottom; }
.m-top-right::after { left: 8px; bottom: -28px; width: 1px; height: 30px; transform: rotate(43deg); transform-origin: bottom; }
.m-bottom-left::after { right: 8px; top: -29px; width: 1px; height: 30px; transform: rotate(43deg); transform-origin: top; }
.m-bottom-right::after { left: 8px; top: -29px; width: 1px; height: 30px; transform: rotate(-43deg); transform-origin: top; }
.compact-bite-helper { width: 100%; margin: 8px auto 0; padding: 8px; justify-content: center; background: #f8fafc; }
.compact-bite-helper > span { width: 100%; text-align: center; margin: 0 0 2px; }
.compact-bite-helper button { min-width: 40px; min-height: 32px; font-size: 11px; }

.notes-field-v11 { display: grid; gap: 10px; font-size: 13px; font-weight: 850; color: #163452; }
.notes-field-v11 textarea { width: 100%; min-height: 190px; resize: vertical; border: 1px solid #c1ccd8; border-radius: 10px; background: #fbfcfe; padding: 12px; font: inherit; color: #20384f; }
.survey-form-message { width: 100%; text-align: center; margin: 16px 0 0; }
.survey-actions-v11 { width: 100%; margin: 16px 0 0; padding-top: 18px; border-top: 1px solid #dce3ea; justify-content: space-between; }
.survey-cancel-button { min-width: 150px; min-height: 48px; border: 1px solid #dc5a67; border-radius: 9px; background: #fff1f3; color: #b43241; font-size: 14px; font-weight: 800; cursor: pointer; }
.submit-survey-button { min-width: 210px; min-height: 48px; border-radius: 9px; font-size: 14px; }

@media (max-width: 1000px) {
  .survey-meta-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .survey-main-grid { grid-template-columns: 1fr; }
  .survey-column { padding: 20px 0; }
  .survey-column + .survey-column { border-left: 0; border-top: 1px solid #dce3ea; }
  .measurement-board { width: min(520px, 100%); margin: 0 auto; }
  .choice-stack { max-width: 520px; margin-left: auto; margin-right: auto; }
  .notes-field-v11 { max-width: 520px; margin: 0 auto; }
}
@media (max-width: 640px) {
  .survey-modal-header { padding: 18px 16px 14px; }
  .survey-modal-header h2 { font-size: 24px; }
  .survey-form-v11 { padding: 0 16px 18px; }
  .survey-meta-row { grid-template-columns: 1fr 1fr; gap: 12px; }
  .measurement-board { min-height: 560px; }
  .window-graphic { width: 108px; height: 235px; }
  .measure-field { width: 92px; }
  .m-left-top, .m-left-bottom { left: 0; }
  .m-right-top, .m-right-bottom { right: 0; }
  .m-top-left { left: 50%; transform: translateX(-115%); }
  .m-top-right { right: 50%; transform: translateX(115%); }
  .m-bottom-left { left: 50%; transform: translateX(-115%); }
  .m-bottom-right { right: 50%; transform: translateX(115%); }
  .survey-actions-v11 { gap: 10px; }
  .survey-cancel-button, .submit-survey-button { min-width: 0; flex: 1; }
}

/* V12 map metadata alignment ----------------------------------------------- */
/* The map artwork and JSON metadata are generated together. The tiny anchor
   below sits exactly on the tick mark; the visible number uses label_x/y from
   the same JSON file and keeps a generous invisible touch target. */
.window-map-anchor {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: #7d8b98;
  box-shadow: 0 0 0 1px rgba(255,255,255,.9);
  pointer-events: none;
  z-index: 2;
}
.window-map-anchor.complete { background: #189653; }
.window-map-anchor.review { background: #c93434; }
.window-map-anchor.incomplete { background: #66788a; }

.window-hotspot.metadata-hotspot {
  width: 58px;
  height: 58px;
  margin: 0;
  padding: 0;
  transform: translate(-50%, -50%);
  border: 0;
  background: transparent;
  z-index: 3;
}
.window-hotspot.metadata-hotspot .window-label {
  position: absolute;
  left: 50%;
  top: 50%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
  min-width: 20px;
  height: 22px;
  padding: 0 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: rgba(255,255,255,.92);
  font-size: 12px;
  line-height: 1;
  font-weight: 850;
  box-shadow: 0 0 0 1px rgba(210,220,230,.75);
}
.window-hotspot.metadata-hotspot.complete .window-label { color: #148b4a; }
.window-hotspot.metadata-hotspot.review .window-label { color: #c93434; }
.window-hotspot.metadata-hotspot.incomplete .window-label { color: #21384d; }
.window-hotspot.metadata-hotspot.selected .window-label {
  color: #0b5fac;
  background: #e8f2ff;
  box-shadow: 0 0 0 2px #3e94e6;
}
@media (hover:hover) and (pointer:fine) {
  .window-hotspot.metadata-hotspot:hover .window-label { background: #edf5ff; }
}

/* V13 photo intake -------------------------------------------------------- */
.photo-intake {
  margin-top: 4px;
  padding: 16px;
  border: 1px solid #d6e0ea;
  border-radius: 12px;
  background: #fbfcfe;
}
.photo-intake-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: #163452;
}
.photo-intake-heading strong { font-size: 13px; font-weight: 850; }
.photo-intake-heading span { font-size: 12px; color: #7b8998; }
.photo-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.photo-dropzone {
  width: 100%;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 2px dashed #c6d5e4;
  border-radius: 10px;
  background: #fff;
  color: #304b65;
  padding: 14px;
  text-align: center;
  transition: border-color .15s ease, background .15s ease;
}
.photo-dropzone:hover, .photo-dropzone:focus-visible, .photo-dropzone.dragover {
  border-color: #5b9fe6;
  background: #f4f9ff;
  outline: none;
}
.photo-camera { font-size: 30px; line-height: 1; color: #63798e; }
.photo-dropzone strong { font-size: 14px; }
.photo-dropzone small { display: block; font-size: 11px; font-weight: 500; color: #718297; }
.photo-previews {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.photo-thumb {
  position: relative;
  min-width: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid #c6d2de;
  border-radius: 8px;
  background: #eef3f7;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb.existing::after {
  content: "Saved";
  position: absolute;
  left: 5px;
  bottom: 5px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(12, 42, 70, .78);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
}
.photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(9, 34, 57, .88);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.photo-intake-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 12px;
  margin-top: 8px;
  color: #7b8998;
  font-size: 10px;
}
@media (max-width: 1000px) {
  .photo-intake { max-width: 520px; margin: 0 auto; }
}
@media (max-width: 480px) {
  .photo-previews { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* V15 admin + early-stop bite rule ----------------------------------------- */
.compact-bite-helper .quick-alert {
  border-color: #d27a4a;
  background: #fff5ef;
  color: #a64419;
}
.compact-bite-helper .quick-alert:hover { background: #ffeadf; border-color: #bb6335; }
.compact-bite-helper small {
  width: 100%;
  margin-top: 4px;
  text-align: center;
  color: #6d7f90;
  font-size: 10px;
  line-height: 1.35;
}
.adjustment-alert {
  margin: 8px 0;
  padding: 8px 10px;
  border: 1px solid #efc28b;
  border-radius: 7px;
  background: #fff8ea;
  color: #805318;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.35;
}

.admin-modal {
  width: min(620px, 100%);
  margin: 7vh auto 0;
  background: #fff;
  border: 1px solid #cbd7e2;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0,0,0,.24);
  overflow: hidden;
}
.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid #e2e8ee;
}
.admin-modal-header h2 { margin: 2px 0 0; color: #15324f; font-size: 24px; }
.admin-unlock, .admin-settings { padding: 22px; }
.admin-unlock p { margin: 0 0 18px; color: #63778a; line-height: 1.5; font-size: 13px; }
.admin-unlock label, .admin-setting-field { display: grid; gap: 7px; }
.admin-unlock label span, .admin-setting-field > span { font-size: 13px; font-weight: 850; color: #163452; }
.admin-unlock input, .admin-setting-field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #bac8d5;
  border-radius: 9px;
  padding: 0 12px;
  font-size: 16px;
  color: #18344f;
  background: #fff;
}
.admin-setting-field small { color: #738496; font-size: 11px; line-height: 1.4; }
.admin-message { min-height: 20px; margin: 10px 0; color: #8a3540; font-size: 12px; font-weight: 700; }
.admin-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

@media (max-width: 760px) {
  .admin-modal { margin-top: 2vh; }
  .admin-unlock, .admin-settings { padding: 16px; }
}

/* V16 review workspace --------------------------------------------------- */
.review-screen { padding-bottom: 32px; }
.review-page-heading { align-items: end; }
.review-page-heading p { margin: 6px 0 0; color: #6b7c8f; font-size: 14px; }
.review-tower-select { display: grid; gap: 6px; min-width: 220px; color: #607286; font-size: 12px; font-weight: 800; }
.review-tower-select select { min-height: 42px; border: 1px solid #c9d5df; border-radius: 9px; background: #fff; color: #18334f; padding: 0 12px; font: inherit; }
.review-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.review-metric { background: #fff; border: 1px solid #d8e1e8; border-radius: 12px; padding: 18px; box-shadow: 0 4px 16px rgba(26,52,78,.05); }
.review-metric span { display: block; color: #65778a; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.review-metric strong { display: block; margin: 8px 0 4px; color: #173554; font-size: 31px; line-height: 1; }
.review-metric small { color: #7b8997; line-height: 1.4; }
.review-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); gap: 16px; align-items: start; }
.review-panel { background: #fff; border: 1px solid #d8e1e8; border-radius: 12px; padding: 18px; min-width: 0; }
.review-floor-panel { grid-row: span 2; }
.review-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.review-panel-head h2 { margin: 2px 0 0; color: #173554; font-size: 20px; }
.review-count-pill { min-width: 34px; height: 28px; border-radius: 999px; background: #e7f4ec; color: #1c6a3b; display: inline-grid; place-items: center; font-weight: 900; font-size: 12px; }
.review-count-pill.alert { background: #fdeaea; color: #a62d2d; }
.review-table-wrap { overflow-x: auto; }
.review-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.review-table th { text-align: left; color: #718294; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; padding: 10px 9px; border-bottom: 1px solid #dfe6ec; white-space: nowrap; }
.review-table td { padding: 11px 9px; border-bottom: 1px solid #edf1f4; color: #29435d; vertical-align: top; }
.review-table td small { display: block; margin-top: 2px; color: #8a98a5; font-size: 10px; }
.review-floor-link { border: 0; background: none; color: #1d5e9c; padding: 0; font: inherit; font-weight: 900; cursor: pointer; }
.historical-note { display: block; max-width: 170px; color: #9a7a2e !important; }
.review-window-list { display: grid; gap: 8px; max-height: 310px; overflow: auto; }
.review-window-link { width: 100%; border: 1px solid #dce5ec; background: #fafcfd; border-radius: 9px; padding: 10px 12px; text-align: left; cursor: pointer; color: #24405a; }
.review-window-link:hover { border-color: #9ebbd4; background: #f2f8fc; }
.review-window-link strong, .review-window-link span { display: block; }
.review-window-link span { margin-top: 2px; color: #7b8997; font-size: 11px; }
.review-empty { color: #8795a3; padding: 12px 0; font-size: 13px; }
.review-condition-list { margin: 0; display: grid; gap: 0; }
.review-condition-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #edf1f4; }
.review-condition-list dt { color: #5f7184; }
.review-condition-list dd { margin: 0; color: #173554; font-weight: 900; }
.review-note { margin-top: 14px; padding: 11px 12px; border-radius: 9px; background: #f7f9fb; color: #6c7c8d; font-size: 11px; line-height: 1.45; }
.review-note p { margin: 0 0 5px; }
.review-note p:last-child { margin-bottom: 0; }
.single-quick-flag { justify-content: center; }
.single-quick-flag > span { color: #687b8d; font-weight: 800; }
.single-quick-flag .quick-alert { min-width: 108px; font-size: 14px; }
.single-quick-flag small { flex-basis: 100%; text-align: center; max-width: 540px; }
@media (max-width: 1050px) {
  .review-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-grid { grid-template-columns: 1fr; }
  .review-floor-panel { grid-row: auto; }
}
@media (max-width: 650px) {
  .review-page-heading { align-items: stretch; }
  .review-tower-select { min-width: 0; width: 100%; }
  .review-metrics { grid-template-columns: 1fr; }
}

/* V17: global below-3/8 flag confirmation */
.global-threshold-button.confirmed {
  background: #e8f7ee;
  border-color: #76b98d;
  color: #17633a;
}
.threshold-confirmed {
  flex-basis: 100%;
  text-align: center;
  color: #17633a;
  font-weight: 800;
  font-size: 13px;
}
.confirm-modal {
  width: min(92vw, 520px);
  background: #fff;
  border-radius: 18px;
  padding: 30px;
  box-shadow: 0 24px 70px rgba(18, 39, 61, .22);
  text-align: center;
}
.confirm-modal h2 {
  margin: 8px 0 10px;
  color: #17395a;
  font-size: 24px;
}
.confirm-modal p {
  margin: 0 auto 10px;
  max-width: 430px;
  color: #425b72;
  line-height: 1.5;
}
.confirm-modal .confirm-note {
  font-size: 13px;
  color: #6d7f90;
}
.confirm-icon {
  width: 46px;
  height: 46px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff4e9;
  border: 1px solid #efc798;
  color: #a55b16;
  font-weight: 900;
  font-size: 24px;
}
.confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}
.confirm-actions > button {
  min-width: 150px;
}
@media (max-width: 600px) {
  .confirm-actions { flex-direction: column; }
  .confirm-actions > button { width: 100%; }
}

/* V20 review details, estimating, and admin backup ------------------------- */
.adjustment-estimate { display: grid; gap: 7px; padding: 4px 0 14px; border-bottom: 1px solid #edf1f4; margin-bottom: 12px; }
.adjustment-estimate > strong { color: #173554; font-size: 28px; line-height: 1; }
.adjustment-estimate > div { color: #687b8e; font-size: 12px; }
.review-cost-input { display: grid; gap: 6px; margin-top: 4px; color: #607286; font-size: 11px; font-weight: 800; }
.review-cost-input > div { display: flex; align-items: center; gap: 7px; }
.review-cost-input > div > span { color: #4f6478; font-weight: 900; }
.review-cost-input input { width: 118px; min-height: 38px; border: 1px solid #c9d5df; border-radius: 8px; padding: 0 10px; color: #18334f; font: inherit; background: #fff; }
#reviewCostMessage { min-height: 16px; color: #607286; font-size: 11px; }

.review-data-panel { margin-top: 16px; }
.review-data-head p { margin: 5px 0 0; color: #718294; font-size: 12px; }
.review-filters { display: grid; grid-template-columns: minmax(220px, 1.6fr) minmax(150px, .7fr) minmax(170px, .8fr); gap: 10px; margin-bottom: 14px; }
.review-filters label { display: grid; gap: 5px; color: #607286; font-size: 11px; font-weight: 800; }
.review-filters input, .review-filters select { min-height: 40px; border: 1px solid #c9d5df; border-radius: 8px; padding: 0 10px; background: #fff; color: #18334f; font: inherit; }
.review-data-table-wrap { max-height: 460px; overflow: auto; border: 1px solid #e3e9ee; border-radius: 9px; }
.review-data-table thead th { position: sticky; top: 0; z-index: 1; background: #f8fafb; }
.review-data-table td { white-space: nowrap; }
.review-data-table td:nth-child(3), .review-data-table td:nth-child(6) { white-space: normal; min-width: 100px; }
.record-status { display: inline-flex; align-items: center; min-height: 25px; padding: 0 8px; border-radius: 999px; font-size: 10px; font-weight: 900; }
.record-status.complete { background: #e6f5ec; color: #1d6c3d; }
.record-status.adjustment { background: #fff0df; color: #9b5911; }
.record-status.review { background: #fde9e9; color: #a32f2f; }
.review-open-record { border: 1px solid #b9cadd; border-radius: 7px; background: #fff; color: #215e97; padding: 6px 10px; font: inherit; font-size: 11px; font-weight: 850; cursor: pointer; }
.review-open-record:hover { background: #f1f7fb; }

.admin-settings { display: grid; gap: 16px; }
.admin-backup-panel { border: 1px solid #dce5ec; background: #f8fafb; border-radius: 11px; padding: 15px; }
.admin-backup-panel h3 { margin: 2px 0 5px; color: #173554; font-size: 17px; }
.admin-backup-panel p { margin: 0; color: #718294; font-size: 11px; line-height: 1.45; }
.admin-backup-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.danger-outline { border-color: #df8e95 !important; color: #9f3039 !important; background: #fff8f8 !important; }
.admin-security-status { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #dce5ec; background: white; border-radius: 9px; padding: 10px 12px; }
.admin-security-status span { color: #6c7e90; font-size: 11px; font-weight: 750; }
.admin-security-status strong { font-size: 12px; }
.admin-security-status strong.enabled { color: #1d6c3d; }
.admin-security-status strong.disabled { color: #8a3540; }
.admin-code-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.admin-stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 13px; }
.admin-stat { min-width: 0; border: 1px solid #dce5ec; background: white; border-radius: 9px; padding: 11px 12px; display: grid; gap: 4px; }
.admin-stat span { color: #718294; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.admin-stat strong { color: #173554; font-size: 17px; overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .review-filters { grid-template-columns: 1fr; }
  .review-data-table-wrap { max-height: 520px; }
  .review-cost-input > div { flex-wrap: wrap; }
  .admin-code-grid, .admin-stat-grid { grid-template-columns: 1fr; }
  .login-card { padding: 28px 22px; }
}
.review-data-table .record-notes { min-width: 160px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* V21 phone field mode ---------------------------------------------------- */
.brand-logo { width: 48px; height: 44px; object-fit: contain; flex: 0 0 auto; }
.brand-copy strong { display: block; font-size: 30px; letter-spacing: .02em; }
.brand-copy span { display: block; font-size: 14px; opacity: .9; margin-top: 2px; }
.mobile-view-toggle, .mobile-survey-nav, .mobile-action-prev, .mobile-action-next { display: none; }

.photo-camera-button {
  width: 100%; min-height: 64px; margin-bottom: 9px; border: 1px solid #3f8fd7;
  border-radius: 10px; background: #eaf4ff; color: #155f9e; display: flex;
  align-items: center; justify-content: center; gap: 10px; padding: 10px 14px;
}
.photo-camera-button > span { font-size: 24px; line-height: 1; }
.photo-camera-button strong, .photo-camera-button small { display: block; }
.photo-camera-button strong { font-size: 14px; }
.photo-camera-button small { color: #607b95; font-size: 10px; }

.mobile-window-list { padding: 14px; background: #f8fafc; }
.mobile-window-list-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.mobile-window-list-head > div strong, .mobile-window-list-head > div span { display: block; }
.mobile-window-list-head > div strong { font-size: 18px; color: #173554; }
.mobile-window-list-head > div span { margin-top: 2px; color: #728397; font-size: 11px; }
.mobile-window-list-head label { display: grid; gap: 4px; width: 110px; color: #61758a; font-size: 10px; font-weight: 800; }
.mobile-window-list-head input { width: 100%; min-height: 40px; border: 1px solid #b8c8d8; border-radius: 8px; padding: 0 10px; background: #fff; color: #18344f; font-size: 16px; }
.mobile-window-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.mobile-window-button { min-height: 50px; border: 1px solid #becbd8; border-radius: 9px; background: #fff; color: #243a50; font-size: 14px; font-weight: 900; }
.mobile-window-button.complete { background: #e7f8ef; border-color: #75c494; color: #187642; }
.mobile-window-button.review { background: #fdeaea; border-color: #dc8d8d; color: #aa3030; }
.mobile-window-button.selected { box-shadow: inset 0 0 0 2px #3e94e6; border-color: #3e94e6; }

.mobile-save-toast {
  position: fixed; left: 50%; bottom: 84px; z-index: 1600; transform: translateX(-50%);
  max-width: calc(100vw - 28px); padding: 11px 16px; border-radius: 999px;
  background: #123754; color: #fff; box-shadow: 0 8px 28px rgba(0,0,0,.22);
  font-size: 13px; font-weight: 850; opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.mobile-save-toast.show { opacity: 1; }

@media (max-width: 700px), (any-pointer: coarse) and (max-width: 1400px) {
  body { padding-bottom: 66px; }
  .app-shell { display: block; min-height: 100vh; }
  .sidebar { position: fixed; z-index: 900; left: 0; right: 0; bottom: 0; min-height: 0; height: 64px; display: block; background: #0a2239; box-shadow: 0 -4px 18px rgba(7,28,47,.18); }
  .brand, .sidebar-user { display: none; }
  .main-nav { height: 64px; padding: 5px 8px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .nav-item, .nav-item:not(.active) { min-width: 0; padding: 5px 3px; gap: 2px; flex-direction: column; justify-content: center; border-radius: 8px; font-size: 10px; color: #dce8f4; }
  .nav-item span { width: auto; font-size: 18px; }
  .nav-item.active { font-size: 10px; }
  .app-header { height: 34px; padding: 0 12px; }
  .header-title { font-size: 11px; }
  .content { padding: 10px 10px 22px; }
  .breadcrumbs { margin-bottom: 5px; font-size: 11px; overflow-x: auto; white-space: nowrap; }
  h1 { font-size: 24px; }
  .page-heading, .map-toolbar { align-items: flex-start; gap: 8px; margin-bottom: 10px; }
  .map-toolbar .secondary-button { padding: 8px 9px; font-size: 11px; }
  .floor-card-grid { grid-template-columns: 1fr; }
  .floor-card { min-height: 74px; }
  .tower-card { min-height: 96px; padding: 14px; }

  .dashboard-grid { display: block; }
  .selector-panel, .right-rail { display: none; }
  .map-card { border-radius: 10px; }
  .map-card-header { min-height: 0; display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; padding: 10px; }
  .map-card-header > div:first-child { grid-column: 1; }
  .map-card-header > div:first-child span { display: none; }
  .status-summary { grid-column: 1 / -1; order: 3; display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; gap: 5px; font-size: 9px; overflow-x: auto; }
  .status-summary strong { font-size: 12px; padding-left: 5px; }
  .legend-dot { width: 10px; height: 10px; }
  .mobile-view-toggle { display: inline-grid; grid-template-columns: 1fr 1fr; padding: 2px; border: 1px solid #b9c9d9; border-radius: 9px; background: #eef3f8; }
  .mobile-view-toggle button { border: 0; border-radius: 7px; background: transparent; color: #526a80; min-height: 34px; padding: 0 10px; font-size: 11px; font-weight: 850; }
  .mobile-view-toggle button.active { background: #fff; color: #0d61b6; box-shadow: 0 1px 4px rgba(20,54,84,.12); }
  .map-frame { min-height: 420px; max-height: 68vh; overflow: auto; touch-action: pan-x pan-y pinch-zoom; overscroll-behavior: contain; }
  .map-frame img { width: 100%; height: auto; }
  .window-hotspot.metadata-hotspot { width: 72px; height: 72px; }
  .window-hotspot.metadata-hotspot .window-label { min-width: 25px; height: 26px; font-size: 13px; }
  .mobile-window-list { min-height: 58vh; }
  .mobile-window-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }

  .modal-backdrop { padding: 0; background: #fff; overflow: hidden; }
  .survey-modal { width: 100%; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0; overflow: auto; box-shadow: none; }
  .survey-modal-header { position: sticky; top: 0; z-index: 20; padding: 10px 14px 8px; background: #fff; border-bottom: 1px solid #dce3ea; }
  .survey-modal-header h2 { font-size: 19px; }
  .survey-modal-header h2::after { display: none; }
  .modal-close { font-size: 30px; }
  .survey-form-v11 { padding: 0 12px 82px; }
  .mobile-survey-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin: 0 -12px 10px; padding: 8px 12px; background: #f4f8fc; border-bottom: 1px solid #dce5ee; }
  .mobile-survey-nav button { min-height: 42px; border: 1px solid #b7c9da; border-radius: 9px; background: #fff; color: #1a5f9b; font-weight: 850; }
  .mobile-survey-nav button:last-child { justify-self: stretch; }
  .mobile-survey-nav > div { text-align: center; min-width: 108px; }
  .mobile-survey-nav small, .mobile-survey-nav strong { display: block; }
  .mobile-survey-nav small { color: #738598; font-size: 9px; }
  .mobile-survey-nav strong { margin-top: 2px; color: #173554; font-size: 14px; }
  .survey-meta-row { grid-template-columns: 1fr 1fr; gap: 9px; padding: 10px 0 16px; }
  .survey-meta-row label { gap: 4px; font-size: 11px; }
  .survey-meta-row input { min-height: 46px; font-size: 16px; }
  .survey-meta-row label:nth-child(4) { grid-column: 1 / -1; }
  .survey-main-grid { padding-top: 8px; }
  .survey-column { padding: 16px 0; }
  .choice-stack { max-width: none; margin-bottom: 20px; }
  .choice-stack legend { font-size: 13px; margin-bottom: 8px; }
  .choice-stack span { min-height: 54px; font-size: 15px; }
  .photo-intake { max-width: none; padding: 12px; }
  .photo-camera-button { min-height: 72px; background: #1769d2; color: #fff; border-color: #1769d2; }
  .photo-camera-button small { color: #d9eaff; }
  .photo-dropzone { min-height: 82px; }
  .photo-camera { display: none; }

  .measurement-heading { text-align: center; margin-bottom: 8px; }
  .measurement-board { position: relative; min-height: 570px; width: 100%; max-width: 430px; margin: 0 auto; display: block; }
  .window-graphic { display: block; width: 106px; height: 236px; }
  .measure-field { width: 94px; text-align: center; }
  .measure-field span { font-size: 10px; }
  .measure-field input { min-height: 44px; font-size: 18px; text-align: center; }
  .m-top-left { left: 50%; top: 12px; transform: translateX(-112%); }
  .m-top-right { right: 50%; top: 12px; transform: translateX(112%); }
  .m-left-top { left: 0; top: 150px; }
  .m-right-top { right: 0; top: 150px; }
  .m-left-bottom { left: 0; bottom: 104px; }
  .m-right-bottom { right: 0; bottom: 104px; }
  .m-bottom-left { left: 50%; bottom: 10px; transform: translateX(-112%); }
  .m-bottom-right { right: 50%; bottom: 10px; transform: translateX(112%); }
  .measure-field::after { display: block; }
  .compact-bite-helper { margin-top: 12px; padding: 10px; }
  .single-quick-flag .quick-alert { min-height: 48px; min-width: 150px; font-size: 15px; }
  .notes-field-v11 { max-width: none; }
  .notes-field-v11 textarea { min-height: 130px; font-size: 16px; }

  .survey-actions-v11 { position: sticky; bottom: 0; z-index: 25; width: calc(100% + 24px); margin: 18px -12px -82px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid #cfdbe6; background: rgba(255,255,255,.97); box-shadow: 0 -5px 18px rgba(25,52,78,.10); display: grid; grid-template-columns: 76px minmax(0, 1fr) 76px; gap: 8px; }
  .survey-actions-v11 .survey-cancel-button { display: none; }
  .mobile-action-prev, .mobile-action-next { display: block; min-width: 0; min-height: 50px; border: 1px solid #b7c9da; border-radius: 9px; background: #fff; color: #1a5f9b; font-weight: 850; }
  .submit-survey-button { min-width: 0; min-height: 50px; font-size: 15px; }

  .review-screen { padding-bottom: 10px; }
  .review-panel { padding: 13px; }
}

@media (max-width: 390px) {
  .mobile-window-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .measurement-board { grid-template-columns: 1fr 1fr; gap: 8px; }
  .mobile-survey-nav button span { display: none; }
}


/* V22 mobile map zoom + raw-data review ----------------------------------- */
.map-zoom-toolbar { display: none; }
.map-zoom-stage { position: relative; width: 100%; min-width: 100%; transform-origin: 0 0; }
.map-zoom-stage > img { display: block; width: 100%; height: auto; }
.map-zoom-stage .hotspot-layer { position: absolute; inset: 0; }
.review-data-actions { display: flex; align-items: center; gap: 10px; }
.review-data-table { min-width: 2550px; }
.review-data-table th, .review-data-table td { white-space: nowrap; }
.review-data-table .record-notes { min-width: 240px; max-width: 320px; white-space: normal; }

@media (max-width: 700px), (any-pointer: coarse) and (max-width: 1400px) {
  .map-zoom-toolbar { display: flex; position: sticky; top: 0; z-index: 20; justify-content: flex-end; gap: 5px; padding: 6px 8px; background: rgba(255,255,255,.94); border-bottom: 1px solid #d9e3ec; }
  .map-zoom-toolbar button { min-width: 42px; min-height: 38px; border: 1px solid #b7c9da; border-radius: 8px; background: #fff; color: #173554; font-size: 18px; font-weight: 850; }
  .map-zoom-toolbar #mapZoomReset { min-width: 64px; font-size: 11px; }
  .map-frame { touch-action: pan-x pan-y; overflow: auto; -webkit-overflow-scrolling: touch; }
  .map-zoom-stage { width: 100%; }
  .review-data-head { align-items: flex-start; }
  .review-data-actions { width: 100%; justify-content: space-between; }
  .review-data-actions .secondary-button { min-height: 42px; }
  .review-data-table-wrap { max-height: 62vh; overflow: auto; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 390px) {
  .measurement-board { min-height: 550px; }
  .window-graphic { width: 98px; height: 224px; }
  .measure-field { width: 88px; }
  .m-top-left { transform: translateX(-108%); }
  .m-top-right { transform: translateX(108%); }
  .m-bottom-left { transform: translateX(-108%); }
  .m-bottom-right { transform: translateX(108%); }
}

/* V23 Precon locking + mobile fraction entry ------------------------------- */
.survey-lock-banner {
  margin: 10px 0 4px;
  padding: 11px 13px;
  border: 1px solid #d7b866;
  border-radius: 9px;
  background: #fff8df;
  color: #684f0d;
  font-size: 13px;
  font-weight: 750;
}
.mobile-measurement-pad { display: none; }
.measure-field input.active-measurement { outline: 2px solid #3e94e6; outline-offset: 1px; border-color: #6ea9db; background: #f3f9ff; }
.precon-lock-badge,
.precon-unlocked-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}
.precon-lock-badge { background: #eaf2fb; color: #174f86; border: 1px solid #b9d0e7; }
.precon-unlocked-badge { background: #f4f6f8; color: #687785; border: 1px solid #d8e0e7; }
.review-row-actions { display: flex; gap: 6px; align-items: center; }
.review-lock-record {
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid #b9c9d9;
  border-radius: 7px;
  background: #173554;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
.review-lock-record.unlock { background: #fff; color: #6b4c00; border-color: #d7b866; }
.review-data-table { min-width: 2750px; }

/* V38 field measurement keypad: popup sheet, not inline content */
.mobile-measurement-pad,
.mobile-measurement-pad-backdrop { display: none; }
.mobile-measurement-pad[hidden],
.mobile-measurement-pad-backdrop[hidden] { display: none !important; }

@media (max-width: 700px), (any-pointer: coarse) and (max-width: 1400px) {
  .mobile-measurement-pad-backdrop:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1090;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(11, 30, 48, .36);
  }
  .mobile-measurement-pad:not([hidden]) {
    display: block;
    position: fixed;
    left: 50%;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 1100;
    width: min(520px, calc(100vw - 20px));
    max-height: min(78dvh, 760px);
    overflow-y: auto;
    margin: 0;
    padding: 14px;
    border: 1px solid #c8d6e3;
    border-radius: 16px;
    background: #f7fafc;
    box-shadow: 0 18px 55px rgba(8, 31, 53, .28);
    transform: translateX(-50%);
    -webkit-overflow-scrolling: touch;
  }
  .mobile-measurement-pad-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
  }
  .mobile-measurement-pad-head > div {
    display: grid;
    gap: 3px;
    min-width: 0;
  }
  .mobile-measurement-pad-head span {
    color: #5d7285;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .03em;
  }
  .mobile-measurement-pad-head strong {
    color: #173554;
    font-size: 14px;
    font-weight: 900;
    text-align: left;
  }
  .mobile-measurement-pad .mobile-measurement-pad-close {
    flex: 0 0 46px;
    width: 46px;
    min-height: 46px;
    padding: 0;
    border: 1px solid #becbd7;
    border-radius: 12px;
    background: #fff;
    color: #51687d;
    font-size: 25px;
    line-height: 1;
    font-weight: 700;
  }
  .mobile-keypad-section { margin-top: 10px; }
  .mobile-keypad-section > span {
    display: block;
    margin-bottom: 7px;
    color: #6a7d90;
    font-size: 11px;
    font-weight: 800;
  }
  .mobile-fraction-shortcuts {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
  }
  .mobile-number-pad {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }
  .mobile-measurement-pad button:not(.mobile-measurement-pad-close) {
    min-height: 46px;
    border: 1px solid #abc2d8;
    border-radius: 10px;
    background: #fff;
    color: #173554;
    font-size: 16px;
    font-weight: 850;
  }
  .mobile-keypad-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
  }
  .mobile-keypad-actions button:first-child {
    background: #fff7f2;
    border-color: #d8b59b;
    color: #8b542d;
  }
  .mobile-keypad-actions button:last-child {
    background: #edf5ff;
    border-color: #98b9dd;
    color: #155a95;
  }
  .mobile-measurement-pad button:active { background: #e9f3fd; }
  .mobile-measurement-pad button:disabled { opacity: .45; }
  .mobile-measurement-pad small {
    display: block;
    margin-top: 10px;
    color: #6d7f90;
    font-size: 10px;
    line-height: 1.35;
    text-align: center;
  }
}

/* iPadOS fallback when Safari presents a desktop-class media profile. */
.field-device .mobile-measurement-pad-backdrop:not([hidden]) {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 1090;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(11, 30, 48, .36);
}
.field-device .mobile-measurement-pad:not([hidden]) {
  display: block;
  position: fixed;
  left: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 1100;
  width: min(520px, calc(100vw - 20px));
  max-height: min(78dvh, 760px);
  overflow-y: auto;
  margin: 0;
  padding: 14px;
  border: 1px solid #c8d6e3;
  border-radius: 16px;
  background: #f7fafc;
  box-shadow: 0 18px 55px rgba(8, 31, 53, .28);
  transform: translateX(-50%);
  -webkit-overflow-scrolling: touch;
}
.field-device .mobile-measurement-pad-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; }
.field-device .mobile-measurement-pad-head > div { display:grid; gap:3px; min-width:0; }
.field-device .mobile-measurement-pad-head span { color:#5d7285; font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.03em; }
.field-device .mobile-measurement-pad-head strong { color:#173554; font-size:14px; font-weight:900; text-align:left; }
.field-device .mobile-measurement-pad .mobile-measurement-pad-close { flex:0 0 46px; width:46px; min-height:46px; padding:0; border:1px solid #becbd7; border-radius:12px; background:#fff; color:#51687d; font-size:25px; line-height:1; font-weight:700; }
.field-device .mobile-keypad-section { margin-top:10px; }
.field-device .mobile-keypad-section > span { display:block; margin-bottom:7px; color:#6a7d90; font-size:11px; font-weight:800; }
.field-device .mobile-fraction-shortcuts { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:7px; }
.field-device .mobile-number-pad { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; }
.field-device .mobile-measurement-pad button:not(.mobile-measurement-pad-close) { min-height:46px; border:1px solid #abc2d8; border-radius:10px; background:#fff; color:#173554; font-size:16px; font-weight:850; }
.field-device .mobile-keypad-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:10px; }
.field-device .mobile-keypad-actions button:first-child { background:#fff7f2; border-color:#d8b59b; color:#8b542d; }
.field-device .mobile-keypad-actions button:last-child { background:#edf5ff; border-color:#98b9dd; color:#155a95; }
.field-device .mobile-measurement-pad small { display:block; margin-top:10px; color:#6d7f90; font-size:10px; line-height:1.35; text-align:center; }

/* V25 suite / tenant floor-layout layer ---------------------------------- */
.map-action-row { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin:8px 0; }
.layout-edit-toggle { min-height:38px; padding:0 14px; border:1px solid #b9c7d5; border-radius:8px; background:#fff; color:#173b5c; font-weight:800; cursor:pointer; }
.layout-edit-toggle.active { background:#e9f3ff; border-color:#3d86cc; color:#0b5fac; }
.layout-toolbar { display:flex; align-items:center; gap:7px; flex-wrap:wrap; padding:9px 10px; margin-bottom:8px; border:1px solid #c9d6e2; border-radius:10px; background:#f7fafc; }
.layout-toolbar button { min-height:38px; padding:0 11px; border:1px solid #bdcad7; border-radius:8px; background:#fff; color:#183b59; font-weight:800; cursor:pointer; }
.layout-toolbar button.active { background:#e7f2ff; border-color:#2c78bd; color:#075ca7; }
.layout-toolbar button.primary { background:#0d70c7; border-color:#0d70c7; color:#fff; }
.layout-toolbar span { flex:1 1 260px; font-size:12px; color:#536b80; }
.layout-wall-layer, .suite-layer { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
.layout-wall-layer { z-index:2; overflow:visible; }
.layout-wall { stroke-width:3; pointer-events:stroke; }
.layout-wall.added { stroke:#0b74c8; }
.layout-wall.removed { stroke:#d43b3b; stroke-dasharray:7 5; }
.suite-layer { z-index:2; }
.suite-map-label { position:absolute; transform:translate(-50%,-50%); min-width:92px; max-width:150px; padding:7px 9px; border:1px solid rgba(22,90,145,.45); border-radius:9px; background:rgba(239,248,255,.92); box-shadow:0 2px 8px rgba(20,50,75,.16); color:#123b5d; text-align:center; cursor:pointer; pointer-events:auto; touch-action:manipulation; }
.suite-map-label strong, .suite-map-label span { display:block; }
.suite-map-label strong { font-size:12px; }
.suite-map-label span { margin-top:2px; font-size:10px; font-weight:650; line-height:1.15; }
.suite-modal { width:min(920px, calc(100vw - 28px)); max-height:92vh; overflow:auto; background:#fff; border-radius:16px; box-shadow:0 24px 70px rgba(0,0,0,.28); }
.suite-form { padding:18px 24px 24px; }
.suite-identity-grid, .suite-field-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.suite-form label { display:grid; gap:6px; color:#173b5c; font-size:12px; font-weight:850; }
.suite-form input, .suite-form select, .suite-form textarea { width:100%; border:1px solid #bdcbd8; border-radius:8px; padding:10px; background:#fff; color:#1d354b; font:inherit; }
.suite-field-grid .wide { grid-column:1 / -1; }
.suite-auto-card { margin:18px 0; padding:15px; border:1px solid #cfe0ee; border-radius:12px; background:#f5faff; }
.suite-auto-card > div:first-child { display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.suite-auto-card > div:first-child span { font-size:12px; color:#64788b; }
.suite-auto-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:14px; }
.suite-auto-grid div { padding:10px; border-radius:8px; background:#fff; }
.suite-auto-grid span, .suite-auto-grid strong { display:block; }
.suite-auto-grid span { font-size:11px; color:#64788b; }
.suite-auto-grid strong { margin-top:3px; color:#183b59; }
.suite-form-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:18px; }
.suite-form-actions button { min-height:44px; padding:0 18px; border-radius:8px; border:1px solid #bcc9d6; background:#fff; font-weight:800; cursor:pointer; }
#suiteFormMessage { min-height:20px; color:#177345; font-weight:700; }
@media (max-width: 700px), (any-pointer: coarse) and (max-width: 1400px) {
  .layout-toolbar { position:sticky; top:0; z-index:10; padding:8px; }
  .layout-toolbar button { min-height:44px; flex:1 1 30%; padding:0 7px; font-size:12px; }
  .layout-toolbar span { flex-basis:100%; }
  .suite-map-label { min-width:82px; padding:8px 7px; }
  .suite-modal { width:100vw; max-height:100dvh; min-height:100dvh; border-radius:0; }
  .suite-form { padding:16px; }
  .suite-identity-grid, .suite-field-grid { grid-template-columns:1fr; }
  .suite-field-grid .wide { grid-column:auto; }
  .suite-auto-grid { grid-template-columns:1fr 1fr; }
  .suite-form-actions { position:sticky; bottom:0; padding:10px 0; background:#fff; }
  .suite-form-actions button { flex:1; min-height:50px; }
}

/* V28 suite editor / touch layout refinement -------------------------------- */
.layout-wall-layer { pointer-events:auto; }
.layout-wall { stroke-width:2.2; pointer-events:stroke; cursor:pointer; }
.layout-wall.added { stroke:#0b74c8; }
.layout-wall.added.selected { stroke:#e53935; stroke-dasharray:6 4; }
.layout-wall.removed { stroke:#d43b3b; stroke-dasharray:7 5; opacity:.7; }
.wall-handle { fill:#fff; stroke:#1976d2; stroke-width:.5; vector-effect:non-scaling-stroke; cursor:grab; pointer-events:all; }
.wall-handle:active { cursor:grabbing; fill:#e8f2ff; }

.suite-layer { z-index:2; }
.suite-map-label.suite-area {
  transform:none;
  min-width:60px;
  max-width:none;
  min-height:44px;
  padding:10px;
  border:1.5px solid rgba(20,92,153,.45);
  border-radius:6px;
  background:rgba(223,242,255,.72);
  box-shadow:none;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  overflow:visible;
  backdrop-filter:blur(.3px);
}
.suite-map-label.suite-area.selected { border:2.5px solid #0d70c7; box-shadow:0 0 0 3px rgba(13,112,199,.12); }
.suite-map-label.suite-area strong { font-size:13px; }
.suite-map-label.suite-area span { font-size:10px; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.suite-resize-handle { position:absolute; width:18px; height:18px; right:-9px; bottom:-9px; border:3px solid #fff; border-radius:50%; background:#0d70c7; box-shadow:0 0 0 1px #0d70c7; cursor:nwse-resize; touch-action:none; }

.suite-editor-card { border:1px solid #c9d7e4; padding:0; overflow:hidden; }
.suite-editor-tabs { display:grid; grid-template-columns:1fr 1fr; border-bottom:1px solid #d8e2eb; background:#f7fafc; }
.suite-editor-tabs button { min-height:44px; border:0; background:transparent; color:#31506d; font-weight:850; cursor:pointer; }
.suite-editor-tabs button.active { background:#fff; color:#0d66b4; box-shadow:inset 0 -3px 0 #0d70c7; }
.suite-editor-body { display:grid; gap:12px; padding:14px; }
.suite-editor-body label { display:grid; gap:5px; color:#173b5c; font-size:12px; font-weight:800; }
.suite-editor-body input,.suite-editor-body textarea { width:100%; border:1px solid #bdcbd8; border-radius:8px; padding:9px 10px; background:#fff; color:#1d354b; font:inherit; }
.suite-editor-actions { display:grid; gap:8px; margin-top:4px; }
.suite-editor-actions button { min-height:42px; border:1px solid #b8c8d7; border-radius:8px; background:#fff; color:#173b5c; font-weight:850; cursor:pointer; }
.suite-editor-actions button.primary { background:#0d70c7; border-color:#0d70c7; color:#fff; }
.suite-editor-actions button.danger { border-color:#efb2b2; color:#b22424; }
.suite-editor-help { margin:4px 0 0; padding:10px; border-radius:8px; background:#eef7ff; color:#48657f; font-size:11px; line-height:1.35; }

@media (max-width: 700px), (any-pointer: coarse) and (max-width: 1400px) {
  .suite-editor-card { position:fixed; left:8px; right:8px; bottom:8px; z-index:60; max-height:72dvh; overflow:auto; box-shadow:0 12px 34px rgba(17,44,68,.28); border-radius:14px; background:#fff; }
  .suite-editor-body { padding-bottom:16px; }
  .suite-map-label.suite-area { min-width:90px; min-height:62px; }
  .wall-handle { r:1.6; }
}

/* V29 touch-first suite wall mapping --------------------------------------- */
.map-zoom-stage.layout-drawing { touch-action: none; cursor: crosshair; }
.map-zoom-stage.layout-drawing .hotspot-layer,
.map-zoom-stage.layout-drawing .suite-layer { pointer-events: none; }
.map-zoom-stage.layout-assigning .window-hotspot { cursor: pointer; }
.window-hotspot.metadata-hotspot.suite-assigned .window-label {
  background: #e6f2ff;
  color: #075ca7;
  box-shadow: 0 0 0 2px #2f86d2;
}
.layout-wall.wall-preview {
  stroke: #0d70c7;
  stroke-width: 2.4;
  stroke-dasharray: 5 4;
  opacity: .8;
  pointer-events: none;
}
.wall-handle-hit {
  fill: transparent;
  stroke: transparent;
  stroke-width: 1;
  pointer-events: all;
  cursor: grab;
  touch-action: none;
}
.wall-handle-hit:active { cursor: grabbing; }
.suite-map-label.suite-area.entire-floor-suite {
  background: rgba(245,248,251,.9) !important;
  border-style: dashed;
  border-color: #72879a;
  color: #304b63;
}
.suite-map-label.suite-area small {
  margin-top: 3px;
  font-size: 9px;
  color: #62798e;
  font-weight: 750;
}
.suite-window-assignment {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #cfdae5;
  border-radius: 9px;
  background: #f8fbfd;
}
.suite-window-assignment span { font-size: 11px; font-weight: 850; color: #49647d; text-transform: uppercase; letter-spacing: .03em; }
.suite-window-assignment strong { color: #153c60; }
.suite-window-assignment small { color: #647b90; line-height: 1.35; }

@media (max-width: 700px), (any-pointer: coarse) and (max-width: 1400px) {
  .layout-toolbar { gap: 6px; }
  .layout-toolbar button { min-height: 48px; font-size: 13px; }
  .layout-edit-toggle { min-height: 46px; }
  .suite-editor-actions button { min-height: 48px; }
  .suite-map-label.suite-area { min-width: 82px; min-height: 52px; }
  .window-hotspot.metadata-hotspot { width: 52px; height: 52px; }
}
.map-zoom-stage.layout-drawing .suite-map-label,
.map-zoom-stage.layout-drawing .window-hotspot { pointer-events: none !important; }

/* V30 direct touch/stylus suite movement ---------------------------------- */
.suite-map-label.suite-area.layout-editing-suite {
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.suite-map-label.suite-area.layout-editing-suite:active { cursor: grabbing; }
.suite-map-label.suite-area.layout-editing-suite .suite-resize-handle {
  width: 24px;
  height: 24px;
  right: -12px;
  bottom: -12px;
}
@media (max-width: 700px), (any-pointer: coarse) and (max-width: 1400px) {
  .suite-map-label.suite-area.layout-editing-suite { min-width: 96px; min-height: 60px; }
  .suite-map-label.suite-area.layout-editing-suite .suite-resize-handle {
    width: 30px;
    height: 30px;
    right: -15px;
    bottom: -15px;
    border-width: 4px;
  }
}


/* V32 reliable layout editor ------------------------------------------------ */
.layout-toolbar button.danger { border-color:#e5a6a6; color:#a92323; background:#fffafa; }
.layout-toolbar button.danger:hover { background:#fff0f0; }
.layout-toolbar button:disabled { opacity:.58; cursor:default; }
.layout-toolbar button.primary.dirty { box-shadow:0 0 0 3px rgba(13,112,199,.16); }
.layout-save-state { flex:0 0 auto !important; padding:5px 8px; border-radius:999px; background:#e9f7ee; color:#247044 !important; font-weight:850; white-space:nowrap; }
.layout-save-state.dirty { background:#fff2d9; color:#925d00 !important; }
.layout-save-state.saving { background:#e8f2ff; color:#075ca7 !important; }
.wall-line-hit { stroke:rgba(0,0,0,0.001); stroke-width:18; pointer-events:stroke; cursor:pointer; touch-action:none; }
.map-zoom-stage.layout-drawing .wall-line-hit { pointer-events:none; }
.layout-wall.added.selected { stroke:#e53935; stroke-width:3.2; stroke-dasharray:none; }
.wall-handle-hit { cursor:grab; }
@media (max-width: 700px), (any-pointer: coarse) and (max-width: 1400px) {
  .wall-line-hit { stroke-width:28; }
  .layout-save-state { order:20; flex:1 1 auto !important; text-align:center; }
  #layoutHint { order:21; }
  #layoutDeleteSelected { flex-basis:45%; }
  #layoutSave { flex-basis:45%; }
}


/* V33 iPad field mode + survey order --------------------------------------- */
.measurement-top-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 auto 16px;
  width: min(520px, 100%);
}
.measurement-top-options .choice-stack { margin-bottom: 0; max-width: none; }
.survey-measurement-column > .photo-intake { margin-top: 18px; }
@media (max-width: 700px), (any-pointer: coarse) and (max-width: 1400px) {
  .measurement-top-options { grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 18px; }
  .measurement-top-options .choice-stack span { min-height: 52px; }
  .survey-measurement-column > .photo-intake { margin-top: 18px; }
}
@media (max-width: 430px) {
  .measurement-top-options { grid-template-columns: 1fr; }
}

/* V34 desktop survey placement -------------------------------------------- */
.desktop-film-shades-slot .measurement-top-options {
  grid-template-columns: 1fr;
  width: 100%;
  margin: 0;
  gap: 0;
}
.desktop-film-shades-slot .measurement-top-options .choice-stack {
  margin: 0 0 30px;
}
.mobile-film-shades-slot { display: block; }
@media (max-width: 700px), (any-pointer: coarse) and (max-width: 1400px) {
  .desktop-film-shades-slot { display: none; }
  .mobile-film-shades-slot { display: block; }
}


/* V35 reliable iPad field mode + simpler delete workflow ------------------- */
/* JavaScript adds .field-device on iPadOS even when Safari reports a
   desktop-class viewport/pointer. These rules intentionally mirror the core
   phone/tablet field interface without changing normal desktop browsers. */
.field-device body { padding-bottom:66px; }
.field-device .app-shell { display:block; min-height:100vh; }
.field-device .sidebar { position:fixed; z-index:900; left:0; right:0; bottom:0; min-height:0; height:64px; display:block; background:#0a2239; box-shadow:0 -4px 18px rgba(7,28,47,.18); }
.field-device .brand, .field-device .sidebar-user { display:none; }
.field-device .main-nav { height:64px; padding:5px 8px; display:grid; grid-template-columns:repeat(4,1fr); gap:4px; }
.field-device .nav-item, .field-device .nav-item:not(.active) { min-width:0; padding:5px 3px; gap:2px; flex-direction:column; justify-content:center; border-radius:8px; font-size:10px; color:#dce8f4; }
.field-device .nav-item span { width:auto; font-size:18px; }
.field-device .nav-item.active { font-size:10px; }
.field-device .app-header { height:34px; padding:0 12px; }
.field-device .header-title { font-size:11px; }
.field-device .content { padding:10px 10px 22px; }
.field-device .breadcrumbs { margin-bottom:5px; font-size:11px; overflow-x:auto; white-space:nowrap; }
.field-device .dashboard-grid { display:block; }
.field-device .selector-panel, .field-device .right-rail { display:none; }
.field-device .map-card { border-radius:10px; }
.field-device .map-card-header { min-height:0; display:grid; grid-template-columns:1fr auto; gap:8px 10px; padding:10px; }
.field-device .map-card-header > div:first-child { grid-column:1; }
.field-device .map-card-header > div:first-child span { display:none; }
.field-device .status-summary { grid-column:1 / -1; order:3; display:grid; grid-template-columns:repeat(4,auto); justify-content:space-between; gap:5px; font-size:9px; overflow-x:auto; }
.field-device .mobile-view-toggle { display:none !important; }
.field-device .mobile-view-toggle button { border:0; border-radius:7px; background:transparent; color:#526a80; min-height:38px; padding:0 14px; font-size:12px; font-weight:850; }
.field-device .mobile-view-toggle button.active { background:#fff; color:#0d61b6; box-shadow:0 1px 4px rgba(20,54,84,.12); }
.field-device .map-zoom-toolbar { display:flex; position:sticky; top:0; z-index:20; justify-content:flex-end; gap:5px; padding:6px 8px; background:rgba(255,255,255,.94); border-bottom:1px solid #d9e3ec; }
.field-device .map-zoom-toolbar button { min-width:42px; min-height:38px; border:1px solid #b7c9da; border-radius:8px; background:#fff; color:#173554; font-size:18px; font-weight:850; }
.field-device .map-zoom-toolbar #mapZoomReset { min-width:92px; font-size:11px; padding:0 10px; }
.field-device .map-frame { min-height:420px; max-height:68vh; overflow:auto; touch-action:pan-x pan-y pinch-zoom; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; }
.field-device .map-zoom-stage:not(.window-select-ready) .window-hotspot,
.field-device .map-zoom-stage:not(.window-select-ready) .suite-map-label { pointer-events:none; }
.field-device .window-hotspot.metadata-hotspot { width:72px; height:72px; }
.field-device .map-zoom-stage.window-select-ready .window-hotspot.metadata-hotspot .window-label { min-width:27px; height:28px; font-size:14px; box-shadow:0 0 0 1px rgba(175,192,208,.9), 0 2px 6px rgba(20,54,84,.12); }
.field-device .mobile-window-list { min-height:58vh; }
.field-device .mobile-window-grid { grid-template-columns:repeat(5,minmax(0,1fr)); }
.field-device .layout-toolbar { position:sticky; top:0; z-index:30; padding:8px; }
.field-device .layout-toolbar button { min-height:46px; flex:1 1 30%; padding:0 8px; font-size:12px; }
.field-device .layout-toolbar span { flex-basis:100%; }
.field-device .wall-line-hit { stroke-width:32; }
.field-device #layoutDeleteSelected { flex-basis:45%; font-weight:900; }
.field-device #layoutDeleteSelected.active { background:#ffe8e8; border-color:#d55252; color:#9f2020; box-shadow:0 0 0 2px rgba(213,82,82,.12); }
.field-device #layoutSave { flex-basis:45%; }
.field-device .layout-save-state { order:20; flex:1 1 auto !important; text-align:center; }
.field-device #layoutHint { order:21; }
.field-device .modal-backdrop { padding:0; background:#fff; overflow:hidden; }
.field-device .survey-modal { width:100%; height:100dvh; max-height:none; margin:0; border:0; border-radius:0; overflow:auto; box-shadow:none; }
.field-device .survey-modal-header { position:sticky; top:0; z-index:20; padding:10px 14px 8px; background:#fff; border-bottom:1px solid #dce3ea; }
.field-device .survey-form-v11 { padding:0 12px 82px; }
.field-device .mobile-survey-nav { display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:8px; margin:0 -12px 10px; padding:8px 12px; background:#f4f8fc; border-bottom:1px solid #dce5ee; }
.field-device .mobile-survey-nav button { min-height:42px; border:1px solid #b7c9da; border-radius:9px; background:#fff; color:#1a5f9b; font-weight:850; }
.field-device .survey-main-grid { padding-top:8px; }
.field-device .survey-column { padding:16px 0; }
.field-device .choice-stack { max-width:none; margin-bottom:20px; }
.field-device .choice-stack span { min-height:54px; font-size:15px; }
.field-device .photo-intake { max-width:none; padding:12px; }
.field-device .photo-camera-button { min-height:72px; background:#1769d2; color:#fff; border-color:#1769d2; }
.field-device .measurement-board { position:relative; min-height:570px; width:100%; max-width:430px; margin:0 auto; display:block; }
.field-device .survey-actions-v11 { position:sticky; bottom:0; z-index:25; width:calc(100% + 24px); margin:18px -12px -82px; padding:8px 10px calc(8px + env(safe-area-inset-bottom)); border-top:1px solid #cfdbe6; background:rgba(255,255,255,.97); box-shadow:0 -5px 18px rgba(25,52,78,.10); display:grid; grid-template-columns:76px minmax(0,1fr) 76px; gap:8px; }
.field-device .survey-actions-v11 .survey-cancel-button { display:none; }
.field-device .mobile-action-prev, .field-device .mobile-action-next { display:block; min-width:0; min-height:50px; }
.field-device .desktop-film-shades-slot { display:none; }
.field-device .mobile-film-shades-slot { display:block; }


/* V45/V46 phone-specific field map tuning --------------------------------- */
.phone-map-hint { display:none; }
@media (orientation: portrait) {
  .phone-field-device .phone-map-hint {
    display:flex;
    align-items:center;
    justify-content:center;
    gap:5px;
    margin:0;
    padding:7px 10px;
    border-top:1px solid #dce6ef;
    border-bottom:1px solid #dce6ef;
    background:#f4f8fc;
    color:#526b82;
    font-size:11px;
    line-height:1.25;
    text-align:center;
  }
  .phone-field-device .phone-map-hint > span { color:#1769d2; font-size:17px; font-weight:900; line-height:1; }
  .phone-field-device .phone-map-hint strong { color:#244967; }
}
.phone-field-device .map-frame {
  min-height:360px;
  max-height:72dvh;
}
.phone-field-device .window-hotspot.metadata-hotspot {
  /* Keep the target comfortably finger-sized without letting neighboring
     windows steal each other's taps once the phone is zoomed in. */
  width:48px;
  height:52px;
}
.phone-field-device .map-zoom-stage.window-select-ready .window-hotspot.metadata-hotspot .window-label {
  min-width:34px;
  height:36px;
  padding:0 6px;
  border-radius:8px;
  font-size:17px;
  font-weight:900;
  box-shadow:0 0 0 1px rgba(148,172,194,.95), 0 3px 9px rgba(20,54,84,.16);
}
.phone-field-device .map-zoom-toolbar button {
  min-width:48px;
  min-height:44px;
}
.phone-field-device .map-zoom-toolbar #mapZoomReset {
  min-width:104px;
  font-size:12px;
}
@media (orientation: landscape) {
  .phone-field-device .map-frame {
    min-height:260px;
    max-height:calc(100dvh - 132px);
  }
}

/* V49 enlarged photo viewer + saved-photo deletion ------------------------ */
.photo-thumb img[role="button"] { cursor: zoom-in; }
.saved-photo-remove { font-size: 14px; background: rgba(139, 28, 37, .92); }
.photo-viewer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3200;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 12, 22, .94);
}
.photo-viewer-backdrop[hidden] { display: none; }
.photo-viewer {
  width: min(1100px, 100%);
  max-height: calc(100dvh - 36px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: #fff;
}
.photo-viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  font-weight: 800;
}
.photo-viewer-actions { display: flex; align-items: center; gap: 8px; }
.photo-viewer-close,
.photo-viewer-delete,
.photo-viewer-nav {
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.12);
  color: #fff;
  font: inherit;
}
.photo-viewer-close {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
}
.photo-viewer-delete {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 9px;
  background: rgba(177, 34, 45, .88);
  font-weight: 800;
}
.photo-viewer-delete:disabled { opacity: .45; }
.photo-viewer-stage {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 10px;
}
.photo-viewer-stage img {
  width: 100%;
  height: min(78dvh, 820px);
  object-fit: contain;
  border-radius: 10px;
  background: #050b10;
  touch-action: pinch-zoom;
  user-select: none;
  -webkit-user-drag: none;
}
.photo-viewer-nav {
  width: 50px;
  height: 64px;
  border-radius: 12px;
  font-size: 42px;
  line-height: 1;
}
.photo-viewer-nav:disabled { opacity: .22; }
.photo-viewer-hint { text-align: center; color: #cbd5df; font-size: 12px; }

@media (max-width: 700px), (any-pointer: coarse) and (max-width: 1400px) {
  .photo-viewer-backdrop { padding: 0; }
  .photo-viewer { width: 100%; height: 100dvh; max-height: none; padding: 10px; }
  .photo-viewer-stage { grid-template-columns: 42px minmax(0, 1fr) 42px; gap: 4px; }
  .photo-viewer-stage img { height: calc(100dvh - 118px); border-radius: 6px; }
  .photo-viewer-nav { width: 40px; height: 58px; font-size: 36px; }
  .photo-viewer-delete { min-height: 40px; padding: 0 11px; }
  .photo-viewer-hint { display: none; }
}
