/* Farmhouse Getaways admin — cream shell, barn-red accent.
   Camera screens stay dark. Bump the ?v= on /css/app.css in index.html
   whenever this file changes (cached immutable for a year). */

:root {
  --bg:        #F7F2EA;
  --card:      #fff;
  --ink:       #2A1F1B;
  --mute:      #7C6E66;
  --mute-2:    #7C6E66;
  --line:      #E7DDD0;
  --red:       #B4402F;
  --red-soft:  #F6E1DC;
  --sage:      #5E7F66;
  --sage-soft: #E3EEE5;
  --amber:     #C98A1B;
  --amber-soft:#FFF4C8;
  --night:     #141110;
  --night-2:   #1C1917;
  --night-3:   #2A2623;
  --cream:     #2A1F1B;
  --fhg:       #B4402F;
  --mbm-red:   #B4402F;
  --fstv:      #5E7F66;
  --warn:      #C98A1B;
  --accent:    #B4402F;
  --display:   "Instrument Serif", Georgia, serif;
  --body:      "Karla", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --gutter:    16px;
  --radius:    16px;
  --safe-t:    env(safe-area-inset-top, 0px);
  --safe-b:    env(safe-area-inset-bottom, 0px);
  --safe-l:    env(safe-area-inset-left, 0px);
  --safe-r:    env(safe-area-inset-right, 0px);
  --side-w:    220px;
  --tab-h:     calc(62px + var(--safe-b));
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: -.02em; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--red); color: #fff; padding: .7rem 1.1rem; z-index: 99; }
.skip:focus { left: 0; }

