:root {
  color-scheme: light;
  --bg: #eef2f7;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --border: #d7dee8;
  --border-strong: #b9c4d2;
  --text: #172033;
  --muted: #657187;
  --primary: #1f6feb;
  --primary-hover: #1859bd;
  --danger: #c62828;
  --success: #2e7d32;
  --shadow: 0 10px 30px rgba(20, 33, 61, .10);
  --radius: 12px;
  --editor-width: 43%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

/* Gli elementi con attributo hidden devono restare realmente nascosti anche quando
   una classe componente imposta display:grid/flex. */
[hidden] { display: none !important; }


html, body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
}

button, select, textarea { font: inherit; }

.app-header {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(20, 33, 61, .06);
  position: relative;
  z-index: 5;
}

.brand { display: flex; gap: 12px; align-items: center; min-width: 0; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, #1f6feb, #6941c6);
  font-weight: 800;
  font-size: 22px;
  box-shadow: 0 7px 18px rgba(31, 111, 235, .25);
}
.brand h1 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.brand p { margin: 3px 0 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-actions { display: flex; align-items: center; gap: 10px; }

.badge {
  font-size: 12px;
  color: var(--success);
  background: #edf8ef;
  border: 1px solid #cfe9d3;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 700;
}

.workspace {
  height: calc(100vh - 72px);
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(300px, var(--editor-width)) 28px minmax(420px, 1fr);
  gap: 0;
}

.panel {
  min-width: 0;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.editor-panel { border-radius: var(--radius) 4px 4px var(--radius); display: flex; flex-direction: column; }
.preview-panel { border-radius: 4px var(--radius) var(--radius) 4px; display: flex; flex-direction: column; }

.divider {
  cursor: col-resize;
  position: relative;
  z-index: 12;
  display: grid;
  place-items: center;
  touch-action: none;
  outline: none;
}
.divider::before {
  content: "";
  position: absolute;
  inset: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, transparent, var(--border-strong) 9%, var(--border-strong) 91%, transparent);
  opacity: .85;
  transition: background .15s ease, opacity .15s ease, box-shadow .15s ease;
}
.divider-handle {
  position: relative;
  z-index: 1;
  width: 28px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 5px 16px rgba(20, 33, 61, .16);
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
  user-select: none;
  transition: transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.divider:hover::before,
.divider.dragging::before,
.divider:focus-visible::before { opacity: 1; background: linear-gradient(180deg, transparent, var(--primary) 9%, var(--primary) 91%, transparent); }
.divider:hover .divider-handle,
.divider.dragging .divider-handle,
.divider:focus-visible .divider-handle {
  border-color: var(--primary);
  background: var(--surface-2);
  box-shadow: 0 6px 20px rgba(31, 111, 235, .24);
  transform: scale(1.04);
}

.panel-toolbar {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  flex-wrap: wrap;
}
.preview-toolbar { justify-content: space-between; }
.toolbar-group { display: flex; align-items: center; gap: 7px; min-width: 0; }
.toolbar-group.grow { flex: 1; }
.export-group { margin-left: auto; }

.button, .icon-button, .select {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: 7px;
  min-height: 34px;
  padding: 0 11px;
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.button:hover, .icon-button:hover, .select:hover { border-color: #8795aa; background: #fbfcfe; }
.button:active, .icon-button:active { transform: translateY(1px); }
.button.primary { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 700; }
.button.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.button.ghost { background: transparent; }
.icon-button { width: 34px; padding: 0; font-size: 20px; line-height: 1; display: grid; place-items: center; }
.select { max-width: 190px; padding-right: 28px; }
.select.compact { max-width: 110px; }
.field-label { font-size: 12px; color: var(--muted); }

.editor-meta, .editor-footer {
  height: 34px;
  flex: 0 0 auto;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  background: #fbfcfe;
}
.editor-meta { border-bottom: 1px solid var(--border); }
.editor-footer { border-top: 1px solid var(--border); }
.switch-label { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.shortcut { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.editor-wrap { flex: 1; min-height: 0; position: relative; background: #101827; }
#sourceEditor {
  width: 100%;
  height: 100%;
  display: block;
  resize: none;
  border: 0;
  outline: none;
  padding: 16px 18px 80px;
  background: #101827;
  color: #e6edf7;
  caret-color: #7eb6ff;
  font: 13px/1.58 "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
}
#sourceEditor::selection { background: rgba(80, 145, 255, .35); }

.status-bar {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  background: #fbfcfe;
  color: var(--muted);
  font-size: 12px;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #8c98aa; }
.status-dot.ok { background: var(--success); }
.status-dot.busy { background: #e69b00; box-shadow: 0 0 0 4px rgba(230,155,0,.12); }
.status-dot.error { background: var(--danger); }
.render-time { margin-left: auto; }
.zoom-label { min-width: 48px; text-align: center; font-size: 12px; color: var(--muted); }

.error-box {
  max-height: 180px;
  overflow: auto;
  background: #fff4f4;
  color: #8b1e1e;
  border-bottom: 1px solid #f1b7b7;
  padding: 10px 14px;
  font-size: 12px;
}
.error-box pre { margin: 7px 0 0; white-space: pre-wrap; font: 12px/1.45 "SFMono-Regular", Consolas, monospace; }

.preview-viewport {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: #f9fbfd;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.preview-viewport.dragging { cursor: grabbing; }
.preview-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .52;
  background-image:
    linear-gradient(to right, rgba(73,91,120,.09) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(73,91,120,.09) 1px, transparent 1px),
    linear-gradient(to right, rgba(73,91,120,.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(73,91,120,.05) 1px, transparent 1px);
  background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
}
.diagram-canvas {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
}
.diagram-host {
  display: inline-block;
  min-width: 1px;
  min-height: 1px;
  padding: 0;
  background: transparent;
}
.diagram-host svg { display: block; max-width: none !important; }
.viewport-hint {
  position: absolute;
  right: 12px;
  bottom: 10px;
  padding: 5px 8px;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(185,196,210,.8);
  backdrop-filter: blur(5px);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  pointer-events: none;
}

.help-dialog {
  width: min(620px, calc(100vw - 32px));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(20,33,61,.28);
}
.help-dialog::backdrop { background: rgba(12,20,36,.55); backdrop-filter: blur(2px); }
.dialog-header, .dialog-footer { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; }
.dialog-header { border-bottom: 1px solid var(--border); }
.dialog-footer { border-top: 1px solid var(--border); justify-content: flex-end; }
.dialog-header h2 { margin: 0; font-size: 18px; }
.dialog-body { padding: 6px 18px 16px; line-height: 1.55; font-size: 14px; }
.dialog-body h3 { margin: 15px 0 4px; font-size: 14px; }
.dialog-body p { margin: 0; color: #46536a; }
.dialog-body code { background: #eef2f7; border-radius: 4px; padding: 1px 4px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  transform: translate(-50%, 14px);
  opacity: 0;
  pointer-events: none;
  background: #172033;
  color: #fff;
  padding: 9px 13px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
  transition: opacity .18s, transform .18s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  body { overflow: auto; }
  .app-header { position: sticky; top: 0; }
  .brand p, .badge { display: none; }
  .workspace {
    height: auto;
    min-height: calc(100vh - 72px);
    grid-template-columns: 1fr;
    grid-template-rows: minmax(500px, 55vh) minmax(500px, 70vh);
    gap: 12px;
  }
  .divider { display: none; }
  .editor-panel, .preview-panel { border-radius: var(--radius); }
  .shortcut { display: none; }
  .preview-toolbar { justify-content: flex-start; }
  .export-group { margin-left: 0; }
}


/* Tema scuro gestito esclusivamente da smart-tools-theme-dark.css tramite data-ui-theme="dark". */



/* Font Awesome SVG sprite */
.fa-icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.125em;
  fill: currentColor;
  flex: 0 0 auto;
}
.brand-mark .fa-icon { width: 22px; height: 22px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.icon-button { display: inline-grid; place-items: center; padding: 0; min-width: 34px; }
.icon-button .fa-icon { width: 15px; height: 15px; }

.dialog-subtitle { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.dialog-body pre {
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 12px;
}

.icons-dialog { width: min(920px, calc(100vw - 32px)); }
.icons-dialog form { height: min(760px, calc(100vh - 40px)); display: flex; flex-direction: column; }
.icon-search-row { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.icon-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
}
.icon-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31,111,235,.12); }
.icon-search input { flex: 1; min-width: 0; border: 0; outline: 0; color: var(--text); background: transparent; font: inherit; }
.icon-result-info { padding: 8px 16px; color: var(--muted); font-size: 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.icon-grid {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  align-content: start;
  gap: 8px;
}
.icon-tile {
  min-width: 0;
  min-height: 78px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.icon-tile:hover,
.icon-tile:focus-visible {
  border-color: var(--primary);
  background: var(--surface-2);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(31,111,235,.10);
  outline: none;
}
.icon-tile:hover .fa-icon,
.icon-tile:hover span,
.icon-tile:focus-visible .fa-icon,
.icon-tile:focus-visible span { color: currentColor; }
.icon-tile .fa-icon { width: 24px; height: 24px; }
.icon-tile span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.icon-tile small { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.icon-footer { justify-content: space-between; font-size: 12px; color: var(--muted); }

@media (max-width: 820px) {
  .brand p { display: none; }
  .button span { display: none; }
  .button { min-width: 34px; padding: 0 9px; }
  .icon-search-row { flex-direction: column; }
}


/* V3: compatibilità, nitidezza e catalogo esempi */
.badge.neutral { color: var(--muted); background: var(--surface-2); border-color: var(--border); }
.examples-select { max-width: 230px; min-width: 190px; }
.error-hint { margin: 8px 0 0; color: #8b1e1e; line-height: 1.45; }
.preview-toolbar .toolbar-group { flex-wrap: wrap; }
.diagram-canvas { transform-origin: 0 0; }
.diagram-host svg { shape-rendering: geometricPrecision; text-rendering: geometricPrecision; }
#pngScaleSelect { min-width: 58px; max-width: 68px; }
#securitySelect { min-width: 76px; }
#lookSelect { min-width: 92px; }
@media (max-width: 1180px) {
  .preview-toolbar { align-items: flex-start; }
  .export-group { width: 100%; margin-left: 0; }
}

/* Tema scuro gestito esclusivamente da smart-tools-theme-dark.css tramite data-ui-theme="dark". */


/* Disposizione ordinata degli strumenti dell'editor */
.editor-panel > .panel-toolbar .toolbar-group.grow {
  order: 3;
  flex: 1 0 100%;
}
.editor-panel > .panel-toolbar #copyCodeBtn {
  margin-left: auto;
}
.editor-panel > .panel-toolbar {
  align-content: center;
}

/* Diagram Lab v2026.07.012 — editor colorato e footer prodotto */
:root { --app-footer-height: 36px; }

.workspace {
  height: calc(100vh - 72px - var(--app-footer-height));
}

.app-footer {
  height: var(--app-footer-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 11.5px;
  position: relative;
  z-index: 5;
}
.footer-product, .footer-version {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.footer-product strong { color: var(--text); font-size: 12px; }
.footer-product span { overflow: hidden; text-overflow: ellipsis; }
.footer-version { justify-content: flex-end; }
.footer-separator { opacity: .55; }
.footer-version a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 650;
}
.footer-version a:hover { text-decoration: underline; }
.footer-version a:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 3px; }

.editor-footer-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.syntax-status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.syntax-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7ee787 0 33%, #82d2ff 33% 66%, #c99bff 66%);
  box-shadow: 0 0 0 2px rgba(130,210,255,.12);
}

/* Evidenziazione Mermaid a sovrapposizione: il textarea resta l'editor reale. */
.editor-wrap {
  isolation: isolate;
  overflow: hidden;
}
.syntax-highlight,
#sourceEditor {
  margin: 0;
  padding: 16px 18px 80px;
  font: 13px/1.58 "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-variant-ligatures: none;
  letter-spacing: 0;
  tab-size: 2;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
}
.syntax-highlight {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: max-content;
  min-width: 100%;
  min-height: 100%;
  border: 0;
  pointer-events: none;
  overflow: visible;
  background: #101827;
  color: #e6edf7;
  transform: translate(0, 0);
  will-change: transform;
}
.syntax-highlight code { font: inherit; color: inherit; }
#sourceEditor {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  color: transparent;
  -webkit-text-fill-color: transparent;
  caret-color: #8bc1ff;
  overflow: auto;
}
#sourceEditor::selection { background: rgba(80,145,255,.38); }
#sourceEditor::-moz-selection { background: rgba(80,145,255,.38); }
.editor-wrap.highlight-fallback .syntax-highlight { display: none; }
.editor-wrap.highlight-fallback #sourceEditor {
  background: #101827;
  color: #e6edf7;
  -webkit-text-fill-color: #e6edf7;
}

/* Tavolozza della sintassi; solo colore, senza grassetto, per mantenere il cursore allineato. */
.tok-type { color: #82d2ff; }
.tok-keyword { color: #c99bff; }
.tok-direction { color: #7ee787; }
.tok-string { color: #f2cc60; }
.tok-number { color: #ffa657; }
.tok-operator { color: #ff7b72; }
.tok-comment { color: #8b98a5; }
.tok-yaml-key { color: #79c0ff; }
.tok-literal { color: #56d4dd; }
.tok-id { color: #d2a8ff; }
.tok-punctuation { color: #a5d6ff; }
.tok-directive { color: #ff9bce; }

@media (max-width: 900px) {
  .workspace { min-height: calc(100vh - 72px - var(--app-footer-height)); }
  .app-footer { position: static; }
  .syntax-status { display: none; }
}

@media (max-width: 680px) {
  :root { --app-footer-height: 42px; }
  .app-footer { padding: 0 10px; font-size: 10.5px; }
  .footer-product span { display: none; }
  .footer-version { gap: 5px; }
}

@media (forced-colors: active) {
  .syntax-highlight { display: none; }
  #sourceEditor {
    background: Canvas;
    color: CanvasText;
    -webkit-text-fill-color: CanvasText;
    caret-color: CanvasText;
  }
}

/* Diagram Lab — selettore icone avanzato e pulizia area */
.button.danger-soft {
  color: #a52626;
  border-color: #e6bcbc;
  background: #fff7f7;
}
.button.danger-soft:hover {
  color: #8c1d1d;
  border-color: #d98f8f;
  background: #ffeded;
}
.button:disabled,
.icon-button:disabled,
.mini-button:disabled {
  cursor: not-allowed;
  opacity: .5;
  transform: none;
}

.icons-dialog {
  width: min(1120px, calc(100vw - 28px));
}
.icons-dialog form {
  height: min(820px, calc(100vh - 28px));
  min-height: 520px;
}
.icon-dialog-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(420px, 1.45fr) minmax(310px, .9fr);
  overflow: hidden;
}
.icon-browser {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
}
.icon-config {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 14px;
  background: var(--surface-2);
}
.icon-grid {
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
}
.icon-tile.selected {
  border-color: var(--primary);
  background: #eef5ff;
  box-shadow: 0 0 0 2px rgba(31,111,235,.16), 0 5px 15px rgba(31,111,235,.12);
}
.selected-icon-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  margin-bottom: 13px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.selected-icon-card.empty { color: var(--muted); }
.selected-icon-preview {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--primary);
}
.selected-icon-preview .fa-icon { width: 25px; height: 25px; }
.selected-icon-card strong,
.selected-icon-card code { display: block; }
.selected-icon-card code {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}
.config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
#iconFlowFields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.config-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 11px;
  min-width: 0;
}
.config-field > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.config-field small { font-weight: 400; }
.config-field input,
.config-field .select {
  width: 100%;
  max-width: none;
  min-height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  padding: 0 10px;
  color: var(--text);
  background: var(--surface);
  outline: none;
}
.config-field input:focus,
.config-field .select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31,111,235,.12);
}
.icon-compatibility {
  margin: 2px 0 11px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
}
.icon-compatibility.ok {
  border-color: #badfc3;
  background: #f1fbf3;
  color: #276937;
}
.icon-compatibility.warning {
  border-color: #ead49b;
  background: #fff9e9;
  color: #815d00;
}
.snippet-preview {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #101827;
}
.snippet-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding: 0 9px 0 11px;
  border-bottom: 1px solid #273449;
  color: #aebbd0;
  font-size: 11px;
}
.snippet-preview pre {
  min-height: 76px;
  max-height: 160px;
  margin: 0;
  overflow: auto;
  padding: 11px;
  color: #e6edf7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 12px/1.5 "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}
.mini-button {
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid #41506a;
  border-radius: 6px;
  background: #182236;
  color: #d8e2f1;
  cursor: pointer;
  font-size: 10px;
}
.mini-button:hover { background: #22304a; }
.dialog-actions { display: flex; align-items: center; gap: 8px; }

@media (max-width: 880px) {
  .icon-dialog-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(270px, 1fr) minmax(320px, 1fr);
    overflow: auto;
  }
  .icon-browser {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .icon-config { overflow: visible; }
}

@media (max-width: 560px) {
  .config-grid,
  #iconFlowFields { grid-template-columns: 1fr; }
  .icon-footer > span { display: none; }
}


/* Tema scuro gestito esclusivamente da smart-tools-theme-dark.css tramite data-ui-theme="dark". */


.icon-config [hidden] { display: none !important; }

/* Diagram Lab — inserimento icone contestuale e verificato */
.icon-context {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: #f5f8fc;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.icon-context strong { color: var(--text); }
.icon-context .context-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: 600 11px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
}

#iconFlowFields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.icon-section {
  margin: 1px 0 11px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
}
.icon-section-title {
  margin-bottom: 9px;
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
}
.icon-section-title small { color: var(--muted); font-weight: 500; }
.config-field-wide { grid-column: 1 / -1; }
.icon-layout-note {
  margin: 0 0 11px;
  padding: 8px 10px;
  border-left: 3px solid #93a4ba;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.icon-validation {
  margin: 0 0 11px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.42;
}
.icon-validation.checking {
  border-color: #c8d6ea;
  background: #f5f9ff;
  color: #315d91;
}
.icon-validation.ok {
  border-color: #badfc3;
  background: #f1fbf3;
  color: #276937;
}
.icon-validation.error {
  border-color: #e7b5b5;
  background: #fff3f3;
  color: #8f2929;
}
.icon-validation strong { display: block; margin-bottom: 2px; }
.icon-config select option:disabled { color: #9aa5b4; }


/* Tema scuro gestito esclusivamente da smart-tools-theme-dark.css tramite data-ui-theme="dark". */


@media (max-width: 560px) {
  .icon-context { align-items: flex-start; flex-direction: column; }
}

/* Diagram Lab — gestione e modifica icone */
.icon-operation-bar {
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.icon-operation-bar .compact-field {
  flex: 0 0 min(360px, 48%);
  margin: 0;
}
.icon-operation-hint {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.35;
}
.icon-operation-hint.detected {
  border-color: #c8d6ea;
  background: #f5f9ff;
  color: #315d91;
}
.icon-operation-hint.editing {
  border-color: #badfc3;
  background: #f1fbf3;
  color: #276937;
}
.selected-icon-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}
.icon-tile.mermaid-icon {
  border-style: dashed;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
}
.icon-tile.mermaid-icon small {
  color: #6941c6;
  text-transform: none;
}
.icon-locked-note {
  margin: -3px 0 11px;
  padding: 7px 9px;
  border-left: 3px solid #6f86a6;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}
#iconLibraryFilter { max-width: 180px; }


/* Tema scuro gestito esclusivamente da smart-tools-theme-dark.css tramite data-ui-theme="dark". */


@media (max-width: 720px) {
  .icon-operation-bar { align-items: stretch; flex-direction: column; }
  .icon-operation-bar .compact-field { flex-basis: auto; width: 100%; }
}
.icon-tile.incompatible {
  opacity: .42;
  filter: grayscale(.55);
  cursor: not-allowed;
}
.icon-tile.incompatible:hover {
  border-color: var(--border);
  background: var(--surface);
  box-shadow: none;
}

/* Diagram Lab v2026.07.012 — catalogo esempi con anteprima */
.examples-dialog {
  width: min(1180px, calc(100vw - 28px));
}
.examples-dialog form {
  height: min(820px, calc(100vh - 28px));
  min-height: 560px;
  display: flex;
  flex-direction: column;
}
.examples-header { flex: 0 0 auto; }
.examples-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.examples-search { flex: 1; min-width: 220px; }
.examples-toolbar .select { max-width: 220px; min-width: 170px; }
.examples-result-info {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.examples-dialog-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(310px, .86fr) minmax(420px, 1.45fr);
  overflow: hidden;
}
.examples-list-panel {
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--border);
  background: var(--surface-2);
}
.examples-list {
  height: 100%;
  overflow: auto;
  padding: 12px;
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 8px;
}
.example-card {
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: auto;
  overflow: visible;
  padding: 10px 11px 11px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: max-content;
  align-content: start;
  gap: 4px;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.example-card:hover {
  border-color: var(--primary);
  background: #f4f8ff;
  box-shadow: 0 4px 12px rgba(31,111,235,.09);
}
.example-card.selected {
  border-color: var(--primary);
  background: #eef5ff;
  box-shadow: 0 0 0 2px rgba(31,111,235,.14);
}
.example-card-category {
  align-self: flex-start;
  justify-self: start;
  width: max-content;
  max-width: 100%;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.example-card strong {
  min-width: 0;
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.example-card p {
  margin: 0;
  color: var(--muted);
  min-width: 0;
  font-size: 11.5px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.example-card small {
  min-width: 0;
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font: 10.5px/1.3 "SFMono-Regular", Consolas, monospace;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.examples-empty {
  padding: 16px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface);
  text-align: center;
}
.examples-preview-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}
.examples-preview-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 66px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.examples-preview-head strong { display: block; font-size: 15px; }
.examples-preview-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.examples-preview-head code {
  flex: 0 0 auto;
  max-width: 38%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 11px;
}
.examples-preview-status {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 7px 14px;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 11.5px;
}
.examples-preview-box {
  flex: 1 1 auto;
  min-height: 230px;
  position: relative;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 14px;
  background: #f9fbfd;
}
.examples-preview-host {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 210px;
}
.examples-preview-host svg {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
}
.examples-preview-error {
  max-width: 100%;
  overflow: auto;
  padding: 12px;
  border: 1px solid #e7b5b5;
  border-radius: 8px;
  color: #8f2929;
  background: #fff3f3;
  white-space: pre-wrap;
}
.examples-source-details {
  flex: 0 0 auto;
  max-height: 180px;
  overflow: auto;
  border-top: 1px solid var(--border);
  background: #101827;
  color: #e6edf7;
}
.examples-source-details summary {
  position: sticky;
  top: 0;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #273449;
  background: #151e2d;
  color: #cbd6e6;
  font-size: 12px;
}
.examples-source-details pre {
  margin: 0;
  padding: 12px;
  overflow: auto;
  white-space: pre;
  font: 11.5px/1.45 "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}
.examples-footer { justify-content: space-between; font-size: 12px; color: var(--muted); }

@media (max-width: 980px) {
  .examples-dialog form { min-height: 520px; }
  .examples-dialog-body { grid-template-columns: minmax(280px, .8fr) minmax(360px, 1.2fr); }
  .examples-toolbar { flex-wrap: wrap; }
  .examples-result-info { width: 100%; }
}

@media (max-width: 760px) {
  .examples-dialog-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(210px, .75fr) minmax(320px, 1.1fr);
    overflow: auto;
  }
  .examples-list-panel { border-right: 0; border-bottom: 1px solid var(--border); }
  .examples-toolbar .select { max-width: none; flex: 1; }
  .examples-footer { align-items: stretch; flex-direction: column; }
}


/* Tema scuro gestito esclusivamente da smart-tools-theme-dark.css tramite data-ui-theme="dark". */



/* Cavi continui tra subgraph: segmenti SVG aggiunti dopo il rendering Mermaid. */
.diagram-lab-continuous-edges .diagram-lab-edge-stitch {
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Diagram Lab v2026.07.015 — menu esportazione compatto */
.export-group { position: relative; }
.export-menu { position: relative; }
.export-menu-button { min-width: 108px; justify-content: center; }
.export-chevron {
  margin-left: 2px;
  color: var(--muted);
  font-size: 11px;
  transition: transform .15s ease;
}
.export-menu-button[aria-expanded="true"] .export-chevron { transform: rotate(180deg); }
.export-menu-panel {
  position: absolute;
  z-index: 60;
  top: calc(100% + 7px);
  right: 0;
  width: min(320px, calc(100vw - 28px));
  padding: 8px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: 0 18px 45px rgba(14, 25, 44, .24);
}
.export-menu-panel[hidden] { display: none; }
.export-menu-heading {
  padding: 5px 8px 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.export-menu-item {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.export-menu-item:hover,
.export-menu-item:focus-visible {
  border-color: var(--border);
  background: var(--surface-2);
  outline: none;
}
.export-menu-item > .fa-icon {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  color: var(--primary);
}
.export-menu-item > span { min-width: 0; }
.export-menu-item strong,
.export-menu-item small { display: block; }
.export-menu-item strong { font-size: 13px; }
.export-menu-item small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.3;
}
.export-menu-setting {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 1px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--surface-2);
}
.export-menu-setting label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.export-menu-setting #pngScaleSelect { min-width: 66px; max-width: 72px; }
.export-menu-separator {
  height: 1px;
  margin: 7px 4px;
  background: var(--border);
}

/* Tema scuro gestito esclusivamente da smart-tools-theme-dark.css tramite data-ui-theme="dark". */

@media (max-width: 900px) {
  .divider { display: none; }
  .export-menu-panel { right: auto; left: 0; }
}



/* ========================================================================== 
   Diagram Lab v2026.07.026 — densità e responsive avanzato
   ========================================================================== */

/* Catalogo icone più compatto: più elementi visibili senza sacrificare i nomi. */
.icons-dialog { width: min(1080px, calc(100vw - 24px)); }
.icon-search-row { padding: 9px 12px; gap: 8px; }
.icon-result-info { padding: 6px 12px; }
.icon-grid {
  padding: 8px;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 6px;
}
.icon-tile {
  min-height: 62px;
  padding: 7px 6px;
  gap: 4px;
  border-radius: 10px;
}
.icon-tile .fa-icon { width: 20px; height: 20px; }
.icon-tile span { font-size: 10px; line-height: 1.15; }
.icon-tile small { font-size: 8px; line-height: 1; }

/* Migliore elasticità dei gruppi senza introdurre scroll orizzontale. */
.panel-toolbar,
.preview-toolbar,
.toolbar-group { min-width: 0; }
.preview-toolbar .toolbar-group { flex-wrap: wrap; }
.preview-toolbar > .toolbar-group:first-child { flex: 1 1 720px; }
.preview-toolbar > .toolbar-group:nth-child(2) { flex: 0 1 auto; }
.preview-toolbar .export-group { flex: 0 0 auto; }

@media (max-width: 1280px) {
  .examples-dialog { width: min(1040px, calc(100vw - 20px)); }
  .icons-dialog form,
  .examples-dialog form { height: min(720px, calc(100dvh - 24px)); }
}

@media (max-width: 1120px) and (min-width: 901px) {
  .editor-panel > .panel-toolbar .button > span { display: none; }
  .editor-panel > .panel-toolbar .button {
    width: 32px;
    min-width: 32px;
    padding-inline: 0;
  }
  .editor-panel > .panel-toolbar #cleanBtn,
  .editor-panel > .panel-toolbar #copyCodeBtn { margin-left: 0; }
  .preview-toolbar .field-label { display: none; }
  .preview-toolbar .select.compact { max-width: 96px; }
}

@media (max-width: 900px) {
  .workspace {
    grid-template-rows: minmax(460px, 62dvh) minmax(500px, 74dvh);
  }
  .editor-panel > .panel-toolbar .toolbar-group.grow { order: 3; flex-basis: 100%; }
  .editor-panel > .panel-toolbar #copyCodeBtn { margin-left: auto; }
  .preview-toolbar > .toolbar-group { flex: 1 1 100%; }
  .preview-toolbar .export-group { flex: 0 0 auto; margin-left: auto; }
}

@media (max-width: 680px) {
  .panel-toolbar { padding: 6px; gap: 5px; }
  .toolbar-group { gap: 4px; }
  .editor-panel > .panel-toolbar .button > span,
  .preview-toolbar #fitBtn > span { display: none; }
  .editor-panel > .panel-toolbar .button,
  .preview-toolbar #fitBtn {
    width: 32px;
    min-width: 32px;
    padding-inline: 0;
  }
  .preview-toolbar .field-label { display: none; }
  .preview-toolbar .select.compact { max-width: 90px; min-width: 76px; }
  .zoom-label { min-width: 42px; }
  .workspace { grid-template-rows: minmax(430px, 68dvh) minmax(470px, 78dvh); }
  .icons-dialog { width: calc(100vw - 12px); }
  .icon-grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); padding: 6px; gap: 5px; }
  .icon-tile { min-height: 58px; padding: 6px 5px; }
  .icon-tile .fa-icon { width: 19px; height: 19px; }
}

@media (max-width: 460px) {
  .editor-footer .syntax-status,
  .editor-footer .shortcut { display: none; }
  .editor-footer-left { width: 100%; justify-content: space-between; }
  .preview-toolbar .select.compact { max-width: 84px; min-width: 70px; font-size: 11px; }
  .icon-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .icon-tile span { font-size: 9px; }
}

/* Link legali nella guida */
.legal-links {
  margin: .65rem 0 0;
  padding-left: 1.25rem;
  display: grid;
  gap: .45rem;
}
.legal-links a {
  color: var(--primary, #2563eb);
  font-weight: 650;
  text-underline-offset: 3px;
}
.legal-links a:hover,
.legal-links a:focus-visible {
  text-decoration-thickness: 2px;
}

/* Diagram Lab v2026.07.026 — catalogo esempi: contenuti sempre visibili. */
@media (max-height: 680px) and (min-width: 761px) {
  .examples-dialog form {
    min-height: 0;
    height: calc(100dvh - 20px);
  }
  .examples-preview-box { min-height: 180px; }
}

@media (max-width: 520px) {
  .examples-list { padding: 8px; gap: 6px; }
  .example-card { padding: 9px 10px 10px; }
  .example-card strong { font-size: 12.5px; }
  .example-card p { font-size: 11px; }
  .example-card small { font-size: 10px; }
}


/* Diagram Lab v2026.07.026 — importazione tramite trascinamento */
.editor-panel { position: relative; isolation: isolate; }
.drop-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  margin-inline: auto;
  padding: 3px 9px;
  border: 1px dashed var(--border-strong);
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}
.drop-hint .fa-icon { width: 12px; height: 12px; }
.file-drop-overlay {
  position: absolute;
  inset: 7px;
  z-index: 80;
  display: grid;
  place-items: center;
  border: 2px dashed transparent;
  border-radius: 14px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(.992);
  transition: opacity .14s ease, visibility .14s ease, transform .14s ease, border-color .14s ease;
}
.editor-panel.file-drag-active .file-drop-overlay {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}
.file-drop-card {
  display: grid;
  justify-items: center;
  gap: 7px;
  max-width: min(340px, calc(100% - 32px));
  padding: 24px 32px;
  border: 1px solid currentColor;
  border-radius: 18px;
  text-align: center;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .22);
}
.file-drop-card .fa-icon { width: 34px; height: 34px; }
.file-drop-card strong { font-size: 17px; line-height: 1.2; }
.file-drop-card span { font-size: 11px; font-weight: 700; }
@media (max-width: 900px) { .drop-hint { display: none; } }
@media (max-width: 520px) {
  .file-drop-overlay { inset: 5px; border-radius: 12px; }
  .file-drop-card { padding: 20px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .file-drop-overlay { transition: none; }
}

/* ===== Privacy, cookie banner e PWA install ===== */
.footer-link-button {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font: inherit;
  font-weight: 650;
}
.footer-link-button:hover { text-decoration: underline; }
.footer-link-button:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }

.consent-banner,
.install-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(var(--app-footer-height) + 12px);
  z-index: 30;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 92%, #ffffff 8%);
  box-shadow: 0 20px 50px rgba(20, 33, 61, .18);
}
.install-banner { bottom: calc(var(--app-footer-height) + 12px); }
.consent-banner h2,
.install-banner h2 { margin: 0 0 6px; font-size: 15px; }
.consent-banner p,
.install-banner p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.consent-banner-links,
.consent-banner-actions,
.install-banner-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.consent-banner-links a { color: var(--primary); font-weight: 650; text-decoration: none; }
.consent-banner-links a:hover { text-decoration: underline; }
.consent-banner-icon,
.install-banner-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #315ee6);
  box-shadow: 0 12px 26px rgba(37, 99, 235, .22);
  flex: 0 0 auto;
}
.consent-banner-icon .fa-icon,
.install-banner-icon .fa-icon { font-size: 24px; }
.consent-banner-content,
.install-banner-content { min-width: 0; }

.privacy-dialog { width: min(860px, calc(100vw - 28px)); }
.privacy-kicker {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  color: var(--primary);
}
.privacy-dialog-body { display: grid; gap: 14px; }
.privacy-pref-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-2);
}
.privacy-pref-card.disabled { opacity: .82; }
.privacy-pref-copy h3 { margin: 0 0 6px; font-size: 18px; display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.privacy-pref-copy p { margin: 0; }
.privacy-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, .08);
  border: 1px solid rgba(37, 99, 235, .18);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .05em;
  font-weight: 800;
}
.privacy-badge.muted { background: rgba(100, 116, 139, .10); border-color: rgba(100, 116, 139, .2); }
.privacy-links-inline { display:flex; flex-wrap:wrap; gap:16px; padding: 4px 2px 0; }
.privacy-links-inline a { color: var(--primary); font-weight: 700; }
.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.toggle-switch input { position:absolute; inset:0; opacity:0; pointer-events:none; }
.toggle-slider {
  width: 54px;
  height: 30px;
  border-radius: 999px;
  background: #cfd8e5;
  position: relative;
  display: inline-block;
}
.toggle-slider::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,.15);
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::after { left: 28px; }
.toggle-switch input:disabled + .toggle-slider { opacity: .72; }
.install-dialog { width: min(680px, calc(100vw - 24px)); }
.install-steps { margin: 0; padding-left: 18px; }
.install-steps li { margin: 0 0 10px; line-height: 1.55; }

@media (max-width: 980px) {
  .consent-banner,
  .install-banner {
    grid-template-columns: 1fr;
    padding: 14px 15px;
  }
  .consent-banner-icon,
  .install-banner-icon { width: 46px; height: 46px; border-radius: 14px; }
}

@media (max-width: 700px) {
  .consent-banner,
  .install-banner {
    left: 8px;
    right: 8px;
    bottom: calc(var(--app-footer-height) + 8px);
    gap: 12px;
  }
  .consent-banner-actions,
  .install-banner-actions { width: 100%; }
  .consent-banner-actions > *,
  .install-banner-actions > * { flex: 1 1 auto; }
  .privacy-pref-card { align-items: flex-start; }
}
