/* hyd-jaali.css
   jaali, the tile-mosaic paint window (#hyd-jaali, a dialog; behaviour in hyd-jaali.js). Layout:
   titlebar, a menu row (file, edit, goodies, each opening a drop-down list), a body of three
   columns (the tool and pattern palettes, the canvas stage, and the inspector with the picture,
   tiles and look group boxes and the two buttons), then a status footer.
   Nothing here is a new look: the frame, titlebar, window controls, push buttons, photo border
   and footer are solitaire's (hyd-solitaire.css), the menu row and the pressed state are
   pinball's (hyd-pinball.css), the drop-down lists are the place search results'
   (hyd-desktop-refinement.css), the group boxes are the personalise dialog's picture effect box
   (hyd-desktop-effects.css) and the range inputs are the music deck's (hyd-radio.css and
   hyd-deck-details.css). The tool and pattern palettes are MacPaint's: black lines on white,
   the chosen tool inverted, the chosen pattern repeated in a box above the patterns.
   Phones (620 px and below) get pinball's sheet sizing and 44 px targets. */

/* --- Window (solitaire's frame) --- */
#hyd-jaali {
  --jaali-tone-size: 8px;
  --jaali-tones-height: max(28px, calc(2 * var(--jaali-tone-size) + 10px));
  --jaali-tones-gap: 6px;
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(1040px, calc(100vw - 24px));
  height: min(calc(700px + var(--jaali-tones-height) + var(--jaali-tones-gap)), calc(100dvh - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  padding: 3px;
  border: 1px solid;
  border-color: #f6f6f6 #5a5b60 #5a5b60 #f6f6f6;
  border-radius: 5px;
  background: #c6c6ca;
  color: #222;
  box-shadow: 0 14px 48px #0007;
  font:
    12px/1.4 'Lucida Grande',
    Tahoma,
    sans-serif;
  text-transform: lowercase;
  overflow: hidden;
  color-scheme: light;
}

#hyd-jaali::backdrop {
  background: #11131a70;
}

#hyd-jaali[open] {
  display: flex;
  flex-direction: column;
}

#hyd-jaali *,
#hyd-jaali *::before,
#hyd-jaali *::after {
  box-sizing: border-box;
}

/* Script toggles hidden inside the dialog; !important stops any display rule from showing those
   parts anyway. */
#hyd-jaali [hidden] {
  display: none !important;
}

#hyd-jaali button {
  font: inherit;
  cursor: pointer;
}

#hyd-jaali button:disabled {
  cursor: default;
}

#hyd-jaali :is(button, canvas, input):focus-visible {
  outline: 3px solid #a8d4ff;
  outline-offset: 2px;
}

/* --- Titlebar and window controls (solitaire's) --- */
#hyd-jaali .jaali-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 32px;
  padding: 3px 8px;
  border: 1px solid #919297;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(#f0f0f1, #cbcbce 48%, #b6b6ba 50%, #d5d5d8);
  color: #222;
  flex: none;
}

#hyd-jaali h2 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font:
    bold 12px/1.4 'Lucida Grande',
    Tahoma,
    sans-serif;
  color: #222;
  text-shadow: 0 1px #fff8;
}

/* A small jaali swatch where solitaire shows its spade; the script paints the pattern. */
#hyd-jaali .jaali-title-icon {
  width: 12px;
  height: 12px;
  flex: none;
  border: 1px solid #41454b;
  background-size: 8px 8px;
  image-rendering: pixelated;
}

#hyd-jaali .jaali-title-spacer {
  width: 48px;
  flex: none;
}

#hyd-jaali .jaali-window-controls {
  display: flex;
  gap: 6px;
  flex: none;
  width: 48px;
}

#hyd-jaali .jaali-window-controls button {
  display: grid;
  place-items: center;
  padding: 0;
  min-width: 19px;
  width: 19px;
  height: 19px;
  border: 1px solid #6d7177;
  border-radius: 50%;
  background: linear-gradient(#fbfbfc, #adb1b8);
  color: #333;
  line-height: 1;
  font-size: 15px;
  box-shadow: inset 0 1px #fff;
}