/* ---------- sign-in ---------- */
#gate[hidden], #panel[hidden], #cam-view[hidden], #viewer[hidden], [hidden] { display: none !important; }
#gate:not([hidden]) {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: calc(var(--safe-t) + 32px) max(20px, var(--safe-r)) calc(var(--safe-b) + 32px) max(20px, var(--safe-l));
  background:
    radial-gradient(ellipse 80% 50% at 50% 18%, #fff 0%, rgba(255,255,255,0) 70%),
    var(--bg);
}
.gate-inner { width: min(100%, 26rem); display: flex; flex-direction: column; align-items: center; }
.gate-logo { width: min(280px, 76vw); height: auto; margin: 0 0 22px; }
#gate .gate-card {
  width: 100%; margin: 0; padding: 28px 24px 24px; text-align: center;
  border-radius: 22px; box-shadow: 0 18px 50px rgba(42, 31, 27, .07);
}
.gate-card h1 { font-size: 2.35rem; line-height: 1.05; margin: 0 0 6px; }
.gate-kicker { margin: 0 0 18px; color: var(--mute); font-size: 15px; }
#gate-note {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 1.2em; margin: 0 0 18px; text-align: center;
  font-size: 13px; color: var(--mute);
}
.gate-spin {
  width: 14px; height: 14px; border-radius: 50%; flex: none;
  border: 2px solid var(--line); border-top-color: var(--red);
  animation: gate-spin .7s linear infinite;
}
@keyframes gate-spin { to { transform: rotate(360deg); } }
.g-signin {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; height: 44px; padding: 0 16px; box-sizing: border-box;
  background: #fff; color: #1f1f1f; border: 1px solid #747775; border-radius: 4px;
  font-family: Roboto, Arial, sans-serif; font-size: 14px; font-weight: 500;
  letter-spacing: .01em; text-decoration: none;
}
.g-signin:hover { background: #f7f8f8; }
.g-signin svg { width: 18px; height: 18px; flex: none; display: block; }

/* ---------- app shell ---------- */
#panel:not([hidden]) { display: block; min-height: 100dvh; }
.app { display: flex; min-height: 100dvh; }
.side { display: none; }
.main {
  flex: 1; width: 100%; max-width: 1100px; margin: 0 auto;
  padding: calc(var(--safe-t) + 16px) calc(var(--safe-r) + 16px) calc(var(--tab-h) + 28px) calc(var(--safe-l) + 16px);
}
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.top h1 { font-size: 32px; line-height: 1.05; margin: 0; }
.top .sub, .subline { color: var(--mute); font-size: 13px; margin-top: 4px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--red); color: #fff;
  display: grid; place-items: center; font-weight: 700; flex: none;
}
h1.big, h2.big {
  font-family: var(--display); font-weight: 400; font-size: clamp(2rem, 7vw, 2.8rem);
  line-height: 1.02; margin: 0 0 .6rem;
}
h2.mid { font-family: var(--display); font-weight: 400; font-size: 1.45rem; line-height: 1.15; margin: 0 0 .45rem; }
.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--red); margin: 0 0 .35rem;
}
p { margin: 0 0 .8rem; }
.fine { font-size: 13px; color: var(--mute); margin: 0 0 .7rem; }
.unit { font-size: .38em; letter-spacing: .08em; text-transform: uppercase; font-family: var(--body); color: var(--mute); font-weight: 700; }
.sec { padding-block: 4px 18px; }
.wrap { max-width: 46rem; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px;
}
.card h2 {
  font-size: 22px; margin: 0 0 8px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
}
.card h2 a, .card .more-link { font-family: var(--body); font-weight: 600; font-size: 13px; color: var(--red); }
.grid { display: grid; gap: 12px; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.kpi {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
}
.kpi b { display: block; font-size: 26px; line-height: 1.1; letter-spacing: -.02em; }
.kpi span { color: var(--mute); font-size: 12px; }

.row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.card > .row:first-of-type, .card h2 + .row { border-top: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.rbr, .rbr { background: var(--red); }
.dot.mr, .mr { background: var(--sage); }
.dot.mc, .mc { background: var(--amber); }
.row .t { flex: 1; min-width: 0; }
.row .t b, .row .t strong { display: block; font-weight: 700; }
.row .t small, .row .t .fine { display: block; color: var(--mute); font-size: 12px; font-weight: 400; margin: 0; }

.pill, .count {
  display: inline-block; font-size: 12px; font-weight: 700; line-height: 1.3;
  padding: 4px 10px; border-radius: 99px; background: var(--red-soft); color: var(--red);
  border: 0; white-space: nowrap;
}
.count { min-width: 1.3rem; text-align: center; padding: 1px 7px; background: var(--red); color: #fff; }
.pill.g { background: var(--sage-soft); color: var(--sage); }
button.pill { cursor: pointer; font-family: var(--body); }
.pill.amber { background: var(--amber-soft); color: #6b4d00; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  font-family: var(--body); font-size: 14px; font-weight: 700; letter-spacing: 0; text-transform: none;
  padding: 10px 14px; border-radius: 12px; border: 1px solid transparent;
  cursor: pointer; background: transparent; text-align: center;
}
.btn-go { background: var(--red); color: #fff; }
.btn-line { border-color: var(--line); color: var(--ink); background: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.btn-row .btn { flex: 1 1 auto; }
.btn:disabled { opacity: .55; cursor: default; }

.info-btn {
  width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; color: var(--mute); font-family: var(--display); font-size: 14px; font-style: italic;
  line-height: 1; padding: 0; cursor: pointer; vertical-align: 2px; margin-left: 6px;
}
.info-pop {
  font-size: 13px; color: var(--mute); background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; margin: 8px 0 12px;
}

/* filters */
.adm-filters, .chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.filter-row { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.filter-row .adm-filters { margin: 0; flex: 1 1 auto; }
.adm-filter, .chip, .cam-tabs button {
  flex: none; background: #fff; border: 1px solid var(--line); color: var(--ink);
  border-radius: 99px; padding: 6px 12px; cursor: pointer; font-size: 13px; font-weight: 600;
}
.adm-filter.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.site-select, .pb-input {
  display: block; width: 100%; font: inherit; padding: 10px 12px; margin: 4px 0 12px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink);
}
.filter-row .site-select { width: auto; max-width: 58%; margin: 0; flex: 0 1 auto; }
textarea.pb-input { resize: vertical; line-height: 1.4; }
.pb-check { display: flex; align-items: flex-start; gap: .5rem; margin: .2rem 0 .5rem; }
.pb-check input { margin-top: .25rem; }

/* inbox + bookings cards */
.sub {
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  padding: 12px 14px; margin-bottom: 10px;
}
.sub.done { opacity: .62; }
.sub-top { display: flex; align-items: baseline; gap: .45rem; flex-wrap: wrap; margin-bottom: .45rem; }
.sub-top b { font-size: 1.02rem; }
.sub-where {
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink); background: var(--bg); border-radius: 6px; padding: 2px 6px;
}
.sub-when { font-size: 12px; color: var(--mute); margin-left: auto; }
.sub dl { margin: 0; display: grid; grid-template-columns: 6.6rem 1fr; gap: .2rem .7rem; }
.sub dt { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); padding-top: .2rem; }
.sub dd { margin: 0; font-size: 14px; color: var(--ink); word-break: break-word; }
.sub dd a { color: var(--red); text-decoration: underline; text-underline-offset: 2px; }
.sub dl + dl { margin-top: .45rem; padding-top: .45rem; border-top: 1px solid var(--line); }
.sub .btn { padding: 8px 12px; }
.sub-msg { margin: .1rem 0 .45rem; font-size: 15.5px; line-height: 1.45; white-space: pre-wrap; }
.sub-reach { margin: 0 0 .5rem; font-size: 14px; }
.sub-reach a { color: var(--red); text-decoration: underline; text-underline-offset: 2px; }
.sub-replied {
  margin: .65rem 0 0; padding: .55rem .7rem; background: var(--sage-soft); border-radius: 10px; font-size: 13px;
}
.sub-replied b { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--sage); margin-right: .35rem; }
.sub-replied span { display: block; margin-top: .2rem; color: var(--ink); }
.sub-more { margin-top: .35rem; }
.sub-more summary {
  cursor: pointer; font-size: 12px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--mute); width: fit-content;
}
.sub-more dl { margin-top: .4rem; }

/* Reply composer: a bottom sheet on a phone, a dialog on a wider screen. */
.sheet {
  position: fixed; inset: 0; z-index: 85; background: rgba(42, 31, 27, .45);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet-card {
  width: 100%; max-width: 560px; background: #fff; border-radius: 18px 18px 0 0;
  padding: 14px 16px calc(var(--safe-b) + 16px);
  max-height: min(92dvh, 760px); overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .12);
}
.sheet-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex: none; }
.sheet-bar h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 28px; flex: 1; }
.sheet-x {
  width: 40px; height: 40px; border-radius: 99px; border: 1px solid var(--line);
  background: #fff; font-size: 22px; line-height: 1; cursor: pointer;
}
#reply-form, #reply-done { display: flex; flex-direction: column; min-height: 0; }
#reply-fields { overflow: auto; min-height: 0; }
#reply-form .btn-row, #reply-done .btn-row { flex: none; }
.sheet label {
  display: block; margin: 10px 0 3px; font-size: 11px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--mute);
}
.sheet input, .sheet textarea {
  display: block; width: 100%; font: 16px/1.4 var(--body); padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink);
}
.sheet textarea { min-height: 140px; resize: vertical; }
.sheet input[readonly] { background: var(--bg); }
.sheet-quote {
  margin: 10px 0 0; padding: 8px 0 8px 12px; border-left: 3px solid var(--line);
  color: var(--mute); font-size: 13px; white-space: pre-wrap;
}
.sheet-sent { padding: 8px 0 4px; }
.sheet-sent b { font-family: var(--display); font-size: 32px; font-weight: 400; display: block; margin: 0 0 6px; }
@media (min-width: 720px) {
  .sheet { align-items: center; padding: 24px; }
  .sheet-card { border-radius: 18px; padding: 18px 18px 16px; }
}
/* A phone on its side is wide enough for the dialog rule above and short
   enough that the send button would sit below the fold. Dock it and shrink
   the writing box so Send stays on screen. */
