/* Header-only brand treatment. Navigation and application content stay unchanged. */
body.workspace-refresh .brand-header {
  --header-surface-start: #fff1e3;
  --header-surface-middle: #fffdf9;
  --header-surface-end: #f0f6ed;
  --header-border: #e0e5d9;
  --header-accent: #d5a16e;
  --header-text: #34523c;
  --header-muted: #69776a;
  --header-hover: #f0f5eb;
  --header-glow: rgba(242, 173, 100, .13);
  --header-control-surface: rgba(255, 255, 255, .72);
  --header-control-border: #dce4d7;
  --header-warm-text: #b96b2d;
  --header-warm-line: #e5b68f;
  --header-cool-line: #c3d6b9;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "brand storage";
  align-items: center;
  justify-items: stretch;
  gap: 16px 24px;
  box-sizing: border-box;
  width: 100%;
  min-height: 96px;
  padding: 14px clamp(24px, 3vw, 56px);
  border: 0;
  border-left: 4px solid var(--header-accent);
  border-bottom: 1px solid var(--header-border);
  background: radial-gradient(ellipse at 7% 35%, var(--header-glow), transparent 42%),
    linear-gradient(105deg, var(--header-surface-start), var(--header-surface-middle) 46%, var(--header-surface-end));
  box-shadow: none;
}

.brand-header .header-tree-decoration {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}

.brand-header .header-tree-decoration::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--header-warm-line), var(--header-border) 45%, var(--header-cool-line));
  opacity: .75;
}

.brand-header .header-tree-watermark {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 140px;
  height: calc(100% - 8px);
  max-height: 140px;
  object-fit: contain;
  opacity: .192;
  filter: saturate(1.02);
  mix-blend-mode: multiply;
  transform: translateY(-50%);
}


body.workspace-refresh .brand-header .header-main-brand {
  width: auto;
  min-width: 0;
  flex-direction: row;
  justify-content: flex-start;
  gap: 20px;
  padding: 0;
}

body.workspace-refresh .brand-header .header-home-button {
  flex: 0 0 auto;
  width: clamp(156px, 14vw, 208px);
  max-width: 100%;
  min-width: 0;
}

body.workspace-refresh .brand-header .header-main-logo {
  width: 100%;
  max-width: none;
  height: 64px;
  object-fit: contain;
}

body.workspace-refresh .brand-header .header-utility-bar {
  width: auto;
  max-width: 100%;
  min-width: 0;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  gap: 14px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.workspace-refresh .brand-header #dashboard-weather.header-weather {
  flex: 0 1 330px;
  width: 330px;
  min-width: 310px;
  max-width: 350px;
  margin: 0;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--header-control-border);
  border-radius: 10px;
  background: var(--header-control-surface);
  box-shadow: none;
}
body.workspace-refresh .brand-header .header-weather-item {
  border-left-color: var(--header-control-border);
  color: var(--header-muted);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
body.workspace-refresh .brand-header .header-weather-slide > .bi {
  color: var(--header-warm-text);
}
body.workspace-refresh .brand-header #dashboard-weather[role="link"]:focus-visible {
  border-color: var(--header-border);
  background: var(--header-hover);
  box-shadow: none;
}

body.workspace-refresh .brand-header .web-storage-actions { gap: 10px; align-items: center; }
body.workspace-refresh .brand-header .header-utility-bar .storage-button {
  min-height: 40px;
  height: 40px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 650;
  box-shadow: none;
  transform: none;
}

body.workspace-refresh .brand-header .header-utility-bar .orangefarm-header-link {
  gap: 8px;
  min-width: 0;
  min-height: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--header-muted);
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  transition: none;
}
body.workspace-refresh .brand-header .orangefarm-header-link .header-shortcut-logo {
  display: block;
  flex: 0 0 auto;
  box-sizing: content-box;
  width: 74px;
  height: 20px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
}
body.workspace-refresh .brand-header .orangefarm-header-link span {
  padding: 0;
  border: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}
body.workspace-refresh .brand-header .header-utility-bar .orangefarm-header-link:focus-visible {
  border-color: var(--header-accent);
  color: var(--header-text);
  background: var(--header-hover);
  box-shadow: none;
}

body.workspace-refresh .brand-header .settings-launch-button {
  gap: 7px;
  border: 1px solid var(--header-control-border);
  border-radius: 8px;
  color: var(--header-text);
  background: var(--header-control-surface);
}
body.workspace-refresh .brand-header .settings-launch-button .bi { font-size: 17px; }
body.workspace-refresh .brand-header .settings-launch-button:focus-visible {
  border-color: var(--header-border);
  color: var(--header-text);
  background: var(--header-hover);
  box-shadow: none;
}
body.workspace-refresh .brand-header :is(.orangefarm-header-link, .settings-launch-button):focus-visible {
  outline: 2px solid #d87929;
  outline-offset: 3px;
}

/* Shortcut controls stay still on pointer hover; keyboard focus remains visible. */
body.workspace-refresh .brand-header :is(.header-home-button, .orangefarm-header-link, .settings-launch-button, #dashboard-weather[role="link"]) {
  transition: none;
}
body.workspace-refresh .brand-header :is(.header-home-button, .orangefarm-header-link, .settings-launch-button, #dashboard-weather[role="link"]):hover {
  transform: none;
  filter: none;
  box-shadow: none;
}

html[data-theme="dark"] body.workspace-refresh .brand-header {
  --header-surface-start: #383128;
  --header-surface-middle: #292f2a;
  --header-surface-end: #29372c;
  --header-border: #475247;
  --header-accent: #a58058;
  --header-text: #e4efdf;
  --header-muted: #b6c4b0;
  --header-hover: #354733;
  --header-glow: rgba(178, 111, 52, .08);
  --header-control-surface: rgba(42, 53, 45, .88);
  --header-control-border: #51604f;
  --header-warm-text: #e2ad76;
  --header-warm-line: #8e6b49;
  --header-cool-line: #52694b;
}

/* Match the footer image opacity (.192) and its dark parent opacity (.18). */
html[data-theme="dark"] .brand-header .header-tree-watermark {
  opacity: .03456;
}

@media (max-width: 1199px) {
  body.workspace-refresh .brand-header {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "brand" "storage";
    min-height: 0;
    padding: 16px 24px;
    gap: 12px;
  }
  body.workspace-refresh .brand-header .header-main-brand { justify-content: center; }
  body.workspace-refresh .brand-header .header-utility-bar { width: 100%; justify-self: stretch; justify-content: center; }
}

@media (max-width: 760px) {
  body.workspace-refresh .brand-header { padding: 14px 16px; }
  body.workspace-refresh .brand-header .header-utility-bar { flex-direction: column; gap: 10px; }
  body.workspace-refresh .brand-header #dashboard-weather.header-weather {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    max-width: 350px;
  }
  body.workspace-refresh .brand-header .header-utility-bar .storage-button { min-height: 44px; height: 44px; }
  .brand-header .header-tree-watermark { right: 4px; width: 112px; max-height: 112px; }
}

@media (max-width: 480px) {
  body.workspace-refresh .brand-header .header-main-brand { flex-direction: column; gap: 8px; }
  body.workspace-refresh .brand-header .header-home-button { width: 166px; }
  body.workspace-refresh .brand-header .header-main-logo { height: 54px; }
}

@media (prefers-reduced-motion: reduce) {
  body.workspace-refresh .brand-header .orangefarm-header-link { transition: none; }
}
