
/* Preserve UMAR's charcoal, cream and gold; give content a bounded scroll area. */
html, body { height:100%; }
body { height:100dvh; overflow:hidden; }
#main-content { min-width:0; min-height:0; }
#workspace-scroll { min-height:0; min-width:0; overflow-y:auto; overflow-x:hidden;
    touch-action:auto; -webkit-overflow-scrolling:touch; overscroll-behavior-y:contain; }
#sidebar { height:100dvh; touch-action:auto; }
.umar-tab-strip { min-width:0; max-width:100%; touch-action:auto; scrollbar-width:thin;
    scrollbar-color:#B8860B #F4F1EA; padding-bottom:10px; }
.umar-tab-strip::-webkit-scrollbar { display:block; height:6px; }
.umar-tab-strip::-webkit-scrollbar-thumb { background:#B8860B; border-radius:4px; }
.umar-tab { min-height:44px; }
.umar-tab svg, .umar-card-title svg { width:18px; height:18px; flex-shrink:0; stroke-width:1.75; }
.tab-controls { display:flex; justify-content:flex-end; gap:8px; margin-top:-8px; margin-bottom:12px; }
.tab-controls button { width:44px; height:44px; border:1px solid #d6d3cb; border-radius:8px;
    color:#1D1D1B; background:#fff; font-size:22px; }
.tab-controls button:disabled { opacity:.35; }
button:focus-visible,a:focus-visible,[contenteditable]:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible {
    outline:2px solid #B8860B; outline-offset:3px; }
.editor-layout { display:grid; grid-template-columns:minmax(0,2fr) minmax(240px,1fr); gap:24px; }
.editor-layout label,.review-form label { display:block; margin:14px 0 5px; font-weight:600; font-size:14px; }
.editor-layout input,.editor-layout select,.editor-layout textarea,.review-form input,.review-form select,.review-form textarea {
    width:100%; min-height:44px; border:1px solid #b6b3aa; border-radius:8px; padding:10px 12px; background:#fff; color:#1D1D1B; }
.editor-toolbar { display:flex; flex-wrap:wrap; gap:6px; padding:8px 0; }
.editor-toolbar button,.cms-action { min-height:44px; padding:8px 14px; border:1px solid #b6b3aa; border-radius:8px; background:#fff; }
.cms-action.primary { background:#1D1D1B; color:#F4F1EA; border-color:#1D1D1B; }
#cms-editor { border:1px solid #b6b3aa; border-radius:8px; padding:20px; min-height:320px;
    background:#fff; color:#1D1D1B; overflow-wrap:anywhere; }
#cms-editor img { max-width:100%; height:auto; }
#cms-editor h2 { font-size:1.5rem; font-weight:700; margin:1em 0 .5em; }
#cms-editor ul { list-style:disc; padding-left:1.5em; }
#cms-preview { width:100%; min-height:550px; border:1px solid #d6d3cb; border-radius:8px; background:#fff; }
.cms-list-item,.review-item { padding:16px 0; border-bottom:1px solid #d6d3cb; }
#cms-message,#review-message { min-height:24px; margin-top:12px; }
.review-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:20px; }
.review-item pre { white-space:pre-wrap; overflow-wrap:anywhere; font:inherit; font-size:13px; }
html.dark .editor-layout input,html.dark .editor-layout textarea,html.dark .editor-layout select,
html.dark #cms-editor,html.dark .cms-action,html.dark .review-form input,html.dark .review-form textarea,
html.dark .review-form select { background:#24221f; color:#F4F1EA; }
@media(max-width:1023px) {
    #workspace-scroll { padding:16px; padding-bottom:max(24px,env(safe-area-inset-bottom)); }
    #main-content header { padding-left:12px; padding-right:12px; }
    #notif-dropdown { width:min(320px,calc(100vw - 24px)); }
    .umar-hero,.umar-module-hero { padding:16px; }
    .umar-hero-title,.umar-module-hero-title { font-size:1.1rem; }
    .umar-hero-quote { display:none; }
    .editor-layout,.review-grid { grid-template-columns:minmax(0,1fr); }
    .editor-layout input,.editor-layout textarea,.editor-layout select { font-size:16px; }
    #workspace-scroll .page-content { max-width:100%; min-width:0; }
    #workspace-scroll .overflow-x-auto { max-width:100%; touch-action:auto; }
    #btn-mobile-menu { min-width:44px; min-height:44px; }
}
@media(prefers-reduced-motion:reduce) { * { scroll-behavior:auto !important; } }

.tab-controls[hidden] { display:none; }

html.dark .editor-toolbar button,html.dark .tab-controls button {
    background:#24221f !important; color:#F4F1EA !important; border-color:#8b857a;
}
html.dark .editor-layout input::placeholder,html.dark .editor-layout textarea::placeholder {
    color:#b9b3a8; opacity:1;
}

/* Tables own horizontal scrolling; the workspace remains vertically scrollable. */
.umar-table-scroll { width:100%; max-width:100%; min-width:0; overflow-x:auto; touch-action:auto;
    -webkit-overflow-scrolling:touch; scrollbar-width:thin; scrollbar-color:#B8860B #F4F1EA; }
.umar-table-scroll > table { max-width:none; }
.umar-table-scroll th { white-space:nowrap; }
.umar-table-scroll::-webkit-scrollbar { height:8px; display:block; }
.umar-table-scroll::-webkit-scrollbar-thumb { background:#B8860B; border-radius:4px; }
.umar-table-controls { display:flex; gap:8px; align-items:center; justify-content:flex-end; padding:8px 0; }
.umar-table-controls[hidden] { display:none; }
.umar-table-controls span { margin-right:auto; font-size:12px; color:#6b6250; }
.umar-table-controls button { min-width:44px; min-height:44px; border:1px solid #b6b3aa; border-radius:8px; background:#fff; color:#1D1D1B; }
.umar-table-controls button:disabled { opacity:.35; }
html.dark .umar-table-controls button { background:#24221f; color:#F4F1EA; }
html.dark .umar-table-controls span { color:#d7d0c0; }

.cms-dialog { width:min(1100px,calc(100vw - 32px)); max-height:calc(100dvh - 32px); padding:24px; margin:auto; border:1px solid #d6d3cb; border-radius:16px; background:#FFFDF7; color:#1D1D1B; overflow:auto; }
.cms-dialog::backdrop { background:rgb(29 29 27 / .6); }
.cms-dialog-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:16px; }
.cms-dialog-heading h2 { font-size:20px; font-weight:700; }
.cms-article-table th { background:#F4F1EA; text-transform:uppercase; font-size:12px; }
.cms-article-table th,.cms-article-table td { padding:16px; border-bottom:1px solid #e6e2d8; vertical-align:middle; }
.cms-article-title { display:flex; gap:12px; align-items:center; min-width:240px; max-width:400px; }
.cms-article-title img { width:72px; height:56px; object-fit:cover; border-radius:8px; flex-shrink:0; }
.cms-row-actions { display:flex; gap:6px; }
.cms-cover-box { margin-top:12px; border-radius:12px; overflow:hidden; }
.cms-cover-box img { width:100%; height:200px; }
html.dark .cms-dialog { background:#24221f; color:#F4F1EA; }
html.dark .cms-article-table th { background:#302c25; }
@media(max-width:640px){.cms-dialog{padding:16px;width:calc(100vw - 16px);max-height:calc(100dvh - 16px);}.cms-dialog .editor-layout{grid-template-columns:minmax(0,1fr);}}
