/* Load last. Comfortable touch controls; the existing closet. fonts and palette stay in place. */
:root {
  --touch-target: 48px;
  --mobile-gutter: 16px;
  --mobile-nav-height: 74px;
  --mobile-header-height: 64px;
}

body { font-size: 16px; line-height: 1.75; }
button, a, summary { touch-action: manipulation; }
button:focus-visible, a:focus-visible, summary:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--blue, #521f32);
  outline-offset: 4px;
}
.content p, .dialog-body p { font-size: 16px; line-height: 1.8; }
.content :is(small, label), .dialog-body :is(small, label),
.content .field-label, .dialog-body .field-label,
.content .form-field label, .dialog-body .form-field label {
  font-size: 14px; line-height: 1.7;
}
.content :is(.primary, .secondary, .text-button, .app-link, .filter, .plain-tab, .visual-tab, .mood),
.dialog-body button, .dialog-body summary {
  min-height: var(--touch-target); font-size: 14px; line-height: 1.5;
}
.content :is(.primary, .secondary), .dialog-body :is(.primary, .secondary) {
  padding: 12px 18px; gap: 10px;
}
.content :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.dialog-body :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) {
  font-size: 16px; min-height: var(--touch-target); line-height: 1.5;
}
.content :is(input, textarea), .dialog-body :is(input, textarea) { scroll-margin-block: 90px 130px; }
.content :is(input[type="checkbox"], input[type="radio"]),
.dialog-body :is(input[type="checkbox"], input[type="radio"]) {
  width: 20px; height: 20px; min-height: 20px; flex-shrink: 0;
  accent-color: var(--blue, #521f32);
}
.content :is(.form-help, .app-note, .small, .weather-advice, .weather-source, .wardrobe-sample-note),
.dialog-body :is(.form-help, .app-note, .small, .sample-note),
.content :is(.mini-item b, .mini-item span, .look-option b, .look-option small, .summary-stat span),
.content :is(.live-garment-button h3, .live-garment-button p, .garment-card h3, .garment-card p),
.content :is(.visual-note, .selection-row span, .detail-stats span, .weather-main dt, .weather-compact small) {
  font-size: 14px; line-height: 1.7;
}
.content .eyebrow, .dialog-body .eyebrow, .content .community-kicker {
  font-size: 12px; letter-spacing: .1em;
}
.content :is(.weather-live-top button, .weather-source button, .wardrobe-edit-link) { min-height: 48px; font-size: 14px; }
.content .weather-live-top .eyebrow { font-size: 12px; }
.content .weather-source a { font-size: 14px; }
.content .live-conditions .mood { font-size: 14px; }
.dialog-header { gap: 16px; }
.dialog-header h2 { font-size: 21px; line-height: 1.4; overflow-wrap: anywhere; }
.dialog-header .close { width: 48px; height: 48px; min-width: 48px; min-height: 48px; }
.dialog-header .close .icon { width: 24px; height: 24px; }
.toast { font-size: 14px; line-height: 1.7; }
#app-save-status, .demo-footer, .demo-footer > span { font-size: 14px; }

/* Real posts remain the visual focus, with a compact entry to the camera. */
.live-root, .live-dialog { font-size: 16px; --live-muted: #715961; }
.live-root :is(.live-user-name b, .live-user-name small, .live-byline-date,
.live-source-switch > button, .live-tabbar > button, .live-post-actions > button,
.live-post-footer, .live-post-footer > button, .live-post-footer > span,
.live-tags, .live-status, .live-feed-end > span, .live-story-row .community-story b,
.live-text-link, .live-outline, .live-note-card .community-kicker) { font-size: 14px; }
.live-dialog :is(button, .live-user-name b, .live-user-name small, .live-help,
.live-comments b, .live-comments small, .live-garment-options label, .live-status,
.live-upload small, .live-upload-change, label.field-label, legend) { font-size: 14px; }
.live-root .live-caption, .live-dialog .live-comments p { font-size: 16px; line-height: 1.8; }
.live-root :is(.live-person, .live-tabbar > button, .live-post-actions > button,
.live-post-footer > button, .live-source-switch > button, .community-more,
.live-feed-tools form > button, .community-layout-toggle > button),
.live-dialog :is(.live-person, .live-selected-tags > button, .live-garment-options label) { min-height: 48px; }
.live-root .community-more, .live-root .live-refresh { min-width: 48px; }
.live-post-actions { gap: 20px; padding-top: 4px; }
.live-root .live-post-actions .icon { width: 25px; height: 25px; }
.live-avatar { width: 42px; height: 42px; min-width: 42px; }
.live-post-footer { flex-wrap: wrap; gap: 4px 16px; padding-bottom: 10px; }
.live-post-footer > span:last-child { white-space: normal; }
.live-post-photo { max-height: 70dvh; }
.live-photo-label { font-size: 12px; letter-spacing: .06em; background: #38252bc9; padding: 4px 9px; }
.live-media-video {
  display: block; width: 100%; max-width: 100%; aspect-ratio: 4 / 5;
  max-height: 70dvh; object-fit: contain; background: #292224;
}
.live-post-photo > .live-media-video { height: 100%; }
.live-detail-photo { max-height: 70dvh; }
.live-header { padding-block: 0 18px; }
.live-header h1 { font-size: clamp(30px, 3.6vw, 46px); line-height: 1.12; margin: 6px 0 10px; }
.live-header p { letter-spacing: 0; }
.live-source-switch { margin-bottom: 16px; }
.live-feed-topline { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.live-feed-topline > div { min-width: 0; }
.live-feed-topline :is(h1, h2) { font-size: clamp(26px, 3vw, 36px); line-height: 1.3; margin: 0; }
.live-feed-topline p { font-size: 14px; margin-top: 4px; }
.live-quick-capture {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  margin: 0 0 16px; padding: 18px 20px; background: var(--white, #fffdfa);
  border: 1px solid var(--line, #d8cdca); border-radius: 8px;
}
.live-quick-capture > div { min-width: 0; }
.live-quick-capture :is(h2, h3, strong) { font-size: 18px; line-height: 1.5; }
.live-quick-capture p { font-size: 14px; margin: 4px 0 0; }
.live-camera-cta, .live-root .live-camera-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 13px 22px; font-size: 16px; line-height: 1.5;
  background: var(--blue, #521f32); color: var(--white, #fffdfa); border-radius: 8px;
}
.live-camera-cta .icon { width: 25px; height: 25px; }
.live-feed-tools { padding-block: 8px 18px; }
.live-feed-tools .community-layout-toggle > button { font-size: 14px; }
.live-root .live-feed-tools input { font-size: 16px; }
.live-empty { min-height: 0; padding: 26px; }
.live-empty > p { margin: 14px 0 18px; max-width: 42ch; }
.live-empty > em { font-size: 34px; }
.live-empty-number { margin-bottom: 14px; }
.live-empty-editorial { margin-bottom: 18px; }
.live-empty-editorial img { height: 150px; }
.live-empty-editorial > span { font-size: 12px; letter-spacing: .08em; }
.live-empty-editorial img:nth-child(2) { margin-top: 0; }
.live-side { gap: 24px; }
.live-side .live-note-card { padding: 28px; }
.live-side .live-note-card h2 { margin-block: 16px; }
.live-side .live-note-card :is(p, small), .live-side .live-friend-note p { font-size: 14px; line-height: 1.8; }

/* Camera markup: #modal.capture-open > header + #modal-body > .capture-dialog. */
#modal.capture-open { width: min(620px, calc(100vw - 32px)); }
.capture-dialog { display: flex; flex-direction: column; align-items: stretch; gap: 14px; min-width: 0; }
.capture-stage {
  position: relative; display: grid; place-items: center; width: 100%; min-height: 200px;
  aspect-ratio: 4 / 5; max-height: 58dvh; overflow: hidden;
  background: #292224; color: #fffaf5; border-radius: 8px;
}
.capture-stage :is(video, img, canvas) { display: block; width: 100%; height: 100%; object-fit: cover; }
.capture-stage video { position: absolute; inset: 0; }
.capture-stage > :is(p, .capture-placeholder) { position: relative; padding: 24px; text-align: center; font-size: 16px; max-width: 34ch; }
.capture-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 16px; align-items: center; }
.capture-toolbar > :first-child { justify-self: start; }
.capture-toolbar > :last-child { justify-self: end; }
.capture-toolbar :is(button, .capture-library) { min-height: 48px; min-width: 48px; font-size: 14px; }
.capture-toolbar .capture-shutter, .dialog-body .capture-shutter {
  width: 76px; height: 76px; min-width: 76px; min-height: 76px; padding: 0;
  display: grid; place-items: center; justify-self: center; border-radius: 50%;
  border: 3px solid var(--blue, #521f32); background: var(--white, #fffdfa);
  color: var(--blue, #521f32); box-shadow: inset 0 0 0 6px var(--white, #fffdfa), inset 0 0 0 8px #dcc7ce;
}
.capture-shutter .icon { width: 29px; height: 29px; }
.capture-shutter:is([aria-pressed="true"], [data-recording="true"], .is-recording) {
  background: var(--blue, #521f32); color: var(--white, #fffdfa);
  box-shadow: inset 0 0 0 6px var(--white, #fffdfa);
}
.capture-mode { display: flex; align-items: center; justify-content: center; gap: 4px; }
.capture-mode button, button.capture-mode {
  min-height: 48px; padding: 10px 18px; font-size: 14px; border-radius: 24px;
  color: var(--muted, #6d6266); background: transparent;
}
.capture-mode button:is(.active, [aria-pressed="true"], [aria-selected="true"]),
button.capture-mode:is(.active, [aria-pressed="true"]) { color: var(--blue, #521f32); background: var(--blue-soft, #eee3e5); }
.capture-status { min-height: 24px; font-size: 14px; line-height: 1.7; color: var(--muted, #6d6266); text-align: center; overflow-wrap: anywhere; }
.capture-dialog .capture-status { font-size: 14px; margin: 0; }
.capture-status[role="alert"] { color: #8d263d; }
.capture-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 18px; }
.capture-footer :is(p, small) { font-size: 14px; text-align: center; }
.capture-library { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px 10px; color: var(--blue, #521f32); cursor: pointer; }
.capture-library .icon { width: 26px; height: 26px; }
.capture-library:focus-within { outline: 2px solid var(--blue, #521f32); outline-offset: 4px; }

/* One clear publish action; secondary choices can live in <details>. */
.live-compose-preview {
  display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 5; max-height: 58dvh;
  overflow: hidden; background: #eae0d8; border-radius: 6px; position: relative;
}
.live-compose-preview :is(video, img) { display: block; width: 100%; height: 100%; max-height: 58dvh; object-fit: contain; }
.live-compose-preview video { background: #292224; }
.live-compose-summary { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; padding: 12px 0; font-size: 14px; }
.live-compose-summary :is(p, small) { font-size: 14px; }
.live-compose-details { margin: 18px 0; padding-block: 4px; border-block: 1px solid var(--line, #d8cdca); }
.live-compose-details summary { min-height: 48px; padding: 12px 0; font-size: 14px; line-height: 1.7; cursor: pointer; color: var(--blue, #521f32); }
.live-compose-details[open] > summary { margin-bottom: 12px; }
.live-compose-details :is(select, input, textarea) { margin-bottom: 12px; }
.live-publish-bar {
  position: sticky; bottom: -28px; z-index: 5; margin: 20px -28px -28px;
  padding: 14px 28px 22px; border-top: 1px solid var(--line, #d8cdca);
  background: var(--white, #fffdfa); box-shadow: 0 -8px 24px #49312408;
}
.live-publish-bar .primary, .live-dialog .live-publish-bar .primary { min-height: 52px; width: 100%; font-size: 16px; }
.live-publish-bar :is(p, small) { font-size: 14px; line-height: 1.6; margin: 8px 0 0; }
.live-dialog .community-compose-tabs > button { font-size: 14px; min-height: 48px; }
.live-dialog .live-upload > span:first-child { min-height: 168px; }
.live-dialog .live-garment-options label { min-height: 48px; }
.live-dialog .live-comments { overscroll-behavior: contain; }

@media (min-width: 761px) {
  .rail { min-height: 88px; height: auto; padding-block: 18px; }
  .navigation { gap: clamp(18px, 2.2vw, 32px); }
  .navigation .nav-item { min-height: 48px; font-size: 14px; }
  .navigation .quick-camera-nav { padding: 10px 16px; background: var(--blue); color: var(--white); border-radius: 8px; gap: 9px; }
  .navigation .quick-camera-nav .icon { display: block; width: 22px; height: 22px; }
  .navigation .quick-camera-nav::after { display: none; }
  .top-actions .text-button { font-size: 14px; min-height: 48px; }
  .top-actions .avatar { width: 44px; height: 44px; }
  .live-layout { grid-template-columns: minmax(0, 650px) minmax(240px, 300px); justify-content: center; gap: clamp(28px, 5vw, 64px); }
  .live-layout.is-gallery { grid-template-columns: minmax(0, 1fr); }
  .live-side { top: 24px; }
  #modal { max-height: calc(100dvh - 48px); }
}

@media (min-width: 761px) and (max-width: 1000px) {
  .rail { padding-inline: 24px; gap: 18px; }
  .navigation { gap: 16px; }
  .live-layout { grid-template-columns: minmax(0, 1fr); max-width: 650px; }
  .live-side { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live-layout.is-gallery { max-width: none; }
}

@media (max-width: 760px) {
  html { scroll-padding-top: calc(var(--mobile-header-height) + env(safe-area-inset-top, 0px)); }
  .rail {
    position: sticky; top: 0; z-index: 22; width: 100%; height: calc(var(--mobile-header-height) + env(safe-area-inset-top, 0px));
    min-height: 64px; justify-content: flex-start; gap: 0;
    padding: env(safe-area-inset-top, 0px) max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
    background: var(--paper, #f6f3ee); border-bottom: 1px solid var(--line, #d8cdca);
  }
  .rail > .wordmark { position: static; font-size: 40px; line-height: 1; letter-spacing: -2.5px; }
  .topbar {
    position: fixed; display: flex; top: env(safe-area-inset-top, 0px); right: max(16px, env(safe-area-inset-right, 0px));
    z-index: 23; width: auto; height: var(--mobile-header-height); min-height: 64px;
    margin: 0; padding: 0; border: 0; background: transparent;
  }
  .topbar-date, .topbar .mobile-logo { display: none; }
  .top-actions { position: static; gap: 10px; }
  .top-actions .text-button { min-height: 48px; padding: 8px 4px; font-size: 14px; gap: 6px; }
  .top-actions .text-button .icon { width: 21px; height: 21px; }
  .top-actions .avatar { width: 44px; height: 44px; min-height: 44px; font-size: 23px; }
  .navigation {
    position: fixed; inset: auto 0 0; z-index: 24; margin: 0; width: 100%;
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px;
    min-height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px));
    padding: 8px max(8px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
    border-radius: 0; border-top: 1px solid var(--line, #d8cdca);
    background: #fffdfaf5; backdrop-filter: blur(16px); box-shadow: 0 -4px 24px #49312408;
  }
  .navigation .nav-item {
    min-width: 0; min-height: 58px; padding: 5px 2px; gap: 4px; border-radius: 12px;
    font-size: 12px; font-weight: 500; line-height: 1.3; color: #715b63;
  }
  .navigation .nav-item .icon { display: block; width: 25px; height: 25px; stroke-width: 1.65; }
  .navigation .nav-item.active { background: var(--blue-soft, #eee3e5); color: var(--blue, #521f32); }
  .navigation .nav-item.quick-camera-nav { background: var(--blue, #521f32); color: var(--white, #fffdfa); margin-inline: 3px; }
  .navigation .quick-camera-nav .icon { width: 27px; height: 27px; }
  .navigation .nav-item::after { display: none; }
  .content { padding: 20px var(--mobile-gutter) calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px) + 32px); }
  .content .page-intro { gap: 16px; margin-bottom: 24px; }
  .content .page-intro h1 { font-size: 29px; }
  .content .page-intro p { font-size: 16px; }
  .content .page-intro > .primary { font-size: 14px; min-height: 48px; white-space: normal; }
  .content .daily-intro { margin-bottom: 16px; }
  .content .daily-intro .daily-subtitle { font-size: 16px !important; line-height: 1.7; }
  .content .daily-intro > .text-button { font-size: 14px; min-height: 48px; }
  .content .look-options { gap: 12px; }
  .content .look-option { flex-basis: 136px; }
  .content .look-option small { white-space: normal; }
  .content .mini-item { gap: 10px; }
  .content .mini-item > .garment-photo { width: 44px; height: 44px; flex-shrink: 0; }
  .content .filters { gap: 20px; }
  .content .filter { min-height: 48px; }
  .content .live-header-actions { display: flex; flex-wrap: wrap; gap: 10px; }
  .content .live-header-actions :is(.primary, .secondary) { font-size: 14px; min-height: 48px; }
  .closet-summary { justify-content: space-between; gap: 12px; }
  .closet-grid { gap: 24px 14px; }
  .form-grid { gap: 20px 14px; }
  .form-field { min-width: 0; }
  .live-root .live-source-switch { gap: 22px; margin-bottom: 14px; padding-bottom: 0; }
  .live-root .live-header { display: block; padding: 0 0 14px; }
  .live-root .live-header h1 { font-size: 30px; letter-spacing: -1px; white-space: normal; margin: 0 0 7px; }
  .live-root .live-header p { font-size: 16px; line-height: 1.7; }
  .live-header .community-header-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; gap: 10px; margin-top: 14px; }
  .live-header .community-header-actions :is(.primary, .secondary) { width: 100%; height: auto; min-height: 48px; padding: 11px 12px; display: flex; font-size: 14px; }
  .live-header .community-header-actions :is(.primary, .secondary) > span { position: static; width: auto; height: auto; overflow: visible; clip: auto; clip-path: none; white-space: normal; }
  .live-header .community-header-actions .icon { width: 22px; height: 22px; }
  .live-feed-topline { gap: 12px; margin-bottom: 12px; }
  .live-feed-topline :is(h1, h2) { font-size: 27px; }
  .live-quick-capture { padding: 14px; gap: 12px; align-items: stretch; flex-direction: column; }
  .live-quick-capture .live-camera-cta { width: 100%; }
  .live-root .live-weather-strip { gap: 4px 12px; padding-block: 2px; }
  .live-root .live-weather-strip > .app-link { font-size: 14px; }
  .live-root .live-story-row { gap: 18px; padding-block: 12px; }
  .live-story-row .community-story { min-width: 62px; gap: 6px; }
  .live-story-row .community-story > span { width: 58px; height: 58px; }
  .live-root .live-tabbar { gap: 10px; overflow-x: auto; scrollbar-width: thin; }
  .live-root .live-tabbar > button { min-height: 48px; flex-shrink: 0; padding: 10px 0; }
  .live-tabbar > .live-refresh { margin-left: auto; }
  .live-feed-tools { gap: 8px; padding: 8px 0 16px; }
  .live-feed-tools form { flex-basis: 100%; max-width: 100%; order: 2; }
  .live-feed-tools .community-layout-toggle { margin-left: auto; }
  .live-root .live-layout { display: grid; grid-template-columns: minmax(0, 1fr); max-width: none; gap: 30px; }
  .live-posts { gap: 28px; }
  .live-layout:not(.is-gallery) .live-post { margin-inline: calc(-1 * var(--mobile-gutter)); }
  .live-layout:not(.is-gallery) .live-post > :not(.live-post-photo):not(.live-media-video) { margin-inline: var(--mobile-gutter); }
  .live-layout:not(.is-gallery) .live-post > .live-media-video { margin-inline: 0; }
  .live-post .community-byline { gap: 10px; margin-bottom: 10px; }
  .live-root .live-person { gap: 10px; }
  .live-root .live-post-photo { aspect-ratio: 4 / 5; max-height: 70dvh; }
  .live-root .live-post-photo > img { object-fit: cover; }
  .live-root .live-caption { font-size: 16px; line-height: 1.8; margin-block: 6px 10px; }
  .live-root .live-photo-label { font-size: 12px; top: 12px; left: 16px; letter-spacing: .04em; }
  .live-layout.is-gallery .live-posts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
  .live-layout.is-gallery .live-user-name b { font-size: 14px; }
  .live-layout.is-gallery .live-post .live-avatar { width: 32px; min-width: 32px; height: 32px; font-size: 21px; }
  .live-layout.is-gallery .live-caption { font-size: 14px; }
  .live-layout.is-gallery .live-photo-label { font-size: 12px; left: 6px; top: 8px; padding: 3px 6px; }
  .live-layout.is-gallery .live-post-actions > button { font-size: 14px; min-height: 48px; }
  .live-layout.is-gallery .live-post-actions .icon { width: 22px; height: 22px; }
  .live-root .live-empty { padding: 20px; min-height: 0; }
  .live-empty > em { font-size: 29px; }
  .live-empty-editorial img { height: 100px; }
  .live-empty > .primary { width: 100%; min-height: 52px; font-size: 16px; }
  .live-empty-number { margin-bottom: 12px; }
  .live-side { grid-template-columns: minmax(0, 1fr); position: static; }
  .live-side .live-note-card { padding: 22px; }
  .live-side .live-note-card h2 { font-size: 30px; }
  .live-root .live-approval-row { flex-wrap: wrap; gap: 10px; }
  .live-root .live-approval-row > button { min-height: 48px; font-size: 14px; }
  .live-dialog .live-user-row { gap: 10px; flex-wrap: wrap; }
  .live-user-row .live-person { flex: 1 1 150px; }
  .live-dialog .live-user-row .secondary { font-size: 14px; min-height: 48px; }
  .live-request-buttons { flex-direction: row; flex-wrap: wrap; gap: 10px; }
  .live-dialog .community-compose-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .live-dialog .community-compose-tabs > button { white-space: normal; padding: 10px 6px; }
  .live-dialog .live-garment-options { grid-template-columns: minmax(0, 1fr); }
  .live-dialog .live-approval-actions { grid-template-columns: minmax(0, 1fr); }
  .live-dialog .live-user-search { gap: 8px; }
  .live-dialog .live-user-search > button { min-width: 60px; padding: 10px 12px; }
  .live-dialog .live-consent-copy { padding: 16px; }
  .demo-footer { margin-top: 30px; gap: 8px; }
  .demo-footer > span { max-width: none; text-align: left; }
  .toast { bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px) + 12px); font-size: 14px; padding: 14px 18px; }

  /* The dialog itself never scrolls; its body does, below the persistent close control. */
  #modal, #modal.capture-open {
    width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh;
    margin: 0; inset: 0; padding: 0; border: 0; border-radius: 0;
    overflow: hidden; background: var(--white, #fffdfa);
  }
  #modal[open] { display: flex; flex-direction: column; }
  #modal .dialog-header {
    position: relative; flex: 0 0 auto; min-height: calc(64px + env(safe-area-inset-top, 0px));
    padding: calc(8px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px));
    gap: 12px; z-index: 6;
  }
  #modal .dialog-header h2 { font-size: 20px; line-height: 1.45; }
  #modal .dialog-body {
    flex: 1 1 auto; min-height: 0; padding: 20px max(16px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  }
  #modal .dialog-body > p { font-size: 16px; }
  #modal.capture-open .dialog-body { display: flex; flex-direction: column; padding-top: 12px; padding-bottom: max(16px, env(safe-area-inset-bottom, 0px)); }
  .capture-dialog { flex: 1 0 auto; width: 100%; gap: 12px; }
  .capture-stage { aspect-ratio: 9 / 16; max-height: min(70dvh, calc(100dvh - 300px)); min-height: 180px; border-radius: 8px; }
  .capture-toolbar { gap: 12px; }
  .capture-mode { flex-shrink: 0; }
  .capture-footer { gap: 6px 14px; }
  .capture-footer .capture-library { font-size: 14px; }
  .live-compose-preview, .live-compose-preview :is(video, img) { max-height: 54dvh; }
  .live-compose-summary { padding-block: 12px; }
  .live-publish-bar {
    bottom: calc(-24px - env(safe-area-inset-bottom, 0px));
    margin: 20px calc(-1 * var(--mobile-gutter)) calc(-24px - env(safe-area-inset-bottom, 0px));
    padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(14px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  }
  .production-recovery-tools { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .production-account-panel :is(p, button), .production-confirm,
  .production-photo-account p, .production-photo-account button { font-size: 14px; }
  .production-recovery > .primary, .production-delete .primary { font-size: 16px; min-height: 52px; }
}

@media (max-width: 370px) {
  .navigation { gap: 2px; padding-inline: 5px; }
  .navigation .nav-item { font-size: 12px; }
  .navigation .quick-camera-nav { margin-inline: 1px; }
  .top-actions { gap: 6px; }
  .top-actions .text-button { font-size: 14px; gap: 4px; }
  .live-layout.is-gallery .live-posts { grid-template-columns: minmax(0, 1fr); }
  .live-layout.is-gallery .live-post-actions { flex-wrap: nowrap; gap: 14px; }
  .live-layout.is-gallery .live-post-actions > button:nth-child(2) { order: initial; flex-basis: auto; }
  .live-root .live-tabbar { gap: 10px; }
  .capture-toolbar { gap: 8px; }
  .capture-toolbar .capture-library { padding-inline: 0; flex-direction: column; gap: 3px; }
}

@media (max-width: 760px) and (max-height: 620px) and (orientation: landscape) {
  #modal.capture-open .dialog-body { overflow-y: auto; }
  .capture-stage { aspect-ratio: 16 / 9; max-height: 60dvh; min-height: 180px; }
}

@media (prefers-reduced-motion: reduce) {
  .live-post-photo > img, .capture-dialog *, .quick-camera-nav { transition: none; animation: none; }
}
/* Capture and preview controls match the implemented camera flow. */
.capture-toolbar { grid-template-columns: minmax(0, 1fr) auto; }
.capture-footer { display: grid; grid-template-columns: minmax(0, 1fr) 80px minmax(0, 1fr); gap: 8px; }
.capture-footer .capture-library { flex-direction: column; padding: 6px 0; text-align: center; line-height: 1.4; }
.capture-shutter > span { width: 52px; height: 52px; border-radius: 50%; background: var(--blue); }
.capture-shutter.recording > span { width: 30px; height: 30px; border-radius: 6px; }
.capture-timer { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); padding: 5px 12px; border-radius: 20px; background: #862d42; color: white; font: 600 14px/1.6 system-ui; font-variant-numeric: tabular-nums; }
.capture-stage video.is-selfie { transform: scaleX(-1); }
.capture-audio { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; }
.live-compose-media-actions { display: flex; gap: 8px; margin-top: 12px; }
.live-compose-media-actions > * { flex: 1; text-align: center; cursor: pointer; }
.live-compose-placeholder { display: grid; justify-items: center; padding: 24px; text-align: center; }
.live-compose-placeholder > .icon { width: 44px; height: 44px; }
.live-post-video .live-photo-label { pointer-events: none; }
.live-video-thumb { display: grid; place-items: center; aspect-ratio: 4 / 5; background: var(--blue-soft); font-size: 16px; }
.mobile-magazine-link { margin-bottom: 20px; }
@media(max-width:760px) {
  .live-root .live-header.live-quick-capture { padding: 16px; }
  .live-root .live-header .community-kicker { display: none; }
  .live-root .live-header h1 { font-size: 26px; }
  .live-root .live-source-switch > span { display: none; }
  .live-root .live-feed-tools { flex-wrap: wrap; }
  .live-quick-capture .community-header-actions { grid-template-columns: 1fr; }
  .live-quick-capture .community-header-actions > .secondary { display: none; }
}
