:root {
    --ink: #18231f;
    --muted: #69766f;
    --canvas: #f3f6f2;
    --panel: #ffffff;
    --line: #dfe7e1;
    --green-950: #0e2f25;
    --green-800: #194b3a;
    --green-700: #27684f;
    --green-500: #45a778;
    --mint: #dff2e8;
    --amber: #e8b04d;
    --danger: #b94242;
    --shadow: 0 18px 50px rgba(28, 56, 45, .08);
    --radius: 20px;
}

* { box-sizing: border-box; }
html { max-width: 100%; overflow-x: clip; color-scheme: light; }
body { max-width: 100%; margin: 0; overflow-x: clip; background: var(--canvas); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; width: 270px; flex-direction: column; padding: 28px 20px; color: #fff; background: linear-gradient(165deg, #0b2a21, #164c39 70%, #1c6549); }
.brand { display: flex; gap: 13px; align-items: center; color: #fff; text-decoration: none; padding: 0 8px 28px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 21px; letter-spacing: -.5px; }
.brand small { margin-top: 2px; color: #a9cabc; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.brand-mark { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 13px; color: var(--green-950); background: #8fe0b5; font-weight: 900; font-size: 21px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
.brand-mark-large { width: 58px; height: 58px; border-radius: 18px; font-size: 30px; }
.nav { display: grid; gap: 8px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-radius: 12px; color: #c9ddd4; text-decoration: none; font-weight: 650; }
.nav a:hover, .nav a.active { color: #fff; background: rgba(255,255,255,.1); }
.nav a.active { box-shadow: inset 3px 0 #8fe0b5; }
.nav a span { width: 22px; text-align: center; font-size: 19px; }
.sidebar-footer { display: grid; gap: 17px; margin-top: auto; }
.sidebar-backdrop { display: none; }
.client-brand { align-items: center; padding: 2px 8px 26px; }
.client-brand-mark { display: grid; width: 48px; height: 48px; flex: 0 0 48px; place-items: center; border: 1px solid color-mix(in srgb,var(--admin-accent,#35a475),#fff 18%); border-radius: 15px; color: var(--admin-accent-text,#07130d); background: var(--admin-accent,#35a475); font-size: 22px; font-weight: 900; }
.client-brand-with-logo { align-items: stretch; flex-direction: column; gap: 11px; padding-inline: 0; }
.client-brand-logo { display: grid; width: 100%; min-height: 118px; place-items: center; padding: 12px 16px; border: 1px solid #39433d; border-radius: 15px; }
.client-logo-bg-auto { background: color-mix(in srgb,#f5f7f6,transparent 8%); }
.client-logo-bg-transparent { border-color: transparent; background: transparent; }
.client-logo-bg-light { background: #f5f7f6; }
.client-logo-bg-dark { background: #111512; }
.client-brand-logo img { display: block; width: auto; height: auto; max-width: 100%; max-height: 92px; object-fit: contain; }
.client-brand-copy { min-width: 0; padding-inline: 5px; }
.client-brand-with-logo .client-brand-copy { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.client-brand-with-logo .client-brand-copy small { margin: 0; }
.client-brand-with-logo .client-brand-copy strong { font-size: 13px; text-align: right; }
.client-brand strong { overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.user-chip { display: flex; gap: 10px; align-items: center; min-width: 0; }
.user-chip strong, .user-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip small { color: #a9cabc; font-size: 11px; }
.avatar { display: grid; flex: 0 0 38px; height: 38px; place-items: center; border-radius: 50%; color: var(--green-950); background: #fff; font-weight: 800; }

.app-shell { min-height: 100vh; margin-left: 270px; }
.topbar { display: flex; min-height: 108px; align-items: center; gap: 16px; padding: 24px clamp(24px, 4vw, 60px); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.82); backdrop-filter: blur(16px); }
.topbar h1 { margin: 3px 0 0; font-size: clamp(25px, 3vw, 34px); letter-spacing: -.04em; }
.menu-toggle { display: none; border: 0; background: none; font-size: 26px; }
.main { padding: 34px clamp(24px, 4vw, 60px) 70px; }
.eyebrow { color: var(--green-700); font-size: 11px; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
.muted { color: var(--muted); font-size: 13px; }

.hero-panel { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 38px 42px; border-radius: 28px; color: #fff; background: radial-gradient(circle at 90% 20%, rgba(133,225,178,.25), transparent 27%), linear-gradient(135deg, #0f352a, #237052); box-shadow: var(--shadow); }
.hero-panel .eyebrow { color: #9ce2bd; }
.hero-panel h2 { max-width: 720px; margin: 8px 0; font-size: clamp(28px, 4vw, 46px); letter-spacing: -.05em; }
.hero-panel p { margin: 0; color: #cfe4da; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 22px 0; }
.stats-grid article { display: flex; align-items: baseline; gap: 8px; }
.stat-card { padding: 24px 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: 0 8px 24px rgba(28,56,45,.04); }
.stat-card span, .stat-card small { display: block; color: var(--muted); }
.stat-card strong { display: block; margin: 10px 0 3px; font-size: 38px; letter-spacing: -.05em; }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: 0 10px 34px rgba(28,56,45,.05); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.panel-heading h2 { margin: 5px 0 0; font-size: 22px; letter-spacing: -.03em; }
.panel-heading code { color: var(--muted); }
.panel:not(.table-panel) { padding: 28px; }
.site-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.site-card { min-width: 0; padding: 21px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(155deg, #fff, #f7faf7); }
.site-card-top, .site-meta, .card-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.site-initial { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; color: var(--green-800); background: var(--mint); font-weight: 850; }
.status-dot { color: var(--green-700); font-size: 12px; font-weight: 750; }
.status-dot::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--green-500); }
.site-card h3 { min-height: 48px; margin: 18px 0 5px; font-size: 18px; }
.site-card-title { display: flex; align-items: baseline; gap: 8px; }
.site-card p { overflow: hidden; margin: 0 0 17px; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.site-meta { color: var(--muted); font-size: 12px; }
.site-meta code { color: var(--green-700); }
.card-actions { margin: 18px -21px -21px; padding: 13px 21px; border-top: 1px solid var(--line); }
.card-actions a, .row-actions a { color: var(--green-700); font-size: 11px; font-weight: 700; letter-spacing: .055em; text-decoration: none; text-transform: uppercase; }

.template-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.template-card { display: flex; min-width: 0; overflow: hidden; flex-direction: column; border: 1px solid var(--line); border-radius: 19px; background: var(--panel); box-shadow: var(--shadow); }
.template-card.inactive { opacity: .62; }
.template-visual { position: relative; height: 210px; overflow: hidden; color: #fff; background: #e7ece8; }
.template-visual span { position: absolute; inset: 0 0 auto; height: 30px; background: #f8faf8; border-bottom: 1px solid rgba(0,0,0,.12); }
.template-visual i { position: absolute; left: 8%; top: 57px; width: 48%; height: 92px; border-radius: 10px; background: linear-gradient(135deg,#163d30,#47ae7c); }
.template-visual b { position: absolute; right: 7%; top: 49px; width: 32%; height: 125px; border-radius: 48% 48% 12px 12px; background: #90dcb4; }
.template-visual em { position: absolute; left: 10%; bottom: 20px; color: rgba(10,31,23,.32); font-size: 46px; font-style: normal; font-weight: 950; }
.template-visual.theme-editorial { background: #eee7da; }
.template-visual.theme-editorial i { border-radius: 0; background: linear-gradient(135deg,#baa17d,#5b4c3d); }
.template-visual.theme-editorial b { border-radius: 0; background: #26211d; }
.template-visual.theme-studio { background: #111713; }
.template-visual.theme-studio span { background: #202a24; border-color: #39473f; }
.template-visual.theme-studio i { border-radius: 2px; background: #d5ff43; }
.template-visual.theme-studio b { border-radius: 2px; background: linear-gradient(145deg,#29332d,#dd4638); }
.template-visual.layout-portfolio i { inset: 30px 0 0; width: 100%; height: auto; border-radius: 0; background: linear-gradient(135deg,#171a18,#9b6e4b); }
.template-visual.layout-portfolio b { right: auto; left: 8%; top: 100px; width: 45%; height: 60px; border-radius: 2px; background: rgba(4,8,6,.72); }
.template-visual.layout-performance { background: linear-gradient(118deg,#111 0 58%,#e33b2f 58% 62%,#080909 62%); }
.template-visual.layout-performance i { transform: skewX(-5deg); border: 2px solid #e33b2f; background: #2c3230; }
.template-visual.layout-industrial { background: #dfe5e7; }
.template-visual.layout-industrial i,.template-visual.layout-industrial b { border-radius: 0; }
.template-visual.layout-industrial b { background: #e26a22; }
.template-card-body { flex: 1; padding: 22px; }
.template-card-meta { display: flex; justify-content: space-between; gap: 12px; color: #85d6ac; font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.template-card h2 { margin: 13px 0 8px; font-size: 21px; letter-spacing: -.035em; }
.template-card-body p { min-height: 60px; margin: 0 0 17px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.template-card-body small { color: #788c81; font-size: 11px; }
.template-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; min-height: 54px; padding: 14px 22px; border-top: 1px solid var(--line); }
.template-actions a { color: var(--green-500); font-size: 12px; font-weight: 800; text-decoration: none; }

.button { display: inline-flex; min-height: 43px; align-items: center; justify-content: center; padding: 10px 17px; border: 1px solid transparent; border-radius: 11px; cursor: pointer; text-decoration: none; font-size: 11px; font-weight: 750; letter-spacing: .055em; text-transform: uppercase; transition: transform .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button-primary, .button-secondary { color: var(--green-500); border-color: #3d4741; background: #222725; }
.button-primary:hover, .button-secondary:hover { color: color-mix(in srgb, var(--green-500), #fff 18%); border-color: var(--green-700); background: #2a302d; }
.button-light { color: var(--green-950); background: #fff; }
.button-ghost { color: #fff; border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.05); }
.button-danger { color: #fff; background: var(--danger); }
.button-full { width: 100%; }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; }
.text-link { color: var(--green-700); font-weight: 750; text-decoration: none; }

.page-actions, .context-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-actions p { margin: 0; color: var(--muted); }
.context-bar { padding: 22px 26px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.context-bar h2 { margin: 4px 0; font-size: 22px; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 17px 20px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); background: #f8faf8; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
td { font-size: 14px; }
td strong, td small { display: block; }
td small { max-width: 360px; margin-top: 4px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.row-actions { white-space: nowrap; vertical-align: middle; }
.row-actions a + a { margin-left: 10px; }
.row-actions form { display: inline-flex; margin: 0 0 0 14px; }
.row-actions form:first-child { margin-left: 0; }
.row-actions button { padding: 0; border: 0; background: transparent; color: var(--green-700); font: inherit; font-size: 13px; font-weight: 750; cursor: pointer; }
.row-actions button.danger-link { color: #b42318; }
.site-list-table th:first-child, .site-list-table td:first-child { width: 38%; }
.site-list-table th:last-child, .site-list-table td:last-child { text-align: right; }
.site-list-name { display: flex; align-items: center; gap: 8px; }
.site-list-open { display: inline-grid; width: 21px; height: 21px; flex: 0 0 21px; place-items: center; border: 1px solid #345243; border-radius: 6px; color: var(--green-500); font-size: 12px; line-height: 1; text-decoration: none; }
.site-list-open:hover { border-color: var(--green-500); background: #193428; }
.site-list-url { display: block; max-width: 390px; margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 11px; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.site-list-url:hover { color: var(--green-500); text-decoration: underline; }
.order-badge { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; background: var(--mint); font-weight: 800; }
.type-chip, .boolean { display: inline-block; padding: 5px 8px; border-radius: 8px; background: #edf1ee; font-size: 11px; font-weight: 750; text-transform: uppercase; }
.boolean.yes { color: #17613f; background: #def3e8; }
.boolean.no { color: #6c706e; }
.mode-badge { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border: 1px solid transparent; border-radius: 999px; font-size: 10px; font-weight: 850; letter-spacing: .035em; white-space: nowrap; text-transform: uppercase; }
.mode-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.mode-badge.legacy { color: #ffaaa3; border-color: #7d3734; background: #3b1d1b; }
.mode-badge.legacy::before { background: #ef6258; }
.mode-badge.editable { color: #9adfba; border-color: #285840; background: #153223; }
.mode-badge.editable::before { background: #61c995; }
.mode-badge.demo { color: #c8b7ff; border-color: #594a8a; background: #28203f; }
.mode-badge.demo::before { background: #a78bfa; }
.mode-badge.draft { color: #f0ce87; border-color: #5d4a25; background: #2c2515; }
.mode-badge.draft::before { background: #e7a93b; }
.mode-badge.live { color: #b4dcff; border-color: #376487; background: #172d3e; }
.mode-badge.live::before { background: #68b9f4; }
.site-status-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.site-status-badges .type-chip, .site-status-badges .mode-badge { display: inline-flex; min-height: 27px; box-sizing: border-box; align-items: center; padding: 6px 9px; border-radius: 999px; font-size: 10px; font-weight: 850; line-height: 1; letter-spacing: .035em; white-space: nowrap; }
.site-status-badges .type-chip { border: 1px solid #3b443f; }
.status-dot.demo { color: #c8b7ff; }
.status-dot.demo::before { background: #a78bfa; box-shadow: 0 0 0 3px rgba(167,139,250,.12); }
.site-groups { display: grid; gap: 24px; }
.site-group-heading { display: flex; align-items: center; justify-content: space-between; gap: 25px; padding: 24px 28px; border-bottom: 1px solid var(--line); }
.site-group-heading h2 { margin: 5px 0 4px; font-size: 22px; }
.site-group-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.site-group > summary { list-style: none; cursor: pointer; user-select: none; }
.site-group > summary::-webkit-details-marker { display: none; }
.site-group:not([open]) .site-group-heading { border-bottom: 0; }
.site-group-count { display: flex; flex: 0 0 auto; align-items: center; gap: 12px; }
.site-group-count > strong { display: grid; width: 45px; height: 45px; place-items: center; border-radius: 14px; color: #b7efd1; background: #183b2d; font-size: 20px; }
.site-group-count > i { color: var(--muted); font-size: 20px; font-style: normal; transition: transform .18s ease; }
.site-group:not([open]) .site-group-count > i { transform: rotate(-90deg); }
.site-group-demo { border-color: #443a62; }
.site-group-demo .site-group-count > strong { color: #d4c7ff; background: #2c2443; }
.site-group-legacy .site-group-count > strong { color: #f0ce87; background: #312815; }
.site-demo-switch { margin: 0; padding: 14px 0; }
.site-demo-switch > span { display: grid; gap: 4px; }

.editor-layout { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) 290px; gap: 22px; align-items: start; }
.editor-save-dock { position: sticky; z-index: 24; top: 12px; grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 16px; background: color-mix(in srgb,var(--panel),transparent 6%); box-shadow: 0 12px 35px rgba(0,0,0,.16); backdrop-filter: blur(16px); }
.editor-save-dock > div:first-child { display: grid; gap: 2px; }
.editor-save-dock small { color: var(--muted); font-size: 12px; }
.editor-main { display: grid; gap: 22px; min-width: 0; }
.editor-side { display: grid; min-width: 0; gap: 18px; }
.sticky-card { position: sticky; top: 22px; }
.sticky-card h3, .danger-card h3 { margin: 6px 0; }
.sticky-card p, .danger-card p { color: var(--muted); font-size: 13px; line-height: 1.55; }
.sticky-card .button + .button { margin-top: 9px; }
.danger-card { border-color: #f0d0d0; }
.form-grid { display: grid; min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid > *, .editor-layout .panel { min-width: 0; }
.panel-subsection { margin-top: 28px; padding-top: 26px; border-top: 1px solid var(--line); }
.panel-subsection h3 { margin: 0 0 8px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-field-group { display: grid; gap: 4px; margin-top: 10px; padding: 18px 0 4px; border-top: 1px solid var(--line); }
.form-field-group:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.form-field-group strong { color: var(--ink); font-size: 17px; }
.form-field-group span { color: var(--muted); font-size: 13px; line-height: 1.45; }
label { display: grid; gap: 7px; color: #34453e; font-size: 13px; font-weight: 700; }
input, textarea, select { width: 100%; border: 1px solid #ced9d2; border-radius: 10px; outline: none; color: var(--ink); background: #fbfcfb; }
input, select { min-height: 43px; padding: 9px 12px; }
textarea { padding: 12px; line-height: 1.55; resize: vertical; }
.rich-editor { display: grid; overflow: hidden; border: 1px solid #414943; border-radius: 10px; background: #121513; }
.rich-editor:focus-within { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(69,167,120,.12); }
.rich-editor-toolbar { display: flex; flex-wrap: wrap; gap: 6px; padding: 9px; border-bottom: 1px solid #303632; background: #171b18; }
.rich-editor-toolbar button { min-height: 32px; padding: 6px 10px; border: 1px solid #414943; border-radius: 6px; color: #dce5e0; background: #202521; font-size: 12px; cursor: pointer; }
.rich-editor-toolbar button:hover, .rich-editor-toolbar button:focus-visible { border-color: var(--green-500); color: #71dda8; outline: none; }
.rich-editor-area { display: block; min-height: 300px; padding: 18px; color: var(--ink); background: #121513; line-height: 1.65; outline: none; overflow-wrap: anywhere; }
.rich-editor-area p { margin: 0 0 1em; }
.rich-editor-area h3 { margin: 1.3em 0 .5em; font-size: 1.25em; }
.rich-editor-area ul, .rich-editor-area ol { padding-left: 1.5em; }
.rich-editor-area a { color: #71dda8; }
.rich-editor-source { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); opacity: 0; pointer-events: none; }
input:focus, textarea:focus, select:focus { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(69,167,120,.12); background: #fff; }
.color-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.color-field { padding: 13px; border: 1px solid var(--line); border-radius: 12px; }
.color-field > span:last-child { display: flex; gap: 8px; }
.color-field input[type="color"] { flex: 0 0 43px; width: 43px; padding: 4px; cursor: pointer; }
.content-editor textarea { min-height: 560px; color: #d6e9df; border: 0; background: #13241e; font-family: "Cascadia Code", Consolas, monospace; font-size: 13px; tab-size: 4; }
.switch-row { display: flex; align-items: center; justify-content: space-between; margin: 18px 0; padding: 13px 0; border-block: 1px solid var(--line); }
.switch-row input[type="checkbox"] { width: 42px; min-height: 22px; accent-color: var(--green-700); }
.hero-field-switch { margin: 0 0 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 13px; background: color-mix(in srgb,var(--panel),var(--green-700) 4%); }
.hero-field-switch > span:first-child { display: grid; gap: 4px; }
.hero-field-switch small { color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.4; }
.form-grid > [data-show-conditions][hidden] { display: none; }

.notice { margin-bottom: 20px; padding: 14px 17px; border-radius: 12px; font-size: 14px; }
.notice-success { color: #165b3c; border: 1px solid #bce3cd; background: #e5f5ec; }
.notice-error { color: #8a2929; border: 1px solid #edcaca; background: #fff0f0; }
.notice ul { margin-bottom: 0; }
.empty-state { padding: 45px 20px; text-align: center; color: var(--muted); }
.empty-state h2, .empty-state h3 { margin: 0 0 7px; color: var(--ink); }

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 30px; background: radial-gradient(circle at 15% 15%, #2d7658, transparent 30%), linear-gradient(145deg, #0b291f, #143c30); }
.login-card { display: grid; width: min(980px, 100%); grid-template-columns: 1.1fr .9fr; overflow: hidden; border-radius: 28px; background: #fff; box-shadow: 0 35px 90px rgba(0,0,0,.28); }
.login-intro { min-height: 560px; padding: 58px; color: #fff; background: radial-gradient(circle at 80% 80%, rgba(130,224,177,.3), transparent 28%), #123b2e; }
.login-intro .eyebrow { display: block; margin-top: 110px; color: #91d9b5; }
.login-intro h1 { max-width: 520px; margin: 12px 0; font-size: clamp(34px, 5vw, 54px); line-height: 1; letter-spacing: -.055em; }
.login-intro p:last-child { max-width: 460px; color: #bfd7cc; line-height: 1.6; }
.login-form { display: flex; flex-direction: column; justify-content: center; gap: 19px; padding: 58px; }
.login-form h2 { margin: 6px 0 0; font-size: 30px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 1050px) {
    .site-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .template-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .editor-layout { grid-template-columns: 1fr; }
    .editor-side { grid-row: 1; grid-template-columns: repeat(2, 1fr); }
    .editor-save-dock ~ .editor-side { grid-row: auto; }
    .sticky-card { position: static; }
}

@media (max-width: 760px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: 25px 0 60px rgba(0,0,0,.18); }
    .menu-open .sidebar { transform: translateX(0); }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 29; display: block; visibility: hidden; border: 0; opacity: 0; background: rgba(0,0,0,.58); transition: opacity .2s,visibility .2s; }
    .menu-open .sidebar-backdrop { visibility: visible; opacity: 1; }
    .menu-open { overflow: hidden; }
    .app-shell { margin-left: 0; }
    .menu-toggle { display: block; flex: 0 0 42px; width: 42px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: var(--panel); }
    .main { padding: 22px 14px 52px; }
    .topbar { position: sticky; z-index: 22; top: 0; min-height: 82px; padding: 14px 16px; }
    .topbar h1 { font-size: clamp(22px,7vw,29px); }
    .topbar .eyebrow { font-size: 9px; letter-spacing: .1em; }
    .hero-panel, .page-actions, .context-bar { align-items: flex-start; flex-direction: column; }
    .hero-panel { padding: 26px 22px; border-radius: 20px; }
    .context-bar { width: 100%; padding: 20px 18px; }
    .context-bar > .button, .page-actions > .button { width: 100%; }
    .panel:not(.table-panel) { padding: 20px 18px; }
    .panel-heading { align-items: flex-start; flex-direction: column; margin-bottom: 18px; }
    .stats-grid, .site-grid, .form-grid, .color-grid, .editor-side { grid-template-columns: 1fr; }
    .template-grid { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: auto; }
    .editor-save-dock { top: 90px; padding: 10px; }
    .editor-save-dock > div:first-child { display: none; }
    .editor-save-dock .button-row { display: grid; width: 100%; grid-template-columns: 1fr 1fr; }
    .editor-save-dock .button { min-width: 0; padding-inline: 10px; }
    .login-card { grid-template-columns: 1fr; }
    .login-intro { min-height: auto; padding: 35px; }
    .login-intro .eyebrow { margin-top: 40px; }
    .login-form { padding: 35px; }
    .table-wrap { margin-inline: 0; border-radius: 13px; scrollbar-width: thin; }
    .table-wrap table:not(.site-list-table) { min-width: 680px; }
    th, td { padding: 14px 15px; }
    .row-actions { white-space: normal; }
    .row-actions a, .row-actions form { margin: 4px 10px 4px 0; }
    .site-action-row { display: grid; width: 100%; grid-template-columns: repeat(2,minmax(0,1fr)); }
    .site-action-row .button { min-width: 0; padding-inline: 10px; }
    .site-context-title, .site-context-title code { max-width: 100%; overflow-wrap: anywhere; }
    .button-row { width: 100%; }
    .button-row .button { flex: 1 1 145px; }
    input, select, textarea { max-width: 100%; }
    .rich-editor-area { min-height: 240px; padding: 15px; }
}

@media (max-width: 480px) {
    .sidebar { width: min(86vw,310px); padding: 22px 17px; }
    .site-action-row { grid-template-columns: 1fr; }
    .editor-save-dock .button-row { grid-template-columns: 1fr; }
    .content-switcher { grid-template-columns: 1fr; }
    .site-card-top, .site-meta, .card-actions { align-items: flex-start; flex-wrap: wrap; }
}

/* Elenco siti: da tabella desktop a schede compatte, senza overflow orizzontale. */
.app-shell, .main, .panel, .site-groups, .table-wrap { min-width: 0; max-width: 100%; }

@media (max-width: 900px) {
    .site-list-table { display: block; width: 100%; min-width: 0; }
    .site-list-table thead { display: none; }
    .site-list-table tbody { display: grid; width: 100%; gap: 12px; padding: 12px; }
    .site-list-table tr { display: grid; width: 100%; min-width: 0; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px 18px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb,var(--panel),#000 3%); }
    .site-list-table td { display: block; width: auto !important; min-width: 0; padding: 0; border: 0; text-align: left !important; overflow-wrap: anywhere; }
    .site-list-table td:first-child, .site-list-table td:last-child { grid-column: 1 / -1; }
    .site-list-table td:nth-child(2)::before, .site-list-table td:nth-child(3)::before, .site-list-table td:nth-child(4)::before { display: block; margin-bottom: 6px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
    .site-list-table td:nth-child(2)::before { content: "Stato"; }
    .site-list-table td:nth-child(3)::before { content: "Ultima modifica"; }
    .site-list-table td:nth-child(4)::before { content: "Contenuti"; }
    .site-list-table .site-list-name { align-items: flex-start; }
    .site-list-table .site-list-name strong, .site-list-table .site-list-url { max-width: 100%; overflow-wrap: anywhere; white-space: normal; }
    .site-list-table .row-actions { display: flex; flex-wrap: wrap; gap: 10px 16px; padding-top: 13px; border-top: 1px solid var(--line); }
    .site-list-table .row-actions a, .site-list-table .row-actions form { margin: 0; }
    .site-group-heading { padding: 20px; }
}

@media (max-width: 480px) {
    .site-list-table tr { grid-template-columns: 1fr; }
    .site-list-table td { grid-column: 1 / -1; }
    .site-group-heading { align-items: flex-start; gap: 14px; padding: 18px; }
    .site-group-heading h2 { font-size: 19px; }
    .site-group-count { gap: 7px; }
    .site-group-count > strong { width: 38px; height: 38px; border-radius: 11px; font-size: 16px; }
}

/* Dark admin skin */
:root {
    color-scheme: dark;
    --ink: #f0f3f1;
    --muted: #a0aaa5;
    --canvas: var(--admin-canvas, #101211);
    --panel: var(--admin-panel, #191c1a);
    --line: #303632;
    --green-950: #101713;
    --green-800: color-mix(in srgb, var(--admin-accent, #35a475), #000 28%);
    --green-700: var(--admin-accent, #35a475);
    --green-500: color-mix(in srgb, var(--admin-accent, #35a475), #fff 22%);
    --mint: #20332a;
    --shadow: 0 18px 55px rgba(0, 0, 0, .26);
}

body { background: radial-gradient(circle at 82% 0, rgba(53,164,117,.07), transparent 28%), var(--canvas); }
.sidebar { background: linear-gradient(175deg, color-mix(in srgb, var(--admin-sidebar, #1c201e), #000 15%), var(--admin-sidebar, #1c201e) 68%, color-mix(in srgb, var(--admin-sidebar, #1c201e), #fff 5%)); border-right: 1px solid #343a36; }
.brand { padding-inline: 0; }
.brand-logo-plate, .login-logo-plate { display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--admin-logo-background, #f8faf9), #000 10%); border-radius: 13px; background: var(--admin-logo-background, #f8faf9); box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.brand-logo-plate { width: 100%; min-height: 64px; padding: 12px 15px; }
.brand-logo-plate img { display: block; width: 100%; height: auto; }
.brand-compact { display: none; width: 42px; height: 42px; place-items: center; border-radius: 12px; color: #092319; background: #7be1ae; font-weight: 900; font-size: 22px; }
.login-logo-plate { width: min(360px, 100%); padding: 18px 22px; }
.login-logo-plate img { display: block; width: 100%; height: auto; }
.topbar { border-color: var(--line); background: rgba(22,25,23,.9); }
.hero-panel { border: 1px solid #37634f; background: radial-gradient(circle at 90% 20%, rgba(97,201,149,.12), transparent 27%), linear-gradient(135deg, #202522, #29332e); }
.panel, .stat-card, .site-card, .context-bar { border-color: var(--line); background: var(--panel); box-shadow: var(--shadow); }
.site-card { background: linear-gradient(155deg, #1d201e, #161917); }
.site-card p, .site-meta, .stat-card span, .stat-card small, .muted, td small { color: var(--muted); }
.status-dot.legacy { color: #ffaaa3; }
.status-dot.legacy::before { background: #ef6258; }
.status-dot.draft { color: #f0ce87; }
.status-dot.draft::before { background: #e7a93b; }
.status-dot.live { color: #b4dcff; }
.status-dot.live::before { background: #68b9f4; box-shadow: 0 0 0 3px rgba(104,185,244,.13); }
.button-secondary { color: var(--green-500); border-color: #3d4741; background: #222725; }
.button-light { color: #0c2a20; background: #effaf4; }
.table-wrap { background: var(--panel); }
th { color: #a7b0ab; background: #151817; }
th, td { border-color: var(--line); }
tbody tr:hover { background: #202522; }
code { color: #83dbae; }
.type-chip, .boolean { color: #c3cac6; background: #282e2a; }
.boolean.yes { color: #91e0b7; background: #173d2e; }
.order-badge { color: #b4efd0; background: #173d2e; }
label { color: #c7d5cd; }
input, textarea, select { color: var(--ink); border-color: #414943; background: #121513; }
input:focus, textarea:focus, select:focus { border-color: var(--green-500); background: #171b18; }
input:disabled, textarea:disabled, select:disabled { color: #b5bcb8; border-color: #303632; background: #111311; opacity: .8; }
.color-field { border-color: var(--line); background: #151817; }
.content-editor textarea { color: #e0e5e2; background: #0d0f0e; }
.danger-card { border-color: #633737; background: #241717; }
.notice-success { color: #b5eccf; border-color: #285b42; background: #133323; }
.notice-error { color: #f2b9b9; border-color: #683c3c; background: #311b1b; }
.notice-legacy { color: #f1d59a; border: 1px solid #624f28; background: #292313; }
.form-lock { display: contents; min-width: 0; margin: 0; padding: 0; border: 0; }
.form-lock:disabled .panel { box-shadow: none; }
.auth-shell { background: radial-gradient(circle at 15% 15%, rgba(53,164,117,.2), transparent 30%), linear-gradient(145deg, #121412, #202422); }
.login-card { border: 1px solid #363d38; background: #181b19; }
.login-intro { background: radial-gradient(circle at 80% 80%, rgba(97,201,149,.14), transparent 28%), #202522; }
.login-form { background: #181b19; }
.admin-appearance-form { display: grid; gap: 20px; }
.admin-brand-editor { display: grid; grid-template-columns: minmax(220px, 360px) minmax(0, 1fr); align-items: center; gap: 30px; }
.admin-logo-preview { display: grid; min-height: 130px; place-items: center; padding: 24px; border: 1px solid var(--line); border-radius: 16px; }
.admin-logo-preview img { display: block; max-width: 100%; max-height: 100px; width: auto; height: auto; }
.form-stack { display: grid; gap: 18px; }
.form-stack > label:not(.check) { display: grid; gap: 8px; }
.form-stack .check { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.form-stack .check input { width: 18px; height: 18px; }
.admin-color-grid { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 14px; }
.admin-color-grid label { display: grid; gap: 9px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #151817; }
.admin-color-grid input[type="color"] { width: 100%; height: 52px; padding: 4px; cursor: pointer; }
.admin-color-note { margin: 18px 0 0; }
.site-settings-tools { margin-top: 22px; }
.site-settings-tools .panel-heading { margin-bottom: 18px; }
.site-settings-tools .panel-heading p { margin: 5px 0 0; color: var(--muted); }
.link-field-stack { display: grid; gap: 8px; }
.site-context-bar { align-items: flex-start; }
.site-context-title { min-width: 210px; }
.site-context-meta { display: flex; align-items: center; gap: 12px; }
.site-context-meta .status-dot { font-size: 11px; }
.site-title-line { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.site-title-line h2 { margin-bottom: 2px; }
.site-open-link { color: var(--green-500); font-size: 12px; font-weight: 800; text-decoration: none; }
.site-open-link:hover { text-decoration: underline; }
.site-action-groups { display: grid; justify-items: end; gap: 10px; }
.site-action-row { display: flex; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.site-action-secondary .button { min-height: 35px; padding: 7px 13px; }
@media (max-width: 760px) {
    .site-action-groups { width: 100%; justify-items: stretch; }
    .site-action-row { justify-content: flex-start; }
}
.wizard-intro { position: relative; overflow: hidden; background: radial-gradient(circle at 90% 10%, rgba(97,201,149,.12), transparent 30%), linear-gradient(140deg, #242a26, #191c1a); }
.wizard-intro::after { content: ""; position: absolute; width: 180px; height: 180px; right: -70px; bottom: -100px; border: 34px solid rgba(97,201,149,.07); border-radius: 50%; }
.wizard-intro h2 { margin: 11px 0 8px; font-size: clamp(27px, 4vw, 39px); letter-spacing: -.045em; }
.wizard-intro p { max-width: 720px; margin: 0; color: var(--muted); line-height: 1.65; }
.step-chip { float: right; padding: 7px 10px; border: 1px solid #315445; border-radius: 999px; color: #aee7ca; background: #173126; font-size: 11px; font-weight: 800; }
label small { color: var(--muted); font-size: 11px; font-weight: 500; }
.theme-choice { display: grid; grid-template-columns: 190px minmax(0, 1fr) auto; align-items: center; gap: 20px; padding: 16px; border: 1px solid #3a443e; border-radius: 16px; background: #171a18; cursor: pointer; }
.theme-choice-list { display: grid; gap: 13px; }
.theme-choice:has(input:checked) { border-color: var(--green-500); background: #202923; box-shadow: 0 0 0 3px rgba(97,201,149,.08); }
.theme-choice > input { position: absolute; opacity: 0; pointer-events: none; }
.theme-choice strong, .theme-choice small { display: block; }
.theme-choice strong { margin-bottom: 7px; color: var(--ink); font-size: 17px; }
.theme-choice small { color: var(--muted); line-height: 1.5; }
.theme-choice b { padding: 6px 9px; border-radius: 8px; color: #95deb7; background: #173d2e; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.format-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.format-choice-grid .theme-choice { grid-template-columns: 24px minmax(0, 1fr); min-height: 120px; }
.format-choice-grid .theme-choice > input { position: static; width: 18px; height: 18px; opacity: 1; pointer-events: auto; }
.format-destination { margin-top: 16px; }
.theme-preview { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 24px 55px 36px; gap: 5px; min-height: 125px; padding: 9px; border-radius: 11px; background: #f4f2ea; box-shadow: 0 8px 25px rgba(0,0,0,.25); }
.theme-preview i { display: block; border-radius: 4px; background: #1e5642; }
.theme-preview i:first-child { grid-column: 1 / -1; background: #e2ded0; }
.theme-preview i:nth-child(2) { background: linear-gradient(135deg, #245d48, #61a781); }
.theme-preview i:nth-child(3) { background: #d7c9a8; }
.editorial-preview { grid-template-columns: 1.25fr .75fr; grid-template-rows: 18px 66px 31px; border-radius: 3px; background: #f4efe6; }
.editorial-preview i { border-radius: 0; }
.editorial-preview i:first-child { background: #1d1916; }
.editorial-preview i:nth-child(2) { background: linear-gradient(135deg, #c4a47a, #6f5944); }
.editorial-preview i:nth-child(3) { background: repeating-linear-gradient(#3b332c 0 3px, transparent 3px 10px); }
.studio-preview { grid-template-columns: .8fr 1.2fr; grid-template-rows: 20px 70px 25px; border-radius: 4px; background: #eeeae2; }
.studio-preview i { border-radius: 2px; }
.studio-preview i:first-child { background: #111713; }
.studio-preview i:nth-child(2) { background: #72d99b; }
.studio-preview i:nth-child(3) { background: linear-gradient(145deg, #171d19 0 55%, #d2ff46 55%); }
.check-list { display: grid; gap: 8px; margin: 18px 0 22px; padding: 0; list-style: none; color: #c4d1ca; font-size: 13px; }
.check-list li::before { content: "✓"; margin-right: 8px; color: var(--green-500); font-weight: 900; }
.lifecycle-panel { margin-top: 22px; }
.lifecycle-panel > p { max-width: 850px; color: var(--muted); line-height: 1.65; }
.delete-site-form { display: grid; grid-template-columns: minmax(260px, 460px) auto; align-items: end; gap: 16px; margin-top: 20px; }
.delete-site-form label { display: grid; gap: 8px; }
.builder-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 22px; align-items: start; }
.builder-canvas { display: grid; gap: 12px; min-width: 0; }
.builder-empty { min-height: 360px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.empty-icon { display: grid; width: 58px; height: 58px; margin-bottom: 15px; place-items: center; border: 1px dashed #4b6a5a; border-radius: 18px; color: #8ad8af; background: #14271e; font-size: 31px; }
.block-card { display: grid; grid-template-columns: 24px 30px 45px minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); box-shadow: 0 8px 25px rgba(0,0,0,.12); }
.block-card.disabled { opacity: .62; }
.block-handle { color: #61736a; font-size: 18px; letter-spacing: -5px; }
.block-order { color: var(--muted); font-size: 12px; font-weight: 800; text-align: center; }
.block-icon, .block-type-icon { display: grid; place-items: center; border-radius: 12px; color: #b8f0d2; background: #1a4936; font-weight: 900; }
.block-icon { width: 43px; height: 43px; }
.block-content { min-width: 0; }
.block-title-row { display: flex; align-items: center; gap: 10px; }
.block-content h3 { margin: 0; font-size: 16px; }
.block-content p { overflow: hidden; margin: 5px 0 0; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.block-controls { display: flex; align-items: center; gap: 6px; }
.block-controls form { margin: 0; }
.block-controls button, .block-controls a { display: grid; min-width: 34px; height: 34px; place-items: center; padding: 0 9px; border: 1px solid #34463d; border-radius: 9px; color: #b8d5c6; background: #111914; text-decoration: none; font-size: 12px; font-weight: 750; cursor: pointer; }
.block-controls .block-delete-button { border-color: #673a3a; color: #f0a0a0; background: #201414; }
.block-controls .block-delete-button:hover { border-color: #b94242; color: #fff; background: #8f3030; }
.block-controls button:disabled { opacity: .3; cursor: default; }
.progress-list { display: grid; gap: 0; margin-top: 20px; }
.progress-list span { padding: 10px 0; color: #75867d; border-bottom: 1px solid var(--line); font-size: 12px; }
.progress-list span.done { color: #8fddba; }
.block-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.block-type-card { display: grid; grid-template-columns: 52px minmax(0, 1fr) 28px; align-items: center; gap: 15px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: var(--panel); text-decoration: none; transition: border-color .15s, transform .15s, background .15s; }
.block-type-card:hover { transform: translateY(-2px); border-color: #3d745b; background: #17241d; }
.block-type-icon { width: 52px; height: 52px; font-size: 20px; }
.block-type-card strong, .block-type-card small { display: block; }
.block-type-card strong { margin-bottom: 5px; }
.block-type-card small { color: var(--muted); line-height: 1.45; }
.block-type-card b { color: #7ed5a7; font-size: 24px; }
.media-upload { display: grid; grid-template-columns: minmax(230px, 1fr) minmax(220px, .8fr) minmax(260px, 1fr) auto; align-items: end; gap: 18px; margin-bottom: 22px; }
.media-upload h2 { margin: 5px 0; }
.media-upload p { margin: 0; color: var(--muted); font-size: 12px; }
.file-drop { display: flex; min-height: 84px; align-items: center; justify-content: center; padding: 12px 18px; border: 1px dashed #426451; border-radius: 13px; color: #a6ddbf; background: #101b15; cursor: pointer; text-align: center; transition: border-color .15s, background .15s, box-shadow .15s; }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-drop > span { display: block; min-width: 0; }
.file-drop strong, .file-drop small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-drop strong { max-width: 270px; }
.file-drop small { max-width: 270px; margin-top: 5px; color: var(--muted); font-size: 10px; font-weight: 500; }
.file-drop.has-file { color: #b9f0d3; border-style: solid; border-color: var(--green-500); background: #153326; box-shadow: 0 0 0 3px rgba(97,201,149,.09); }
.media-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.media-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: 0 10px 30px rgba(0,0,0,.15); }
.media-thumb { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #0a0f0c; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.media-thumb:hover img { transform: scale(1.025); }
.media-info { padding: 15px; }
.media-info strong, .media-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-info small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.media-info p { min-height: 32px; margin: 12px 0; color: #a9b8b0; font-size: 11px; line-height: 1.45; }
.media-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.media-actions form { margin: 0; }
.media-actions button { padding: 0; border: 0; background: none; cursor: pointer; }
.danger-link { color: #e98d8d; font-size: 12px; font-weight: 750; }
.field-help { color: var(--muted); font-size: 11px; font-weight: 500; }
.form-intro { margin: 0 0 20px; color: var(--muted); line-height: 1.6; }
.toggle-field > span:last-of-type { display: flex; min-height: 43px; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #0e1712; }
.toggle-field input { width: 18px; height: 18px; margin: 0; }
.policy-page-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.policy-page-grid article { display: grid; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: #0f1813; }
.policy-page-grid strong { font-size: 17px; }
.policy-page-grid span { color: var(--muted); font-size: 12px; }
.policy-page-grid .button { justify-self: start; }
.small-link { margin-top: 5px; color: #7bd4a5; font-size: 11px; text-decoration: none; }
.inline-media-picker { display: flex; width: 100%; max-width: 100%; min-width: 0; gap: 8px; overflow-x: auto; overscroll-behavior-inline: contain; padding: 7px 0 3px; }
.inline-media-picker button { position: relative; flex: 0 0 86px; height: 66px; overflow: hidden; padding: 0; border: 2px solid transparent; border-radius: 9px; background: #0b110e; cursor: pointer; }
.inline-media-picker button.selected { border-color: var(--green-500); }
.inline-media-picker img { width: 100%; height: 100%; object-fit: cover; }
.inline-media-picker i { position: absolute; right: 4px; bottom: 4px; padding: 3px 5px; border-radius: 5px; color: #fff; background: rgba(5,20,14,.85); font-size: 9px; font-style: normal; font-weight: 800; }
.media-picker-detailed { gap: 12px; }
.media-picker-detailed button { display: grid; flex-basis: 190px; height: 158px; grid-template-rows: 102px 52px; color: #e9f5ee; text-align: left; background: #101b15; }
.media-picker-detailed button > img { width: 100%; height: 102px; object-fit: contain; padding: 6px; background: #f4f6f5; }
.media-picker-detailed button > span { display: grid; min-width: 0; align-content: center; padding: 5px 8px; }
.media-picker-detailed button > span strong, .media-picker-detailed button > span small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-picker-detailed button > span strong { font-size: 10px; }
.media-picker-detailed button > span small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.media-picker-detailed button > i { top: 7px; right: 7px; bottom: auto; }
.block-media-picker { display: grid; max-height: 356px; grid-template-columns: repeat(auto-fill,minmax(190px,1fr)); gap: 12px; overflow-x: hidden; overflow-y: auto; padding: 7px 8px 5px 2px; scrollbar-gutter: stable; }
.block-media-picker button { width: 100%; min-width: 0; }
.news-default-picker { display: grid; width: 100%; max-height: 504px; grid-template-columns: repeat(auto-fill,minmax(170px,1fr)); gap: 12px; overflow-x: hidden; overflow-y: auto; padding: 3px 8px 3px 2px; scrollbar-gutter: stable; }
.news-default-picker button { width: 100%; min-width: 0; height: 158px; }
.news-default-picker .logo-name-choice { display: grid; place-items: center; align-content: center; color: #b9f0d3; background: #101b15; }
.news-default-picker .logo-name-choice b { font-size: 15px; }
.logo-choice { display: grid; min-width: 0; gap: 10px; margin-bottom: 24px; }
.logo-media-picker { gap: 12px; padding: 9px 2px 8px; }
.logo-media-picker button { flex-basis: 142px; height: 104px; border-radius: 12px; background: #f5f7f6; }
.logo-media-picker img { object-fit: contain; padding: 9px; }
.logo-media-picker .logo-name-choice { display: grid; place-items: center; color: #b9f0d3; background: #101b15; }
.logo-media-picker .logo-name-choice b { font-size: 25px; text-transform: uppercase; }
.logo-media-picker i { right: 7px; bottom: 7px; left: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }

@media (max-width: 760px) {
    .delete-site-form { grid-template-columns: 1fr; }
    .policy-page-grid { grid-template-columns: 1fr; }
    .format-choice-grid { grid-template-columns: 1fr; }
    .brand-logo-plate { display: none; }
    .brand-compact { display: grid; }
    .theme-choice { grid-template-columns: 1fr; }
    .theme-choice b { justify-self: start; }
    .builder-layout { grid-template-columns: 1fr; }
    .builder-side { grid-row: 1; }
    .block-picker { grid-template-columns: 1fr; }
    .block-card { grid-template-columns: 24px 36px minmax(0, 1fr); }
    .block-order { display: none; }
    .block-controls { grid-column: 2 / -1; justify-content: flex-end; }
    .media-upload { grid-template-columns: 1fr; align-items: stretch; }
    .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
    .media-grid { grid-template-columns: 1fr; }
}
.share-link-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; }
.share-link-row input { min-width: 0; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
@media (max-width: 720px) { .share-link-row { grid-template-columns: 1fr; } }

.news-editor-form { display: grid; gap: 18px; }
.table-panel > .panel-heading { margin-bottom: 0; padding: 28px 28px 24px; }
.content-switcher { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 0 0 20px; padding: 6px; border: 1px solid var(--line); border-radius: 16px; background: #0d1712; }
.content-switcher a { position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 3px 14px; padding: 15px 18px; border: 1px solid transparent; border-radius: 11px; color: var(--muted); text-decoration: none; transition: background .15s,border-color .15s,color .15s; }
.content-switcher a:hover { color: #d9eee2; background: #132219; }
.content-switcher a.active { color: #effaf4; border-color: #315a45; background: #173425; box-shadow: inset 0 -2px 0 var(--green-500); }
.content-switcher span { font-size: 14px; font-weight: 850; }
.content-switcher b { grid-row: 1 / 3; grid-column: 2; align-self: center; min-width: 31px; padding: 6px 8px; border-radius: 9px; color: #9ee4bd; background: rgba(83,190,133,.13); font-size: 11px; text-align: center; }
.content-switcher small { font-size: 10px; }
.news-editor-card { width: min(980px,100%); margin-inline: auto; }
.news-form-stack { display: grid; gap: 22px; }
.news-form-stack > label { display: grid; gap: 8px; }
.news-form-stack > label:first-child input { min-height: 58px; font-size: 22px; }
.news-meta-row { display: grid; grid-template-columns: minmax(180px,.35fr) minmax(0,1fr); gap: 18px; align-items: start; }
.news-meta-row label { display: grid; gap: 8px; }
.news-image-field { display: grid; grid-template-columns: 220px minmax(260px,1fr); gap: 14px; align-items: stretch; }
.news-image-preview { position: relative; display: block; min-height: 150px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #f4f6f5; }
.news-image-preview img { width: 100%; height: 100%; min-height: 150px; object-fit: cover; }
.news-image-preview b { position: absolute; right: 8px; bottom: 8px; padding: 5px 8px; border-radius: 7px; color: #fff; background: rgba(5,16,11,.78); font-size: 10px; }
.mini-editor { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #0d1611; }
.mini-editor:focus-within { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(97,201,149,.09); }
.mini-editor-toolbar { display: flex; flex-wrap: wrap; gap: 5px; padding: 9px; border-bottom: 1px solid var(--line); background: #111e17; }
.mini-editor-toolbar button { min-height: 32px; padding: 6px 10px; border: 1px solid #345041; border-radius: 7px; color: #d8e9df; background: #15241b; font: inherit; font-size: 11px; cursor: pointer; }
.mini-editor-toolbar button:hover { color: #fff; border-color: var(--green-500); }
.mini-editor-surface { display: block; min-height: 330px; padding: 24px; outline: none; color: var(--ink); font-size: 15px; font-weight: 500; line-height: 1.75; }
.mini-editor-surface:empty::before { content: 'Scrivi qui il testo della notizia…'; color: var(--muted); }
.mini-editor-surface h2 { margin: 28px 0 10px; font-size: 25px; }
.mini-editor-surface h3 { margin: 24px 0 8px; font-size: 19px; }
.mini-editor-surface p { margin: 0 0 15px; }
.mini-editor-surface a { color: #7bd4a5; }
.news-advanced { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #101a14; }
.news-advanced summary { padding: 15px 17px; color: #dcece3; font-weight: 800; cursor: pointer; }
.news-advanced summary span { margin-left: 5px; color: var(--muted); font-size: 10px; font-weight: 600; text-transform: uppercase; }
.news-advanced[open] summary { border-bottom: 1px solid var(--line); }
.news-advanced .form-grid { padding: 18px; }
@media (max-width: 760px) {
    .table-panel > .panel-heading { padding: 22px 18px 19px; }
    .content-switcher { grid-template-columns: 1fr 1fr; }
    .content-switcher a { padding: 13px; }
    .content-switcher small { display: none; }
    .news-meta-row, .news-image-field { grid-template-columns: 1fr; }
    .news-editor-card { padding: 18px; }
    .mini-editor-surface { min-height: 280px; padding: 18px; }
    .admin-brand-editor, .admin-color-grid { grid-template-columns: 1fr; }
}

.site-settings-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 22px; padding: 22px 24px; }
.site-settings-identity { display: flex; min-width: 0; align-items: center; gap: 18px; }
.site-settings-identity > div { min-width: 0; }
.site-settings-identity h2 { margin: 5px 0 4px; font-size: clamp(24px,3vw,34px); line-height: 1.08; overflow-wrap: anywhere; }
.site-settings-identity a, .site-settings-identity small { display: block; max-width: 100%; overflow: hidden; color: var(--muted); font-size: 12px; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.site-settings-identity a:hover { color: var(--green-500); }
.site-settings-logo { display: grid; width: 96px; height: 76px; flex: 0 0 96px; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #f4f6f5; }
.site-settings-logo img { display: block; width: 100%; height: 100%; padding: 9px; object-fit: contain; }
.site-settings-logo b { font-size: 24px; letter-spacing: -.04em; }
.site-settings-logo.client-logo-bg-transparent { border-color: transparent; background: transparent; }
.site-settings-logo.client-logo-bg-light { background: #f4f6f5; }
.site-settings-logo.client-logo-bg-dark { background: #161a18; }

@media (max-width: 760px) {
    .site-settings-header { align-items: stretch; flex-direction: column; padding: 18px; }
    .site-settings-header > .button { width: 100%; }
    .site-settings-logo { width: 78px; height: 66px; flex-basis: 78px; }
    .site-settings-identity h2 { font-size: 23px; }
}

@media (max-width: 420px) {
    .site-settings-identity { align-items: flex-start; flex-direction: column; }
}