/* --- Menu row (pinball's) with the grid readout on the right (solitaire's score) --- */
#hyd-jaali .jaali-menubar {
  display: flex;
  flex: none;
  align-items: center;
  gap: 5px;
  min-height: 42px;
  padding: 5px 11px;
  border-bottom: 1px solid #a1a2a4;
  background: #dedfdd;
  box-shadow:
    inset 0 1px #f4f4f2,
    0 1px #f4f4f2;
}

#hyd-jaali .jaali-menu-item {
  position: relative;
}

#hyd-jaali .jaali-readout {
  margin-left: auto;
  color: #51545b;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* --- Push buttons (solitaire's toolbar buttons) --- */
#hyd-jaali :is(.jaali-menubar [data-jaali-menu], .jaali-actions > button, .jaali-play) {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 29px;
  padding: 4px 11px;
  border: 1px solid;
  border-color: #f6f6f7 #7f8188 #7f8188 #f6f6f7;
  border-radius: 3px;
  background: linear-gradient(#f7f7f8, #d9dadd);
  color: #202329;
  box-shadow: 0 1px #fff6;
  white-space: nowrap;
}

#hyd-jaali .jaali-menubar [data-jaali-menu] {
  min-width: 67px;
  font-size: 11px;
}

/* An open menu's button stays pressed (pinball's pressed buttons). */
#hyd-jaali :is(.jaali-menubar [data-jaali-menu], .jaali-actions > button, .jaali-play):active,
#hyd-jaali .jaali-menubar [data-jaali-menu][aria-expanded='true'] {
  background: #b9bdc0;
  box-shadow:
    inset 0 1px 3px #4b46534d,
    0 1px #fff9;
}

#hyd-jaali :is(.jaali-actions > button, .jaali-play):disabled {
  color: #81838a;
  box-shadow: none;
}

/* --- Drop-down lists (the place search results' list) --- */
#hyd-jaali .jaali-menu {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  z-index: 3;
  display: grid;
  min-width: 168px;
  padding: 4px;
  background: #f3f3f3;
  color: #262b30;
  border: 1px solid #777d85;
  border-radius: 3px;
  box-shadow: 2px 4px 8px #0005;
}

#hyd-jaali .jaali-menu button {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px;
  background: none;
  color: inherit;
  border: 0;
  border-radius: 2px;
  box-shadow: none;
  text-align: left;
  font:
    12px/1.35 'Lucida Grande',
    Tahoma,
    sans-serif;
  white-space: nowrap;
}

#hyd-jaali .jaali-menu button:is(:hover, :focus-visible):not(:disabled) {
  background: #427cb5;
  color: #fff;
  outline: none;
}

#hyd-jaali .jaali-menu button:disabled {
  color: #81838a;
}

/* --- Body: three columns --- */
#hyd-jaali .jaali-body {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) 252px;
  gap: 11px;
  flex: 1 1 auto;
  min-height: 0;
  padding: 11px;
  background: #d9d9dc;
}

/* --- Tool and pattern palettes (MacPaint's) --- */
#hyd-jaali .jaali-tools {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

#hyd-jaali :is(.jaali-tool-palette, .jaali-nibs, .jaali-pattern-palette) {
  display: grid;
  gap: 1px;
  flex: none;
  border: 1px solid #111;
  background: #111;
}

#hyd-jaali .jaali-tool-palette {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#hyd-jaali :is(.jaali-tool-palette, .jaali-nibs) button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #111;
}

#hyd-jaali :is(.jaali-tool-palette, .jaali-nibs) svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

/* Each tool says what it is under its picture. */
#hyd-jaali :is(.jaali-tool-palette, .jaali-nibs) span {
  font-size: 10px;
  line-height: 1;
}

#hyd-jaali :is(.jaali-tool-palette, .jaali-nibs) button[aria-pressed='true'] {
  background: #111;
  color: #fff;
}

