/* The approved iPhone layout, shared with the desktop monitor. */
.icon-definitions { position: absolute; overflow: hidden; pointer-events: none; }
.ui-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.mobile-brand, .home-pill { display: none; }
.monitor-actions { display: flex; flex-shrink: 0; gap: 8px; }
.monitor-actions .ui-icon { width: 17px; height: 17px; }
.live-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-card { position: relative; min-width: 0; }
.grid-tile { display: block; width: 100%; padding: 0; overflow: hidden; border-radius: 12px; background: #173d31; color: #fff; text-align: left; }
.grid-tile:focus-visible, .grid-motion:focus-visible { outline: 3px solid #83a15e; outline-offset: 3px; }
.grid-frame { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; background: #102b28; color: #89a490; }
.grid-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.grid-caption { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px 10px; padding: 11px 13px; font-size: 13px; }
.grid-caption strong { min-width: 0; overflow-wrap: anywhere; }
.grid-badge { color: #d1ddd2; font-size: 11px; }
.grid-badge.is-live { color: #d8e9ac; }
.grid-motion {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: calc(100% - 16px);
  min-height: 40px;
  padding: 6px 9px;
  border-radius: 20px;
  background: #ffe5c8;
  color: #58391f;
  font-size: 11px;
  font-weight: 650;
  text-align: left;
}
.grid-motion .ui-icon { width: 16px; height: 16px; }
.grid-controls, .grid-pages { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.grid-controls { justify-content: space-between; margin: 14px 0 20px; }
.grid-pages button:disabled { opacity: .4; cursor: default; }
.grid-pages span { font-size: 12px; }
.grid-rewind-panel { margin-bottom: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.grid-rewind-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 6px; }
.grid-rewind-toolbar .button { min-height: 40px; padding: 6px 10px; font-size: 11px; }
#grid-rewind-label { margin-left: auto; align-self: center; color: var(--ink); font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
#grid-rewind-time { width: 100%; height: 30px; margin: 5px 0; padding: 0; border: 0; background: transparent; accent-color: var(--green); }
#grid-rewind-form label { flex: 0 1 auto; min-width: 0; gap: 4px; font-size: 11px; }
#grid-rewind-jump { width: 100%; min-height: 40px; padding: 6px 8px; }
#grid-rewind-status { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
#grid-rewind-toggle:disabled { opacity: .45; cursor: default; }
@media (max-width: 700px) {
  #grid-rewind-toggle { min-height: 40px; padding: 6px 9px; font-size: 11px; }
  #grid-rewind-jump { font-size: 16px; }
  .grid-rewind-panel:not([hidden]) ~ .live-grid .grid-frame { height: auto; aspect-ratio: 16 / 10; }
}
.camera-layout { max-width: 1000px; }
.camera-layout fieldset { min-width: 0; padding: 0; margin: 0; border: 0; }
.camera-layout-list { margin: 0 0 16px; padding: 0; list-style: none; }
.camera-layout-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: end; padding: 8px 0; border-bottom: 1px solid var(--line); }
.camera-layout-position { display: grid; min-height: 44px; place-items: center; color: var(--muted); font-size: 12px; }
.camera-layout-name input { width: 100%; min-height: 44px; }
.camera-layout-ptz { grid-column: 2 / -1; justify-self: start; min-height: 36px; }
.camera-layout-zoom { grid-column: 2 / -1; justify-self: start; }
.camera-layout-controls { display: flex; gap: 4px; }
.camera-layout-controls .button { min-width: 44px; min-height: 44px; padding: 0; font-size: 16px; }
.camera-layout-controls .button:disabled { opacity: .4; cursor: default; }
.camera-layout-status { margin: 12px 0 0; color: var(--green); font-size: 13px; }
.camera-layout-status.error { color: #a04430; }
.account-card { max-width: 720px; }
.account-card summary { width: fit-content; padding: 8px 0; cursor: pointer; font-size: 13px; font-weight: 600; }
.account-form { display: grid; gap: 12px; max-width: 420px; margin-top: 12px; }
.account-form > .button { justify-self: start; }
.account-status { margin: 12px 0; color: var(--green); font-size: 13px; }
.account-status.error { color: #a04430; }
.users-list { padding: 0; margin: 20px 0 0; list-style: none; }
.user-row { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.user-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; overflow-wrap: anywhere; }
.user-role { color: var(--muted); font-size: 12px; }
.user-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 12px; }
.user-actions summary { min-height: 42px; padding: 12px 0; }
.viewer-top strong { font-size: 14px; font-weight: 600; }
.mode-badge { font-weight: 650; }
.mode-badge.is-live { color: #2c4932; background: #d8e9ac; border-color: #d8e9ac; }
.viewer-footer > #viewer-time { margin-right: auto; margin-left: 12px; max-width: none; }
.viewer-footer > div { margin-left: auto; }
.viewer-footer .live-button { min-height: 40px; }
.viewer-footer .icon-button { display: grid; place-items: center; min-height: 40px; }
.ptz-toolbar { flex-shrink: 0; padding: 0 12px 4px; border-top: 1px solid #ffffff20; }
.ptz-toolbar .live-button { min-height: 44px; }
.ptz-toolbar .live-button[aria-expanded="true"] { color: #d8e9ac; }
.ptz-controls { display: grid; grid-template-columns: auto auto minmax(0,1fr); align-items: center; gap: 12px; padding: 0 0 10px; }
.ptz-directions { display: grid; grid-template-columns: repeat(3,44px); gap: 4px; }
.ptz-directions [data-ptz="up"], .ptz-directions [data-ptz="down"] { grid-column: 2; }
.ptz-directions [data-ptz="left"] { grid-row: 2; grid-column: 1; }
.ptz-directions [data-ptz="right"] { grid-row: 2; grid-column: 3; }
.ptz-zoom { display: grid; gap: 4px; }
.ptz-zoom span { color: #d2e1d3; font-size: 11px; text-align: center; }
.viewer .video-stage { overflow: hidden; }
#video { transform: scale(var(--ptz-view-zoom,1)); }
.ptz-controls button { min-width: 44px; min-height: 44px; padding: 0; border: 1px solid #ffffff35; border-radius: 8px; background: #ffffff13; color: #f2f7ef; font-size: 22px; }
.ptz-controls button:active { background: #ffffff35; }
.ptz-controls button[aria-disabled="true"] { opacity: .55; cursor: default; }
.ptz-controls p { margin: 0; font-size: 12px; color: #d2e1d3; line-height: 1.5; }
@media (max-width: 370px) {
  .ptz-controls { grid-template-columns: auto 1fr; }
  .ptz-zoom { justify-self: start; }
  .ptz-controls p { grid-column: 1 / -1; }
}
.camera-card { border: 0; background: transparent; overflow: visible; padding: 3px; border-radius: 9px; }
.camera-card.selected { outline: none; }
.camera-card.selected .camera-preview { outline: 2px solid #859e5b; outline-offset: 3px; }
.camera-preview { border-radius: 8px; overflow: hidden; }
.camera-preview .ui-icon { width: 27px; height: 27px; }
.camera-card-label { justify-content: center; padding: 10px 2px 2px; }
.camera-card-label strong { font-weight: 450; font-size: 11px; }
.camera-strip { padding: 5px 2px 6px; scroll-snap-type: x proximity; }
.camera-card { scroll-snap-align: start; }
.date-picker { position: relative; display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 9px; border-radius: 18px; background: #f0f2e9; padding: 7px 12px; font-size: 12px; font-weight: 450; min-height: 40px; }
.date-picker .ui-icon { width: 17px; height: 17px; }
.date-picker input { opacity: 0; position: absolute; inset: 0; width: 100%; height: 100%; min-width: 100%; max-width: none; cursor: pointer; }
.date-picker input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; padding: 0; }
.date-picker:focus-within { outline: 3px solid #8aac67; outline-offset: 2px; }
.timeline-tools .icon-button, .timeline-range-tools .icon-button { min-width: 40px; min-height: 40px; }
.timeline-range-tools { display: flex; align-items: center; gap: 4px; }
.timeline-range-tools .ui-icon { width: 16px; height: 16px; }
.timeline-range-tools .icon-button { font-size: 19px; color: #748267; }
.timeline-range-tools .icon-button:disabled { opacity: .25; cursor: default; }
.timeline-subheading { margin-top: 8px; }
.timeline-zoom-control { display: grid; grid-template-columns: auto minmax(0,1fr) 72px; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.timeline-zoom-control input { width: 100%; min-width: 0; min-height: 44px; margin: 0; padding: 0; border: 0; background: transparent; accent-color: var(--green); }
.timeline-zoom-control span { text-align: right; font-variant-numeric: tabular-nums; }
.timeline-event-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.timeline-event-nav .button { min-height: 44px; padding: 6px; font-size: 12px; }
.timeline-event-nav .button:disabled { opacity: .45; cursor: default; }
.timeline-labels { font-size: 10px; color: #798473; }
.timeline .recording-block { background: #adc89b; }
.timeline-track { background: #f0f3eb; }
.playhead span { border-radius: 4px; background: #214e41; color: #fff; padding: 3px 6px; font-size: 10px; top: 30px; }
.playhead { background: #214e41; }
.timeline-bottom { margin-top: 22px; }
.timeline-focus { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; margin: 4px 0 8px; padding: 4px 4px 4px 10px; border-radius: 8px; background: #f9ead8; color: #623d22; font-size: 12px; font-weight: 600; }
.timeline-focus-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.timeline-focus .button { min-height: 40px; padding: 6px 10px; font-size: 11px; }
.activity-header h2 { display: flex; align-items: center; gap: 9px; }
.motion-icon { color: #d18f50; width: 21px; height: 21px; }
.activity-more { display: flex; align-items: center; gap: 6px; font-size: 10px; }
.activity-header .count-pill { font-size: 9px; }
.activity-panel { min-height: 310px; max-height: none; }
.event-list { max-height: none; }
.event-row { min-height: 72px; gap: 12px; }
.event-icon { position: relative; width: 55px; height: 39px; flex-basis: 55px; overflow: hidden; background: #edf1e6; color: #a1ad8f; border-radius: 6px; }
.event-icon .ui-icon { width: 19px; height: 19px; }
.event-icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.event-chevron { width: 14px; height: 14px; color: #7f8c75; margin-left: 1px; }
.event-name { font-size: 12px; font-weight: 500; }
.event-kind { font-size: 10px; margin-top: 5px; color: #818c77; }
.event-time { font-size: 10px; white-space: nowrap; }
.event-list .event-time small { display: none; }
.event-row:last-child { border-bottom: 0; }
.activity-controls { max-width: 900px; display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 20px; color: #77846b; font-size: 12px; }
.activity-controls select { font-size: 12px; }
.activity-review { display: grid; gap: 10px; max-width: 900px; margin-bottom: 16px; }
.activity-review-card, .replay-player { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 14px; }
.activity-review-card h2 { margin: 0; font-size: 17px; }
.activity-review-card p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.home-replay, .motion-sequence-heading, .replay-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.home-replay, .motion-sequence-heading { justify-content: space-between; }
.activity-review-card summary { cursor: pointer; font-size: 16px; font-weight: 650; }
.motion-heatmap {
  min-width: 0;
  --heat-empty: #f0f3eb;
  --heat-one: #dce9cf;
  --heat-two: #b8d7a3;
  --heat-three: #477642;
  --heat-four: #295b41;
  --heat-text: #213a2c;
  --heat-strong-text: #fff;
}
.heatmap-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 0 4px; }
.heatmap-legend, .heatmap-nav { display: flex; align-items: center; gap: 4px; }
.heatmap-legend { color: var(--muted); font-size: 11px; }
.heatmap-legend i { width: 13px; height: 13px; border-radius: 3px; }
.heatmap-nav .button { min-width: 40px; min-height: 38px; padding: 4px; font-size: 17px; }
.heatmap-nav .button:disabled { opacity: .45; cursor: default; }
.heatmap-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; scroll-padding-inline-start: 112px; padding-bottom: 4px; }
.heatmap-scroll:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.heatmap-table { width: max-content; min-width: 100%; border-spacing: 3px; font-variant-numeric: tabular-nums; }
.heatmap-table :is(th,td) { padding: 0; }
.heatmap-table .heatmap-camera { position: sticky; left: 0; z-index: 1; padding-inline: 4px 8px; background: var(--surface); text-align: left; font-size: 11px; }
.heatmap-camera span { display: block; width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.heatmap-table .heatmap-hour { padding: 0 2px; color: var(--muted); font-size: 10px; font-weight: 550; white-space: nowrap; }
.heatmap-cell, .heatmap-empty { display: grid; place-items: center; width: 100%; min-width: 30px; min-height: 32px; padding: 2px; border-radius: 5px; font-size: 11px; }
.heatmap-empty { background: var(--heat-empty); color: var(--muted); }
.heatmap-cell { color: var(--heat-text); font-weight: 650; }
.heatmap-cell:is([data-level="3"],[data-level="4"]) { color: var(--heat-strong-text); }
.heatmap-cell:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
.motion-heatmap [data-level="1"] { background: var(--heat-one); }
.motion-heatmap [data-level="2"] { background: var(--heat-two); }
.motion-heatmap [data-level="3"] { background: var(--heat-three); }
.motion-heatmap [data-level="4"] { background: var(--heat-four); }
@media (max-width: 700px) {
  .heatmap-camera span { width: 86px; }
  .heatmap-cell, .heatmap-empty { min-width: 42px; min-height: 40px; }
}
.motion-sequence { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.motion-sequence-heading { font-size: 13px; }
.motion-trail { display: flex; gap: 8px; overflow-x: auto; list-style: none; margin: 8px 0 0; padding: 2px 2px 5px; }
.motion-trail li { flex: 0 0 auto; }
.motion-step { display: grid; gap: 3px; min-height: 44px; max-width: 180px; padding: 8px 10px; border-radius: 8px; background: #f7eadb; color: #58391f; text-align: left; font-size: 12px; overflow-wrap: anywhere; }
.motion-step span { font-size: 11px; }
.replay-player { margin-top: 10px; }
.replay-player p { margin: 0 0 9px; font-weight: 650; font-size: 13px; }
.replay-actions .button { min-width: 40px; padding-inline: 10px; }
.replay-actions .button:disabled, #home-replay:disabled { opacity: .45; cursor: default; }
.timeline-panel:has(.scrub-thumbnail:not([hidden])) { overflow: visible; }
.scrub-thumbnail { position: absolute; z-index: 6; bottom: calc(100% + 19px); transform: translateX(-50%); width: min(144px,100%); aspect-ratio: 16 / 9; object-fit: contain; background: #102b28; border: 2px solid #fff; border-radius: 7px; box-shadow: 0 3px 12px #15282444; pointer-events: none; }
#activity-more-events { margin: 18px 0 30px; }
.event-limit-note { color: #87917d; font-size: 11px; padding: 18px 0 4px; }
.recording-error { color: #ad6042; font-weight: 500; }

@media (max-width: 700px) {
  :root { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
  .topbar { height: auto; min-height: 68px; padding: calc(12px + env(safe-area-inset-top)) 20px 12px; background: #f7f8f4; }
  .topbar .breadcrumb, .topbar .topbar-right { display: none; }
  .mobile-brand { display: flex; font-size: 25px; letter-spacing: -1px; gap: 8px; }
  .mobile-brand .brand-mark { font-size: 29px; }
  .mobile-brand .brand-dot { margin-left: -8px; }
  .home-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; background: #e9eddf; padding: 10px 13px; border-radius: 25px; min-height: 40px; }
  .home-pill .ui-icon { width: 17px; height: 17px; }
  .home-pill .status-dot { width: 5px; height: 5px; margin-left: 1px; }
  .main { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  .view { padding: 15px 18px 0; }
  .page-heading { margin-bottom: 15px; min-height: 34px; }
  #monitor-view .page-heading > div > .eyebrow,
  #monitor-view .page-heading > div > p:last-child { display: none; }
  .page-heading h1 { font-size: clamp(25px, 6.7vw, 31px); font-weight: 650; letter-spacing: -.04em; margin: 0; }
  .page-heading h1 span { color: inherit; }
  .monitor-actions { gap: 3px; }
  .monitor-actions #open-grid { font-size: 11px; gap: 5px; padding: 7px; min-height: 40px; }
  .monitor-actions #refresh { font-size: 0; padding: 5px; width: 40px; min-height: 40px; border: 0; background: transparent; }
  .monitor-actions #refresh span { font-size: 23px; color: #8a9779; }
  .live-grid { gap: 8px; }
  .grid-caption { padding: 8px 9px; font-size: 12px; }
  .monitor-grid { gap: 15px; }
  .viewer { border-radius: 12px; background: #173d31; border-color: #173d31; box-shadow: none; }
  .viewer-top { height: 42px; padding: 0 12px; border: 0; }
  .viewer-top > div { gap: 8px; }
  .viewer-top strong { font-size: 15px; }
  .viewer-top .status-dot { width: 7px; height: 7px; }
  .mode-badge { font-size: 9px; letter-spacing: .09em; padding: 4px 7px; }
  .video-stage { aspect-ratio: 16 / 9; min-height: 0; margin: 0 5px; border-radius: 6px; }
  .player-empty { padding: 15px; }
  .player-empty .empty-eye { display: none; }
  .player-empty h2 { font-size: 19px; }
  .player-empty p { font-size: 11px; line-height: 1.65; margin: 9px auto 14px; }
  .viewer-footer { height: 40px; padding: 0 10px; }
  .viewer-footer > #viewer-time { display: none; }
  .viewer-footer .live-button { font-size: 11px; gap: 6px; }
  .viewer-footer select { font-size: 10px; max-width: 130px; min-height: 40px; }
  .viewer-footer > div { gap: 9px; }
  .viewer-footer .icon-button { min-width: 36px; }
  .camera-section { margin-top: 9px; }
  .camera-section > .section-heading { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .camera-strip { margin-top: 0; gap: 7px; }
  .camera-card { flex: 0 0 calc((100% - 21px) / 4); min-width: 76px; padding: 3px; }
  .camera-preview { aspect-ratio: 16 / 10; border-radius: 7px; }
  .camera-card-label { padding: 9px 0 0; }
  .camera-card-label strong { font-size: 11px; }
  .timeline-panel { margin-top: 10px; padding: 11px 12px 12px; border-radius: 12px; display: grid; grid-template-columns: minmax(0, 1fr); }
  .timeline-panel h2 { font-size: 19px; font-weight: 550; }
  .timeline-panel > .section-heading { grid-row: 1; }
  .timeline-tools { gap: 0; }
  .timeline-tools .icon-button { min-width: 34px; min-height: 40px; font-size: 24px; }
  .date-picker { gap: 7px; font-size: 12px; padding: 7px 12px; }
  .timeline-area { grid-row: 2; margin: 9px 2px 0; }
  .timeline-labels { height: 19px; font-size: 10px; }
  .timeline { height: 43px; }
  .timeline-track, .recording-block { top: 7px; height: 14px; }
  .event-marker { top: 6px; height: 16px; }
  .playhead { top: 2px; bottom: 13px; }
  .playhead span { top: 27px; font-size: 9px; padding: 3px 5px; }
  .timeline-subheading { grid-row: 3; margin: -5px 0 0; min-height: 34px; }
  .legend { font-size: 9px; gap: 11px; }
  .legend i { width: 7px; height: 7px; }
  .timeline-range-tools { gap: 0; }
  .timeline-range-tools .icon-button { min-width: 26px; min-height: 34px; font-size: 18px; padding: 3px; }
  .timeline-subheading select { font-size: 9px; min-height: 34px; }
  .timeline-bottom { margin: 0; min-height: 0; font-size: 10px; align-items: flex-start; }
  .timeline-bottom > #timeline-status:not(.recording-error) { display: none; }
  .timeline-bottom > #timeline-status.recording-error { padding-top: 8px; line-height: 1.7; }
  #jump-time-button { display: grid; place-items: center; margin-left: 4px; }
  .timeline-note { display: none; }
  .jump-form { grid-row: 5; }
  .activity-panel { min-height: 0; border-radius: 12px; max-height: none; }
  .activity-header { display: block; padding: 10px 14px 2px; border: 0; }
  .activity-header > .eyebrow, .activity-header > select { display: none; }
  .activity-header .section-heading { margin: 0; }
  .activity-header h2 { font-size: 19px; font-weight: 550; }
  .activity-more { font-size: 10px; min-height: 28px; }
  .activity-more .count-pill { display: none; }
  .event-list { padding: 0 14px 3px; max-height: none; }
  .event-row { min-height: 58px; padding: 8px 0; gap: 12px; }
  .event-icon { flex-basis: 54px; width: 54px; height: 37px; border-radius: 6px; }
  .event-name { font-size: 13px; }
  .event-kind { font-size: 11px; margin-top: 4px; }
  .event-time { font-size: 11px; }
  .event-chevron { width: 13px; height: 13px; }
  .activity-footer { padding: 5px 14px 10px; font-size: 8px; border: 0; gap: 7px; }
  .events-empty { padding: 14px 5px; }
  .events-empty h3 { margin-top: 0; }
  .events-empty p { font-size: 10px; }
  .page-footer { display: none; }
  .mobile-nav { min-height: calc(68px + env(safe-area-inset-bottom)); height: auto; padding: 7px 8px calc(8px + env(safe-area-inset-bottom)); background: #f7f8f4ed; }
  .mobile-nav button { gap: 5px; padding: 7px 10px; font-size: 11px; min-height: 48px; min-width: 80px; color: #8a9678; }
  .mobile-nav .ui-icon { width: 23px; height: 23px; stroke-width: 1.5; }
  .mobile-nav button.active .ui-icon { stroke-width: 2; }
  .activity-controls { margin-bottom: 16px; }
  .activity-full { padding: 2px 14px; }
  .activity-full .event-row { min-height: 72px; }
  .settings-grid .form-row { flex-wrap: wrap; }
  .settings-grid .form-row > label { min-width: 90px; }
  .auth-main input, .settings-card input, .settings-card select { font-size: 16px; }
  .toast { bottom: calc(83px + env(safe-area-inset-bottom)); }
}

@media (max-width: 700px) and (orientation: portrait) {
  #grid-view { padding-inline: 10px; }
  .grid-frame {
    height: clamp(126px, calc((100svh - 365px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) / 2), 240px);
    aspect-ratio: auto;
  }
}
.viewer-footer > #play-toggle { padding-right: 12px; margin-right: 12px; border-right: 1px solid #ffffff20; }
.viewer:fullscreen { width: 100%; height: 100%; display: flex; flex-direction: column; border-radius: 0; }
.viewer:fullscreen .video-stage { flex: 1; min-height: 0; aspect-ratio: auto; }
.viewer:fullscreen .viewer-top,.viewer:fullscreen .viewer-footer { flex-shrink: 0; }
@media(max-width:700px) { .viewer-footer > #play-toggle { padding-right: 8px; margin-right: 8px; } }
/* A larger seek surface, with a visible current-view position. */
.timeline { height: 78px; touch-action: none; user-select: none; cursor: grab; }
.timeline .timeline-track,.timeline .recording-block { top: 16px; height: 28px; border-radius: 5px; }
.timeline .event-marker { top: 13px; height: 34px; width: 4px; }
.timeline .playhead { top: 7px; bottom: 26px; width: 2px; z-index: 3; }
.timeline .playhead::before { top: 12px; left: -7px; width: 16px; height: 16px; border: 3px solid #fff; border-radius: 50%; background: #214e41; box-shadow: 0 1px 5px #153b3540; }
.timeline .playhead span { top: 49px; font-size: 11px; line-height: 17px; padding: 3px 7px; }
.timeline .playhead.is-live { background: #476e2f; }
.timeline .playhead.is-live::before { background: #88aa55; }
.timeline.is-scrubbing { cursor: grabbing; }
.timeline.is-scrubbing .playhead::before { width: 22px; height: 22px; left: -10px; top: 9px; background: #d18f50; }
.timeline.is-scrubbing .playhead span { background: #9b673a; }
@media(max-width:700px) {
 .timeline { height: 78px; }
 .timeline-subheading { margin-top: 0; }
 .timeline .playhead span { font-size: 10px; }
}

.cached-block{position:absolute;top:41px;height:4px;background:#438ba0;border-radius:2px;pointer-events:none}.cache-status{font-size:10px;color:#438192;line-height:1.6;margin-top:10px}@media(max-width:700px){.cache-status{font-size:9px;margin-top:5px}}
/* Motion spans stand above the recording track instead of hairline ticks. */
.timeline .event-marker { top: 9px; height: 40px; min-width: 0; border-radius: 5px; background: #d58e4c; border: 1px solid #b87537; box-shadow: 0 1px 3px #9a632329; opacity: .94; pointer-events: auto; cursor: pointer; }
.timeline .event-marker:hover { background: #ba7435; opacity: 1; }
.timeline-heading-left{display:flex;align-items:center;gap:8px}.timeline-heading-left #clip-toggle{font-size:24px;color:#47664a;min-height:40px;min-width:36px}.clip-editor{grid-row:6;border-top:1px solid var(--line);margin-top:15px;padding-top:17px}.clip-editor h3{margin:0;font-size:16px;font-weight:550}.clip-editor .section-heading>span{font-size:11px;color:var(--muted)}.clip-help{font-size:11px;line-height:1.7;color:#7c8972;margin:10px 0}.clip-time-row{display:flex;gap:10px;align-items:end;margin:14px 0}.clip-time-row label{flex:1;min-width:0}.clip-time-row input{width:100%}.clip-time-row .button{font-size:10px}.clip-time-row .button.selecting{background:#e0ebd5;border-color:#77995e}.clip-actions{display:flex;gap:12px;align-items:end;margin-top:16px}.clip-actions label{flex:1;min-width:0;font-size:11px}.clip-actions select{max-width:100%;font-size:11px}.clip-result{margin-top:15px;padding:14px;border-radius:9px;background:#eff3e9;font-size:12px;line-height:1.8}.clip-result progress{display:block;width:100%;height:8px;accent-color:#426c43;margin:13px 0}.clip-result-actions{display:flex;gap:15px;align-items:center;margin-top:12px}.clip-selection{position:absolute;top:5px;height:46px;border:2px dashed #527d9c;background:#79b2d52b;pointer-events:none;z-index:2;border-radius:5px}.timeline.is-clip-picking{outline:2px solid #527d9c;outline-offset:3px;cursor:crosshair}@media(max-width:700px){.timeline-heading-left{gap:3px}.timeline-heading-left #clip-toggle{min-width:30px;padding:4px}.clip-time-row input{font-size:16px;padding:9px 7px}.clip-time-row .button{padding:10px 8px;white-space:normal;max-width:94px}.clip-actions{flex-wrap:wrap}.clip-actions label{flex-basis:100%}.clip-actions select{font-size:14px}.clip-actions>.button{width:100%}.clip-help{font-size:10px}.clip-time-row label{font-size:11px}}
