/* jurandskin1: an appearance overlay, never a layout or navigation replacement.
   Fonts are local, licensed OFL assets; document/email islands keep their own type. */
@font-face {
  font-family: "DM Sans";
  src: url("../fonts/jurand/DM-Sans-Variable.ttf") format("truetype");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("../fonts/jurand/Playfair-Display-Variable.ttf") format("truetype");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

@media screen {
  html[data-crm-theme="jurand"] :is(.app, .modal-backdrop, .floating-editor-panel,
    .workspace-start-menu, .workspace-context-menu, .workspace-taskbar, .toast) {
    font-family: var(--jurand-ui-font, "DM Sans", "Segoe UI", Arial, sans-serif);
  }
  html[data-crm-theme="jurand"] :is(.app, .modal-backdrop, .floating-editor-panel,
    .workspace-start-menu, .workspace-context-menu, .workspace-taskbar)
    :is(button, input, select, textarea, .input-like):not(:is(.rich-email-editor-surface, .email-html-frame, .offer-template-preview-page,
      .offer-preview-page-sheet, [data-sales-offer-description-block]) *) {
    font-family: var(--jurand-ui-font, "DM Sans", "Segoe UI", Arial, sans-serif);
  }
  html[data-crm-theme="jurand"] :is(.rich-email-editor-surface, .email-html-frame,
    .offer-template-preview-page, .offer-preview-page-sheet, [data-sales-offer-description-block]) {
    font-family: var(--app-font-family);
  }
  html[data-crm-theme="jurand"] :is(.topbar h1, .panel-title h2, .panel-title h3,
    .view-header h1, .view-header h2, .workspace-window-title):not(:is(.rich-email-editor-surface, .email-html-frame, .offer-template-preview-page,
      .offer-preview-page-sheet, [data-sales-offer-description-block]) *) {
    font-family: var(--jurand-display-font, "Playfair Display", Georgia, serif);
    font-weight: 500;
    letter-spacing: -.2px;
  }
  html[data-crm-theme="jurand"] .topbar h1 {
    font-size: clamp(23px, 2.1vw, 31px);
    font-weight: 500;
  }
  html[data-crm-theme="jurand"] :is(#appBrandTitle, .workspace-start-title) {
    font-family: var(--jurand-display-font, "Playfair Display", Georgia, serif);
    font-weight: 500;
    letter-spacing: -.25px;
  }
  html[data-crm-theme="jurand"] :is(.nav button, .workspace-start-app,
    .workspace-taskbar-window, .primary, .secondary, .small-button,
    .filter-button, .form label, .data-table th):not(:is(.rich-email-editor-surface, .email-html-frame,
      .offer-template-preview-page, .offer-preview-page-sheet, [data-sales-offer-description-block]) *) {
    font-weight: 500;
  }
  html[data-crm-theme="jurand"] :is(.row-main strong, .dashboard-module-card strong):not(:is(.rich-email-editor-surface,
    .email-html-frame, .offer-template-preview-page, .offer-preview-page-sheet, [data-sales-offer-description-block]) *) { font-weight: 600; }
  html[data-crm-theme="jurand"] .sidebar {
    background: var(--color-sidebar-bg);
    border-inline-end: 1px solid var(--crm-ui-line);
  }
  html[data-crm-theme="jurand"] :is(.topbar, .workspace-start-header) {
    color: var(--crm-ui-text);
    background: var(--crm-ui-surface);
    border-color: var(--crm-ui-line);
  }
  html[data-crm-theme="jurand"] :is(.panel, .modal-card, .module-free-card,
    .dashboard-module-card, .settings-section):not(:is(.rich-email-editor-surface, .email-html-frame,
      .offer-template-preview-page, .offer-preview-page-sheet, [data-sales-offer-description-block]) *) {
    border-color: var(--crm-ui-line);
    border-radius: min(var(--app-radius-soft, 12px), 12px);
    box-shadow: 0 2px 9px color-mix(in srgb, var(--crm-ui-text) 4%, transparent);
  }
  html[data-crm-theme="jurand"][data-crm-shadow="flat"] :is(.panel, .modal-card,
    .module-free-card, .dashboard-module-card, .settings-section):not(:is(.rich-email-editor-surface, .email-html-frame,
      .offer-template-preview-page, .offer-preview-page-sheet, [data-sales-offer-description-block]) *) { box-shadow: none; }
  html[data-crm-theme="jurand"] :is(.primary, .secondary, .small-button, .filter-button,
    .nav button, .workspace-start-app, .workspace-taskbar-window, .input-like,
    input:not([type="checkbox"]):not([type="radio"]), select, textarea):not(:is(.rich-email-editor-surface, .email-html-frame, .offer-template-preview-page,
      .offer-preview-page-sheet, [data-sales-offer-description-block]) *) {
    border-radius: min(var(--app-radius, 7px), 7px);
  }
  html[data-crm-theme="jurand"] :is(.secondary, .filter-button):not(.active):not(:disabled):not(:is(.rich-email-editor-surface,
    .email-html-frame, .offer-template-preview-page, .offer-preview-page-sheet, [data-sales-offer-description-block]) *) {
    background: var(--crm-ui-surface);
    color: var(--crm-ui-text);
    border-color: var(--crm-ui-line);
  }
  html[data-crm-theme="jurand"] :is(.secondary, .filter-button):hover:not(.active):not(:disabled):not(:is(.rich-email-editor-surface,
    .email-html-frame, .offer-template-preview-page, .offer-preview-page-sheet, [data-sales-offer-description-block]) *) {
    background: var(--crm-ui-row-hover);
  }
  html[data-crm-theme="jurand"] :is(.primary, .dashboard-module-action):not(:disabled):not(:is(.rich-email-editor-surface,
    .email-html-frame, .offer-template-preview-page, .offer-preview-page-sheet, [data-sales-offer-description-block]) *) {
    color: var(--color-button-primary-text);
    background: var(--color-button-primary-bg);
    border-color: var(--color-button-primary-border);
    box-shadow: none;
    font-weight: 500;
  }
  html[data-crm-theme="jurand"] :is(.primary, .dashboard-module-action):hover:not(:disabled):not(:is(.rich-email-editor-surface,
    .email-html-frame, .offer-template-preview-page, .offer-preview-page-sheet, [data-sales-offer-description-block]) *) {
    color: var(--color-button-primary-hover-text);
    background: var(--color-button-primary-hover);
  }
  html[data-crm-theme="jurand"] :is(.tenant-brand-initials, .workspace-start-logo) {
    font-family: var(--jurand-display-font, "Playfair Display", Georgia, serif);
    font-weight: 500;
  }
  html[data-crm-theme="jurand"] :is(.pear.has-tenant-initials, .workspace-start-logo) {
    color: var(--color-accent-text);
    background: var(--color-accent-soft);
    border: 1px solid var(--color-accent-border);
    filter: none;
    box-shadow: none;
  }
  html[data-crm-theme="jurand"] .tenant-brand-initials { color: var(--color-accent-text); }

  /* Override the paint only. The persisted wallpaper and every window bound stay intact. */
  html[data-crm-theme="jurand"][data-crm-workspace="windows"] body.workspace-shell-enabled .main {
    background-color: var(--color-surface-soft);
    background-image: url("../jurand-foliage.svg"),
      radial-gradient(ellipse at 72% 52%, color-mix(in srgb, var(--color-accent) 18%, transparent), transparent 64%),
      linear-gradient(145deg, var(--color-surface-soft), var(--color-accent-soft));
    background-repeat: no-repeat;
    background-size: 300px 350px, cover, cover;
    background-position: right 14px bottom 60px, center, center;
  }
  html[data-crm-theme="jurand"][data-crm-workspace="windows"] body.workspace-shell-enabled
    .main > .view.workspace-window-open {
    background: var(--crm-ui-surface);
    border-color: var(--crm-ui-line);
    box-shadow: var(--crm-ui-shadow);
  }
  html[data-crm-theme="jurand"][data-crm-workspace="windows"] body.workspace-shell-enabled
    .main > .view.workspace-window-open:not(.workspace-window-maximized):not(.workspace-window-snapped) {
    border-radius: min(var(--app-radius-soft, 10px), 10px);
  }
  html[data-crm-theme="jurand"][data-crm-workspace="windows"] body.workspace-shell-enabled
    .main > .view.workspace-window-open.active {
    border-color: var(--color-accent-border);
    box-shadow: var(--crm-ui-shadow), 0 0 0 1px var(--color-accent-border);
  }
  html[data-crm-theme="jurand"][data-crm-workspace="windows"] body.workspace-shell-enabled
    .workspace-window-titlebar {
    background: var(--crm-ui-titlebar-bg);
    color: var(--crm-ui-titlebar-text);
    border-color: var(--crm-ui-line);
    box-shadow: none;
  }
  html[data-crm-theme="jurand"][data-crm-workspace="windows"] body.workspace-shell-enabled
    :is(.workspace-taskbar, .workspace-start-menu, .workspace-context-menu) {
    background: var(--crm-ui-surface);
    color: var(--crm-ui-text);
    border-color: var(--crm-ui-line);
    box-shadow: var(--crm-ui-shadow);
  }
}