@media (max-height: 520px) {
  .sheet { align-items: flex-end; padding: 0; }
  .sheet-card {
    max-width: 720px; border-radius: 16px 16px 0 0;
    height: 100dvh; max-height: 100dvh;
    padding: 8px 16px calc(var(--safe-b) + 10px);
  }
  .sheet-bar { margin-bottom: 0; }
  .sheet-bar h2 { font-size: 22px; }
  .sheet label { margin: 6px 0 2px; }
  .sheet textarea { min-height: 72px; }
  .sheet-quote { max-height: 3.2rem; overflow: auto; }
  .sheet .btn-row { margin-top: 6px; }
}
body.sheet-on { overflow: hidden; }
.sub.bk-rbr { background: #FDF6F4; border-color: #E7C6BF; }
.sub.bk-mr { background: #F4F8F5; border-color: #C9D9CC; }
.sub-where.bk-rbr { background: var(--red); color: #fff; }
.sub-where.bk-mr { background: var(--sage); color: #fff; }
.sub.bk-mc { background: #FFFAF0; border-color: #EAD6A6; }
.sub-where.bk-mc { background: var(--amber); color: #fff; }
.cal-nights { color: var(--mute); font-size: .85em; }
.stay-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.stay-actions .stay-mail { flex: 1 1 100%; }

.dup { margin-top: .7rem; padding: .7rem .8rem; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.dup-name { border-color: var(--amber); background: #FFF8E8; }
.dup-head { font-size: .85rem; font-weight: 700; margin: 0 0 .25rem; }
.dup-name .dup-head { color: #8a5a00; }
.dup .fine { margin: 0; }
.dup .fine + .fine, .dup-who + .fine { margin-top: .35rem; }
.dup-who { font-size: .85rem; font-weight: 700; margin: .45rem 0 0; }
.dup-who.is-ok { color: var(--sage); }
.dup-who.is-warn { color: #8a5a00; }
.dup-table { width: 100%; table-layout: fixed; border-collapse: collapse; margin-top: .6rem; font-size: 13px; }
.dup-table th, .dup-table td { text-align: left; vertical-align: top; padding: .3rem .45rem .3rem 0; word-break: break-word; }
.dup-table thead th { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); border-bottom: 1px solid var(--line); }
.dup-table tbody th { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--mute); width: 5rem; }
.dup-table tr.dup-diff td:last-child { font-weight: 700; }
.dup-table tr.dup-diff th { color: #8a5a00; }
@media (max-width: 34rem) {
  .dup-table, .dup-table tbody, .dup-table tr, .dup-table th, .dup-table td { display: block; width: auto; }
  .dup-table thead { display: none; }
  .dup-table tr { padding: .35rem 0; border-bottom: 1px solid var(--line); }
  .dup-table tbody td::before { content: attr(data-l); color: var(--mute); font-size: 11px; display: block; }
}

.cal-month { margin-bottom: .8rem; border-bottom: 1px solid var(--line); }
.cal-month > summary {
  cursor: pointer; list-style: none; display: flex; align-items: baseline; justify-content: space-between; gap: .6rem;
  padding: .7rem 0; font-family: var(--display); font-size: 1.25rem;
}
.cal-month > summary::-webkit-details-marker { display: none; }
.cal-month > summary::before { content: "▸"; margin-right: .45rem; color: var(--red); font-family: var(--body); }
.cal-month[open] > summary::before { content: "▾"; }
.cal-month-count { font-family: var(--body); font-size: 12px; font-weight: 600; color: var(--mute); }
.cal-month-body { padding-bottom: .8rem; }

.rows { list-style: none; margin: 0; padding: 0; }
.rows li { border-bottom: 1px solid var(--line); }
.rows a, .rows button {
  display: flex; align-items: center; gap: .75rem; width: 100%;
  padding: .85rem .1rem; background: none; border: 0; color: inherit; text-align: left; cursor: pointer;
}
.rows b { display: block; font-size: .97rem; }
.rows span { display: block; font-size: .8rem; color: var(--mute); }
.rows .go { margin-left: auto; color: var(--mute); font-size: 13px; }
.rows a > div { flex: 1 1 auto; min-width: 0; }
.rows a > .btn { width: auto; flex: none; }
.warn { color: #8a5a00; }
.good { color: var(--sage); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin: 8px 0 0; }
.stat-tile { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 10px 12px; }
.stat-tile b { display: block; font-size: 1.25rem; line-height: 1.1; }
.stat-tile span { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--mute); }
.stat-tile.warn b { color: #8a5a00; }
.stat-tile.good b { color: var(--sage); }

.flash {
  margin: 0 0 10px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid #E7C6BF; background: var(--red-soft); color: var(--ink); font-size: 14px;
}
.flash a { color: var(--red); text-decoration: underline; }

.pane { display: none; }
.pane.is-on { display: block; }

/* camera strip + grid */
.camstrip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.thumb {
  aspect-ratio: 16/10; border-radius: 12px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #5b5a4a, #2d2a24); border: 0; padding: 0; display: block; width: 100%; cursor: pointer;
}
.thumb img, .cam-pic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb .n, .thumb .ago {
  position: absolute; color: #fff; font-size: 12px; font-weight: 700;
  text-shadow: 0 1px 2px #000; z-index: 1;
}
.thumb .n { left: 8px; bottom: 6px; }
.thumb .ago { right: 8px; bottom: 6px; font-weight: 600; color: #eee; }
.thumb .s {
  position: absolute; right: 8px; top: 8px; width: 8px; height: 8px; border-radius: 50%;
  background: #4ADE80; box-shadow: 0 0 0 2px rgba(0,0,0,.45); z-index: 1;
}
.thumb .s.off { background: #9CA3AF; }
.live {
  position: absolute; left: 8px; top: 8px; z-index: 1; background: #DC2626; color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: .04em; padding: 2px 7px; border-radius: 6px;
}

/* ---------- bottom bar + sidebar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: #fff; border-top: 1px solid var(--line);
  display: flex; justify-content: space-around; align-items: flex-end;
  padding: 6px calc(4px + var(--safe-r)) calc(10px + var(--safe-b)) calc(4px + var(--safe-l));
}
.tabbar a {
  flex: 1; text-align: center; font-size: 11px; color: var(--mute); font-weight: 600;
  background: none; border: 0; padding: 0;
}
.tabbar a svg { display: block; margin: 0 auto 2px; }
.tabbar a.is-on { color: var(--red); }
.nav-count {
  display: inline-block; min-width: 1.15rem; padding: 0 6px; border-radius: 99px;
  background: var(--bg); color: var(--mute); font-size: 12px; font-weight: 700;
  line-height: 1.45; text-align: center;
}
.side a.is-on .nav-count { background: #fff; color: var(--red); }
.conn-sum { font-weight: 700; margin: 0 0 8px; }
.conn-sum.is-good { color: var(--sage); }
.conn-sum.is-bad { color: var(--red); }
.conn-problems { list-style: none; margin: 0 0 10px; padding: 0; }
.conn-problems li { color: var(--red); font-weight: 700; padding: 2px 0; }
.rows .go.is-missing { color: var(--red); font-weight: 700; }

.more-list a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 4px; border-top: 1px solid var(--line); font-weight: 700;
}
.more-list a:first-child { border-top: 0; }
.more-list a span { color: var(--mute); font-weight: 500; }

.preview-banner {
  background: var(--amber-soft); border: 1px dashed var(--amber); color: #6b4d00;
  font-size: 12px; padding: 8px 10px; border-radius: 10px; margin-bottom: 12px;
}

/* social / publish */
.ig-thumb { width: 56px; height: 70px; object-fit: cover; border-radius: 8px; flex: none; background: var(--bg); }
.ig-nums { display: block; font-size: 13px; color: var(--mute); margin-top: .2rem; }
.pb-video { display: block; width: 100%; max-width: 360px; border-radius: 12px; background: #000; margin: .6rem 0; }
.pb-strip { display: flex; gap: .5rem; overflow-x: auto; margin: .6rem 0; }
.pb-strip img { width: 140px; height: 176px; object-fit: cover; border-radius: 8px; flex: none; background: var(--bg); }
.section-label { margin: 18px 0 8px; }

/* ---------- cameras (dark) ---------- */
#pane-cameras.is-on {
  background: var(--night); color: #fff;
  margin: calc(-1 * (var(--safe-t) + 16px)) calc(-1 * (var(--safe-r) + 16px)) 0 calc(-1 * (var(--safe-l) + 16px));
  padding: calc(var(--safe-t) + 16px) calc(var(--safe-r) + 16px) 24px calc(var(--safe-l) + 16px);
  min-height: calc(100dvh - var(--tab-h));
}
#pane-cameras .top h1, #cam-view h1, #cam-view .top h1 { color: #fff; }
#pane-cameras .subline, #pane-cameras .fine, #cam-view .fine { color: #aaa; }
#pane-cameras .chip, #pane-cameras .adm-filter {
  background: transparent; border-color: #333; color: #fff;
}
#pane-cameras .chip.is-on, #pane-cameras .chip.on, #pane-cameras .adm-filter.is-on {
  background: #fff; color: #111; border-color: #fff;
}
/* One camera fills the width. Two or more are equal 16:9 tiles: stacked on a
   phone, two per row from tablet width up (so three or four make a 2×2). */
.camgrid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.camgrid .thumb { border-radius: 14px; aspect-ratio: 16 / 9; }
.camgrid .big { grid-column: 1 / -1; }
.camgrid .big .s { display: none; }
.camgrid .thumb .n { max-width: calc(100% - 88px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 700px) {
  .camgrid { grid-template-columns: 1fr 1fr; }
}
.cam-health { color: #aaa; font-size: 13px; margin: 0 0 12px; }
.evs { margin-top: 18px; }
.evs > b { display: block; margin-bottom: 4px; }
.ev { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid #2a2623; color: inherit; width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; cursor: pointer; }
.ev .thumb { width: 92px; aspect-ratio: 16/10; flex: none; border-radius: 8px; }
.ev small { color: #aaa; display: block; font-size: 12px; }
.tag {
  display: inline-block; margin-left: 4px; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px;
  background: #1f3a2a; color: #86efac; vertical-align: 1px;
}
.tag.v, .tag-vehicle { background: #3a2f1f; color: #fcd34d; }
.tag-person { background: #3a2424; color: #fca5a5; }
.tag-animal { background: #1f3a2a; color: #86efac; }
.tag-motion { background: #2a2623; color: #ddd; }

#cam-view:not([hidden]) {
  position: fixed; z-index: 60; inset: 0; background: #0e0c0b; color: #fff;
  display: flex; flex-direction: column; overflow: auto;
  padding: calc(var(--safe-t) + 10px) calc(var(--safe-r) + 12px) calc(var(--safe-b) + 12px) calc(var(--safe-l) + 12px);
}
.cam-fs-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.cam-fs-top .who { flex: 1; min-width: 0; }
.cam-fs-top b { display: block; font-size: 18px; }
.cam-back, .icon-btn {
  width: 40px; height: 40px; border-radius: 999px; border: 1px solid #333;
  background: #1c1917; color: #fff; font-size: 20px; line-height: 1; cursor: pointer; flex: none;
}
.cam-stage { position: relative; }
.cam-picture { position: relative; background: #000; border-radius: 16px; overflow: hidden; aspect-ratio: 16/10; }
.cam-zoom-view {
  position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab;
  -webkit-user-select: none; user-select: none;
}
.cam-zoom-view.is-drag { cursor: grabbing; }
.cam-zoom-view img, .cam-zoom-view video {
  width: 100%; height: 100%; object-fit: contain; background: #000;
  transform-origin: center center; -webkit-user-drag: none; user-select: none;
}
.cam-zoom-view img { pointer-events: none; }
#cv-rtc { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: transparent; }
.cam-badge {
  position: absolute; left: 10px; top: 10px; z-index: 2; padding: 3px 8px; border-radius: 6px;
  background: rgba(0,0,0,.55); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .04em;
}
.cam-badge.is-live { background: #DC2626; }
.cam-zoom-readout {
  position: absolute; z-index: 2; top: 10px; right: 10px; padding: 2px 8px; border-radius: 99px;
  background: rgba(0,0,0,.6); color: #fff; font-size: 12px; font-weight: 700;
}
.cam-icon {
  position: absolute; z-index: 2; width: 40px; height: 40px; border-radius: 99px;
  border: 1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.5); color: #fff; cursor: pointer;
}
.cam-full { right: 8px; bottom: 8px; }
.cam-unfull { display: none; right: 12px; top: calc(var(--safe-t) + 12px); font-size: 22px; }
.cam-stage.is-full { position: fixed; inset: 0; z-index: 70; background: #000; border-radius: 0; }
.cam-stage.is-full .cam-picture { position: absolute; inset: 0; height: auto; aspect-ratio: auto; border-radius: 0; }
.cam-stage.is-full .cam-full { display: none; }
.cam-stage.is-full .cam-unfull { display: block; }
.cam-zoom {
  display: flex; align-items: center; gap: 4px; margin-top: 8px; padding: 2px;
  border-radius: 999px; background: #1c1917; border: 1px solid #333;
}
.cam-zoom[hidden], .cam-play[hidden], .cam-zoom-readout[hidden], .cam-play-toggle[hidden] { display: none !important; }
.cam-zoom-btn {
  width: 40px; height: 40px; border-radius: 99px; border: 0; background: transparent; color: #fff;
  font-size: 20px; font-weight: 700; cursor: pointer;
}
.cam-zoom-reset { width: auto; min-width: 40px; padding: 0 8px; font-size: 13px; }
.cam-zoom-btn:disabled { opacity: .35; }
.cam-zoom input[type="range"] { flex: 1; accent-color: #fff; }
.cam-tabs { display: flex; gap: 6px; margin: 10px 0; overflow-x: auto; }
#cam-view .cam-tabs button, #cam-view .chip {
  background: transparent; border: 1px solid #333; color: #fff;
}
#cam-view .cam-tabs button.is-on, #cam-view .chip.is-on { background: #fff; color: #111; border-color: #fff; }
.cam-off { padding: 8px 10px; border: 1px solid #3a2f1f; border-radius: 10px; color: #fcd34d; background: #241c14; }
#cam-view .info-btn { background: transparent; color: #fff; border-color: #555; margin-left: 6px; vertical-align: -2px; }
#cam-view .info-pop { background: #1c1917; color: #ddd; border-color: #333; }

/* Full-screen stays CSS (iPhone has no Fullscreen API for this pane). The
   joystick, zoom, and exit sit on top of the picture. */
.cam-stage.is-full .cam-zoom {
  position: absolute; z-index: 3; top: calc(var(--safe-t) + 10px); left: 50%;
  transform: translateX(-50%); width: min(220px, 46vw); margin: 0;
  background: rgba(28, 25, 23, .55); border-color: rgba(255,255,255,.25);
}
.cam-stage.is-full .cam-unfull { right: max(12px, env(safe-area-inset-right)); z-index: 4; }
#cam-view:has(.cam-stage.is-full) #cv-ptz-panel {
  position: fixed; z-index: 76; left: max(12px, env(safe-area-inset-left));
  bottom: max(12px, env(safe-area-inset-bottom)); margin: 0; width: auto; max-width: none;
  pointer-events: none;
}
#cam-view:has(.cam-stage.is-full) .cam-live-ctl { margin: 0; display: block; }
#cam-view:has(.cam-stage.is-full) .cam-live-rest,
#cam-view:has(.cam-stage.is-full) .joy-wrap .info-btn,
#cam-view:has(.cam-stage.is-full) .joy-wrap .info-pop,
#cam-view:has(.cam-stage.is-full) #cv-ptz-note { display: none !important; }
#cam-view:has(.cam-stage.is-full) .joy-wrap { margin: 0; }
#cam-view:has(.cam-stage.is-full) .joy {
  pointer-events: auto; width: 108px; height: 108px; opacity: .9;
  border-color: rgba(255,255,255,.4);
  background: radial-gradient(circle, rgba(42,38,35,.75) 0 30%, rgba(14,12,11,.45) 31%);
}
#cam-view:has(.cam-stage.is-full) .joy-knob { width: 40px; height: 40px; margin: -20px 0 0 -20px; }
#cv-ptz-note.cam-err { color: #fcd34d; margin: 8px 0 0; }
.cam-live-ctl { display: flex; flex-direction: column; align-items: stretch; gap: 14px; margin-top: 4px; }
.joy-wrap { position: relative; align-self: flex-start; }
.joy-wrap .info-btn {
  position: absolute; top: -4px; right: -4px; z-index: 2;
  width: 26px; height: 26px; margin: 0;
  background: #1c1917; color: #fff; border-color: #555;
}
.joy-wrap .info-pop {
  position: absolute; z-index: 4; left: 0; bottom: calc(100% + 8px);
  width: min(280px, 78vw); margin: 0;
}
.cam-live-rest { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.cam-actions .btn, .cam-spots .btn { width: 100%; }
.cam-spots { display: flex; flex-direction: column; gap: 8px; }
.cam-spots .cam-h, .cam-spots .info-pop, .cam-spots .chips { margin: 0; }
#cam-view .btn-line { background: transparent; color: #fff; border-color: #444; }
.joy {
  position: relative; width: 132px; height: 132px; border-radius: 50%; flex: none;
  border: 1px solid #333; background: radial-gradient(circle, #2a2623 0 30%, #1c1917 31%);
  touch-action: none; user-select: none;
}
.joy.is-off { opacity: .4; }
.joy-knob {
  position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px;
  border-radius: 50%; background: var(--red); pointer-events: none;
}
.cam-h { margin: .8rem 0 .35rem; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #aaa; }
.cam-play { position: relative; background: #000; border-radius: 16px; overflow: hidden; aspect-ratio: 16/10; margin: 8px 0; }
.cam-play-toggle {
  position: absolute; z-index: 2; left: 8px; bottom: 8px; width: 40px; height: 40px; border-radius: 99px;
  border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer;
}
.cam-clips { margin-top: 8px; }
.cam-clips button.is-on b { color: #fff; }
.cam-evs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.cam-ev { display: block; color: #ddd; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font-size: 12px; }
.cam-ev img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 8px; background: #222; margin-bottom: 4px; }
.cam-dl { display: grid; grid-template-columns: auto 1fr; gap: .35rem .8rem; margin: 8px 0 0; font-size: 14px; }
.cam-dl dt { color: #aaa; }
.cam-dl dd { margin: 0; overflow-wrap: anywhere; }
.cs-alert-on { padding-left: 1.4rem; }
#cv-sheet {
  margin-top: 8px; padding: 12px; border-radius: 16px; background: #1c1917; border: 1px solid #333;
}
#cv-sheet .sheet-switch { display: flex; gap: 6px; margin-bottom: 8px; }

/* viewer */
.viewer {
  position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center;
  padding: calc(var(--safe-t) + 3.2rem) calc(var(--safe-r) + 12px) calc(var(--safe-b) + 12px) calc(var(--safe-l) + 12px);
}
.viewer-body { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.viewer-body img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-doc { width: 100%; max-width: 680px; height: 100%; border: 0; border-radius: 8px; background: #fff; }
.viewer-x {
  position: absolute; top: calc(var(--safe-t) + 8px); right: 12px; width: 44px; height: 44px;
  border-radius: 99px; border: 1px solid #333; background: #1c1917; color: #fff; font-size: 26px; cursor: pointer;
}
.snap-view {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; max-width: 100%; min-width: 0; text-align: center;
}
.viewer-body .snap-view img {
  max-width: 100%; width: auto; height: auto; object-fit: contain;
  max-height: calc(100dvh - var(--safe-t) - var(--safe-b) - 8.5rem);
}
.snap-status {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 0; max-width: calc(100vw - 48px); color: #eee; font-size: 16px; line-height: 1.35;
}
.snap-spin {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 2px solid #444; border-top-color: #fff;
  animation: gate-spin .7s linear infinite;
}
.snap-actions { display: flex; justify-content: center; }
.snap-view .btn-line {
  background: transparent; color: #fff; border-color: #444;
  min-width: 8.5rem; min-height: 44px;
}
.snap-note { margin: 0; max-width: 18rem; color: #aaa; font-size: 13px; }
body.viewer-on, body.cam-open { overflow: hidden; }

/* Tall windows get the sidebar. A phone on its side is wide but short, and
   that used to open this layout and crush the picture. */
@media (min-width: 900px) and (min-height: 720px) {
  .side {
    display: flex; flex-direction: column; gap: 4px; width: var(--side-w); flex: none;
    background: #fff; border-right: 1px solid var(--line);
    position: sticky; top: 0; height: 100dvh;
    padding: calc(var(--safe-t) + 20px) 12px calc(var(--safe-b) + 20px) calc(var(--safe-l) + 12px);
  }
  .side .brand { font-family: var(--display); font-size: 22px; line-height: 1.15; padding: 0 10px 14px; }
  .side a {
    padding: 10px 12px; border-radius: 10px; color: var(--ink); display: flex;
    justify-content: space-between; align-items: center; gap: 8px; font-weight: 600;
  }
  .side a.is-on { background: var(--red-soft); color: var(--red); }
  .tabbar { display: none; }
  .main {
    padding: calc(var(--safe-t) + 28px) calc(var(--safe-r) + 32px) calc(var(--safe-b) + 40px) 32px;
    max-width: 960px;
    margin-left: 0;
    margin-right: auto;
  }
  .gl-actions .btn { flex: 0 0 auto; }
  #ks-fields .pb-input { width: 240px; max-width: 100%; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .dash { grid-template-columns: 1.3fr 1fr; }
  .camstrip { grid-template-columns: repeat(5, 1fr); }
  .top h1 { font-size: 40px; }
  #pane-cameras.is-on {
    margin: calc(-1 * (var(--safe-t) + 28px)) calc(-1 * (var(--safe-r) + 32px)) calc(-1 * (var(--safe-b) + 40px)) -32px;
    padding: calc(var(--safe-t) + 28px) calc(var(--safe-r) + 32px) calc(var(--safe-b) + 40px) 32px;
    min-height: 100dvh;
  }
  #cam-view:not([hidden]) { left: var(--side-w); }
  .cam-stage.is-full { left: var(--side-w); }
  /* Keep the joystick on screen under the picture. A full-width 16:10 frame
     on a short desktop window used to push it below the fold. */
  #cam-view .cam-picture {
    width: min(100%, calc((100dvh - 440px) * 1.6));
    max-height: calc(100dvh - 440px);
  }
  #cam-view .cam-stage.is-full .cam-picture { width: auto; max-width: none; max-height: none; height: auto; }
  #cv-ptz-panel { max-width: 560px; }
  #cam-view .cam-live-ctl { flex-direction: row; align-items: flex-start; gap: 16px; }
  #cam-view .cam-live-rest { flex: 1; }
  #cam-view:has(.cam-stage.is-full) #cv-ptz-panel { left: calc(var(--side-w) + 12px); }
  .joy { width: 160px; height: 160px; }
  .joy-knob { width: 56px; height: 56px; margin: -28px 0 0 -28px; }
}

/* Phone landscape: video on the upper right, controls down the left.
   The joystick sits at the bottom of that column, where the left thumb is. */
@media (orientation: landscape) and (max-height: 700px) and (min-width: 640px) {
  #cam-view:not([hidden]) {
    display: grid;
    grid-template-columns: minmax(168px, 230px) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    left: 0;
    column-gap: 8px;
    padding: calc(var(--safe-t) + 6px) max(8px, var(--safe-r)) calc(var(--safe-b) + 6px) max(8px, var(--safe-l));
  }
  #cam-view .cam-fs-top { grid-column: 1 / -1; margin-bottom: 4px; }
  #cam-view .cam-fs-top b { font-size: 16px; }
  #cam-view .cam-back, #cam-view .icon-btn { width: 34px; height: 34px; }
  #cam-view .cam-stage {
    grid-column: 2; grid-row: 2; min-width: 0; min-height: 0;
    display: flex; flex-direction: column; justify-content: flex-start;
  }
  #cam-view .cam-picture {
    flex: 1 1 auto; width: 100%; min-height: 0; max-height: none;
    aspect-ratio: auto; border-radius: 12px;
  }
  #cam-view .cam-stage.is-full { display: block; }
  #cam-view .cam-stage.is-full .cam-picture {
    position: absolute; inset: 0; width: auto; height: auto; max-height: none; aspect-ratio: auto;
  }
  #cam-view .cam-zoom { margin-top: 4px; flex: none; }
  #cam-view .cam-zoom-btn { width: 32px; height: 32px; font-size: 16px; }
  #cam-view .cam-rail {
    grid-column: 1; grid-row: 2; min-height: 0; min-width: 0;
    display: flex; flex-direction: column; overflow: hidden;
  }
  #cam-view #ct-live {
    flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
  }
  #cam-view #cv-ptz-panel {
    flex: 1 1 auto; min-height: 0; max-width: none;
    display: flex; flex-direction: column;
  }
  #cam-view .cam-live-ctl {
    flex: 1 1 auto; min-height: 0; gap: 8px;
    flex-direction: column; align-items: stretch;
  }
  #cam-view .cam-live-rest { order: -1; flex: 1 1 auto; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; gap: 8px; }
  #cam-view .joy-wrap { order: 1; margin-top: auto; align-self: flex-start; flex: none; }
  #cam-view .joy { width: 92px; height: 92px; }
  #cam-view .joy-knob { width: 34px; height: 34px; margin: -17px 0 0 -17px; }
  #cam-view #ct-rec,
  #cam-view #ct-events,
  #cam-view #cv-sheet { flex: 1 1 auto; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; }
  #cam-view #cv-offline {
    flex: none; margin: 0 0 6px; padding: 4px 8px; font-size: 11px; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  #cam-view .cam-tabs { margin: 0 0 6px; flex: none; }
  #cam-view .cam-tabs button { padding: 4px 8px; font-size: 12px; }
  #cam-view .cam-h { margin: .3rem 0 .15rem; }
  #cam-view:has(.cam-stage.is-full) #cv-ptz-panel,
  #cam-view:has(.cam-stage.is-full) #ct-live,
  #cam-view:has(.cam-stage.is-full) .cam-live-ctl {
    display: block; flex: none; height: auto; min-height: 0;
  }
  #cam-view:has(.cam-stage.is-full) .joy { width: 96px; height: 96px; margin-top: 0; }
  #cam-view:has(.cam-stage.is-full) .joy-knob { width: 36px; height: 36px; margin: -18px 0 0 -18px; }
}

/* Guest Kiosk Screensaver. Scoped so the other sections stay as they are. */
#pane-kiosk .ks-fold {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 12px;
}
#pane-kiosk .ks-fold:not([open]) > :not(summary) { display: none; }
#pane-kiosk .ks-fold > summary {
  list-style: none; cursor: pointer; position: relative;
  padding: 14px 44px 14px 16px; min-height: 52px; font-weight: 400;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
#pane-kiosk .ks-fold > summary::-webkit-details-marker { display: none; }
#pane-kiosk .ks-fold > summary::marker { content: ""; }
#pane-kiosk .ks-fold > summary::after {
  content: "▸"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  color: var(--red); font-family: var(--body); font-size: 16px; line-height: 1;
}
#pane-kiosk .ks-fold[open] > summary { border-bottom: 1px solid var(--line); }
#pane-kiosk .ks-fold[open] > summary::after { content: "▾"; }
#pane-kiosk .ks-fold-row {
  display: flex; flex-wrap: wrap; align-items: center; column-gap: 12px; row-gap: 2px;
}
#pane-kiosk .ks-fold-row > span:first-child {
  flex: 1 1 auto; min-width: 0;
  font-family: var(--display); font-size: 1.45rem; line-height: 1.15;
}
#pane-kiosk .ks-fold-note {
  flex: 1 0 100%;
  font-family: var(--body); font-size: 13px; color: var(--mute); font-weight: 500;
}
#pane-kiosk .ks-fold-note:empty { display: none; }
#pane-kiosk .ks-fold-body { padding: 14px 16px 16px; }
#pane-kiosk .ks-settings-save { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 14px 0 0; }
#pane-kiosk #ks-save-settings { min-width: 11rem; padding: 12px 18px; font-size: 16px; }
#pane-kiosk .ks-settings-save .ks-msg { margin: 0; }
#pane-kiosk .ks-fold > summary:focus-visible {
  outline: 2px solid var(--red); outline-offset: -2px; border-radius: var(--radius);
}
#pane-kiosk .ks-pickup {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; margin: 0 0 14px;
}
#pane-kiosk .ks-pickup b { font-weight: 700; }
#pane-kiosk fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
#pane-kiosk .ks-times { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#pane-kiosk .ks-slides { list-style: none; margin: 0; padding: 0; }
#pane-kiosk .ks-slide {
  display: grid; grid-template-columns: 2.75rem 1.6rem minmax(0, 1fr); gap: 8px;
  align-items: start; padding: 14px 0; border-top: 1px solid var(--line);
}
#pane-kiosk .ks-slide:first-child { border-top: 0; padding-top: 0; }
#pane-kiosk .ks-grab {
  width: 44px; height: 44px; margin: 0; padding: 0; border: 0; background: transparent;
  color: #3d2b22; cursor: grab; touch-action: none; user-select: none;
  display: flex; align-items: center; justify-content: center;
}
#pane-kiosk .ks-grab i {
  display: block; width: 18px; height: 2px; border-radius: 1px; background: currentColor;
  box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}
#pane-kiosk .ks-grab:active, #pane-kiosk .ks-slide.is-dragging .ks-grab { cursor: grabbing; }
#pane-kiosk .ks-grab-spacer { display: block; width: 44px; height: 44px; }
#pane-kiosk .ks-num { font-weight: 700; padding-top: 12px; }
#pane-kiosk .ks-drop {
  list-style: none; min-height: 72px; margin: 8px 0; border: 2px dashed #9CC0A6;
  border-radius: 12px; background: rgba(156, 192, 166, .35);
  display: flex; align-items: center; justify-content: center;
  color: #2F6B4F; font-weight: 700;
}
#pane-kiosk .ks-slide.is-dragging {
  position: fixed; z-index: 40; margin: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 28px rgba(40, 24, 16, .22); opacity: .96;
}
#pane-kiosk .ks-body { display: flex; gap: 12px; min-width: 0; align-items: flex-start; }
#pane-kiosk .ks-thumb, #pane-kiosk .ks-draft {
  display: block; width: 168px; aspect-ratio: 16 / 10; object-fit: cover; object-position: center center;
  border-radius: 10px; background: #E7DDD0; flex: none;
}
#pane-kiosk .ks-thumb.is-contain, #pane-kiosk .ks-draft.is-contain { object-fit: contain; object-position: center center; }
#pane-kiosk .ks-thumb.is-focus-top, #pane-kiosk .ks-draft.is-focus-top { object-position: center top; }
#pane-kiosk .ks-thumb.is-focus-bottom, #pane-kiosk .ks-draft.is-focus-bottom { object-position: center bottom; }
#pane-kiosk select:disabled { opacity: .55; }
#pane-kiosk label.is-locked,
#pane-kiosk .pb-input.is-locked { opacity: .4; }
#pane-kiosk #ks-dim-hint, #pane-kiosk #ks-cycle-hint { margin: 0 0 4px; }
#pane-kiosk #ks-dim-order { margin: 0 0 12px; }
#pane-kiosk #ks-dim-order:empty { display: none; }
#pane-kiosk #ks-tablet-status:empty { margin: 0; }
#pane-kiosk .ks-settings-actions { margin-top: 14px; }
#pane-kiosk .ks-settings-actions .btn { flex: 0 0 auto; }
#pane-kiosk .ks-msg.is-dirty { color: #8a5a00; font-weight: 700; }
#ks-save-settings:disabled {
  background: #E7DDD0; color: #7C6E66; border-color: #E7DDD0; opacity: 1; cursor: default;
}
#pane-kiosk .ks-draft { display: block; width: min(100%, 320px); margin: 0 0 12px; }
#pane-kiosk .ks-copy { min-width: 0; flex: 1; }
#pane-kiosk .ks-copy b { display: block; }
#pane-kiosk .ks-line, #pane-kiosk .ks-meta { display: block; color: var(--mute); font-size: 13px; }
#pane-kiosk .ks-quiet { color: var(--mute); font-weight: 500; }
#pane-kiosk .ks-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
#pane-kiosk .ks-actions .btn { padding: 8px 10px; flex: 0 1 auto; }
#pane-kiosk .ks-houses { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; }
#pane-kiosk .ks-houses .pb-check { margin: 0; font-weight: 700; }
#pane-kiosk .ks-move { position: relative; }
#pane-kiosk .ks-move-menu {
  position: absolute; z-index: 4; top: calc(100% + 4px); left: 0; min-width: 15rem;
  display: flex; flex-direction: column; gap: 4px; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(40, 24, 16, .12);
}
#pane-kiosk .ks-move-menu .btn { width: 100%; text-align: left; }
#pane-kiosk .ks-move-warn {
  display: block; color: var(--red); font-size: 13px; font-weight: 700;
  line-height: 1.35; padding: 4px 6px 2px;
}
#pane-kiosk .ks-slide.is-off .ks-thumb { opacity: .45; }
#pane-kiosk .ks-exp-group + .ks-exp-group { margin-top: 18px; }
#pane-kiosk .ks-exp-house { margin: 0 0 8px; font-size: 1.35rem; }
#pane-kiosk .ks-exp-list { list-style: none; margin: 0; padding: 0; }
#pane-kiosk .ks-exp { padding: 12px 0; border-top: 1px solid var(--line); }
#pane-kiosk .ks-exp-list .ks-exp:first-child { border-top: 0; padding-top: 0; }
#pane-kiosk .ks-exp .ks-body { align-items: center; }
#pane-kiosk .ks-exp .ks-copy b { font-size: 16px; }
#pane-kiosk .ks-exp .ks-meta { margin-top: 2px; }
#pane-kiosk .ks-exp.is-off .ks-thumb { opacity: .45; }
#pane-kiosk .ks-exp .pb-check { margin: 8px 0 0; }
#pane-kiosk .ks-preview-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
#pane-kiosk .ks-preview { margin: 0; width: 320px; }
#pane-kiosk .ks-preview-label { margin: 0 0 6px; font-family: var(--body); font-size: 13px; font-weight: 700; letter-spacing: .06em; }
#pane-kiosk .ks-frame {
  width: 320px; height: 200px; position: relative; overflow: hidden;
  border-radius: 8px; background: #141110;
}
#pane-kiosk .ks-stage {
  width: 1280px; height: 800px; position: absolute; left: 0; top: 0;
  transform: scale(0.25); transform-origin: top left; border: 0; display: block;
  color: #fff; background: #141110;
}
#pane-kiosk .ks-msg.is-bad { color: var(--red); font-weight: 700; }
#pane-kiosk .ks-msg.is-good { color: #2F6B4F; font-weight: 700; }
#pane-kiosk .ks-thumb.ks-missing,
#pane-kiosk .ks-draft.ks-missing {
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--mute); font-size: 13px; line-height: 1.3; padding: 8px;
  background: repeating-linear-gradient(135deg, #E7DDD0, #E7DDD0 8px, #F3EBE1 8px, #F3EBE1 16px);
}
@media (max-width: 640px) {
  #pane-kiosk .ks-body { flex-direction: column; }
  #pane-kiosk .ks-thumb { width: min(100%, 360px); }
  #pane-kiosk .ks-fold > summary { padding: 12px 40px 12px 14px; }
  #pane-kiosk .ks-fold-row > span:first-child { font-size: 1.35rem; }
}
@media (max-width: 520px) {
  #pane-kiosk .ks-times { grid-template-columns: 1fr; }
}