#hyd-jaali .jaali-nibs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#hyd-jaali .jaali-nibs svg {
  width: 16px;
  height: 16px;
}

#hyd-jaali .jaali-pattern-palette button {
  display: block;
  overflow: hidden;
  background-size: 100% 100%;
  image-rendering: pixelated;
}

/* 32 tiles in a compact grid, four across; the chosen one is boxed in the grid itself. */
#hyd-jaali .jaali-pattern-palette {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#hyd-jaali .jaali-pattern-palette button {
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
}

#hyd-jaali .jaali-pattern-palette button[aria-pressed='true'] {
  box-shadow:
    inset 0 0 0 1px #fff,
    inset 0 0 0 3px #111;
}

/* The strip adds its own row to the window, keeping the original stage height. */
#hyd-jaali .jaali-canvas-column {
  display: grid;
  grid-template-rows: minmax(0, 1fr) var(--jaali-tones-height);
  gap: var(--jaali-tones-gap);
  min-width: 0;
  min-height: 0;
}

#hyd-jaali .jaali-tones-strip {
  display: flex;
  gap: 3px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior: contain;
}

#hyd-jaali .jaali-tones-strip button {
  display: grid;
  place-items: center;
  flex: 0 0 var(--jaali-tones-height);
  height: var(--jaali-tones-height);
  padding: 4px;
  border: 1px solid #000;
  border-radius: 0;
  background: #fff;
}

#hyd-jaali .jaali-tones-strip span {
  display: block;
  background-repeat: repeat;
  image-rendering: pixelated;
}

#hyd-jaali :is(.jaali-tones-strip, .jaali-tones) button:disabled {
  opacity: 0.4;
}

/* --- Stage: the canvas, centred, in a thin black frame --- */
#hyd-jaali .jaali-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

/* content-box: the script sizes the drawing area itself and keeps room for the border, so the
   bitmap maps 1:1 onto device pixels (review I1). */
#hyd-jaali .jaali-stage canvas {
  position: absolute;
  inset: 0;
  display: block;
  box-sizing: content-box;
  margin: auto;
  border: 1px solid #111;
  box-shadow: 1px 1px 0 #f8f8f4;
  image-rendering: pixelated;
  touch-action: none;
  cursor: crosshair;
}

#hyd-jaali .jaali-stage canvas.jaali-can-pan { cursor: grab; }
#hyd-jaali .jaali-stage canvas.jaali-panning { cursor: grabbing; }

#hyd-jaali .jaali-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: 72px;
}

/* --- Inspector: group boxes (the personalise dialog's picture effect box) --- */
#hyd-jaali .jaali-inspector {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

#hyd-jaali fieldset {
  min-width: 0;
  margin: 0;
  padding: 6px 10px 10px;
  border: 1px solid #a1a2a4;
  border-radius: 2px;
}

#hyd-jaali legend {
  padding: 0 5px;
  font-weight: 700;
}

#hyd-jaali .jaali-sources {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  max-height: 134px;
  overflow: auto;
  overscroll-behavior: contain;
}

/* Picture thumbnails, framed as solitaire frames its photograph. */
#hyd-jaali .jaali-sources button {
  position: relative;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 1px solid #86878a;
  border-radius: 0;
  background: #b9bdc0;
}

#hyd-jaali .jaali-sources img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#hyd-jaali .jaali-sources .is-film::after {
  position: absolute;
  left: 3px;
  bottom: 1px;
  color: #fff;
  font-size: 9px;
  text-shadow: 0 0 2px #000;
  content: '▶';
}

#hyd-jaali .jaali-sources button[aria-pressed='true'] {
  border-color: #111;
  box-shadow: 0 0 0 1px #111;
}

#hyd-jaali .jaali-sources button:disabled {
  opacity: 0.35;
}

