
.help-panel { position: fixed; top: 4.5rem; right: 1rem; z-index: 50; width: min(26rem, calc(100vw - 2rem)); max-height: calc(100vh - 6rem); overflow: auto; background: var(--white, #fff); color: inherit; border: 1px solid var(--line, #e0e5eb); border-radius: 10px; box-shadow: 0 8px 28px rgba(0, 0, 0, .18); padding: 1rem; }
.help-panel .help-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.help-panel h2 { margin: 0; font-size: 1.1rem; }
.help-panel input { width: 100%; box-sizing: border-box; margin-top: .25rem; }
.help-results { list-style: none; padding-left: 0; margin: .5rem 0; }
.help-results li { padding: .35rem 0; border-bottom: 1px solid var(--line, #e0e5eb); }
.help-head { display: flex; align-items: baseline; gap: .5rem; }
.help-head > h1, .help-head > h2, .help-head > h3 { margin-right: 0; }
a.help-q { display: inline-flex; align-items: center; justify-content: center; min-width: 1.4rem; min-height: 1.4rem; border: 1px solid currentColor; border-radius: 50%; font-size: .8rem; font-weight: 600; line-height: 1; text-decoration: none; }
a.help-q:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* Explorer (/app). Builds on /assets/site.css tokens (--blue, --line, --surface, …). */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -10000px; top: 8px; background: var(--white); padding: 8px 12px; border: 2px solid var(--blue); border-radius: var(--radius); z-index: 10; }
.skip:focus { left: 8px; }
select { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); color: var(--text); font: inherit; font-size: .9rem; max-width: 100%; }
select:focus-visible, .tab:focus-visible, tr.rowlink:focus-visible, .obj-btn:focus-visible, .link-btn:focus-visible, .sort:focus-visible, .chip-x:focus-visible, main:focus-visible, h2:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
input[type=date] { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; width: 100%; }
.error:empty { display: none; }
.warn { color: var(--warn); }

/* header */
.app-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 20px; padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--white); }
.app-header .brand img { width: 170px; }
.account { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.acct-email { overflow-wrap: anywhere; }
.flash { margin: 0; padding: 8px 20px; background: var(--blue-tint); border-bottom: 1px solid var(--line); font-size: .9rem; }
/* rc.8 (D-089): pending deletion banner and the Settings danger zone */
.ws-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 12px; padding: 10px 14px; border: 1px solid #f0c2bd; border-radius: var(--radius); background: #fdf3f2; color: var(--err); font-size: .9rem; }
.danger-zone { border: 1px solid #f0c2bd; border-radius: var(--radius); padding: 12px 16px; }
.danger-zone h3 { margin-top: 0; color: var(--err); }
.btn.danger-solid { background: var(--err); border-color: var(--err); color: var(--white); }
.btn.danger-solid:disabled { opacity: .5; cursor: not-allowed; }
/* rc.10: Settings -> Connected apps */
.conn-zone { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.conn-zone h3 { margin-top: 0; }
.key-list { list-style: none; padding: 0; margin: 8px 0; }
.key-list li { border-top: 1px solid var(--line); padding: 8px 0; }
.key-list p { margin: 2px 0; overflow-wrap: anywhere; }
.conn-rows > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.conn-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 240px; }
/* Custom dashboards: long addresses wrap or shrink inside the card; no horizontal scroll at 390 px. */
.site-row, .site-share { min-width: 0; max-width: 100%; }
.site-url { overflow-wrap: anywhere; word-break: break-all; }
.site-url-row { flex-wrap: nowrap; min-width: 0; max-width: 100%; }
.site-url-input { flex: 1 1 auto; min-width: 0; width: 100%; text-overflow: ellipsis; }
.site-acts { flex-wrap: wrap; }
.conn-name { overflow-wrap: anywhere; }
.conn-host { font-family: var(--mono); overflow-wrap: anywhere; }
.conn-row.disconnected .conn-main { opacity: .6; }
.conn-done { color: var(--muted); font-weight: 600; }
/* rc.12: Settings -> Dashboards */
.dash-name { overflow-wrap: anywhere; }
.dash-act { display: flex; flex-wrap: wrap; gap: 6px; }
.dash-row.disconnected .conn-main { opacity: .6; }
.dash-new { display: flex; flex-direction: column; gap: 4px; }
.dash-new:empty { display: none; }
.dash-url { width: 100%; font-size: .8rem; }
.boot { padding: 40px 20px; color: var(--muted); }

/* three-column layout */
.layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: calc(100vh - 70px); }
.layout.has-detail { grid-template-columns: 230px minmax(0, 1fr) minmax(320px, 400px); }
.side { border-right: 1px solid var(--line); background: var(--surface); padding: 16px; }
.side label { margin-top: 0; }
.side select { width: 100%; }
.side-h { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 20px 0 6px; font-family: var(--mono); font-weight: 600; }
ul.plain, ol.plain { list-style: none; padding: 0; margin: 0; }
.obj-btn { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; width: 100%; text-align: left; font: inherit; font-size: .9rem; padding: 7px 10px; border: 0; border-left: 2px solid transparent; background: transparent; color: var(--text); cursor: pointer; border-radius: 0 var(--radius) var(--radius) 0; }
.obj-btn:hover { background: var(--white); }
.obj-btn[aria-current=true] { background: var(--blue-tint); color: var(--blue); border-left-color: var(--blue); font-weight: 600; }
.obj-pick { display: none; }
.obj-pick select { width: 100%; }
.obj-name { font-family: var(--mono); font-size: .85rem; overflow-wrap: anywhere; }
.obj-meta { color: var(--muted); font-size: .75rem; white-space: nowrap; font-weight: 400; }
.main { padding: 16px 20px 40px; min-width: 0; }
.detail { border-left: 1px solid var(--line); padding: 16px; background: var(--white); min-width: 0; overflow-wrap: anywhere; }
@media (min-width: 1101px) {
  /* The record panel stays in view while the table scrolls, with its own scroll. */
  /* The header stays on top, so the panel fits exactly in the viewport below it. */
  .app-header { position: sticky; top: 0; z-index: 5; }
  .side { position: sticky; top: var(--app-head, 64px); align-self: start; max-height: calc(100vh - var(--app-head, 64px)); overflow-y: auto; }
  .layout { align-items: start; }
  .layout > .side { min-height: calc(100vh - var(--app-head, 64px)); }
  .detail { position: sticky; top: var(--app-head, 64px); align-self: start; max-height: calc(100vh - var(--app-head, 64px)); overflow-y: auto; overscroll-behavior: contain; }
}
.detail-back { display: none; }
.ws-slug { margin: 4px 0 0; font-family: var(--mono); font-size: .75rem; overflow-wrap: anywhere; }
.ws-slug:empty { display: none; }
.note { margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: var(--radius); background: var(--blue-tint); font-size: .92rem; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab { font: inherit; font-size: .9rem; padding: 8px 14px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: transparent; color: var(--muted); cursor: pointer; }
.tab:hover { color: var(--text); }
.tab[aria-selected=true] { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }

/* records */
.toolbar { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.obj-title { font-size: 1.4rem; font-family: var(--mono); margin: 0 0 8px; overflow-wrap: anywhere; }
.filter-box > summary { cursor: pointer; font-size: .85rem; font-weight: 600; margin: 0 0 6px; width: max-content; }
.filter-box > summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (min-width: 761px) { .filter-box > summary { display: none; } }
.rec-table .chips-inline { flex-wrap: nowrap; }
.rec-table .tag { white-space: nowrap; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.filter-row label { margin: 0 0 4px; font-size: .78rem; }
.fcell { min-width: 140px; } .fcell.grow { flex: 1 1 200px; }
.fcell input[type=text] { padding: 8px 10px; font-size: .9rem; }
.fcell select { width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.chip-x { font: inherit; font-size: .82rem; padding: 3px 10px; border: 1px solid var(--blue); background: var(--blue-tint); color: var(--blue); border-radius: 999px; cursor: pointer; }
.chip-x:hover { background: var(--white); }
.state { margin: 12px 0 0; }
.state:empty { display: none; }
.rec-table { margin: 0; }
.table-box { position: relative; margin-top: 12px; }
#table-wrap { overflow-x: auto; }
/* Fades on the edges that have more columns behind them. */
.table-box::before, .table-box::after { content: ""; position: absolute; top: 0; bottom: 0; width: 28px; pointer-events: none; opacity: 0; transition: opacity .15s; z-index: 1; }
.table-box::before { left: 0; background: linear-gradient(to right, rgba(23, 33, 46, .14), rgba(23, 33, 46, 0)); }
.table-box::after { right: 0; background: linear-gradient(to left, rgba(23, 33, 46, .14), rgba(23, 33, 46, 0)); }
.table-box.more-left::before, .table-box.more-right::after { opacity: 1; }
.scroll-hint { margin: 10px 0 -4px; text-align: right; }
.rec-table td { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
table.data.rec-table th { padding: 0; }
.sort { display: block; width: 100%; text-align: left; font: inherit; font-weight: 600; font-size: .78rem; color: var(--muted); background: transparent; border: 0; padding: 8px 12px; cursor: pointer; white-space: nowrap; }
.sort:hover { color: var(--text); }
th[aria-sort] .sort { color: var(--blue); }
tr.rowlink { cursor: pointer; }
tr.rowlink:hover td { background: var(--surface); }
tr.rowlink[aria-current=true] td { background: var(--blue-tint); }
tr.rowlink:focus-visible { outline-offset: -2px; }
.pager { margin-top: 12px; }
.num { font-variant-numeric: tabular-nums; }
.txt { white-space: pre-wrap; }
.rec-table .txt { white-space: nowrap; }
.empty-val { color: var(--muted); font-style: italic; }
.odd { color: var(--warn); font-family: var(--mono); font-size: .85em; }
.odd::after { content: " (unexpected value)"; font-family: var(--font); font-style: italic; }
.empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 24px; background: var(--surface); max-width: 640px; }
.empty h2 { margin-bottom: 6px; }
.loading { margin: 8px 0; }

/* schema + usage */
.schema-obj { margin-bottom: 28px; }
.schema-obj h2 { font-family: var(--mono); font-size: 1.1rem; }
.wrap-cell { white-space: normal !important; min-width: 160px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; margin: 8px 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.usage-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 4px 16px; align-items: center; margin: 8px 0; max-width: 640px; }
.usage-row meter { grid-column: 2; width: 100%; height: 10px; }
.usage-label { font-weight: 600; font-size: .9rem; }

/* detail */
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.detail-head h2 { font-size: 1.1rem; margin: 4px 0 8px; overflow-wrap: anywhere; }
.dsec { border-top: 1px solid var(--line); padding: 12px 0; }
.dsec h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-family: var(--mono); margin-bottom: 8px; }
.fields { margin: 0; }
.fields dt { display: flex; gap: 8px; align-items: center; font-size: .82rem; color: var(--muted); margin-top: 8px; }
.fields dd { margin: 2px 0 0; font-size: .95rem; }
.badge.warn { color: var(--warn); border-color: #e8cfa6; }
.lgroup { margin-bottom: 12px; }
.lgroup h4 { font-size: .85rem; margin: 0 0 4px; font-family: var(--mono); }
.link-btn { display: block; width: 100%; text-align: left; font: inherit; font-size: .9rem; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); color: var(--blue); cursor: pointer; margin-bottom: 4px; overflow-wrap: anywhere; }
.link-btn:hover { border-color: var(--blue); }
.files .file { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; }
.thumb img { display: block; width: 72px; height: 72px; object-fit: cover; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.file-name { font-weight: 600; font-size: .9rem; overflow-wrap: anywhere; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.badge.role { font-weight: 400; color: var(--blue); border-color: var(--blue); background: var(--blue-tint); }
.history .event { padding: 6px 0; border-bottom: 1px solid var(--line); }
.history .event:last-child { border-bottom: 0; }
.ev-top { display: flex; gap: 8px; align-items: center; }
.ev-action { font-size: .92rem; font-weight: 600; }
.ev-details { margin-top: 4px; color: var(--text); overflow-wrap: anywhere; }
.ev-details .mono { font-size: .82rem; }
.ev-changes { margin: 2px 0 0; padding-left: 18px; }
.ev-old { color: var(--muted); text-decoration: line-through; }
.ev-new { font-weight: 600; }
.dsec .btn { margin-top: 6px; }

/* dialogs */
dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; max-width: min(520px, calc(100vw - 32px)); color: var(--text); }
dialog::backdrop { background: rgba(23, 33, 46, .45); }
dialog input[type=text] { font-family: var(--mono); font-size: .85rem; }
.row.nowrap { flex-wrap: nowrap; }
.row.end { justify-content: flex-end; margin-top: 12px; }

@media (max-width: 1100px) {
  .layout.has-detail { grid-template-columns: 220px minmax(0, 1fr); }
  .layout.has-detail .detail { grid-column: 2; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .layout, .layout.has-detail { grid-template-columns: 1fr; min-height: 0; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); }
  /* Phone: workspace and object are two compact selects side by side, so records show on the first screen. */
  .side { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; padding: 8px 16px 10px; align-items: end; }
  .side > label[for=ws-select] { grid-column: 1; grid-row: 1; }
  .side > #ws-select { grid-column: 1; grid-row: 2; }
  .obj-pick { display: block; grid-column: 2; grid-row: 1 / span 2; }
  .side-h, .obj-list, .ws-slug { display: none; }
  .obj-btn { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
  .obj-btn[aria-current=true] { border-color: var(--blue); }
  /* Phone: the five tabs fit one 390px row, or wrap; never wider than the screen. */
  .tabs { flex-wrap: wrap; gap: 0; }
  .tab { padding: 8px 9px; white-space: nowrap; }
  .layout.has-detail .detail { grid-column: 1; border-top: 0; }
  /* Record sheet: full screen over the list, its own scroll, Back at the top. */
  .detail { position: fixed; inset: 0; z-index: 20; border: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px 32px; }
  body.sheet-open { overflow: hidden; }
  .detail-head { position: sticky; top: 0; z-index: 1; flex-direction: column; align-items: stretch; gap: 6px; background: var(--white); padding: 12px 0 4px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
  .detail-head h2 { margin: 2px 0 6px; }
  .detail-back { display: inline-block; align-self: flex-start; }
  .detail-close { display: none; }
  .main { padding: 12px 16px 24px; }
  .app-header { padding: 8px 16px; gap: 6px 12px; }
  .app-header .brand img { width: 120px; }
  .account { gap: 6px; }
  .account .btn { padding: 4px 8px; font-size: .8rem; }
  .acct-email { display: none; }
  .fcell { flex: 1 1 100%; }
  .usage-row { grid-template-columns: 1fr; }
  .usage-row meter { grid-column: 1; }
}

/* Prompt 06: editing, views, recycle bin */
.toolbar .grow { flex: 1 1 auto; }
.inline-check { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.inline-check input { margin: 0; }
tr.rowlink.archived td { color: var(--muted); font-style: italic; }
.rec-actions { margin: 8px 0 12px; }
dialog.wide-dlg { max-width: min(720px, calc(100vw - 32px)); width: 100%; max-height: calc(100vh - 40px); overflow-y: auto; }
.attach-form { display: grid; gap: 4px; margin-bottom: 10px; }
.attach-form input[type=file] { font: inherit; font-size: .85rem; }
.link-form select { flex: 1 1 auto; min-width: 0; }
#view-select { max-width: 320px; }

/* rc.8: search, filters per type, summaries, media, file browser, export */
.search-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; }
.search-row input[type=search] { flex: 1 1 220px; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; font-size: .9rem; }
.search-box { margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: var(--radius); background: var(--white); }
.search-head h2 { margin: 0; font-size: 1rem; }
.search-group h3 { margin: 10px 0 4px; font-family: var(--mono); }
.search-hits .hit-row { padding: 6px 0; border-bottom: 1px solid var(--line); }
.search-hits .hit-row:last-child { border-bottom: 0; }
.hit-snippet { margin: 2px 0 0 2px; overflow-wrap: anywhere; }
mark { background: #fff3a6; color: inherit; padding: 0 1px; border-radius: 2px; }
.enable-help pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface); padding: 8px 10px; border-radius: var(--radius); font-size: .8rem; margin: 6px 0; }
.fsub { min-width: 120px; flex: 1 1 120px; }
.fsub input, .fcell input[type=number], .fcell input[type=time], .fcell input[type=datetime-local], .fcell input[type=search] { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; font-size: .9rem; }
.vlabel { margin: 0 0 4px; }
.vchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
fieldset.vset { display: flex; flex-wrap: wrap; gap: 4px 12px; border: 0; margin: 0; padding: 0; }
.agg-form fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px 10px; margin: 0 0 10px; display: grid; gap: 8px; }
.agg-form legend { font-size: .8rem; font-weight: 600; padding: 0 4px; }
.agg-form fieldset > .btn { justify-self: start; }
.agg-form fieldset { min-width: 0; }
.agg-form .row.nowrap { flex-wrap: wrap; }
#agg-out { margin-top: 12px; }
.agg-form .row { align-items: center; gap: 8px; }
.agg-table td.num, .agg-table th.num { text-align: right; }
th.rollup, td.rollup { background: var(--surface); }
.file .media-line { margin: 2px 0; }
.player { display: block; width: 100%; max-width: 480px; margin: 6px 0; }
audio.player { height: 40px; }
.file-acts { gap: 8px; align-items: center; margin-top: 4px; }
.versions { margin-top: 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.version-list li { margin: 2px 0; }
.badge.ok { border-color: var(--blue); color: var(--blue); }
.replace-form { display: grid; gap: 4px; margin-top: 8px; }
.replace-form input[type=file] { font: inherit; font-size: .85rem; }
.fb-form { margin-bottom: 10px; }
.fb-form .check { display: flex; gap: 6px; align-items: center; margin-top: 4px; font-size: .78rem; }
.fb-list { margin-top: 10px; }
.fb-list li.file { padding: 10px 0; border-bottom: 1px solid var(--line); }
.fcell.fcheck { min-width: 0; padding-bottom: 8px; }
.snippet { margin: 4px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.export-row { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.export-item { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
@media (max-width: 760px) {
  .search-row select, .search-row .btn { flex: 1 1 auto; }
  .player { max-width: 100%; }
}
