/**
 * WABAG Gazette - Enterprise Email Studio CSS
 * Design Tokens & Component Styling
 */

:root {
  --navy: #0A4B8C;
  --navy-deep: #073B6F;
  --teal: #0F6FA8;
  --teal-light: #EAF4FB;
  --green: #2E9B47;
  --green-light: #EBF7EE;
  --ink: #1B2A3A;
  --slate: #4A5D70;
  --muted: #6B7C90;
  --line: #DCE3EA;
  --line-subtle: #EDF2F7;
  --bg: #F0F4F8;
  --card: #FFFFFF;
  --warn: #B54708;
  --warn-bg: #FFF7ED;
  --warn-border: #F5D9B8;
  --danger: #D92D20;
  --danger-bg: #FEF3F2;
  --danger-border: #FECDCA;
  --locked-badge: #4B5563;
  --locked-bg: #F3F4F6;
  --shadow-sm: 0 1px 2px rgba(10, 30, 60, 0.05);
  --shadow-md: 0 4px 12px rgba(10, 30, 60, 0.08);
  --shadow-lg: 0 10px 30px rgba(10, 30, 60, 0.12);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* App Header & Navigation */
header.app-header {
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 100%);
  color: #fff;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
  min-height: 56px;
  box-sizing: border-box;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-badge {
  background: #ffffff;
  color: var(--navy);
  font-weight: 900;
  font-size: 14px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
  box-shadow: var(--shadow-sm);
}

.brand-text h1 {
  font-size: 16px;
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-text .version {
  font-size: 10.5px;
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  border-radius: 12px;
  font-weight: 500;
}

.brand-text .sub {
  font-size: 11.5px;
  opacity: 0.85;
  margin-top: 2px;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 10px;
}

.role-switcher-pill {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 4px 8px 4px 12px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  backdrop-filter: blur(4px);
}

.role-switcher-pill .role-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.role-select {
  background: #ffffff;
  color: var(--navy);
  border: none;
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 16px;
  cursor: pointer;
  outline: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.header-more-group {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.header-more-group .btn-ghost {
  border: none;
  background: transparent;
  padding: 4px 8px;
  font-size: 11px;
}

.header-more-group .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Buttons & Inputs */
button, .btn-link {
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 7px 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease-in-out;
  outline: none;
  text-decoration: none;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed !important;
}

.btn-primary {
  background: #ffffff;
  color: var(--navy);
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.btn-primary:hover:not(:disabled) {
  background: #f0f6fc;
  transform: translateY(-1px);
}

.btn-accent {
  background: var(--green);
  color: #ffffff;
}

.btn-accent:hover:not(:disabled) {
  background: #27853d;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.25);
}

.btn-line {
  background: #ffffff;
  border-color: var(--line);
  color: var(--ink);
}

.btn-line:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-danger {
  background: #ffffff;
  border-color: var(--danger-border);
  color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger-bg);
}

.btn-sm {
  padding: 5px 9px;
  font-size: 11.5px;
  border-radius: 4px;
}

/* Main Grid Layout */
main.app-main {
  display: grid;
  grid-template-columns: 530px 1fr;
  gap: 0;
  height: calc(100vh - 60px);
  min-height: calc(100vh - 60px);
  overflow: hidden;
}

@media (max-width: 1200px) {
  main.app-main {
    grid-template-columns: 480px 1fr;
  }
}

@media (max-width: 960px) {
  main.app-main {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }
}



.panel-editor {
  padding: 18px 22px;
  height: 100%;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  overflow-x: hidden !important;
  border-right: 1px solid var(--line);
  background: #F8FAFC;
  box-sizing: border-box;
}

.panel-preview {
  padding: 18px 24px;
  height: 100%;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  overflow-x: hidden !important;
  display: flex;
  flex-direction: column;
  background: #EEF2F6;
  box-sizing: border-box;
}

/* Department Info Banner */
.dept-banner {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(10, 30, 60, 0.05);
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

.dept-banner.admin-mode {
  background: linear-gradient(135deg, #073B6F 0%, #0A4B8C 100%);
  color: #ffffff;
  border-color: #073B6F;
}

.dept-banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.dept-info {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.dept-icon {
  font-size: 20px;
  background: var(--teal-light);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.admin-mode .dept-icon {
  background: rgba(255, 255, 255, 0.2);
}

.dept-meta {
  flex: 1 1 0;
  min-width: 0;
}

.dept-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dept-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-badge {
  background: #FEF08A !important;
  color: #854D0E !important;
  border-color: #FDE047 !important;
  font-size: 10px !important;
}

.dept-template-row {
  font-size: 12px;
  margin-top: 2px;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dept-template-row .tpl-lbl {
  font-size: 11px;
  opacity: 0.75;
}

.dept-template-row strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dept-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  width: 100%;
}

.admin-mode .dept-banner-actions {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-banner-switch {
  flex: 1 1 0;
  background: #F1F5F9;
  color: var(--text);
  border: 1px solid #CBD5E1;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-banner-switch:hover {
  background: #E2E8F0;
  border-color: #94A3B8;
}

.admin-mode .btn-banner-switch {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.admin-mode .btn-banner-switch:hover {
  background: rgba(255, 255, 255, 0.28);
}

.btn-banner-save {
  background: #16A34A;
  color: #ffffff;
  border: 1px solid #15803D;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-banner-save:hover {
  background: #15803D;
}

/* Fieldsets & Form Controls */
fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
  margin: 0 0 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

fieldset.locked-section {
  background: #FAFCFE;
  border-color: #D3DFEC;
}

legend {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal);
  font-weight: 700;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lock-pill {
  font-size: 10px;
  background: var(--locked-bg);
  color: var(--locked-badge);
  border: 1px solid #D1D5DB;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lock-pill.locked {
  background: #FEF3C7;
  color: #92400E;
  border-color: #FDE68A;
}

label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--slate);
  margin: 10px 0 4px;
  font-weight: 600;
}

label .tag {
  font-size: 10.5px;
  font-weight: 400;
  color: var(--muted);
}

input[type=text],
input[type=url],
textarea,
select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 111, 168, 0.12);
}

input:disabled, textarea:disabled, select:disabled {
  background: #F4F6F8;
  color: #718096;
  cursor: not-allowed;
  border-color: #E2E8F0;
}

textarea {
  min-height: 72px;
  resize: vertical;
  line-height: 1.45;
}

.row {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.row > * {
  flex: 1 1 0;
  min-width: 0 !important;
  max-width: 100%;
  box-sizing: border-box;
}

/* Dynamic Content Block Cards */
.blk {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s;
}

.blk.is-locked {
  border-color: #CBD5E1;
  background: #FAFAFC;
}

.blk-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: #F9FBFC;
  border-radius: 8px 8px 0 0;
}

.blk-head .icon {
  font-size: 15px;
}

.blk-head .name {
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--navy);
}

.blk-head .sp {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.blk-body {
  padding: 12px 14px;
}

.add-block-container {
  margin-top: 14px;
  background: #ffffff;
  border: 1px dashed var(--teal);
  border-radius: var(--radius-md);
  padding: 14px;
}

.add-block-title {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--teal);
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.add-block-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 6px;
}

.add-block-btn {
  background: #ffffff;
  border: 1px solid #D0E2EF;
  color: var(--navy);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: left;
}

.add-block-btn:hover {
  background: var(--teal-light);
  border-color: var(--teal);
}

.people-card-item {
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 8px;
  background: #FAFBFD;
}

/* Preview Toolbar & Frame */
.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
  flex-wrap: wrap;
}

.tabs-group {
  display: flex;
  background: #E2E8F0;
  padding: 3px;
  border-radius: var(--radius-sm);
  gap: 2px;
}

.tabs-group button {
  background: transparent;
  border: none;
  font-size: 12px;
  padding: 6px 12px;
  color: var(--slate);
  border-radius: 4px;
}

.tabs-group button[aria-pressed="true"] {
  background: #ffffff;
  color: var(--navy);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.preview-container {
  flex: 1;
  display: flex;
  justify-content: center;
  background: #DCE3EA;
  border-radius: var(--radius-md);
  padding: 14px;
  overflow: hidden;
  position: relative;
}

iframe#frame {
  width: 100%;
  max-width: 600px;
  height: calc(100vh - 170px);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: var(--shadow-md);
  transition: max-width 0.25s ease-in-out;
}

#code {
  width: 100%;
  height: calc(100vh - 170px);
  font-family: var(--font-mono);
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  background: #0E1B2A;
  color: #CFE6FF;
  line-height: 1.5;
  white-space: pre;
  overflow: auto;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 30, 60, 0.65);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 860px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 100%);
  color: #fff;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 17px;
  margin: 0;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-body {
  padding: 22px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 13px;
}

.admin-table th, .admin-table td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
}

.admin-table th {
  background: #F1F5F9;
  font-weight: 700;
  color: var(--navy);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.allowed-blocks-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.allowed-block-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  background: #F8FAFC;
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.on {
  opacity: 1;
  transform: translateY(0);
}

.toast.toast-success {
  background: #065F46;
}

.toast.toast-warn {
  background: #92400E;
}


/* ==========================================================================
   IMAGE UPLOAD & DISPLAY WIDGETS (COMPACT, NO-OVERFLOW DESIGN)
   ========================================================================== */
.img-upload-widget {
  margin-top: 4px;
  margin-bottom: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.img-upload-widget:hover {
  border-color: var(--teal);
  box-shadow: 0 2px 6px rgba(15, 111, 168, 0.08);
}

.img-upload-widget.is-uploading {
  opacity: 0.65;
  pointer-events: none;
}

.img-dropzone {
  border: 2px dashed #CBD5E1;
  background: #F8FAFC;
  border-radius: 6px;
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 100%;
  box-sizing: border-box;
}

.img-dropzone:hover, .img-dropzone.dragover {
  border-color: var(--teal);
  background: var(--teal-light);
}

.img-dropzone-icon {
  font-size: 18px;
  line-height: 1;
}

.img-dropzone-text {
  font-size: 11.5px;
  color: var(--ink);
  font-weight: 600;
}

.img-dropzone-sub {
  font-size: 10px;
  color: var(--muted);
}

.img-preview-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #F8FAFC;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.img-preview-thumb {
  width: 50px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  flex-shrink: 0;
  display: block;
}

.img-preview-details {
  flex: 1 1 0;
  min-width: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.img-preview-url {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-mono);
  width: 100%;
  max-width: 100%;
  display: block;
}

.img-preview-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.btn-upload-file {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #0F6FA8;
  color: #ffffff;
  border: none;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-upload-file:hover {
  background: #0A4B8C;
}

.btn-save-tpl-header {
  background: #16A34A !important;
  color: #ffffff !important;
  border: 1px solid #15803D !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 3px rgba(22, 163, 74, 0.4);
}

.btn-save-tpl-header:hover {
  background: #15803D !important;
}

.img-url-toggle {
  font-size: 10.5px;
  color: var(--teal);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  margin-top: 4px;
  display: inline-block;
}

.img-url-manual-wrap {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}

/* Custom Sleek Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #F1F5F9;
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}


/* Fit-to-panel fix: fieldsets default to min-width:min-content, which pushed content off-screen */
fieldset {
  min-width: 0 !important;
  width: 100%;
  max-width: 100%;
  padding: 12px 14px;
}
fieldset > *, .panel-editor input, .panel-editor textarea, .panel-editor select {
  max-width: 100%;
}
.panel-editor label { gap: 8px; flex-wrap: wrap; }
.row > div { min-width: 0; }
.row .img-preview-box { flex-wrap: nowrap; }
.row .img-preview-thumb { width: 40px; height: 34px; }
.row .img-preview-actions .btn-upload-file,
.row .img-preview-actions .btn-danger { padding: 3px 6px; font-size: 10.5px; }
@media (max-width: 1200px) { .row { flex-wrap: wrap; } }


/* Single-row header (same pattern for admin and department users) */
.app-header { flex-wrap: nowrap; gap: 12px; }
.app-header .brand-wrapper { flex-shrink: 0; }
.app-header .header-center { flex-shrink: 1; min-width: 0; }
.app-header .header-actions { flex-shrink: 0; gap: 6px; }
.app-header .header-actions button,
.app-header .header-actions a { white-space: nowrap; padding: 5px 9px; font-size: 11.5px; }
.app-header .header-more-group button { padding: 4px 7px; }
.role-switcher-pill { white-space: nowrap; }
.role-select { max-width: 150px; text-overflow: ellipsis; }
@media (max-width: 1500px) {
  .app-header .brand-text .sub { display: none; }
  .role-switcher-pill .role-label { display: none; }
  .role-switcher-pill { padding-left: 8px; }
}
@media (max-width: 1280px) {
  .app-header .brand-text .version { display: none; }
  .app-header .header-more-group button { font-size: 0; padding: 4px 8px; }
  .app-header .header-more-group button::first-letter { font-size: 13px; }
}