#hyd-jaali .jaali-caption {
  margin: 6px 0 0;
  overflow: hidden;
  color: #41454b;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#hyd-jaali .jaali-skip {
  margin: 3px 0 0;
  color: #9c2b2b;
  font-size: 11px;
}

#hyd-jaali .jaali-drawing {
  display: flex;
  gap: 4px;
  margin: 2px 0 6px;
}

#hyd-jaali .jaali-drawing button,
#hyd-jaali .jaali-tones button {
  flex: 1;
  min-height: 28px;
  padding: 3px 8px;
  border: 1px solid #000;
  border-radius: 0;
  background: #fff;
  color: #000;
}

#hyd-jaali .jaali-drawing button[aria-pressed='true'],
#hyd-jaali .jaali-tones button[aria-pressed='true'] {
  background: #000;
  color: #fff;
}

#hyd-jaali .jaali-tones {
  display: grid;
  grid-template-columns: 58px repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 4px;
  margin: 2px 0 6px;
}

#hyd-jaali .jaali-tones button {
  padding: 3px 0;
}

/* move: a popup on the same row layout as the sliders. */
#hyd-jaali .jaali-move select {
  grid-column: 2 / -1;
  min-height: 26px;
  margin: 2px 0;
  font: inherit;
  color: #202329;
}

#hyd-jaali .jaali-slider {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 76px;
  align-items: center;
  gap: 6px;
  min-height: 28px;
}

/* The music deck's sliders. */
#hyd-jaali .jaali-slider input[type='range'] {
  width: 100%;
  margin: 2px 0;
  accent-color: #42596c;
}

#hyd-jaali .jaali-slider output {
  color: #51545b;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

#hyd-jaali .jaali-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: auto;
}

/* --- Footer (solitaire's) --- */
#hyd-jaali .jaali-footer {
  flex: none;
  padding: 7px 10px 6px;
  border-top: 1px solid #999ba1;
  background: #d0d0d4;
  color: #31363b;
  font-size: 11px;
}

#hyd-jaali .jaali-footer p {
  margin: 0;
  line-height: 1.45;
}

/* --- Narrow laptops: a slimmer inspector --- */
@media (max-width: 900px) and (min-width: 621px) {
  #hyd-jaali .jaali-body {
    grid-template-columns: 100px minmax(0, 1fr) 216px;
  }

  #hyd-jaali .jaali-sources {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* --- Phones (up to 620px): a sheet, as pinball's; the canvas on top, then strips --- */
