/* Materiais compartilhados entre o app e suas miniaturas. Sem imagens remotas. */
html, .theme-preview {
    --material: none;
    --material-size: auto;
    --panel-radius: 24px;
    --control-radius: 12px;
    --relief: none;
    --panel-blur: none;
}
html[data-theme="brisa"], .theme-preview-brisa {
    --bg:#eaf3f4; --surface:#f5fbfbed; --surface-solid:#f5fbfb; --surface-muted:#e8f1f2;
    --text:#203c43; --muted:#516d74; --accent:#237786; --accent-strong:#185d6b; --accent-soft:#dceef0;
    --border:#517d8529; --material:linear-gradient(145deg,#ffffffa6,transparent 65%);
    --shadow:inset 0 1px 0 #ffffffd9,0 14px 34px -16px #183f5266; --panel-blur:blur(12px);
}
html[data-theme="papel"], .theme-preview-papel {
    --bg:#eee7da; --surface:#faf5e9; --surface-solid:#faf5e9; --surface-muted:#eee6d7;
    --text:#3e3d32; --muted:#706b59; --accent:#63704d; --accent-strong:#465536; --accent-soft:#e5e8d6;
    --border:#84795c38;
    --material:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23746649' opacity='.075' filter='url(%23n)' d='M0 0h140v140H0z'/%3E%3C/svg%3E");
    --material-size:140px 140px; --shadow:0 2px 0 #b5aa8d55,0 14px 28px -18px #4d453f66;
}
html[data-theme="ceramica"], .theme-preview-ceramica {
    --bg:#e8ded9; --surface:#f2e9e4; --surface-solid:#f2e9e4; --surface-muted:#e9ded8;
    --text:#513c36; --muted:#7a6259; --accent:#a15842; --accent-strong:#85432f; --accent-soft:#edd8cb;
    --border:#a88b7738;
    --material:linear-gradient(145deg,#fff9f57a,transparent 75%);
    --shadow:inset 1px 2px 0 #fff9f5, inset -1px -2px 0 #b9a29745,0 15px 32px -18px #694c4370;
    --relief:inset 1px 1px 2px #fff9f5bb,2px 3px 5px #a68d7a26;
}
html[data-theme="aurora"], .theme-preview-aurora {
    --bg:#eeedf7; --surface:#faf8ff; --surface-solid:#faf8ff; --surface-muted:#ece8f6;
    --text:#38324e; --muted:#686080; --accent:#7856a3; --accent-strong:#63418e; --accent-soft:#eee2f5;
    --border:#9585b535;
    --material:radial-gradient(ellipse at 0 0,#dacafb80,transparent 60%),radial-gradient(ellipse at 100% 100%,#bfeae45c,transparent 55%);
    --shadow:inset 0 1px 0 #ffffff,0 14px 35px -17px #5e4b8d66;
}
html[data-theme="grafite"], .theme-preview-grafite {
    --bg:#e7eaee; --surface:#f7f8fa; --surface-solid:#f7f8fa; --surface-muted:#e9ecf0;
    --text:#242e3c; --muted:#556171; --accent:#42688e; --accent-strong:#2f5277; --accent-soft:#dfe9f3;
    --border:#43597540;
    --material:linear-gradient(180deg,#ffffff80,transparent 90px);
    --shadow:0 2px 4px #2738490f,0 16px 30px -22px #17253699;
}
html[data-mode="dark"] {
    --text:#edf1f5; --muted:#b1bdc8; --border:#bac9dc29;
    --accent-soft:color-mix(in srgb,var(--accent) 20%,var(--surface-solid));
}
html[data-mode="dark"][data-theme="brisa"] { --bg:#101d25; --surface:#1b303aee; --surface-solid:#1b303a; --surface-muted:#243e49; --accent:#59b1bd; --accent-strong:#296f7c; --material:linear-gradient(145deg,#b0e2ed14,transparent 65%); }
html[data-mode="dark"][data-theme="papel"] { --bg:#24271f; --surface:#30342a; --surface-solid:#30342a; --surface-muted:#3c4033; --accent:#aaba8b; --accent-strong:#52633c; }
html[data-mode="dark"][data-theme="ceramica"] { --bg:#28201e; --surface:#3a2e29; --surface-solid:#3a2e29; --surface-muted:#48372f; --accent:#d69579; --accent-strong:#98543c; --material:linear-gradient(145deg,#e8b89d12,transparent 75%); --relief:inset 1px 1px 0 #ffffff14,2px 3px 5px #00000020; }
html[data-mode="dark"][data-theme="aurora"] { --bg:#1b1928; --surface:#28243b; --surface-solid:#28243b; --surface-muted:#36304c; --accent:#b79ade; --accent-strong:#76519e; --material:radial-gradient(ellipse at 0 0,#7557a538,transparent 65%),radial-gradient(ellipse at 100% 100%,#367f7926,transparent 60%); }
html[data-mode="dark"][data-theme="grafite"] { --bg:#14191e; --surface:#252c34; --surface-solid:#252c34; --surface-muted:#333e49; --accent:#8cafd2; --accent-strong:#41688d; --material:linear-gradient(180deg,#d7e7ff0b,transparent 90px); }
html[data-mode="dark"] { --shadow:inset 0 1px 0 #ffffff12,0 16px 32px -14px #00000088; }
html[data-mode="dark"] { --danger:#f49c95; }
html[data-mode="dark"] .button-primary,html[data-mode="dark"] .nav-add { background:var(--accent-strong); color:white; }
/* Superfícies decoradas; campos e texto mantêm bases opacas e legíveis. */
.sheet,.dialog,.bottom-nav,.image-viewer-card {
    background-color:var(--surface);
    background-image:var(--material);
    background-size:var(--material-size);
    border-radius:var(--panel-radius);
    box-shadow:var(--shadow);
    backdrop-filter:var(--panel-blur);
}
.icon-button,.button,.sheet-search-field,.nav-item,.weekday-button,.type-switch {
    border-radius:var(--control-radius);
}
.button-soft,.sheet-search-field,.weekday-button,.icon-button:not(.dialog-close) { box-shadow:var(--relief); }
html[data-mode="dark"] :is(.nav-item.is-active,.type-option.is-active,.weekday-button.is-active,.filter-chip.is-active,.row-action.is-active,.contact-type-icon,.contact-days-tag,output) { color:var(--accent); }
html[data-mode="dark"] .theme-swatch.is-active { color:var(--text); }
.compact-settings-section .settings-inline-heading { flex-direction:row; align-items:center; }
.theme-options { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:5px; padding:3px 0; }
.theme-swatch { padding:4px; gap:5px; border-radius:12px; position:relative; }
.theme-swatch small { font-size:10px; font-weight:600; }
.theme-swatch.is-active { border-color:var(--accent); background:var(--accent-soft); }
.theme-preview { height:70px; border-radius:8px; background-color:var(--bg); background-image:var(--material); background-size:var(--material-size); border:1px solid var(--border); box-shadow:none; }
.theme-preview::before { inset:9px 7px 22px; height:auto; border-radius:calc(var(--panel-radius) / 3); background:var(--surface); background-image:var(--material); background-size:var(--material-size); box-shadow:var(--shadow); border:1px solid var(--border); }
.theme-preview::after { left:7px; right:7px; bottom:6px; width:auto; height:10px; border-radius:4px; background:var(--surface-solid); box-shadow:0 1px 3px #0000001a; }
.theme-preview i,.theme-preview b,.theme-preview em { position:absolute; display:block; z-index:1; font-style:normal; }
.theme-preview i { left:12px; top:16px; width:45%; height:4px; background:var(--accent); border-radius:2px; }
.theme-preview b { left:12px; right:13px; top:26px; height:3px; background:var(--border); box-shadow:0 7px 0 var(--border); border-radius:2px; }
.theme-preview em { width:8px; height:8px; left:calc(50% - 4px); bottom:7px; border-radius:3px; background:var(--accent-strong); }
.theme-preview-ceramica::before { box-shadow:inset 1px 1px 1px #ffffff,3px 4px 5px #ab8a7940; }
.theme-preview-grafite::before { border-color:var(--accent); }
@media(max-width:380px) { .theme-preview { height:62px; } .theme-swatch { padding:3px; } .theme-swatch small { font-size:9px; } }
@media(prefers-reduced-transparency:reduce) { .sheet,.dialog,.bottom-nav { background-color:var(--surface-solid); backdrop-filter:none; } }
