/* ==========================================================================
   Khảo sát hiện trường — Prototype
   Design tokens reuse the workbook's palette (navy header / orange = Appendix 1)
   for visual continuity with 260921_Template_EN_VN_V2b.xlsx.
   ========================================================================== */

:root{
  --navy: #1F3864;
  --band: #2F5597;
  --accent: #ED7D31;
  --accent-dark: #C55A11;
  --bg: #F4F6FA;
  --surface: #FFFFFF;
  --border: #E3E8F0;
  --text: #1C2536;
  --text-muted: #6B7688;
  --success: #2E7D32;
  --success-bg: #E8F5E9;
  --danger: #C0392B;
  --danger-bg: #FDEDEB;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --shadow-lg: 0 8px 24px rgba(16,24,40,.14);
}

*{ box-sizing: border-box; }
html,body{ height:100%; overflow:hidden; }
body{
  margin:0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea{ font-family: inherit; }
svg{ display:block; }

.visually-hidden{ position:absolute !important; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.hidden{ display:none !important; }

/* ---------------------------------------------------------------- layout */
.app{
  height: 100vh;
  height: 100dvh; /* modern mobile browsers: excludes the address-bar chrome */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar{
  background: var(--navy);
  color:#fff;
  padding: 10px 14px;
  display:flex;
  flex-direction:column;
  gap:10px;
  flex: none;
  z-index: 20;
  box-shadow: var(--shadow);
}
.brand{ display:flex; align-items:center; gap:10px; }
.brand-mark{
  width:34px; height:34px; border-radius:9px;
  background: var(--accent);
  display:flex; align-items:center; justify-content:center;
  font-weight:700; font-size:13px; letter-spacing:.02em;
  flex: none;
}
.brand-title{ font-size:15px; font-weight:700; line-height:1.2; }
.brand-sub{ font-size:11px; color:#C9D6EE; line-height:1.2; margin-top:1px; }

.tabs{ display:flex; gap:6px; background:rgba(255,255,255,.08); padding:4px; border-radius:11px; }
.tab{
  flex:1;
  display:flex; align-items:center; justify-content:center; gap:6px;
  background:transparent; border:none; color:#C9D6EE;
  font-size:13px; font-weight:600;
  padding:8px 10px; border-radius:8px;
  cursor:pointer;
  transition: background .15s ease, color .15s ease;
}
.tab-icon{ width:16px; height:16px; }
.tab.active{ background:#fff; color: var(--navy); }
.count-badge{
  background: var(--accent);
  color:#fff;
  font-size:11px; font-weight:700;
  min-width:18px; height:18px; padding:0 5px;
  border-radius:999px;
  display:inline-flex; align-items:center; justify-content:center;
}
.tab.active .count-badge{ background: var(--navy); }

.content{ flex:1; display:flex; min-height:0; }

.view{ display:none; flex:1; min-height:0; min-width:0; flex-direction:column; }
.view.active{ display:flex; }

.pane-scroll{
  flex:1;
  min-height:0;
  overflow-y:auto;
  padding: 14px 14px 8px;
  -webkit-overflow-scrolling: touch;
}

/* ---------------------------------------------------------------- building card (replaces the old ID preview) */
.building-card{
  background: linear-gradient(135deg, var(--band), var(--navy));
  color:#fff;
  border-radius: var(--radius);
  padding: 12px 14px 14px;
  margin-bottom:12px;
  box-shadow: var(--shadow);
}
.building-head{ display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; }
.building-label{
  display:inline-flex; align-items:center; gap:7px;
  font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:#DCE5F5;
}
.building-label svg{ width:17px; height:17px; }
.building-label .req{ color:#FFB38A; }
.building-demo{
  font-size:10px; font-weight:800; letter-spacing:.06em;
  background: rgba(237,125,49,.22); color:#FFD2B5; border:1px solid rgba(237,125,49,.5);
  padding:2px 7px; border-radius:999px;
}
.select-on-dark select{
  background: rgba(255,255,255,.96);
  border-color: transparent;
  font-size:15px; font-weight:800; color: var(--navy);
}
.select-on-dark::after{ border-color: var(--navy); }
.building-name{ font-size:13.5px; font-weight:700; margin-top:9px; line-height:1.35; }
.building-addr{ font-size:12px; color:#C9D6EE; margin-top:2px; line-height:1.35; }
.building-name:empty, .building-addr:empty{ display:none; }

/* ---------------------------------------------------------------- install hint / button, update banner */
.install-hint{
  display:flex; align-items:flex-start; gap:10px;
  background:#EEF3FC; border:1px solid #CFDCF3; color: var(--navy);
  border-radius: var(--radius-sm); padding:10px 10px 10px 12px; margin-bottom:12px;
  font-size:12.5px; line-height:1.45;
}
.install-hint-text{ flex:1; }
.inline-icon{ display:inline-block; width:15px; height:15px; vertical-align:-3px; }
.install-hint-close{ flex:none; width:28px; height:28px; }
.install-btn{
  flex:none; background: var(--accent); color:#fff; border:none;
  font-size:11.5px; font-weight:800; padding:6px 11px; border-radius:999px; cursor:pointer;
}
.update-banner{
  position:fixed; left:50%; top:calc(10px + env(safe-area-inset-top)); transform:translateX(-50%);
  z-index:70; display:flex; align-items:center; gap:12px;
  background:#fff; color: var(--text); border:1px solid var(--border);
  box-shadow: var(--shadow-lg); border-radius:999px; padding:7px 8px 7px 16px;
  font-size:13px; font-weight:600; white-space:nowrap; max-width: calc(100vw - 24px);
}

/* ---------------------------------------------------------------- edit strip (above the save bar) */
.edit-strip{
  flex:none; display:flex; align-items:center; gap:8px;
  background:#FFF1E6; color:#9A4209; border-top:1px solid #F8D3B8;
  padding:8px 14px; font-size:13px;
}
.edit-strip svg{ width:16px; height:16px; flex:none; }
.edit-strip strong{ font-size:14px; }
.edit-strip-bld{ color:#B7662E; font-size:12px; }

/* ---------------------------------------------------------------- step cards */
.step-card{
  background: var(--surface);
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.step-head{
  display:flex; align-items:center; gap:9px;
  margin-bottom: 12px;
}
.step-icon{
  width:26px; height:26px; border-radius:8px; flex:none;
  background:#EDF1FA; color: var(--navy);
  display:flex; align-items:center; justify-content:center;
}
.step-icon svg{ width:16px; height:16px; }
.step-title{
  font-size:13px; font-weight:700; color: var(--text);
  text-transform:uppercase; letter-spacing:.03em;
}
.step-body{ display:flex; flex-direction:column; gap:12px; }

.form-row{ display:flex; flex-direction:column; gap:12px; }
.form-field{ flex:1; min-width:0; display:flex; flex-direction:column; gap:6px; }
.form-field label{ font-size:11.5px; font-weight:700; color: var(--text-muted); text-transform:uppercase; letter-spacing:.02em; }

.req{ color: var(--danger); }

/* ---------------------------------------------------------------- dropdown selects */
.select-wrap{ position:relative; }
.select-wrap::after{
  content:"";
  position:absolute; right:11px; top:50%;
  width:7px; height:7px;
  border-right:2px solid var(--text-muted);
  border-bottom:2px solid var(--text-muted);
  transform: translateY(-65%) rotate(45deg);
  pointer-events:none;
}
.select-wrap{ min-width:0; }
.select-wrap select{
  appearance:none; -webkit-appearance:none; -moz-appearance:none;
  width:100%; min-width:0; max-width:100%;
  padding:11px 28px 11px 11px;
  border:1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size:13.5px; font-weight:600; color: var(--text);
  background: var(--surface);
  cursor:pointer;
  text-overflow: ellipsis;
}
.select-wrap select:focus{ outline:2px solid var(--band); outline-offset:1px; }
.select-wrap select:invalid,
.select-wrap select option[value=""]{ color: var(--text-muted); }

.custom-input{
  margin-top:2px;
  width:100%;
  padding:10px 12px;
  border:1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size:14px;
  background: var(--surface);
}
.custom-input:focus{ outline:2px solid var(--band); outline-offset:1px; }

/* legacy chip styles (kept for any residual use) */
.chips{ display:flex; flex-wrap:wrap; gap:8px; }
.chip{
  border:1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding:8px 14px;
  border-radius:999px;
  font-size:13.5px; font-weight:600;
  cursor:pointer;
  transition: all .12s ease;
  white-space:nowrap;
}
.chip:active{ transform: scale(.96); }
.chip.selected{
  background: var(--navy);
  border-color: var(--navy);
  color:#fff;
}

/* ---------------------------------------------------------------- type grid */
.type-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:8px;
}
.type-btn{
  display:flex; flex-direction:column; align-items:center; gap:4px;
  border:1.5px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding:8px 4px;
  cursor:pointer;
  transition: all .12s ease;
}
.type-btn:active{ transform: scale(.96); }
.type-badge{
  width:28px; height:28px; border-radius:999px;
  display:flex; align-items:center; justify-content:center;
  color:#fff; font-weight:800; font-size:10px;
  letter-spacing:.02em;
}
.type-name-vn{ font-size:11.5px; font-weight:700; text-align:center; line-height:1.15; }
.type-name-en{ font-size:9.5px; color: var(--text-muted); font-style:italic; text-align:center; line-height:1.1; }
.type-btn.selected{ border-color: var(--navy); background:#F0F4FB; box-shadow: inset 0 0 0 1.5px var(--navy); }

/* ---------------------------------------------------------------- measurements */
.measure-row{ display:flex; gap:10px; margin-bottom:10px; }
.input-wrap{ flex:1; min-width:0; display:flex; flex-direction:column; gap:5px; }
.input-wrap label{ font-size:11.5px; color: var(--text-muted); font-weight:600; }
.input-wrap input{
  width:100%; min-width:0;
  padding:10px 12px;
  border:1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size:15px;
}
.input-wrap input:focus{ outline:2px solid var(--band); outline-offset:1px; }

.segmented{ display:flex; gap:6px; }
.seg-btn{
  flex:1;
  padding:8px 4px;
  text-align:center;
  border:1.5px solid var(--border);
  background:#fff;
  border-radius:8px;
  font-size:12px; font-weight:600;
  cursor:pointer;
  color: var(--text-muted);
}
.seg-btn.selected{ background: var(--band); border-color: var(--band); color:#fff; }

.measure-note{
  font-size:12px; color: var(--text-muted); font-style:italic;
  padding:10px 2px;
}

/* ---------------------------------------------------------------- photos */
.photo-row{ display:flex; gap:10px; }
.photo-btn{
  flex:1;
  display:flex; flex-direction:column; align-items:center; gap:6px;
  background: var(--surface);
  border:1.5px dashed var(--border);
  border-radius: var(--radius);
  padding:14px 8px;
  cursor:pointer;
  transition: all .12s ease;
}
.photo-btn:active{ transform: scale(.98); }
.photo-thumb{
  width:56px; height:56px; border-radius:12px;
  background:#F0F2F6;
  display:flex; align-items:center; justify-content:center;
  color: var(--text-muted);
  overflow:hidden;
  flex:none;
}
.photo-thumb img{ width:100%; height:100%; object-fit:cover; }
.cam-icon{ width:26px; height:26px; }
.photo-label{ font-size:13px; font-weight:700; }
.photo-status{ font-size:11px; color: var(--text-muted); }
.photo-btn.captured{ border-style:solid; border-color: var(--success); }
.photo-btn.captured .photo-status{ color: var(--success); font-weight:700; }

textarea{
  width:100%;
  padding:11px 12px;
  border:1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size:14px;
  resize:vertical;
  min-height:64px;
}
textarea:focus{ outline:2px solid var(--band); outline-offset:1px; }

.form-spacer{ height:8px; }

/* ---------------------------------------------------------------- action bar */
.action-bar{
  display:flex; gap:10px;
  flex:none;
  padding:12px 14px calc(12px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top:1px solid var(--border);
  box-shadow: 0 -2px 8px rgba(16,24,40,.06);
}
.btn{
  border:none;
  border-radius: var(--radius-sm);
  padding:13px 18px;
  font-size:14.5px; font-weight:700;
  cursor:pointer;
  transition: opacity .12s ease, transform .12s ease;
}
.btn:active{ transform: scale(.98); }
.btn-primary{ flex:2; background: var(--accent); color:#fff; }
.btn-primary:disabled{ background:#D8DEE8; color:#98A2B3; cursor:not-allowed; }
.btn-ghost{ flex:1; background:#EEF1F6; color: var(--text-muted); }
.btn-outline{ background:#fff; border:1.5px solid var(--border); color: var(--navy); }
.btn-sm{ padding:8px 14px; font-size:13px; }

/* ---------------------------------------------------------------- list view */
.list-header{
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:14px;
}
.list-summary{ font-size:14px; color: var(--text-muted); }
.list-summary strong{ color: var(--navy); font-size:18px; }

.records{ display:flex; flex-direction:column; gap:10px; padding-bottom:20px; }

.empty-state{
  display:flex; flex-direction:column; align-items:center; gap:10px;
  padding:48px 20px; color: var(--text-muted); text-align:center;
}
.empty-icon{ width:40px; height:40px; opacity:.5; }
.empty-state p{ font-size:13.5px; line-height:1.5; margin:0; }

.record-card{
  display:flex; gap:10px;
  background: var(--surface);
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding:12px;
  box-shadow: var(--shadow);
  align-items:flex-start;
}
.record-badge{
  width:38px; height:38px; border-radius:10px; flex:none;
  display:flex; align-items:center; justify-content:center;
  color:#fff; font-weight:800; font-size:11.5px;
}
.record-main{ flex:1; min-width:0; }
.record-title{ font-size:14.5px; font-weight:800; display:flex; align-items:baseline; gap:7px; flex-wrap:wrap; }
.record-type{ font-size:12px; font-weight:500; color: var(--text-muted); }
.record-loc{ font-size:12.5px; color: var(--text-muted); margin-top:2px; }
.record-meta{ font-size:12px; color: var(--text-muted); margin-top:2px; }
.record-remarks{ font-size:12.5px; color: var(--text); margin-top:6px; line-height:1.4; }
.record-thumbs{ display:flex; gap:4px; flex:none; }
.record-thumbs img{ width:38px; height:38px; object-fit:cover; border-radius:8px; border:1px solid var(--border); }
.record-actions{ display:flex; flex-direction:column; gap:6px; flex:none; }
.icon-btn{
  width:30px; height:30px; border-radius:8px; border:1px solid var(--border);
  background:#fff; color: var(--text-muted); cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}
.icon-btn svg{ width:15px; height:15px; }
.icon-btn.delete:hover{ background: var(--danger-bg); color: var(--danger); border-color: var(--danger-bg); }
.icon-btn.edit:hover{ background:#EFF3FA; color: var(--navy); border-color:#EFF3FA; }

/* ---------------------------------------------------------------- toast */
.toast{
  position: fixed;
  left:50%; bottom:24px;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy);
  color:#fff;
  padding:11px 18px;
  border-radius:999px;
  font-size:13.5px; font-weight:600;
  box-shadow: var(--shadow-lg);
  opacity:0;
  pointer-events:none;
  transition: opacity .2s ease, transform .2s ease;
  z-index:60;
  width:max-content;
  max-width: calc(100vw - 32px);
  text-align:center;
  line-height:1.35;
}
.toast.show{ opacity:1; transform: translateX(-50%) translateY(0); }

/* ---------------------------------------------------------------- sync status (header pill + list banner) */
.brand{ flex:1; min-width:0; }
.brand-text{ min-width:0; }
.sync-pill{
  margin-left:auto; flex:none;
  display:inline-flex; align-items:center; gap:6px;
  background: rgba(255,255,255,.1);
  border:1px solid rgba(255,255,255,.18);
  color:#E6ECF7;
  font-size:11.5px; font-weight:700;
  padding:5px 10px; border-radius:999px;
  cursor:pointer; white-space:nowrap;
}
.sync-dot{ width:8px; height:8px; border-radius:999px; background:#98A2B3; flex:none; }
.sync-pill[data-state="online"] .sync-dot{ background:#4ADE80; }
.sync-pill[data-state="offline"] .sync-dot{ background:#F87171; }
.sync-pill[data-state="pending"] .sync-dot{ background: var(--accent); }
.sync-pill[data-state="syncing"] .sync-dot{ background:#FACC15; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse{ 50%{ opacity:.3; } }

.sync-banner{
  display:flex; align-items:center; gap:10px;
  background:#FFF4EC; border:1px solid #F8D3B8; color:#8A3B0A;
  border-radius: var(--radius-sm);
  padding:10px 12px; margin-bottom:12px;
  font-size:12.5px; line-height:1.4;
}
.sync-banner-text{ flex:1; min-width:0; }
.btn-accent-outline{ background:#fff; border:1.5px solid var(--accent); color: var(--accent-dark); flex:none; }

.field-hint{ font-size:11.5px; color: var(--text-muted); }

/* ---------------------------------------------------------------- list toolbar (building filter + export) */
.list-toolbar{ display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.list-filter{ flex:1; min-width:0; }
.list-filter select{ padding-top:9px; padding-bottom:9px; font-size:13px; }
.list-header{ margin-bottom:12px; }
.list-summary #listScope{ font-size:12.5px; }
.record-bld{
  display:inline-block; font-size:10.5px; font-weight:800; letter-spacing:.02em;
  color: var(--band); background:#EDF1FA; padding:1px 6px; border-radius:6px; margin-right:4px;
}
.photo-status.warn{ color:#B45309 !important; font-weight:700; }
.photo-status.busy{ color: var(--band) !important; }
.detail-photo-links{ display:flex; gap:10px; }

/* ---------------------------------------------------------------- list: clickable cards + pending state */
.record-card{ cursor:pointer; transition: border-color .12s ease, box-shadow .12s ease; }
.record-card:hover{ border-color:#C9D3E6; }
.record-card:active{ transform: scale(.995); }
.record-card.pending{ border-style:dashed; border-color:#F2B98D; background:#FFFCF9; }
.record-surveyor{ font-size:11.5px; color: var(--text-muted); margin-top:3px; }
.pill{
  display:inline-flex; align-items:center; gap:4px;
  font-size:10.5px; font-weight:700; letter-spacing:.02em;
  padding:2px 7px; border-radius:999px; white-space:nowrap;
}
.pill-pending{ background:#FFE9D8; color:#A4460B; }
.pill-error{ background: var(--danger-bg); color: var(--danger); }
.pill-ok{ background: var(--success-bg); color: var(--success); }

/* ---------------------------------------------------------------- detail sheet */
.sheet-backdrop{
  position:fixed; inset:0; background:rgba(16,24,40,.45); z-index:40;
}
.sheet{
  position:fixed; inset:0; z-index:45;
  background: var(--bg);
  display:flex; flex-direction:column;
}
.sheet[hidden], .sheet-backdrop[hidden]{ display:none; }
.sheet-head{
  flex:none;
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  background: var(--navy); color:#fff;
  padding:12px 14px;
  padding-top: calc(12px + env(safe-area-inset-top));
}
.sheet-title-wrap{ display:flex; align-items:center; gap:10px; min-width:0; }
.sheet-title{ font-size:19px; font-weight:800; letter-spacing:.02em; font-variant-numeric: tabular-nums; }
.sheet-sub{ font-size:12px; color:#C9D6EE; margin-top:1px; }
.sheet-close{ background:rgba(255,255,255,.12); border-color:rgba(255,255,255,.2); color:#fff; width:36px; height:36px; }
.sheet-close svg{ width:18px; height:18px; }
.sheet-body{ flex:1; min-height:0; overflow-y:auto; padding:14px; -webkit-overflow-scrolling: touch; }
.sheet-foot{
  flex:none; display:flex; gap:10px;
  padding:12px 14px calc(12px + env(safe-area-inset-bottom));
  background: var(--surface); border-top:1px solid var(--border);
}
.btn-danger-ghost{ flex:1; background: var(--danger-bg); color: var(--danger); }

.sync-state{ margin-bottom:12px; font-size:12.5px; }
.sync-state:empty{ display:none; }
.sync-state .pill{ font-size:11.5px; padding:4px 10px; }
.sync-state .sync-err{ display:block; margin-top:6px; color: var(--danger); font-size:12px; }

.detail-photos{ display:grid; grid-template-columns: 1fr 1fr; gap:10px; margin-bottom:14px; }
.detail-photo{
  display:flex; flex-direction:column; gap:6px;
  background: var(--surface); border:1px solid var(--border); border-radius: var(--radius);
  padding:8px; box-shadow: var(--shadow);
  text-decoration:none; color: var(--text);
}
.detail-photo img{ width:100%; aspect-ratio: 4 / 3; object-fit:cover; border-radius:9px; background:#EEF1F6; display:block; }
.detail-photo .empty-photo{
  width:100%; aspect-ratio: 4 / 3; border-radius:9px; background:#F0F2F6;
  display:flex; align-items:center; justify-content:center;
  color: var(--text-muted); font-size:12px;
}
.detail-photo-label{ font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.03em; color: var(--text-muted); display:flex; justify-content:space-between; }
.detail-photo-label span:last-child{ font-weight:600; text-transform:none; letter-spacing:0; color: var(--band); }

.detail-grid{
  margin:0;
  background: var(--surface); border:1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
  display:grid; grid-template-columns: minmax(110px, 38%) 1fr;
  overflow:hidden;
}
.detail-grid dt, .detail-grid dd{ margin:0; padding:10px 12px; border-bottom:1px solid var(--border); font-size:13.5px; line-height:1.4; }
.detail-grid dt{ color: var(--text-muted); font-size:12px; font-weight:700; background:#FAFBFD; }
.detail-grid dd{ font-weight:600; word-break: break-word; white-space: pre-wrap; }
.detail-grid dt:nth-last-of-type(1), .detail-grid dd:nth-last-of-type(1){ border-bottom:none; }
.detail-grid dd.muted{ color: var(--text-muted); font-weight:500; }

@media (min-width: 600px){
  .sheet{
    inset:auto; left:50%; top:50%; transform: translate(-50%, -50%);
    width: min(620px, calc(100vw - 48px)); max-height: calc(100dvh - 48px);
    border-radius: var(--radius); overflow:hidden; box-shadow: var(--shadow-lg);
  }
  .sheet-head{ padding-top:12px; }
  .sheet-body{ padding:18px; }
  .sheet-foot{ padding:12px 18px; }
}

/* ==========================================================================
   Responsive: tablet
   ========================================================================== */
@media (min-width: 600px){
  .pane-scroll{ padding: 20px 24px 12px; max-width: 640px; margin:0 auto; width:100%; }
  .action-bar{ max-width: 640px; margin:0 auto; width:100%; padding-left:24px; padding-right:24px; }
  .type-grid{ grid-template-columns: repeat(4, 1fr); }
  .form-row{ flex-direction:row; gap:12px; }
  .topbar{ padding: 12px 24px; flex-direction:row; align-items:center; justify-content:space-between; }
  .tabs{ max-width:340px; }
  .list-header{ max-width:640px; margin:0 auto 12px; }
  .list-toolbar{ max-width:640px; margin:0 auto 10px; }
  .records{ max-width:640px; margin:0 auto; width:100%; }
  .edit-strip{ max-width:640px; margin:0 auto; width:100%; }
}

/* ==========================================================================
   Responsive: desktop — two-pane layout, both views visible at once
   ========================================================================== */
@media (min-width: 960px){
  .topbar{ padding: 14px 32px; }
  .tabs{ display:none; }

  .content{ max-width:1280px; margin:0 auto; width:100%; gap:24px; padding: 24px 32px; }
  .view{ display:flex !important; }
  .view#view-form{ flex:0 0 420px; }
  .view#view-list{ flex:1; min-width:0; }

  .pane-scroll{ max-width:none; margin:0; padding:0; }
  .view#view-form .pane-scroll{
    background: var(--surface);
    border:1px solid var(--border);
    border-bottom:none;
    border-radius: var(--radius) var(--radius) 0 0;
    padding:20px;
    box-shadow: var(--shadow);
  }
  .action-bar{
    max-width:none; margin:0; padding: 14px 20px;
    border:1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    flex: none;
    box-shadow:none;
  }
  #view-form{ flex-direction:column; }

  .list-header{ max-width:none; margin:0 0 12px; }
  .list-toolbar{ max-width:none; margin:0 0 10px; }
  .records{ max-width:none; margin:0; }
  .edit-strip{ max-width:none; border-left:1px solid #F8D3B8; border-right:1px solid #F8D3B8; }
}
