/* Casa: content stays central; all existing library/editor controls remain available. */
#library-view .page-heading { align-items: center; }
#library-view .page-heading p { max-width: 65ch; }
#library-view .breadcrumbs { flex-wrap: wrap; gap: 4px; padding: 18px 0 12px; border-top: 1px solid #e2e6e2; margin-bottom: 12px; }
#library-view .breadcrumbs button, #media-picker .breadcrumbs button { color: #535e56; border-radius: 0; padding: 8px 6px; min-height: 40px; overflow-wrap: anywhere; text-align: left; }
#library-view .breadcrumbs button:hover, #media-picker .breadcrumbs button:hover { color: #127749; background: #f3f5f2; }
#library-view .library-legend { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 28px; }
#library-files { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 28px; }
#library-files .media-tile, #picker-files .media-tile { border: 1px solid #e2e6e2; border-radius: 12px; padding: 0; background: #fff; color: #212121; box-shadow: none; min-width: 0; }
#library-files .media-tile:hover, #picker-files .media-tile:hover { border-color: #127749; background: #f8faf8; }
#library-files .media-tile:focus-visible, #picker-files .media-tile:focus-visible { outline: 2px solid #127749; outline-offset: 4px; }
#library-files .media-tile > img { aspect-ratio: 4 / 5; object-fit: cover; }
#library-files .file-icon, #library-files .folder-icon { width: 100%; aspect-ratio: 4 / 5; background: #edf2ed; color: #0b3e27; }
#library-files .folder-icon { background: #f4f5f1; }
#library-files .media-tile strong { padding: 17px 18px 0; font-size: 15px; font-weight: 600; line-height: 1.45; letter-spacing: -.01em; }
#library-files .media-tile small { padding: 6px 18px 4px; font-size: 12px; color: #626862; }
#library-files .media-state { margin: 10px 18px 18px; }
#library-view .media-state, #picker-files .media-state { font-size: 12px; line-height: 1.4; border-radius: 4px; font-weight: 500; }
#library-view .media-state.unprepared, #picker-files .media-state.unprepared { color: #972d23; background: #fff0ed; }
#library-view .media-state.scheduled, #picker-files .media-state.scheduled { color: #765300; background: #fff4d4; }
#library-view .media-state.published, #picker-files .media-state.published { color: #11683f; background: #eaf4ed; }
#library-files .empty { border: 0; border-top: 1px solid #e2e6e2; border-radius: 0; background: #f8f8f8; padding: 32px; color: #626862; }

