/* U-Rock console overrides v9 — 2026-07-24. Media-Library skin, global.
   Non-destructive overlay. Header + left nav untouched. No grid/display hacks
   except the branding-stack flex-column (order move, stacking preserved). */

/* ============ MEDIA LIBRARY — fonts up, search row inline ============ */
body.rt-media-library main table{font-size:17px}
body.rt-media-library main table td,body.rt-media-library main table th{font-size:17px!important;padding-top:11px!important;padding-bottom:11px!important}
body.rt-media-library main table td:first-child *{font-size:17.5px!important}
body.rt-media-library main table th{font-size:13px!important;text-transform:uppercase!important;letter-spacing:.09em!important;opacity:.85}
body.rt-media-library main .text-xs,body.rt-media-library main [style*="font-size: 11px"]{font-size:13.5px!important}
body.rt-media-library main [style*="font-size: 13px"]{font-size:15px!important}
body.rt-media-library main [style*="font-size: 12px"]{font-size:14px!important}
/* search + "All shows & tags" on ONE row */
body.rt-media-library main div:has(> input[placeholder]){display:inline-flex!important;width:min(440px,58%)!important;vertical-align:middle;margin-bottom:0!important}
body.rt-media-library main div:has(> input[placeholder]) input{font-size:15px!important}
body.rt-media-library main select{display:inline-block!important;width:auto!important;margin-left:12px!important;vertical-align:middle;font-size:14.5px!important;padding:8px 10px!important}

/* ============ GLOBAL TYPE SCALE — ML look everywhere it applies ============ */
.min-h-screen main table{font-size:16.5px;width:100%!important}
.min-h-screen main table td{font-size:16.5px!important;padding-top:10px!important;padding-bottom:10px!important}
.min-h-screen main table th{font-size:12.5px!important;text-transform:uppercase!important;letter-spacing:.09em!important;opacity:.85}
.min-h-screen main .text-xs{font-size:13px!important}
.min-h-screen main .text-sm{font-size:14.5px!important}
.min-h-screen main .text-\[10px\],.min-h-screen main .text-\[11px\]{font-size:12px!important}
.min-h-screen main .overflow-x-auto{max-width:100%!important}
/* unified card look: tighter radius + consistent border tone */
.min-h-screen main .rounded-xl{border-radius:9px!important}
.min-h-screen main .bg-card{border-color:rgba(69,83,104,.85)!important}

/* ============ DESKTOP DENSITY (kept from v8) ============ */
@media (min-width:1024px){
.min-h-screen.bg-background > .max-w-7xl{
  max-width:none !important;
  padding-left:20px !important; padding-right:20px !important;
  padding-top:14px !important; padding-bottom:32px !important;
}
.min-h-screen .flex.lg\:flex-row{ gap:1.1rem !important; }
.min-h-screen .pb-28{ padding-bottom:2rem !important; }
.min-h-screen main .p-6{ padding:.85rem !important; }
.min-h-screen main .p-5{ padding:.8rem !important; }
.min-h-screen main .p-4{ padding:.7rem !important; }
body.rt-dashboard main .grid.lg\:grid-cols-3{ grid-auto-flow:row dense !important; align-items:start !important; }
}

/* ============ DASHBOARD: Station Branding OFF the top ============ */
/* Its stack becomes flex-column (identical visual stacking); the branding card
   (the only card holding file inputs) is ordered to the bottom. */
body.rt-dashboard main .space-y-5:has(> div input[type="file"]){display:flex;flex-direction:column}
body.rt-dashboard main .space-y-5:has(> div input[type="file"]) > *{order:0}
body.rt-dashboard main .space-y-5 > div:has(input[type="file"]){order:99;margin-top:1.1rem}

/* ============ CONTENT ENGINE wrap (kept) ============ */
body.rt-content-engine main{ max-width:100% !important; overflow-x:hidden !important; }
body.rt-content-engine main input,
body.rt-content-engine main textarea,
body.rt-content-engine main pre,
body.rt-content-engine main code,
body.rt-content-engine main .font-mono{
  max-width:100% !important; box-sizing:border-box !important;
  white-space:pre-wrap !important; word-break:break-word !important; overflow-wrap:anywhere !important;
}