@media (max-width: 620px) {
  #hyd-jaali {
    width: calc(100% - 18px);
    height: auto;
    max-height: calc(100dvh - 18px);
    font-size: 11px;
  }

  #hyd-jaali .jaali-titlebar {
    min-height: 35px;
  }

  #hyd-jaali .jaali-menubar {
    min-height: 47px;
    padding: 3px 7px;
  }

  #hyd-jaali .jaali-menu-item {
    flex: 1;
  }

  #hyd-jaali .jaali-menubar [data-jaali-menu] {
    width: 100%;
    min-width: 0;
    min-height: 44px;
  }

  #hyd-jaali .jaali-menu-item:last-of-type .jaali-menu {
    left: auto;
    right: 0;
  }

  #hyd-jaali .jaali-menu button {
    min-height: 44px;
  }

  #hyd-jaali .jaali-readout {
    display: none;
  }

  #hyd-jaali .jaali-body {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 8px;
    overflow: auto;
    overscroll-behavior: contain;
  }

  #hyd-jaali .jaali-canvas-column {
    order: -1;
    flex: none;
    width: 100%;
    grid-template-rows: auto var(--jaali-tones-height);
  }

  #hyd-jaali .jaali-stage {
    width: 100%;
    aspect-ratio: 4 / 3;
  }

  #hyd-jaali .jaali-tools {
    flex: none;
    overflow: visible;
  }

  /* The inspector's boxes join the scrolling body, so the two buttons can stick to its bottom. */
  #hyd-jaali .jaali-inspector {
    display: contents;
  }

  #hyd-jaali .jaali-inspector > fieldset {
    flex: none;
  }

  #hyd-jaali .jaali-tool-palette {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  #hyd-jaali :is(.jaali-tool-palette, .jaali-nibs) button {
    height: 44px;
  }

  #hyd-jaali .jaali-tool-palette svg {
    width: 22px;
    height: 22px;
  }

  #hyd-jaali :is(.jaali-tool-palette, .jaali-nibs) span {
    font-size: 9px;
  }

  #hyd-jaali .jaali-pattern-palette {
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-auto-columns: 44px;
    overflow-x: auto;
    overscroll-behavior: contain;
  }

  #hyd-jaali .jaali-pattern-palette button {
    height: 44px;
  }

  #hyd-jaali .jaali-sources {
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-auto-columns: 64px;
    max-height: none;
    overflow-x: auto;
  }

  #hyd-jaali :is(.jaali-slider, .jaali-slider select) {
    min-height: 44px;
  }

  #hyd-jaali .jaali-slider {
    grid-template-columns: 62px minmax(0, 1fr) 84px;
  }

  #hyd-jaali .jaali-slider input[type='range'] {
    min-height: 44px;
  }

  #hyd-jaali :is(.jaali-actions > button, .jaali-play) {
    min-height: 44px;
  }

  /* The two buttons stay in reach at the bottom of the sheet while it scrolls. */
  #hyd-jaali .jaali-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: 0 -8px -8px;
    padding: 8px;
    border-top: 1px solid #a1a2a4;
    background: #d9d9dc;
  }

  #hyd-jaali .jaali-footer {
    padding: 6px 8px;
  }
}

@media (max-width: 359px) {
  #hyd-jaali {
    width: calc(100% - 10px);
  }
}

/* Touch screens of any size: 44 px targets, as pinball's buttons. */
/* Any coarse pointer, phone or tablet: 44 px targets, as the site's window-control lists use
   (any-pointer: coarse) (review M5). Two pattern columns and a wider tool column make room. */
@media (any-pointer: coarse) {
  #hyd-jaali {
    --jaali-tones-height: max(44px, calc(2 * var(--jaali-tone-size) + 10px));
  }

  #hyd-jaali .jaali-tones button {
    min-height: 44px;
  }

  #hyd-jaali
    :is(
      .jaali-menubar [data-jaali-menu],
      .jaali-menu button,
      .jaali-actions > button,
      .jaali-play,
      .jaali-slider select,
      .jaali-slider
    ) {
    min-height: 44px;
  }

  #hyd-jaali .jaali-slider input[type='range'] {
    min-height: 44px;
  }

  #hyd-jaali :is(.jaali-tool-palette, .jaali-nibs, .jaali-pattern-palette) button {
    min-width: 44px;
    height: 44px;
  }
}

@media (any-pointer: coarse) and (min-width: 621px) {
  #hyd-jaali .jaali-body {
    grid-template-columns: 93px minmax(0, 1fr) 252px;
  }

  #hyd-jaali :is(.jaali-nibs, .jaali-pattern-palette) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #hyd-jaali .jaali-sources {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* --- Aqua title bar (owner, 21 oct: the same bar as flyovers & u-turns, option B). The site’s blue Aqua glass under
   faint pinstripes, a rim of the same blue, the title in dark blue ink over a white emboss, centred; red and yellow
   round discs. Copied from hyd-flyovers.css and scoped to this window. On a phone the bar is slim (36 px) and each
   disc is drawn at 24 px in a 44 × 44 target (the rest of the target is a transparent border). --- */