#composer { width: min(1120px, calc(100vw - 56px)); max-height: calc(100svh - 48px); background: #fff; color: #212121; border: 0; border-radius: 16px; box-shadow: 0 24px 72px #0b3e272e; }
#composer::backdrop { background: #14281f80; }
#composer .composer-header { padding: 26px 32px; border-bottom: 1px solid #e2e6e2; background: #fff; }
#composer .composer-header h2 { color: #0b3e27; font-size: 28px; font-weight: 600; letter-spacing: -.025em; line-height: 1.2; margin: 0; }
#composer .composer-header button { color: #0b3e27; width: 44px; height: 44px; min-height: 44px; border-radius: 50%; background: transparent; }
#composer .composer-header button:hover { background: #edf2ed; }
#composer .composer-body { grid-template-columns: minmax(0,1.05fr) minmax(0,1fr); }
#composer .composer-fields { padding: 30px 32px; border-right: 1px solid #e2e6e2; }
#composer .composer-fields > label { margin-bottom: 24px; }
#composer label, #composer legend { color: #212121; font-size: 13px; font-weight: 550; }
#composer input:not([type=checkbox]), #composer select, #composer textarea { border: 1px solid #d6dfd8; border-radius: 8px; padding: 12px; min-height: 44px; background: #fff; color: #212121; font-size: 14px; line-height: 1.5; caret-color: #127749; }
#composer input::placeholder, #composer textarea::placeholder { color: #626862; }
#composer :is(input, textarea, select, button):focus-visible { outline: 2px solid #127749; outline-offset: 3px; }
#composer #post-title[readonly] { background: #f3f5f2; border-color: #e2e6e2; color: #535e56; }
#composer .composer-fields fieldset { margin-bottom: 24px; }
#composer .channel-check { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; margin-right: 12px; font-weight: 400; }
#composer .channel-check input { width: 16px; height: 16px; accent-color: #127749; }
#composer .reel-keyword { border-top: 1px solid #e2e6e2; padding-top: 24px; margin-top: 28px; margin-bottom: 24px; }
#composer .reel-keyword h3, #composer .section-heading h3 { color: #0b3e27; font-size: 16px; font-weight: 600; }
#composer .subtle { color: #626862; font-size: 12px; line-height: 1.6; }
#composer .composer-preview { background: #f8f8f8; padding: 30px; }
#composer .section-heading { flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
#composer .section-heading button { padding: 10px 16px; border-radius: 24px; min-height: 40px; font-size: 12px; color: #0b3e27; border-color: #d6dfd8; }
#composer .selected-media { min-height: 200px; max-height: 440px; border-radius: 12px; background: #eaf0eb; }
#composer #selected-media :is(img,video) { max-height: 440px; object-fit: contain; }
#composer #selected-media video { background: #10261a; }
#composer .preview-caption { background: transparent; border: 0; border-radius: 0; padding: 20px 0; margin: 0; }
#composer .preview-caption strong { font-size: 13px; font-weight: 600; color: #0b3e27; }
#composer .preview-caption p { font-size: 14px; line-height: 1.65; color: #535e56; }
#composer .thumbnail-field { border-top: 1px solid #e2e6e2; padding-top: 24px; margin-top: 4px; margin-bottom: 24px; }
#composer input[type=file] { font-size: 12px; padding: 8px; min-width: 0; }
#composer input[type=file]::file-selector-button { border: 1px solid #d6dfd8; background: #fff; color: #0b3e27; border-radius: 20px; padding: 9px 12px; margin-right: 8px; cursor: pointer; font: inherit; }
#composer input[type=file]::file-selector-button:hover { background: #edf2ed; }
#composer #thumbnail-preview img { border-radius: 8px; margin-top: 16px; }
#composer #remove-thumbnail { color: #0b3e27; }
#composer .composer-footer { padding: 22px 32px; border-top: 1px solid #e2e6e2; gap: 20px; background: #fff; }
#composer .composer-footer p { color: #626862; line-height: 1.5; overflow-wrap: anywhere; }
#composer .composer-footer button { min-height: 44px; padding: 10px 20px; border-radius: 24px; }
#composer .primary { background: #127749; color: #fff; border-color: #127749; }
#composer .primary:hover { background: #0b3e27; border-color: #0b3e27; }
#composer button:disabled { background: #e9eeea; border-color: #e2e6e2; color: #626862; }
#composer #media-picker { padding-top: 20px; border-top: 1px solid #e2e6e2; }
#composer .picker-files { gap: 12px; }
#composer .picker-files .media-tile strong { font-size: 12px; }
#composer .picker-files :is(.file-icon,.folder-icon) { width: 100%; color: #0b3e27; background: #edf2ed; }

@media (max-width: 1100px) {
  #library-files { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 22px; }
  #composer .composer-fields, #composer .composer-preview { padding: 24px; }
}
@media (max-width: 760px) {
  #library-files { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
  #composer { width: calc(100vw - 24px); max-height: calc(100svh - 24px); }
  #composer .composer-body { grid-template-columns: minmax(0,1fr); }
  #composer .composer-fields { border-right: 0; border-bottom: 1px solid #e2e6e2; }
  #composer .composer-preview { border: 0; }
  #composer .composer-footer { padding: 18px 24px; flex-wrap: wrap; }
  #composer .composer-footer p { max-width: none; flex-basis: 100%; }
  #composer .composer-footer > div { margin-left: auto; }
}
@media (max-width: 480px) {
  #library-view .page-heading { align-items: flex-start; flex-wrap: wrap; }
  #library-view .library-legend { gap: 8px; margin-bottom: 22px; }
  #library-view .library-legend .media-state { font-size: 11px; padding: 4px 6px; }
  #library-files { gap: 14px; }
  #library-files .media-tile strong { padding: 12px 12px 0; font-size: 13px; }
  #library-files .media-tile small { padding: 5px 12px 4px; }
  #library-files .media-state { margin: 8px 12px 12px; font-size: 11px; }
  #composer { width: 100%; max-width: 100%; height: 100svh; max-height: 100svh; margin: 0; border-radius: 0; }
  #composer .composer-header { padding: 20px; }
  #composer .composer-header h2 { font-size: 25px; }
  #composer .composer-fields, #composer .composer-preview { padding: 24px 20px; }
  #composer input:not([type=checkbox]), #composer select, #composer textarea { font-size: 16px; }
  #composer .date-fields { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  #composer .composer-footer { padding: 16px 20px; gap: 12px; }
  #composer .composer-footer > div { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
  #composer .composer-footer button { font-size: 13px; }
  #composer .selected-media { max-height: 380px; }
}

