/* Platform → Architettura: il mosaico dei moduli sulla base */
.ar-split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ar-stage { display: flex; flex-direction: column; gap: 8px; }
.ar-stage-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.ar-stage-head h3 { margin: 0; }
.ar-legend { display: flex; flex-wrap: wrap; gap: 6px; }
.ar-chip { --c: var(--accent); display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 11.5px; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--border); background: transparent; color: var(--text-2); cursor: pointer; }
.ar-chip i { width: 9px; height: 9px; border-radius: 3px; background: var(--c); }
.ar-chip.on { border-color: var(--c); color: var(--text); background: color-mix(in srgb, var(--c) 12%, transparent); }

.ar-tier-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 8px; }

.ar-surfaces { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.ar-surface { font: inherit; font-size: 12.5px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 6px; border-radius: 12px; border: 1px dashed color-mix(in srgb, #ec4899 45%, var(--border)); background: color-mix(in srgb, #ec4899 6%, transparent); color: var(--text); cursor: pointer; transition: transform .15s, box-shadow .15s; }
.ar-surface:hover { transform: translateY(-2px); }
.ar-surface.sel { box-shadow: 0 0 0 2px #ec4899; }

.ar-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; padding: 8px; border-radius: 16px; background: var(--surface-2); }
.ar-tile { --c: var(--accent); font: inherit; text-align: left; min-height: 64px; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; padding: 9px 10px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); background: linear-gradient(140deg, color-mix(in srgb, var(--c) 30%, transparent), color-mix(in srgb, var(--c) 12%, transparent)); color: var(--text); cursor: pointer; transition: transform .18s, opacity .2s, box-shadow .18s; animation: ar-pop .45s both; }
.ar-tile:nth-child(3n) { animation-delay: .05s; } .ar-tile:nth-child(3n+1) { animation-delay: .1s; }
.ar-tile:hover { transform: translateY(-2px) rotate(-.4deg); }
.ar-tile.sel { box-shadow: 0 0 0 2px var(--c); }
.ar-tile.off { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 10%, transparent) 0 6px, transparent 6px 12px); border-style: dashed; }
.ar-tile.off .ar-tile-name { color: var(--text-2); }
.ar-tile.dim { opacity: .22; }
.ar-tile-name { font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.ar-tile-state { font-size: 10.5px; color: var(--muted); }
.ar-tile-next { --c: var(--muted); cursor: default; border-style: dashed; background: transparent; align-items: center; justify-content: center; text-align: center; animation: none; }
.ar-tile-next .ar-tile-name { color: var(--muted); font-weight: 500; }
@keyframes ar-pop { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }

.ar-base { display: flex; flex-direction: column; gap: 3px; }
.ar-slab { --c: var(--accent); font: inherit; display: grid; grid-template-columns: 24px 18px minmax(110px, auto) minmax(0, 1fr); align-items: center; gap: 8px; text-align: left; padding: 8px 12px; border: 0; border-left: 4px solid var(--c); border-radius: 8px; background: color-mix(in srgb, var(--c) 11%, var(--surface-2)); color: var(--text); cursor: pointer; transition: background .15s, box-shadow .15s; }
.ar-slab:hover { background: color-mix(in srgb, var(--c) 20%, var(--surface-2)); }
.ar-slab.sel { box-shadow: inset 0 0 0 1.5px var(--c); }
.ar-slab .ic-sm { color: var(--c); }
.ar-slab-num { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--c); color: #fff; }
.ar-slab-title { font-weight: 600; font-size: 13px; }
.ar-slab-tag { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ar-detail { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 10px; }
.ar-detail-hero { --c: var(--accent); display: flex; gap: 12px; align-items: center; }
.ar-detail-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); }
.ar-detail-title { font-size: 18px; font-weight: 700; }
.ar-lead { margin: 0; font-size: 13.5px; color: var(--text-2); }
.ar-points { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 7px; font-size: 13px; line-height: 1.5; }
.ar-points code, .ar-recipe code, .ar-step-body code { font-size: 11.5px; }
.ar-where { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.ar-where code, .ar-perms code { font-size: 11px; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); }
.ar-perms { display: flex; flex-wrap: wrap; gap: 6px; }
.ar-sub { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 4px; }
.ar-state { font-size: 12.5px; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, #f59e0b 12%, transparent); color: #d97706; }
.ar-state.on { background: color-mix(in srgb, #10b981 12%, transparent); color: #059669; }

.ar-section-head h2 { margin: 0 0 2px; font-size: 20px; }
.ar-section-head .subtitle { margin-bottom: 10px; }

.ar-layers { display: flex; flex-direction: column-reverse; gap: 8px; }
.ar-layer { --c: var(--accent); padding: 0; border-left: 4px solid var(--c); overflow: hidden; }
.ar-layer-head { font: inherit; width: 100%; display: grid; grid-template-columns: 24px 20px auto minmax(0, 1fr) 16px; gap: 10px; align-items: center; padding: 12px 16px; background: transparent; border: 0; color: var(--text); cursor: pointer; text-align: left; }
.ar-layer-head > .ic { color: var(--c); }
.ar-layer-title { font-weight: 700; font-size: 14.5px; }
.ar-layer-tag { color: var(--muted); font-size: 13px; }
.ar-caret { transition: transform .2s; color: var(--muted); }
.ar-layer.open .ar-caret { transform: rotate(180deg); }
.ar-layer.open { background: color-mix(in srgb, var(--c) 5%, var(--surface)); }
.ar-layer > .ar-points, .ar-layer > .ar-where { padding: 0 16px 0 54px; }
.ar-layer > .ar-where { padding-bottom: 14px; padding-top: 10px; }

.ar-journey { display: flex; flex-direction: column; gap: 14px; }
.ar-steps { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 4px; position: relative; }
.ar-step { font: inherit; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 2px; background: transparent; border: 0; color: var(--muted); cursor: pointer; position: relative; }
.ar-step::before { content: ""; position: absolute; top: 19px; left: -50%; right: 50%; height: 2px; background: var(--border); z-index: 0; }
.ar-step:first-child::before { display: none; }
.ar-step.done::before, .ar-step.on::before { background: var(--accent); }
.ar-step-dot { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface-2); border: 2px solid var(--border); color: var(--text-2); transition: all .2s; }
.ar-step.done .ar-step-dot { border-color: var(--accent); color: var(--accent); }
.ar-step.on .ar-step-dot { background: var(--grad); border-color: transparent; color: #fff; transform: scale(1.12); }
.ar-step-name { font-size: 11.5px; text-align: center; line-height: 1.2; }
.ar-step.on .ar-step-name { color: var(--text); font-weight: 600; }
.ar-step-body { padding: 14px 16px; border-radius: 14px; background: var(--grad-soft); animation: ar-pop .3s both; }
.ar-step-body p { margin: 8px 0; font-size: 13.5px; line-height: 1.55; }
.ar-step-gate { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.ar-step-no { font-size: 12.5px; color: #e11d48; display: flex; align-items: center; gap: 6px; }

.ar-principles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ar-principle { display: flex; flex-direction: column; gap: 6px; }
.ar-principle-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--grad-soft); color: var(--accent); }
.ar-principle-title { font-weight: 700; font-size: 14px; }

.ar-recipe { display: flex; flex-direction: column; gap: 0; }
.ar-recipe-row { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.ar-recipe-row:first-child { border-top: 0; }
.ar-recipe-num { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--grad); color: #fff; }
.ar-recipe-title { font-weight: 600; font-size: 14px; }

@media (max-width: 1200px) { .ar-split { grid-template-columns: minmax(0, 1fr); } .ar-detail { position: static; } .ar-principles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
    .ar-surfaces { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ar-slab { grid-template-columns: 24px 18px minmax(0, 1fr); }
    .ar-slab-tag { display: none; }
    .ar-layer-head { grid-template-columns: 24px 20px minmax(0, 1fr) 16px; }
    .ar-layer-tag { display: none; }
    .ar-layer > .ar-points, .ar-layer > .ar-where { padding-left: 34px; }
    .ar-steps { grid-template-columns: repeat(5, minmax(0, 1fr)); row-gap: 10px; }
    .ar-step::before { display: none; }
    .ar-principles { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .ar-tile, .ar-step-body { animation: none; } }