/* ============ MOBILE (kept from v8) ============ */
@media (max-width:820px){
  .min-h-screen main .overflow-x-auto{ overflow-x:auto !important; -webkit-overflow-scrolling:touch; }
  .min-h-screen main table{ width:auto !important; min-width:640px !important; }
  .min-h-screen main table th, .min-h-screen main table td{
    white-space:nowrap !important; word-break:normal !important; overflow-wrap:normal !important;
    padding-top:8px !important; padding-bottom:8px !important;
  }
  .min-h-screen main table td:first-child, .min-h-screen main table th:first-child{
    white-space:normal !important; min-width:150px; max-width:230px;
  }
  .min-h-screen main .p-6{ padding:.7rem !important; }
  .min-h-screen main .p-5{ padding:.65rem !important; }
  .min-h-screen main .p-4{ padding:.6rem !important; }
  body.rt-media-library main div:has(> input[placeholder]){width:100%!important}
  body.rt-media-library main select{margin-left:0!important;margin-top:8px!important}
}

/* v9.1: the shows/tags dropdown lives in its own wrapper div — inline it next to search */
body.rt-media-library main div:has(> select){display:inline-block!important;width:auto!important;vertical-align:middle;margin-left:12px!important;margin-top:0!important;margin-bottom:0!important}

/* v11: Contact-HQ compose form to the TOP of the Inbox widget column */
.min-h-screen main *:has(> .space-y-2 > input[placeholder="Subject"]){display:flex;flex-direction:column}
.min-h-screen main .space-y-2:has(> input[placeholder="Subject"]){order:-1;margin-bottom:.65rem}

/* ============ v12 type bump — active area up 2pt everywhere (owner) ============ */
.min-h-screen main{font-size:17px}
.min-h-screen main table{font-size:18px}
.min-h-screen main table td{font-size:18px !important}
.min-h-screen main table th{font-size:13.5px !important}
.min-h-screen main .text-xs{font-size:14.5px !important}
.min-h-screen main .text-sm{font-size:16px !important}
.min-h-screen main .text-\[10px\],.min-h-screen main .text-\[11px\]{font-size:13px !important}
.min-h-screen main .text-base{font-size:17.5px !important}
body.rt-media-library main table{font-size:19px}
body.rt-media-library main table td{font-size:19px !important}
body.rt-media-library main table td:first-child *{font-size:19.5px !important}
body.rt-media-library main .text-xs,body.rt-media-library main [style*="font-size: 11px"]{font-size:15px !important}
body.rt-media-library main [style*="font-size: 13px"]{font-size:16.5px !important}

/* ============ v12 mobile guards — nothing runs off the page ============ */
@media (max-width:820px){
  .min-h-screen main{font-size:15.5px;overflow-x:hidden}
  .min-h-screen main .text-sm{font-size:14.5px !important}
  .min-h-screen main .text-xs{font-size:13px !important}
  .min-h-screen main table td{font-size:15px !important}
  .min-h-screen main img,.min-h-screen main video{max-width:100% !important;height:auto}
  .min-h-screen main .grid{grid-template-columns:1fr !important}
  .min-h-screen main pre,.min-h-screen main code{white-space:pre-wrap !important;word-break:break-word !important}
  .min-h-screen main .flex.flex-wrap{min-width:0}
  .min-h-screen main *{overflow-wrap:break-word}
  /* v13: content/approval rows — buttons wrap BELOW text instead of crushing it into a word-stack */
  .min-h-screen main .flex.items-center{flex-wrap:wrap;row-gap:8px}
  .min-h-screen main .flex.items-center > div{min-width:0;flex:1 1 200px}
  .min-h-screen main .flex.items-center > div:has(button),.min-h-screen main .flex.items-center > .inline-flex{flex:0 0 auto}
}

/* ============ v14 — maturity pass: senior legibility + Mail Desk once-over (2026-07-26) ============ */
/* CSS-only. No functional changes. */

