/* Use the app's modal timing and mobile close control with the public dialogs. */
.public-product-dialog[open] { animation: public-product-open 150ms ease-out backwards; }
@keyframes public-product-open {
    from { opacity: 0; transform: scale(.97); }
    to { opacity: 1; transform: scale(1); }
}
.public-product-dialog::backdrop {
    background: rgb(15 23 42 / 10%);
    backdrop-filter: blur(4px);
}
.public-demo-child::backdrop { backdrop-filter: none; }
.public-qr-dialog .public-qr-footer {
    min-block-size: calc(30px + max(10px, env(safe-area-inset-bottom)));
    padding: 10px 16px max(10px, env(safe-area-inset-bottom));
    border-top-color: #eef2f6;
    background: #fbfdff;
}
.public-product-dialog .public-dialog-close { display: none; }
.public-product-dialog .public-dialog-header h2:focus { outline: none; }
.public-product-dialog [hidden] { display: none !important; }
.public-product-dialog button:not(:disabled) { cursor: pointer; }
.public-product-dialog :is(button, input, select, a):focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}
.public-settings-dialog { width: min(940px, calc(100% - 28px)); }
.public-demo-child { width: min(430px, calc(100% - 28px)); }
#demo-utm { width: min(470px, calc(100% - 28px)); }
.public-settings-dialog .public-dialog-header,
.public-demo-child .public-dialog-header { min-height: 60px; padding-inline: 20px; }
.demo-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    padding: 20px;
}
.demo-fields { display: grid; gap: 17px; min-width: 0; }
.public-demo-field { min-width: 0; }
.public-demo-field label, .demo-child-body > label, .demo-utm-fields label, .demo-occurrence label, #demoAlternativeRow > label {
    display: block;
    margin-bottom: 5px;
    color: #334155;
    font-size: 13px;
    font-weight: 650;
}
.public-demo-field > input, .demo-alias input, #demoFolderInput,
.demo-child-body input:not([type="checkbox"], [type="radio"]), .demo-child-body select {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 0 11px;
    border: 1px solid #dfe5eb;
    border-radius: 8px;
    background: #fff;
    color: #24344b;
    font: inherit;
}
.public-demo-field input[readonly] { cursor: text; }
.demo-alias {
    display: flex;
    align-items: stretch;
    border: 1px solid #dfe5eb;
    border-radius: 8px;
    overflow: hidden;
}
.demo-alias span {
    display: flex;
    align-items: center;
    max-width: 60%;
    padding: 0 11px;
    background: #f8fafc;
    border-inline-end: 1px solid #e3e9ef;
    color: #526176;
    overflow-wrap: anywhere;
    user-select: text;
}
.demo-alias input { flex: 1; border: 0; border-radius: 0; }
.demo-alias input:focus-visible { outline-offset: -2px; }
.demo-tag-label {
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 24px;
    margin-bottom: 4px;
}
.demo-tag-label label { margin: 0; }
#demoTagCount { margin-inline-start: auto; color: #64748b; font-size: 12px; }
.create-tag-input {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    min-height: 42px;
    padding: 5px 10px;
    border: 1px solid #dfe5eb;
    border-radius: 8px;
    color: #64748b;
    cursor: text;
}
#demoTagsSelected { display: contents; }
#publicSettingsTags {
    flex: 1 1 145px;
    width: auto;
    min-width: 0;
    min-height: 28px;
    padding: 0 3px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #334155;
    font: inherit;
}
.tag-token {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    max-width: 100%;
    padding: 3px 6px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    color: #334155;
    font-size: 12px;
}
.tag-token button { border: 0; background: transparent; padding: 0 2px; color: #526176; }
.tag-token .public-icon, .tag-picker-checkbox .public-icon { width: 12px; height: 12px; }
.tag-token .public-icon { color: var(--tag-text, #64748b); }

.demo-folder-row { position: relative; }
.demo-folder-toggle {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 42px;
    padding: 0 0 0 2px;
    border: 0;
    background: transparent;
    color: #111827;
    text-align: left;
    font: inherit;
    font-weight: 600;
}
.demo-folder-toggle span { overflow-wrap: anywhere; padding-inline-end: 31px; }
.demo-folder-row:has(.folder-picker-clear:not([hidden])) .demo-folder-toggle span { padding-inline-end: 72px; }
.demo-folder-toggle .public-icon { color: #52627a; }
.demo-folder-toggle[aria-expanded="true"] .public-icon:last-child { transform: rotate(180deg); }
.demo-folder-actions {
    position: absolute;
    inset-inline-end: 23px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 1px;
    align-items: center;
}
.folder-picker-options { max-height: min(24dvh, 10rem); overflow: auto; overscroll-behavior: contain; }
.folder-picker-option { overflow-wrap: anywhere; }
#demoFolderForm { padding: 5px; }
#demoFolderForm > div { display: flex; justify-content: flex-end; gap: 5px; margin-top: 6px; }

.control-summary h3, .demo-product-note h3 { margin: 0 0 8px; font-size: 14px; font-weight: 650; }
.control-summary dl { margin: 0; }
.control-summary .demo-summary-strong { color: #182336; font-weight: 650; }
.control-summary .demo-summary-divider { border-top: 1px solid #e3e9ef; padding-top: .65rem; }
.control-summary #demoSummaryTags, .control-summary #demoSummaryFeatures {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-height: none;
}
.control-summary #demoSummaryValidity { display: grid; justify-items: start; gap: 3px; max-height: none; }
.summary-chip .public-icon { width: 13px; height: 13px; }
.demo-product-note { padding: 14px 3px 0; }
.demo-product-note h3 { margin-bottom: 5px; color: #334155; font-size: 13px; }
.demo-product-note p { margin: 0; color: #526176; font-size: 13px; line-height: 1.5; }

.public-settings-footer { justify-content: space-between; padding-inline: 20px; }
.public-settings-tools { display: flex; flex-wrap: wrap; gap: 10px .18rem; }
.demo-tool { position: relative; display: flex; align-items: center; }
.demo-tool .public-secondary { min-height: 34px; padding-inline: 7px; }
.demo-tool .public-secondary .public-icon { width: 14px; height: 14px; }
.demo-tool .is-active { background: #eaf4ff; border-color: #d3e6fb; color: #1d5e9d; }
.demo-hint {
    display: inline-grid;
    place-items: center;
    width: 23px;
    min-height: 26px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #64748b;
}
.demo-hint .public-icon { width: 12px; height: 12px; }
.demo-hint:hover { background: #edf2f7; }
.demo-tool > .demo-hint {
    position: absolute;
    inset-block-start: -12px;
    inset-inline-end: -2px;
    width: 24px;
    min-height: 24px;
    padding-inline-start: 8px;
}
.demo-tool > .demo-hint:hover { background: transparent; color: #334155; }
.demo-tool > .demo-hint:focus-visible { outline-offset: -2px; }
.demo-tool > .demo-hint .public-icon {
    width: 16px;
    height: 16px;
    padding: 2px;
    border-radius: 4px;
    background: #f8fafc;
}
.demo-tooltip {
    position: fixed;
    inset: auto;
    width: max-content;
    max-width: min(270px, calc(100vw - 24px));
    margin: 0;
    padding: 8px 11px;
    border: 1px solid #dfe5eb;
    border-radius: 9px;
    background: #fff;
    color: #334155;
    text-align: center;
    font-size: 12px;
    box-shadow: 0 5px 16px rgb(15 23 42 / 10%);
}

.demo-child-body { padding: 17px 20px; }
.demo-child-body p { margin: 0 0 13px; }
.demo-child-body p:last-child { margin-bottom: 0; }
.demo-muted { color: #526176; font-size: 13px; line-height: 1.45; }
.demo-child-footer { justify-content: flex-start; }
.demo-utm-fields { display: grid; gap: 8px; }
.demo-utm-fields > div {
    display: grid;
    grid-template-columns: 102px minmax(0, 1fr);
    align-items: center;
    border: 1px solid #dfe5eb;
    border-radius: 8px;
    overflow: hidden;
}
.demo-utm-fields > div:focus-within { outline: 2px solid #2563eb; }
.demo-utm-fields label { margin: 0; padding: 8px 10px; }
.demo-child-body .demo-utm-fields input { border: 0; border-inline-start: 1px solid #e3e9ef; border-radius: 0; outline: 0; }
.demo-utm-footer { justify-content: flex-end; }
.demo-utm-footer #demoUtmClear { margin-inline-end: auto; }
.demo-preview { margin-top: 16px; padding: 10px 12px; border: 1px solid #e3e9ef; border-radius: 8px; background: #f8fafc; overflow-wrap: anywhere; }
.demo-preview p { margin: 3px 0 0; color: #526176; font-size: 12px; }
.demo-preview p + p { max-height: 7em; overflow: auto; }
.demo-password-field { position: relative; }
.demo-password-field #demoPassword { padding-inline-end: 43px; }
.demo-password-field button {
    position: absolute;
    inset: 3px 3px 3px auto;
    display: grid;
    place-items: center;
    width: 36px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #526176;
}
.demo-password-field button:hover { background: #f1f5f9; }
.demo-inline-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-block: 9px 13px; }
.demo-inline-actions .public-secondary { min-height: 30px; padding-inline: 8px; }
.demo-danger { color: #a53333; border-color: #f1d6d6; }
.demo-validity-section { margin: 0 0 15px; }
.demo-validity-section + .demo-validity-section { padding-top: 12px; border-top: 1px solid #e3e9ef; }
.demo-validity-section .public-qr-logo-row { margin: 0; min-height: 30px; gap: 8px; }
.demo-validity-section .demo-muted { margin: 2px 0 6px; }
.demo-occurrence, .demo-expiry, #demoAlternativeRow { margin-top: 10px; }
.demo-expiry { padding: 0; border: 0; }
.demo-expiry legend { color: #526176; font-weight: 600; font-size: 13px; }
.demo-expiry label { display: flex; gap: 7px; align-items: baseline; padding-block: 4px; }
.demo-expiry input { accent-color: #111; }
.demo-child-body .demo-error { margin: 6px 0 0; color: #9a2c2c; font-size: 12px; }

@media (max-width: 767.98px) {
    .public-product-dialog .public-dialog-close {
        display: grid;
        width: 44px;
        height: 44px;
        border: 0;
        border-radius: 10px;
        color: #53647d;
    }
    .public-product-dialog .public-dialog-header { min-height: 56px; padding: 6px 8px 6px 15px; }
    .demo-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 15px; }
    .demo-child-body, .public-settings-footer { padding-inline: 15px; }
    .public-demo-field input, #publicSettingsTags, #demoFolderInput, .demo-child-body input, .demo-child-body select { font-size: 16px; }
    .tag-token button { min-width: 23px; min-height: 22px; }
    .demo-hint { width: 27px; min-height: 30px; }
}
@media (max-width: 480px) {
    .public-settings-footer { display: grid; grid-template-columns: minmax(0, 1fr); }
    .public-settings-footer > .public-primary { justify-self: end; }
    .demo-tool .public-secondary { min-height: 36px; padding-inline: 5px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .public-product-dialog[open] { animation: none; }
}

/* Public equivalents of the app picker and summary rules. */
.tag-picker-name { min-width:0; overflow-wrap:anywhere }
.tag-picker-tag-icon { flex:none; color:var(--tag-text,#64748b) }
.public-settings-dialog .tag-picker .tag-input { flex:1 1 145px; width:auto; min-width:0; max-width:100%; min-height:28px; background:transparent }
.public-settings-dialog .tag-picker-menu { margin-top:5px; background:#fff; border:1px solid #dbe3ee; border-radius:10px; padding:4px; max-height:min(235px,32dvh); overflow-y:auto; overscroll-behavior:contain; box-shadow:0 5px 16px rgba(15,23,42,.06) }
.public-settings-dialog .tag-picker-option { display:flex; align-items:center; gap:.55rem; width:100%; min-height:36px; border:0; border-radius:6px; padding:4px 8px; background:#fff; color:#334155; font-size:.8rem; text-align:left }
.public-settings-dialog .tag-picker-option:not(:disabled):hover, .public-settings-dialog .tag-picker-option.is-highlighted { background:#eef4fb }
.public-settings-dialog .tag-picker-option:disabled { opacity:.55; cursor:not-allowed }
.tag-picker-checkbox { display:grid; place-items:center; flex:0 0 1rem; width:1rem; height:1rem; border:1px solid rgba(15,23,42,.22); border-radius:.25em; background:#fff; font-size:1rem; line-height:1 }
.tag-picker-option[aria-selected="true"] .tag-picker-checkbox { background:#111827; border-color:#111827; color:#fff; font-size:.75rem; border-radius:4px }
.tag-picker-create kbd { margin-inline-start:auto; color:#64748b; background:#f8fafc; border:1px solid #e2e8f0; border-radius:4px; font:inherit }
.public-settings-dialog .tag-picker-message { padding:8px; color:#64748b; font-size:.8rem }
.public-settings-dialog .control-summary { min-width:0; margin:0; padding:.9rem 1rem; border:1px solid #e3e9ef; border-radius:12px; background:#f8fafc; align-self:start; font-size:.82rem; }
.control-summary div + div { margin-top:.65rem }
.control-summary dt { color:#64748b; font-size:.73rem; font-weight:600 }
.control-summary dd { margin:2px 0 0; overflow-wrap:anywhere; white-space:pre-line; line-height:1.4; max-height:5.6em; overflow:auto }
.control-summary [data-value="validity"] { max-height:none }
.summary-chip { display:inline-flex; align-items:center; gap:.3rem; padding:3px 6px; border:1px solid #dbe3ee; border-radius:6px; background:#fff; color:#475569; font-size:.72rem; line-height:1.25 }
.summary-chip.scheduled { background:#eaf4ff; border-color:#dbeeff; color:#285893 }
.summary-chip.expired { background:#fff2f2; border-color:#f1d6d6; color:#a53333 }
.folder-picker { position: relative; min-width: 0; padding-block: .45rem; border-top: 1px solid #e7ebf1; }
.folder-picker-clear {
  min-height: 2rem;
  padding: 0 .2rem;
  border: 0;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: .75rem;
  font-weight: 400;
}
.folder-picker-clear:hover:not(:disabled) { color: #334155; text-decoration: underline; }
.folder-picker-panel { padding: .4rem; border: 1px solid #dfe5eb; border-radius: 10px; background: #fff; }
.folder-picker-option {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  min-height: 2.35rem;
  padding: .4rem .5rem;
  border: 0;
  border-radius: 6px;
  color: #172033;
  background: transparent;
  text-align: left;
}
.folder-picker-option[aria-pressed="true"] { background: #edf3ff; font-weight: 600; }
.folder-picker-option:hover, .folder-picker-option:focus-visible { background: #f0f3f8; }
.folder-picker-create { border-top: 1px solid #edf0f4; margin-top: .25rem; padding-top: .25rem; }
.public-settings-dialog .tag-color-1 { --tag-bg:#fff1f2; --tag-border:#fecdd3; --tag-text:#be123c; }
.public-settings-dialog .tag-color-2 { --tag-bg:#eff6ff; --tag-border:#bfdbfe; --tag-text:#1d4ed8; }
.public-settings-dialog .tag-color-3 { --tag-bg:#ecfdf5; --tag-border:#bbf7d0; --tag-text:#047857; }
.public-settings-dialog .tag-color-4 { --tag-bg:#fff7ed; --tag-border:#fed7aa; --tag-text:#c2410c; }
.public-settings-dialog .tag-color-5 { --tag-bg:#f5f3ff; --tag-border:#ddd6fe; --tag-text:#6d28d9; }
.public-settings-dialog .tag-color-6 { --tag-bg:#f0fdfa; --tag-border:#99f6e4; --tag-text:#0f766e; }
.public-settings-dialog .tag-color-7 { --tag-bg:#fefce8; --tag-border:#fde68a; --tag-text:#a16207; }
.public-settings-dialog .tag-color-8 { --tag-bg:#fdf2f8; --tag-border:#fbcfe8; --tag-text:#be185d; }
.public-settings-dialog .tag-color-9 { --tag-bg:#eef2ff; --tag-border:#c7d2fe; --tag-text:#4338ca; }
.public-settings-dialog .tag-color-10 { --tag-bg:#f0f9ff; --tag-border:#bae6fd; --tag-text:#0369a1; }
.public-settings-dialog .tag-color-11 { --tag-bg:#f0fdf4; --tag-border:#bbf7d0; --tag-text:#15803d; }
.public-settings-dialog .tag-color-12 { --tag-bg:#fffbeb; --tag-border:#fde68a; --tag-text:#b45309; }
.public-settings-dialog .tag-color-13 { --tag-bg:#faf5ff; --tag-border:#e9d5ff; --tag-text:#7e22ce; }
.public-settings-dialog .tag-color-14 { --tag-bg:#ecfeff; --tag-border:#a5f3fc; --tag-text:#0e7490; }
.public-settings-dialog .tag-color-15 { --tag-bg:#f7fee7; --tag-border:#d9f99d; --tag-text:#4d7c0f; }
.public-settings-dialog .tag-color-16 { --tag-bg:#fff7ed; --tag-border:#fdba74; --tag-text:#9a3412; }
.public-settings-dialog .tag-color-17 { --tag-bg:#fef2f2; --tag-border:#fecaca; --tag-text:#b91c1c; }
.public-settings-dialog .tag-color-18 { --tag-bg:#f8fafc; --tag-border:#cbd5e1; --tag-text:#475569; }
.public-settings-dialog .tag-color-19 { --tag-bg:#f1f5f9; --tag-border:#cbd5e1; --tag-text:#334155; }
.public-settings-dialog .tag-color-20 { --tag-bg:#fdf4ff; --tag-border:#f5d0fe; --tag-text:#a21caf; }