#post-destination-list > div { padding: 10px 0; border-bottom: 1px solid #e2e6e2; }
#post-destination-list .publication-options:empty { display: none; }
#post-destination-list .publication-options { margin-top: 12px; }
#composer #post-destination-list .option-row {
  display: grid; grid-template-columns: 18px minmax(0,1fr); align-items: start;
  gap: 10px; margin: 0; padding: 7px 0; line-height: 1.5; font-weight: 400;
}
#composer #composer #post-destination-list .option-row { display: grid; grid-template-columns: 17px minmax(0,1fr); align-items: start; gap: 10px; min-height: 36px; margin: 0; padding: 7px 0; line-height: 1.5; cursor: pointer; }
#post-destination-list .option-check { width: 17px; height: 17px; margin: 2px 0 0; min-height: 0; accent-color: #127749; }
.tiktok-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px 24px; margin-block: 14px; padding-block: 16px; border-block: 1px solid #e2e6e2; }
.tiktok-options h4 { margin: 0 0 8px; color: #0b3e27; font-size: 14px; line-height: 1.4; }
.tiktok-options .option-row:has(input:disabled) { color: #6b736e; }
#post-cta-field[hidden], #post-destination-list select[hidden] {display: none}

.social-inline-icon, .network { vertical-align: -.16em; }
.social-inline-icon { width: 1em; height: 1em; object-fit: contain; flex: none; }
.network img { width: 82%; height: 82%; object-fit: contain; }

.guest-section { border-top: 1px solid #e2e6e2; padding-top: 18px; }
.guest-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; }
#composer .guest-heading h3 { margin: 0; font-size: 16px; color: #0b3e27; }
#composer #guest-add { color: #0b3e27; border: 1px solid #c7d5cb; border-radius: 24px; padding: 7px 14px; min-height: 40px; }
#composer .guest-section fieldset { min-width: 0; margin: 18px 0 0; padding: 14px 16px; border: 1px solid #d6dfd8; border-radius: 8px; }
#composer .guest-section legend { padding: 0 6px; color: #0b3e27; }
#composer .guest-section label { display: block; margin: 0 0 12px; }
.guest-section .guest-network { padding-top: 12px; border-top: 1px solid #e2e6e2; }
#composer .guest-remove { border: 0; background: transparent; text-decoration: underline; text-underline-offset: 3px; padding: 7px 0; color: #535e56; }
.guest-section [hidden], #guest-preview-tabs[hidden] { display: none!important; }
#guest-effects { padding: 0; margin: 12px 0 0; list-style: none; }
#guest-effects li { padding: 5px 0; line-height: 1.5; overflow-wrap: anywhere; }
#guest-preview-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0; border-bottom: 1px solid #d6dfd8; }
#guest-preview-tabs button { display: inline-flex; align-items: center; gap: 5px; font: inherit; font-size: 13px; min-height: 40px; padding: 5px 8px; border: 0; border-bottom: 2px solid transparent; background: transparent; border-radius: 0; }
#guest-preview-tabs [aria-pressed=true] { border-bottom-color: #127749; color: #0b3e27; font-weight: 600; }
.guest-action { display: block; color: #385548; margin-top: .75rem; white-space: normal; overflow-wrap: anywhere; }
#cover-suggestions { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:6px; margin:12px 0; }
#cover-suggestions button { padding:3px; min-width:0; border:2px solid transparent; border-radius:8px; color:#244331; background:#f1f4f1; font-size:12px; font-variant-numeric:tabular-nums; }
#cover-suggestions button[aria-pressed=true] { border-color:#11683f; background:#e4eee7; }
#cover-suggestions img { display:block; width:100%; aspect-ratio:3/4; object-fit:cover; border-radius:4px; margin-bottom:3px; }
#cover-exact { margin:12px 0 20px; }
#cover-exact summary { cursor:pointer; padding:8px 0; font-weight:600; }
#cover-exact input { width:100%; accent-color:#11683f; }
#cover-clock { font-variant-numeric:tabular-nums; }
#cover-frame-preview { display:block; max-width:100%; width:auto; max-height:230px; margin:10px auto; border-radius:6px; }
#cover-frame-preview[hidden] { display:none; }
.cover-controls { display:flex; flex-wrap:wrap; gap:6px; margin:8px 0; }

#library-next:not([hidden]) { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin:12px 0 20px; padding:14px 18px; border-radius:10px; background:#edf3ee; }
#library-next img { width:40px; height:52px; object-fit:cover; border-radius:5px; }
#library-next button { margin-inline-start:auto; }
#schedule-review { box-sizing:border-box; width:min(440px,calc(100% - 32px)); padding:24px; border:1px solid #d6dfd8; border-radius:14px; }
#schedule-summary > img { float:right; width:64px; height:84px; margin:0 0 12px 12px; object-fit:cover; border-radius:6px; }
#schedule-review form > div:last-child { clear:both; display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
