/* Guy Lerer 2.8 · compact workspace.
 * Presentation only: selectors retain the existing DOM, actions and data.
 * Screen rules deliberately leave the original printable receipt untouched.
 */
@media screen {
  dialog {
    --workspace-ink: #35213a;
    --workspace-muted: #746176;
    --workspace-line: #e7d9e4;
    --workspace-surface: #ffffff;
    --workspace-soft: #f7eff6;
    --workspace-accent: #673d6b;
    color-scheme: light;
    width: min(540px, calc(100% - 24px));
    max-height: min(88dvh, 760px);
    margin-block: auto;
    color: var(--workspace-ink);
    background: #fffafd;
    border: 1px solid #b998b36e;
    border-radius: 16px;
    box-shadow: 0 24px 80px #0d061c52, 0 2px 12px #28152f1a;
    font-size: 1rem;
    line-height: 1.45;
    scrollbar-width: thin;
    scrollbar-color: #c7abc4 transparent;
  }

  dialog::backdrop {
    background: #160d20b8;
    backdrop-filter: blur(7px);
  }

  dialog.wide { width: min(760px, calc(100% - 24px)); }
  dialog.detail-panel { width: min(800px, calc(100% - 24px)) !important; }

  dialog .dialog-head {
    min-height: 56px;
    gap: 10px;
    padding: 10px 16px;
    color: var(--workspace-ink);
    background: #fcf7fbd9;
    border-bottom: 1px solid var(--workspace-line);
    backdrop-filter: blur(12px);
  }

  dialog .dialog-head h2 {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.35;
    font-weight: 800;
    letter-spacing: -.035em;
    overflow-wrap: anywhere;
  }

  dialog #panelbody { padding: 16px; }
  dialog .stack { gap: 10px; }
  dialog .row,
  dialog .row-between { gap: 8px; }
  dialog .row-between { flex-wrap: wrap; }
  dialog .pair { gap: 10px; }
  dialog .grow { min-width: 0; overflow-wrap: anywhere; }
  dialog p { margin-block: 6px 10px; }
  dialog p:last-child { margin-bottom: 0; }
  dialog h3:not(.studio-title) { line-height: 1.35; }
  dialog .subhead,
  dialog .editor-section h3,
  dialog .thread-order h3,
  dialog .reviews-box h3 {
    margin: 6px 0 8px;
    font-size: 1.0625rem;
    font-weight: 800;
    letter-spacing: -.02em;
  }

  dialog .studio-title {
    margin: 0;
    font-size: 1.375rem;
    line-height: 1.3;
    font-weight: 800;
    letter-spacing: -.035em;
  }

  dialog .note,
  dialog .muted,
  dialog .small,
  dialog .identity-info p,
  dialog .editor-section small {
    color: var(--workspace-muted);
    font-size: .875rem;
    line-height: 1.5;
  }

  dialog .note,
  dialog .muted { margin-block: 4px 8px; }
  dialog .err { font-size: .875rem; line-height: 1.45; color: #a32955; }
  dialog .divider { margin-block: 8px; border-color: var(--workspace-line); }

  dialog .field {
    display: grid;
    gap: 4px;
    min-width: 0;
    font-size: .875rem;
    font-weight: 700;
    line-height: 1.4;
  }

  dialog .field:has(svg) { display: block; }
  dialog .field:has(svg) input { margin-top: 4px; }
  dialog .field svg { width: 18px; height: 18px; }
  dialog .field input:not([type=checkbox]):not([type=radio]),
  dialog .field textarea,
  dialog .field select,
  dialog .input,
  dialog .field-output {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 8px 10px;
    font-size: 1rem;
    line-height: 1.3;
    color: var(--workspace-ink);
    background: var(--workspace-surface);
    border: 1px solid #ccb9cb;
    border-radius: 8px;
    box-shadow: 0 1px 2px #34203d04;
    transition: border-color .16s ease, box-shadow .16s ease;
  }

  dialog .field-output { font-size: .875rem; }
  dialog .field input::placeholder,
  dialog .field textarea::placeholder,
  dialog .input::placeholder { color: #89748b; opacity: 1; }
  dialog .field textarea { min-height: 88px; resize: vertical; }
  dialog .field input[type=file] { padding: 6px; }
  dialog input::file-selector-button {
    margin-inline-end: 8px;
    padding: 5px 8px;
    border: 1px solid #d7c6d5;
    border-radius: 5px;
    color: #57355b;
    background: #f6edf4;
    font: inherit;
    font-size: .875rem;
    cursor: pointer;
  }

  dialog input[type=checkbox],
  dialog input[type=radio] {
    accent-color: #85508a;
    flex-shrink: 0;
  }

  dialog .checklabel {
    gap: 7px;
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.45;
  }
  dialog .checklabel input,
  dialog .row > input[type=checkbox],
  dialog .cartline input[type=checkbox] { width: 18px; height: 18px; }

  dialog .action,
  dialog .primary,
  dialog .soft,
  dialog .tab,
  dialog .chip,
  dialog .contact-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid #d6c3d3;
    border-radius: 8px;
    font-size: .875rem;
    font-weight: 700;
    line-height: 1.35;
    color: #56345a;
    background: #fff;
    box-shadow: 0 1px 2px #35203905;
    text-align: center;
    transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
  }

  dialog .action,
  dialog .primary {
    border-color: #edd16f;
    color: #39273b;
    background: #ffe37e;
    box-shadow: 0 2px 4px #b08c2720;
  }

  dialog .tab.active,
  dialog .chip[aria-pressed=true] {
    border-color: #673d6b;
    color: #fff;
    background: #673d6b;
  }

  dialog .text-btn { min-height: 34px; padding: 6px 8px; font-size: .875rem; }
  dialog .iconbtn,
  dialog .dialog-head .iconbtn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    flex-shrink: 0;
    color: #6a4c6b;
    background: #fff;
    border: 1px solid #dfcfdd;
    border-radius: 9px;
  }
  dialog .iconbtn svg { width: 17px; height: 17px; }
  dialog button svg,
  dialog a svg { width: 18px; height: 18px; }

  dialog :is(button, a, input, select, textarea, summary):focus-visible {
    outline: 3px solid #9b5c9e;
    outline-offset: 3px;
  }

  dialog :is(input, select, textarea):focus-visible { border-color: #8d568f; }
  dialog button:disabled { opacity: .5; box-shadow: none; }
  dialog .tabs { gap: 6px; margin-bottom: 12px; padding-bottom: 3px; }

  /* Dense, legible working canvas. All existing sections remain available. */
  dialog.studio {
    width: min(1000px, calc(100% - 24px));
    height: auto;
    max-height: 90dvh;
  }
  dialog.studio #panelbody { padding: 0; }
  dialog .studio-wrap { grid-template-columns: 156px minmax(0, 1fr); min-height: 0; }
  dialog .studio-nav {
    padding: 14px 10px;
    color: #f7edf6;
    background: linear-gradient(170deg, #332039, #25182d);
    border-inline-end: 1px solid #442c48;
  }
  dialog .studio-brand {
    padding: 2px 7px 13px;
    font-size: 1rem;
    line-height: 1.35;
    font-weight: 800;
    letter-spacing: -.025em;
  }
  dialog .studio-nav nav { gap: 3px; scrollbar-width: thin; scrollbar-color: #715073 transparent; }
  dialog .studio-nav button {
    min-height: 34px;
    padding: 7px 9px;
    border-radius: 7px;
    font-size: .875rem;
    line-height: 1.35;
    font-weight: 600;
  }
  dialog .studio-nav button[aria-current=page] {
    color: #302034;
    background: #f2d9ee;
    box-shadow: 0 1px 5px #120b1e1a;
  }
  dialog .studio-domains { margin-bottom: 8px; padding-bottom: 8px; border-color: #604768; }
  dialog .studio-nav .studio-sections button { font-size: .875rem; }
  dialog .studio-nav .studio-sections button[aria-current=page] { background: #ffe18b; color: #352238; }
  dialog .studio-nav .text-btn { margin-top: 10px; color: #dfcce3; font-weight: 500; }
  dialog .studio-nav small { padding: 1px 4px; font-size: .75rem; border-radius: 4px; }
  dialog .studio-main { min-width: 0; padding: 18px; }
  dialog .studio-links,
  dialog .paging { gap: 6px; }
  dialog .stats { gap: 8px; }
  dialog .studio-main .stats { margin: 4px 0 8px; }
  dialog .stat {
    min-width: 100px;
    padding: 10px 12px;
    border: 1px solid #e6d7e4;
    border-radius: 10px;
    color: #755778;
    background: linear-gradient(135deg, #fff, #f7eef6);
    font-size: .875rem;
    line-height: 1.4;
  }
  dialog .stat b { margin-bottom: 2px; color: #4d2b51; font-size: 1.375rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
  dialog .order,
  dialog .editor-section,
  dialog .thread-order,
  dialog .identity-info,
  dialog .media-row,
  dialog .hours-day {
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid var(--workspace-line);
    border-radius: 10px;
    color: var(--workspace-ink);
    background: #fff;
    box-shadow: 0 1px 2px #36233b03;
  }
  dialog .editor-section,
  dialog .identity-info { background: #faf5f9; }
  dialog .editor-section .field,
  dialog .editor-section .checklabel { margin-top: 7px; }
  dialog .order p { margin-block: 6px; }
  dialog .adminline,
  dialog .cartline {
    gap: 8px;
    padding: 8px 0;
    border-color: var(--workspace-line);
  }
  dialog .admin-actions { gap: 5px; }
  dialog .admin-actions button { min-height: 32px; padding: 5px 8px; }
  dialog .thumb { width: 44px; height: 44px; border: 1px solid #e2d3e0; border-radius: 8px; }
  dialog .qty { gap: 5px; font-variant-numeric: tabular-nums; }
  dialog .qty button { width: 30px; height: 32px; padding: 3px; background: #fff; border: 1px solid #d7c5d5; border-radius: 7px; }
  dialog .qty button:disabled { opacity: .45; }
  dialog .amount { font-size: 1.125rem; font-variant-numeric: tabular-nums; }
  dialog .badge-new,
  dialog .bot-state { padding: 3px 7px; border-radius: 5px; font-size: .75rem; line-height: 1.5; }
  dialog .empty { margin-block: 0; padding: 20px 12px; background: #f8f1f7; border: 1px dashed #ddc9d9; border-radius: 10px; font-size: .9375rem; }

  dialog .variant-row { gap: 7px; padding-bottom: 8px; margin-bottom: 8px; border-color: var(--workspace-line); }
  dialog .variant-row .checklabel { margin: 0; padding-bottom: 8px; }
  dialog #gallery-editor { gap: 8px; }
  dialog .edit-thumb { width: 84px; }
  dialog .edit-thumb img { width: 84px; height: 66px; border-radius: 7px; }
  dialog .edit-thumb button { min-height: 28px; padding: 4px 6px; }
  dialog .media-row { gap: 8px; }
  dialog .media-thumb { width: 80px; height: 54px; border-radius: 7px; }
  dialog .media-symbol svg { width: 30px; height: 30px; }
  dialog .hours-day { gap: 8px; padding-top: 6px; }
  dialog .hours-day legend { padding-inline: 5px; font-size: .875rem; font-weight: 700; }
  dialog .hours-day label { font-size: .875rem; }
  dialog .hours-day input { min-width: 0; }

  /* Product template, order flow and service views: same fields, less space. */
  dialog .detail-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
  dialog .gallery-frame,
  dialog .gallery-empty { aspect-ratio: 1.35; border-radius: 11px; }
  dialog .detail-copy h3 { font-size: 1.625rem; line-height: 1.2; margin: 10px 0 6px; letter-spacing: -.035em; }
  dialog .detail-copy > p { font-size: 1rem; line-height: 1.5; margin-block: 4px 10px; }
  dialog .detail-score { font-size: .875rem; }
  dialog .category-label,
  dialog .photo-count { padding: 4px 8px; border-radius: 6px; font-size: .75rem; line-height: 1.4; }
  dialog .photo-count { top: 9px; left: 9px; }
  dialog .gallery-nav { bottom: 9px; left: 9px; gap: 5px; }
  dialog .gallery-nav button { width: 34px; height: 34px; font-size: 22px; }
  dialog .thumbnails { margin-top: 7px; gap: 5px; }
  dialog .thumbnails button { width: 45px; height: 45px; border-radius: 7px; }
  dialog .options,
  dialog .rates { margin-block: 10px; }
  dialog .options legend,
  dialog .rates legend { font-size: .875rem; margin-bottom: 5px; }
  dialog .options button,
  dialog .rates label span { gap: 2px; min-height: 36px; padding: 6px 9px; font-size: .875rem; border: 1px solid #d5c0d1; border-radius: 8px; }
  dialog .options button[aria-pressed=true],
  dialog .rates label:has(input:checked) span { color: #fff; background: #673d6b; border-color: #673d6b; box-shadow: none; }
  dialog .reviews-box { margin-top: 16px; padding-top: 12px; border-color: var(--workspace-line); }
  dialog .review { margin-bottom: 7px; padding: 10px 12px; border-color: var(--workspace-line); border-radius: 9px; }
  dialog .review p { margin-block: 4px; font-size: .9375rem; }
  dialog .review-editor { padding-block: 8px; }
  dialog .review-editor form { margin-top: 10px; }
  dialog .purchase-dock { gap: 10px; padding: 8px 10px; border-color: #dfcbd9; border-radius: 11px; background: #fffafd; box-shadow: 0 -3px 14px #4930500a; }
  dialog .purchase-dock .action { min-height: 40px; }
  dialog .purchase-dock small { font-size: .75rem; }
  dialog .purchase-dock strong { font-size: 1rem; }
  dialog.detail-panel #purchase-bar { margin-top: 10px; }
  dialog .receipt-cart-summary { gap: 6px; }
  dialog .order-cost { padding: 9px 10px; font-size: .9375rem; background: #f5eaf3; border-radius: 8px; }
  dialog .thread-order p { margin-block: 6px; }
  dialog .message { max-width: 90%; margin-block: 6px; padding: 8px 10px; border: 1px solid #e1ccdc; border-radius: 10px 10px 3px 10px; background: #fcf0f8; }
  dialog .message.staff { border-radius: 10px 10px 10px 3px; background: #f0eafa; border-color: #ddd1ed; }
  dialog .message p { margin: 3px 0; line-height: 1.45; }
  dialog .message small { font-size: .75rem; color: #775e7a; }
  dialog details > summary { font-size: .9375rem; line-height: 1.45; }
  dialog .bot-card summary { padding-block: 4px; }
  dialog .bot-glance { gap: 6px; }
  dialog .bot-glance[open] summary { margin-bottom: 8px; }
  dialog .fleet-facts { gap: 8px; margin-block: 10px; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); }
  dialog .fleet-facts div { padding-inline: 8px; border-inline-start: 2px solid #c9a6c4; }
  dialog .fleet-facts dt { color: var(--workspace-muted); font-size: .875rem; }
  dialog .fleet-facts dd { margin-top: 3px; font-size: .9375rem; }
  dialog .fleet-probe { gap: 8px; margin-block: 8px; }
  dialog .fleet-actions { gap: 6px; }
  dialog .fleet-line { color: var(--workspace-muted); font-size: .875rem; }
  dialog .bot-bubble { max-width: 460px; padding: 12px; border: 1px solid #dac3d7; border-radius: 12px; background: #fff5fb; box-shadow: 0 2px 8px #43224b08; }
  dialog .bot-bubble > p { margin-block: 6px 10px; font-size: .9375rem; line-height: 1.5; }
  dialog .bot-photo { max-height: 160px; border-radius: 8px; }
  dialog .bot-keys { gap: 5px; margin-top: 5px; }
  dialog .bot-keys > :is(button, a) { flex: 1; min-width: 0; overflow-wrap: anywhere; }

  dialog .ride-ticket { padding: 18px; gap: 7px; border-radius: 13px; }
  dialog .ride-ticket strong { font-size: clamp(2.125rem, 8vw, 3rem); line-height: 1.15; }
  dialog .ride-mast { gap: 7px; font-size: .9375rem; }
  dialog .ride-ticket progress { margin-top: 6px; height: 5px; }
  dialog #ride-steps { gap: 8px; font-size: .75rem; line-height: 1.4; }

  /* Screen receipt density. Original print CSS remains authoritative. */
  dialog .cashier-ticket { font-size: .9375rem; border-radius: 11px; }
  dialog .ct-head { padding: 14px 16px; border-bottom-width: 3px; gap: 10px; }
  dialog .ct-head h2 { font-size: 1.375rem; line-height: 1.25; }
  dialog .ct-head bdi { font-size: 1.25rem; }
  dialog .ct-body { padding: 13px 16px; }
  dialog .ct-meta { gap: 10px; margin-bottom: 12px; }
  dialog .cashier-ticket td,
  dialog .cashier-ticket th { padding: 7px 5px; }
  dialog .ct-totals { margin-top: 10px; }
  dialog .ct-totals div { padding-block: 3px; }
  dialog .ct-totals .ct-grand { padding-top: 7px; font-size: 1.125rem; }
  dialog .ct-terms { padding-top: 8px; }
  dialog .ticket-actions { gap: 6px; margin-top: 12px; }
}

@media screen and (hover: hover) {
  dialog :is(.soft, .tab, .chip, .contact-action):hover:not(:disabled) { background: #f6edf5; border-color: #b990b5; }
  dialog :is(.action, .primary):hover:not(:disabled) { background: #ffdc65; border-color: #dbba52; transform: none; box-shadow: 0 2px 7px #b18a2a28; }
  dialog .tab.active:hover,
  dialog .chip[aria-pressed=true]:hover { background: #543057; color: #fff; }
  dialog .studio-nav button:hover:not([aria-current=page]) { background: #ffffff0d; }
  dialog .iconbtn:hover { border-color: #b991b6; background: #f8eff7; }
}

@media screen and (min-width: 741px) {
  dialog .studio-nav { display: block; }
  dialog .studio-nav nav { display: grid; }
  dialog .studio-nav .studio-brand { display: block; }
  dialog .studio-nav button { text-align: start; white-space: normal; }
}

@media screen and (max-width: 740px) {
  dialog,
  dialog.wide,
  dialog.detail-panel { width: calc(100% - 20px) !important; max-height: 91dvh; border-radius: 14px; }
  dialog .dialog-head { min-height: 52px; padding: 9px 12px; }
  dialog .dialog-head h2 { font-size: 1.1875rem; }
  dialog #panelbody { padding: 12px; }
  dialog.studio { height: auto; max-height: 92dvh; }
  dialog .studio-wrap { display: block; min-height: 0; }
  dialog .studio-main { padding: 13px; }
  dialog .studio-title { font-size: 1.25rem; }
  dialog .studio-nav { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 7px 9px; gap: 5px; border-inline-end: 0; border-bottom: 1px solid #49304e; }
  dialog .studio-nav .studio-brand { display: none; }
  dialog .studio-nav nav { display: flex; gap: 4px; overflow-x: auto; max-height: none; padding-block: 1px 3px; }
  dialog .studio-domains { grid-column: 1 / -1; margin: 0; padding: 0; border: 0; }
  dialog .studio-nav button { min-height: 36px; padding: 7px 9px; font-size: .875rem; white-space: nowrap; }
  dialog .studio-domains > button { flex: 1; }
  dialog .studio-nav .text-btn { margin: 0; padding-inline: 6px; font-size: .875rem; }
  dialog .studio-main .stats { margin-block: 4px; }
  dialog .stat { min-width: 84px; padding: 9px 10px; }
  dialog .stat b { font-size: 1.25rem; }
  dialog .detail-layout { gap: 12px; }
  dialog .detail-copy h3 { font-size: 1.375rem; margin-top: 8px; }
  dialog .detail-copy > p { font-size: .9375rem; }
  dialog .ride-ticket { padding: 14px; }
}

@media screen and (max-width: 520px) {
  dialog .pair { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  dialog .detail-layout { display: block; }
  dialog .detail-copy { margin-top: 12px; }
  dialog .gallery-frame,
  dialog .gallery-empty { aspect-ratio: 1.65; }
  dialog .variant-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 7px; }
  dialog .variant-row .checklabel { padding-bottom: 0; }
  dialog .hours-day { grid-template-columns: .7fr 1fr 1fr; gap: 6px; padding-inline: 9px; }
  dialog .hours-day :is(input, select) { padding-inline: 5px; }
  dialog .admin-actions { max-width: 116px; }
  dialog .adminline .thumb { display: none; }
  dialog .cartline { flex-wrap: wrap; }
  dialog .cartline .grow { flex-basis: calc(100% - 92px); }
  dialog .cartline .qty { margin-inline-start: auto; }
  dialog .purchase-dock { gap: 8px; padding: 7px 9px; }
  dialog .purchase-dock .action { flex-basis: 132px; padding-inline: 9px; }
  dialog .ct-head,
  dialog .ct-body { padding: 11px; }
  dialog .ct-head h2 { font-size: 1.25rem; }
  dialog .ct-head bdi { font-size: 1.125rem; }
  dialog .cashier-ticket { font-size: .875rem; }
}

@media screen and (pointer: coarse) {
  dialog :is(.action, .primary, .soft, .tab, .chip, .text-btn, .contact-action),
  dialog .studio-nav button,
  dialog .options button,
  dialog .rates label span,
  dialog .purchase-dock .action,
  dialog .edit-thumb button { min-height: 44px; }
  dialog :is(.iconbtn, .gallery-nav button, .qty button),
  dialog .dialog-head .iconbtn { min-width: 44px; min-height: 44px; }
  dialog .field input:not([type=checkbox]):not([type=radio]),
  dialog .field select,
  dialog .input { min-height: 44px; }
  dialog .checklabel { min-height: 36px; }
}

@media screen and (prefers-reduced-motion: reduce) {
  dialog,
  dialog *,
  dialog *::before,
  dialog *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