html[data-theme] body dialog#hyd-jaali[open] .jaali-titlebar {
  border: 0;
  border-bottom: 1px solid #6896ba;
  background:
    repeating-linear-gradient(0deg, #ffffff17 0 1px, #68686809 1px 2px),
    linear-gradient(#e3f5ff, #aed8f7 49%, #78b5e2 50%, #a2d2f5);
  box-shadow: inset 0 1px #fff;
  color: #143f62;
}
html[data-theme] body dialog#hyd-jaali[open] .jaali-titlebar h2 {
  color: #143f62;
  font: 700 12px/1.2 var(--desktop-font, 'Lucida Grande', Tahoma, sans-serif);
  letter-spacing: 0;
  text-align: center;
  text-shadow: 0 1px #fff8;
}
html[data-theme] body dialog#hyd-jaali[open] .jaali-titlebar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  justify-content: normal;
  min-height: 30px;
  padding: 3px 9px;
}
html[data-theme] body dialog#hyd-jaali[open] .jaali-title-spacer {
  width: auto;
}
html[data-theme] body dialog#hyd-jaali[open] .jaali-window-controls {
  display: flex;
  align-items: center;
  justify-self: start;
  gap: 4px;
  width: auto;
  height: 24px;
}
html[data-theme] body dialog#hyd-jaali[open] .jaali-window-controls [data-jaali-close] {
  box-sizing: border-box;
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  border: 1px solid #aa514a;
  border-radius: 50%;
  background: radial-gradient(ellipse at 40% 15%, #ffdcd4 0%, #ed867a 45%, #cf645c 74%, #f6a499 100%);
  color: #792f2a;
  box-shadow: inset 0 1px #ffece7, 0 1px #fffc;
  font: 16px/1 Arial, sans-serif;
  text-shadow: none;
}
html[data-theme] body dialog#hyd-jaali[open] .jaali-window-controls [data-jaali-minimise] {
  box-sizing: border-box;
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  border: 1px solid #a17a2b;
  border-radius: 50%;
  color: #6b4a0a;
  background: radial-gradient(ellipse at 40% 15%, #fff3c0, #f2ce65 45%, #d7a637 74%, #ffe292);
  box-shadow: inset 0 1px #fff3c0, 0 1px #fffc;
  font: 16px/1 Arial, sans-serif;
  text-shadow: none;
}

@media (max-width: 620px), (pointer: coarse) and (max-height: 450px) {
  html[data-theme] body dialog#hyd-jaali[open] .jaali-titlebar {
    grid-template-columns: 1fr auto 1fr;
    gap: 0;
  }
  html[data-theme] body dialog#hyd-jaali[open] .jaali-window-controls {
    width: auto;
    height: 44px;
  }
  html[data-theme] body dialog#hyd-jaali[open] .jaali-title-spacer {
    display: block;
    width: auto;
  }
  html[data-theme] body dialog#hyd-jaali[open] .jaali-window-controls > button::before {
    top: 12px;
  }
  html[data-theme] body dialog#hyd-jaali[open] .jaali-titlebar {
    position: relative;
    z-index: 1;
    min-height: 36px;
    padding: 0 4px;
  }
  html[data-theme] body dialog#hyd-jaali[open] .jaali-window-controls {
    gap: 0;
    margin: 0 0 -8px;
  }
  html[data-theme] body dialog#hyd-jaali[open] .jaali-window-controls button,
  html[data-theme] body dialog#hyd-jaali[open] .jaali-window-controls [data-jaali-close],
  html[data-theme] body dialog#hyd-jaali[open] .jaali-window-controls [data-jaali-minimise] {
    box-sizing: border-box;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    margin: 0;
    border-width: 6px 10px 14px;
    border-color: transparent;
    border-radius: 22px / 18px 18px 26px 26px;
    background-clip: padding-box;
    box-shadow:
      inset 0 0 0 1px #aa514a,
      inset 0 2px #ffece7;
    font-size: 15px;
  }
  html[data-theme] body dialog#hyd-jaali[open] .jaali-window-controls [data-jaali-minimise] {
    border-color: transparent;
    background-clip: padding-box;
    box-shadow:
      inset 0 0 0 1px #a17a2b,
      inset 0 2px #fff3c0;
  }
  html[data-theme] body dialog#hyd-jaali[open] .jaali-titlebar h2 {
    font-size: 15px;
  }
}
