/* Scale font sizes without scaling the canvas, videos or fixed sidebar width. */
:root{--ui-text-scale:1.15;font-size:calc(16px * var(--ui-text-scale))}
html body .text-size-control{display:inline-flex;align-items:center;gap:6px;margin:0;padding:0;max-width:100%;flex-shrink:0;color:#555;font-size:calc(12px * var(--ui-text-scale));font-weight:400;line-height:1.5}
html body .text-size-control>span{margin:0;color:inherit;white-space:nowrap}
html body .text-size-control select{display:inline-block;width:auto;max-width:100%;margin:0;border:1px solid #ddd;border-radius:8px;padding:7px 5px;background:#fff;color:#333;font:inherit;min-height:34px;cursor:pointer}
.auth-panel>.text-size-control,#authGate .text-size-control,main>.text-size-control{margin-bottom:20px}
/* Fixed-height text containers must grow when their content wraps. */
html body .topbar{height:auto;min-height:70px;flex-wrap:wrap;row-gap:10px;padding-top:12px;padding-bottom:12px}
.top-actions,.breadcrumbs{flex-wrap:wrap;min-width:0}
html body .nav-item{height:auto;min-height:44px;padding-top:10px;padding-bottom:10px;gap:8px}
.brand>span:last-child,.user-button>span:nth-child(2){min-width:0;overflow-wrap:anywhere}
.brand small{overflow-wrap:anywhere}
/* The logo is a fixed brand mark; navigation remains readable in a narrow rail. */
#sidebar .brand{gap:9px;padding-left:6px;padding-right:6px}
#sidebar .brand b{font-size:27px;white-space:nowrap}
#sidebar .brand small{font-size:10px;letter-spacing:0;overflow-wrap:normal}
html body #sidebar .nav-item{padding-left:8px;padding-right:8px;gap:6px}
#sidebar .new-label{font-size:10px}
.task-nav-heading{flex-wrap:wrap}
.task-nav-heading h2,.task-nav-heading>span{white-space:nowrap}
#sidebar .task-navigation{min-height:calc(200px * var(--ui-text-scale))}
#sidebar #taskHistory{min-height:calc(110px * var(--ui-text-scale))}
.art-overlay{right:11px;overflow-wrap:anywhere}
html body .credit-plus{font-size:17px;line-height:1}
html body :is(.primary-button,.secondary-button,.text-button,.composer-tab,.quick-actions b){white-space:normal;overflow-wrap:anywhere}
.composer-tabs{flex-wrap:wrap}
.composer-foot,.draft-toolbar,.library-heading,.conversation-heading,.conversation-input-heading{flex-wrap:wrap}
.form-grid>*{min-width:0}
html body :is(input,select,textarea){max-width:100%}
html body :is(.credit-button,.avatar){height:auto;min-height:34px}
.conversation-tools select{max-width:100%}
.conversation-composer textarea{font-family:inherit;font-size:calc(13px * var(--ui-text-scale));line-height:1.85}
.task-prompt{font-family:inherit;font-size:calc(13px * var(--ui-text-scale));line-height:1.65}
.sidebar .task-nav-copy small{flex-wrap:wrap;row-gap:3px}
.sidebar .task-nav-copy time{margin-left:0}
html[data-text-size="150"] .conversation-composer{max-height:48dvh;overflow-y:auto}
html body .dialog-actions{flex-wrap:wrap}
html body dialog{overflow-wrap:anywhere;max-height:90dvh;overflow-y:auto}
/* Management tables retain their own horizontal scroll, not a wider page. */
.workspace .sidebar{overflow-y:auto}
.workspace :is(.page-heading,.section-heading,.channel-top,.task-actions){flex-wrap:wrap}
.workspace :is(.panel,.stats article,.channel-card){min-width:0;overflow-wrap:anywhere}
@media(max-width:1000px){
  html[data-text-size="150"] .library-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:700px){
  html body .topbar{padding-left:16px;padding-right:16px;gap:8px}
  .top-actions{gap:8px;margin-left:auto}
  .top-actions .preview-tag{display:none}
  html body .text-size-control{gap:4px}
  html body .text-size-control select{padding:6px 2px}
  html[data-text-size] .library-grid{grid-template-columns:minmax(0,1fr)}
  .composer-tab{flex:1 1 100px;padding-left:9px;padding-right:9px}
  .hero h1{font-size:min(calc(30px * var(--ui-text-scale)),36px)}
  .composer-foot{align-items:flex-start}
  .conversation-heading h1{max-width:100%}
  .conversation-heading>div{min-width:0;max-width:100%}
  html[data-text-size] .conversation-composer{max-height:44dvh;overflow-y:auto}
  .conversation-tools select{max-width:100%;min-width:0}
  .workspace .topbar{padding-left:18px;padding-right:18px}
  .workspace .task-filters{grid-template-columns:minmax(0,1fr)}
  .workspace .auth-message h1{font-size:calc(30px * var(--ui-text-scale))}
}

/* Settings, batch and sidebar controls grow with text instead of clipping. */
html body .settings-button,html body .help-button{height:auto;min-height:44px;white-space:normal;line-height:1.5;overflow-wrap:anywhere;text-align:left}
html body .settings-button>span{margin-left:auto}
html body .settings-dialog{max-width:calc(100% - 24px)}
html body .settings-tabs{row-gap:6px}
html body .settings-field select{max-width:100%}
html body .batch-heading{flex-wrap:wrap}
html body .batch-form-actions{row-gap:10px}
html body .batch-total-hint{flex:1 1 auto}
html body .batch-legacy-actions .primary-button{height:auto;min-height:40px;white-space:normal;line-height:1.5}
html[data-text-size="150"] :is(.batch-panel,.batch-item-card) .form-grid{grid-template-columns:minmax(0,1fr)}
html[data-text-size="150"] :is(.composer-tab,.settings-tabs [role="tab"]){font-size:calc(12px * var(--ui-text-scale))}
html[data-text-size="150"] .settings-facts{grid-template-columns:minmax(0,1fr)}
@media(max-width:700px){
  html body .sidebar-bottom{padding-top:10px}
  html body .settings-dialog{width:calc(100% - 16px)}
  html body .settings-tabs{gap:4px}
  html body :is(.task-search,.gallery-search){min-height:42px}
}