/* --- global readability: breathing room + brighter secondary text for older eyes --- */
.min-h-screen main{line-height:1.55}
.min-h-screen main .text-muted-foreground{color:#a9b4c5 !important}
.min-h-screen main .text-foreground\/60{color:#9aa6b8 !important}
.min-h-screen main .text-foreground\/75,.min-h-screen main .text-foreground\/80{color:#c3ccd9 !important}
.min-h-screen main button:focus-visible,.min-h-screen main a:focus-visible,
.min-h-screen main select:focus-visible,.min-h-screen main input:focus-visible,
.min-h-screen main textarea:focus-visible{outline:2px solid #f97316 !important;outline-offset:2px}

/* --- consistent slim scrollbars (kills the chunky white bars) --- */
.min-h-screen ::-webkit-scrollbar{width:9px;height:9px}
.min-h-screen ::-webkit-scrollbar-thumb{background:#3a475c;border-radius:8px}
.min-h-screen ::-webkit-scrollbar-thumb:hover{background:#4a5a73}
.min-h-screen ::-webkit-scrollbar-track{background:transparent}
.min-h-screen aside::-webkit-scrollbar{width:8px}

/* --- consistent card borders across the active area --- */
.min-h-screen main .bg-card{border-color:rgba(69,83,104,.85) !important}

/* --- selects everywhere: visible, not a dark hole --- */
.min-h-screen main select{background:#1b2434 !important;border:1px solid #45536a !important;color:#e6ebf3 !important;border-radius:8px;padding:6px 10px;font-size:14px !important;min-width:160px}

/* ============ MAIL DESK (rt-mail-desk) ============ */

/* message list: bigger rows, readable subjects, calmer chips */
body.rt-mail-desk main .divide-y > button{padding-top:13px !important;padding-bottom:13px !important}
body.rt-mail-desk main .divide-y > button .text-sm{font-size:16.5px !important;line-height:1.35}
body.rt-mail-desk main .divide-y > button .text-\[13px\]{font-size:14.5px !important;color:#b9c3d2 !important}
body.rt-mail-desk main .divide-y > button .text-\[11px\]{font-size:13px !important}
/* mailbox chip: cap runaway raw addresses (station mailboxes) */
body.rt-mail-desk main .divide-y > button span[class*="uppercase"]{max-width:190px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;vertical-align:middle}
/* list column: taller = more mail on screen */
body.rt-mail-desk main .max-h-\[65vh\]{max-height:72vh !important}

/* reader header: subject pops, meta readable */
body.rt-mail-desk main .text-base.font-semibold{font-size:20px !important;color:#f4f7fb !important;line-height:1.3}
body.rt-mail-desk main .text-\[13px\].text-foreground\/75{font-size:14.5px !important}

/* status chips + action buttons: finger-sized */
body.rt-mail-desk main button.rounded.text-\[11px\],
body.rt-mail-desk main .rounded.text-\[11px\]{padding:6px 12px !important;font-size:13.5px !important}

/* THE GHOST-RENDER FIX: HTML email is written for white backgrounds.
   Give the message body a paper reading panel instead of dark-on-dark. */
body.rt-mail-desk main .max-h-\[55vh\]{
  max-height:62vh !important;
  background:#f6f7f9 !important;color:#1d2530 !important;
  margin:14px 16px 16px !important;border-radius:10px;border:1px solid #d8dde5;
  padding:18px 22px !important;font-size:16.5px !important;line-height:1.6 !important;
}
body.rt-mail-desk main .max-h-\[55vh\] *{color:inherit}
body.rt-mail-desk main .max-h-\[55vh\] a{color:#b5482a !important;text-decoration:underline}
body.rt-mail-desk main .max-h-\[55vh\] img{max-width:100% !important;height:auto}
body.rt-mail-desk main .max-h-\[55vh\] table{width:auto !important;max-width:100%;font-size:inherit !important}
body.rt-mail-desk main .max-h-\[55vh\] td{font-size:inherit !important}
/* emails that hard-code near-white text (written for dark clients) stay readable on paper */
body.rt-mail-desk main .max-h-\[55vh\] [style*="color: #fff"],
body.rt-mail-desk main .max-h-\[55vh\] [style*="color:#fff"],
body.rt-mail-desk main .max-h-\[55vh\] [style*="color: white"],
body.rt-mail-desk main .max-h-\[55vh\] [style*="color: rgb(255"]{color:#1d2530 !important}

/* automation drawer: readable summary */
body.rt-mail-desk main details summary{font-size:15.5px !important}

/* mail desk on phones: reader panel margins tighten */
@media (max-width:820px){
  body.rt-mail-desk main .max-h-\[55vh\]{margin:10px 8px 12px !important;padding:14px !important;font-size:15.5px !important}
}

/* ============ v15 — Communications email readability (2026-07-27) ============ */
body.rt-communications main .email-body{
  background:#f6f7f9 !important;color:#1d2530 !important;
  border-radius:10px;border:1px solid #d8dde5;padding:16px 20px !important;
  font-size:16px !important;line-height:1.6 !important;
}
body.rt-communications main .email-body *{color:inherit !important}
body.rt-communications main .email-body a{color:#b5482a !important;text-decoration:underline}
body.rt-communications main .email-body img{max-width:100% !important;height:auto}
body.rt-communications main pre{
  background:#f6f7f9 !important;color:#1d2530 !important;
  border-radius:10px;border:1px solid #d8dde5;padding:16px 20px !important;
  font-size:16px !important;line-height:1.6 !important;
}
body.rt-communications main .text-muted-foreground{color:#a9b4c5 !important}
