/* AR-120: AtlasAR dashboard, setup wizard and product panel. Builds on atlas-ar-library.css. */
/* AR-180: the app frame (side menu, header, pane, status bar) is in atlas-ar-shell.css. */
.atlas-ar-wrap{color:var(--atlas-ar-ink)}
.atlas-ar-choice-item:focus-visible,.atlas-ar-swatch:focus-visible,.atlas-ar-tab:focus-visible{outline:2px solid var(--atlas-ar-action);outline-offset:2px}
.atlas-ar-head{margin-bottom:16px}
.atlas-ar-head h1{margin:0 0 4px;font-size:23px;font-weight:400;line-height:1.3}
.atlas-ar-head p{margin:0;color:var(--atlas-ar-muted);font-size:14px}

.atlas-ar-section{margin-bottom:16px;padding:16px 20px;border:1px solid var(--atlas-ar-line);border-radius:var(--atlas-ar-radius-lg);background:var(--atlas-ar-surface)}
.atlas-ar-section-title{margin:0 0 12px;font-size:14px;font-weight:600;line-height:1.4}
.atlas-ar-section-title+.atlas-ar-section-lead{margin-top:-8px}
.atlas-ar-section-lead{margin:0 0 12px;color:var(--atlas-ar-muted)}
.atlas-ar-section h3{margin:16px 0 8px;font-size:13px}
/* AR-148: each later group of settings stands apart (a gap and a light line). */
.atlas-ar-section h3:not(:first-child){margin-top:28px;padding-top:16px;border-top:1px solid var(--atlas-ar-surface-3)}
.atlas-ar-section .components-base-control{margin-bottom:12px}
.atlas-ar-split{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px;align-items:start}
.atlas-ar-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.atlas-ar-muted{color:var(--atlas-ar-muted)}
.atlas-ar-label{display:block;margin:8px 0 6px;font-size:11px;font-weight:500;text-transform:uppercase}
.atlas-ar-empty{color:var(--atlas-ar-muted)}

.atlas-ar-badge{display:inline-block;margin-left:6px;padding:2px 8px;border-radius:10px;background:var(--atlas-ar-brand-ground);color:var(--atlas-ar-brand);font-size:11px;font-weight:600;vertical-align:middle}
.atlas-ar-badge--pro{margin-left:0;background:var(--atlas-ar-pro-badge);color:var(--atlas-ar-pro-ink)}
.atlas-ar-badge--warn{background:var(--atlas-ar-danger-ground);color:#8a2424}
.atlas-ar-badge--muted{background:var(--atlas-ar-surface-3);color:var(--atlas-ar-muted)}
.atlas-ar-pro-note{margin:12px 0;padding:8px 12px;border-left:3px solid var(--atlas-ar-pro);background:var(--atlas-ar-pro-ground);color:var(--atlas-ar-ink-2)}
/* AR-146: a note with a few points */
.atlas-ar-pro-note p{margin:4px 0}
.atlas-ar-pro-note ul{margin:6px 0 8px 18px;list-style:disc}
.atlas-ar-pro-note li{margin:2px 0}

.atlas-ar-choice{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:10px;margin-bottom:12px}
.atlas-ar-choice.is-compact{grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}
.atlas-ar-choice-item{display:flex;flex-direction:column;gap:6px;min-height:44px;padding:12px;border:2px solid var(--atlas-ar-line-strong);border-radius:8px;background:#fff;color:var(--atlas-ar-ink);text-align:left;font:inherit;cursor:pointer}
.atlas-ar-choice-item:hover{border-color:var(--atlas-ar-subtle)}
.atlas-ar-choice-item.is-on{border-color:var(--atlas-ar-action);background:var(--atlas-ar-action-ground)}
.atlas-ar-choice-title{font-weight:600}
.atlas-ar-choice-text{font-size:13px;color:var(--atlas-ar-muted)}

.atlas-ar-swatches{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:12px}
.atlas-ar-swatch{width:36px;height:36px;border:2px solid var(--atlas-ar-line-strong);border-radius:50%;cursor:pointer}
.atlas-ar-swatch.is-on{border-color:var(--atlas-ar-action);box-shadow:0 0 0 2px #fff inset}
.atlas-ar-swatch-custom{display:inline-flex;align-items:center;gap:6px;font-size:13px}
.atlas-ar-swatch-custom input{width:40px;height:32px;padding:0;border:1px solid var(--atlas-ar-line-strong);border-radius:4px;background:none}

.atlas-ar-viewer-box,.atlas-ar-viewer-empty{border:1px solid var(--atlas-ar-line);border-radius:8px;background:var(--atlas-ar-viewer-ground);overflow:hidden}
.atlas-ar-viewer-box atlasar-viewer{display:block}
.atlas-ar-viewer-empty{display:flex;align-items:center;justify-content:center;padding:16px;color:var(--atlas-ar-muted);text-align:center}
.atlas-ar-preview-col h3{margin-top:0}

.atlas-ar-savebar{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin:16px 0}
.atlas-ar-saved{color:var(--atlas-ar-success);font-weight:500}
.atlas-ar-error{color:var(--atlas-ar-danger)}

.atlas-ar-cloud-tip{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px;padding:16px 20px;border:1px solid var(--atlas-ar-brand-soft);border-radius:8px;background:var(--atlas-ar-brand-ground-2)}
.atlas-ar-cloud-tip ul{display:flex;flex-wrap:wrap;gap:4px 16px;margin:6px 0 0;padding:0;list-style:none;color:var(--atlas-ar-ink-2)}
.atlas-ar-checklist ol{margin:0;padding:0;list-style:none}
.atlas-ar-checklist li{display:flex;align-items:center;gap:12px;padding:10px 0;border-top:1px solid var(--atlas-ar-surface-3)}
.atlas-ar-check{display:inline-flex;flex:none;align-items:center;justify-content:center;width:24px;height:24px;border:2px solid var(--atlas-ar-line-strong);border-radius:50%;color:#fff;font-size:13px}
.atlas-ar-checklist li.is-done .atlas-ar-check{border-color:var(--atlas-ar-brand);background:var(--atlas-ar-brand)}
.atlas-ar-check-text{display:flex;flex:1;flex-direction:column}
.atlas-ar-check-text span{color:var(--atlas-ar-muted);font-size:13px}
.atlas-ar-checklist li.is-done strong{color:var(--atlas-ar-muted);font-weight:500}
.atlas-ar-progress{display:flex;align-items:center;gap:12px;margin:0 0 8px;color:var(--atlas-ar-muted)}

.atlas-ar-table{border-radius:6px}
.atlas-ar-table td{vertical-align:middle}
.atlas-ar-product-name{display:inline-flex;align-items:center;gap:8px;font-weight:600}
.atlas-ar-product-name img{border-radius:4px;object-fit:cover}
.atlas-ar-actions{text-align:right;white-space:nowrap}
.atlas-ar-table thead th{white-space:nowrap}
.atlas-ar-pager{display:flex;align-items:center;justify-content:flex-end;gap:12px;margin-top:12px}

.atlas-ar-cats{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:8px}
.atlas-ar-cat{display:flex;flex-direction:column;gap:4px;padding:12px;border:1px solid var(--atlas-ar-line);border-radius:6px;color:var(--atlas-ar-muted)}
.atlas-ar-cat.is-on{border-color:var(--atlas-ar-brand-soft);color:var(--atlas-ar-ink)}
.atlas-ar-cat .atlas-ar-badge{align-self:flex-start;margin:0}
.atlas-ar-benefits{margin:0 0 12px 18px;list-style:disc}
/* AR-138: AtlasAR Cloud benefits */
.atlas-ar-cloud-benefits{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;margin:4px 0 16px}
.atlas-ar-cloud-benefit{display:flex;flex-direction:column;gap:4px;padding:12px 14px;border:1px solid var(--atlas-ar-line);border-left:3px solid var(--atlas-ar-action);border-radius:4px;background:var(--atlas-ar-surface-2)}
.atlas-ar-cloud-benefit strong{font-size:13px;color:var(--atlas-ar-ink)}
.atlas-ar-cloud-benefit span{color:var(--atlas-ar-muted);line-height:1.5}
.atlas-ar-cloud-plans{grid-column:1/-1;margin:0;padding:10px 14px;border-radius:4px;background:var(--atlas-ar-action-ground);color:var(--atlas-ar-ink)}
/* AR-133: how connecting AtlasAR Cloud works; the "already registered" choices */
.atlas-ar-cloud-steps{margin-top:20px;padding-top:16px;border-top:1px solid var(--atlas-ar-surface-3)}
.atlas-ar-cloud-steps h3{margin:0 0 8px;font-size:13px}
.atlas-ar-cloud-steps ol,.atlas-ar-cloud-choices{margin:0 0 8px 20px}
.atlas-ar-cloud-steps li,.atlas-ar-cloud-choices li{margin-bottom:6px;color:var(--atlas-ar-muted)}
.atlas-ar-cloud-choices li{margin-bottom:12px}
.atlas-ar-cloud-links{margin:8px 0 0;color:#646970}
.atlas-ar-code{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:8px;border-radius:6px;background:var(--atlas-ar-surface-2)}
.atlas-ar-code code{flex:1;background:none;font-size:13px}
.atlas-ar-checks{margin:0;padding:0;list-style:none}
.atlas-ar-checks li{padding:6px 0}
.atlas-ar-checks li.is-ok span{color:var(--atlas-ar-success);font-weight:700}
.atlas-ar-checks li.is-warn span{color:var(--atlas-ar-danger);font-weight:700}
.atlas-ar-guides{margin:0 0 0 18px;list-style:disc}

/* Setup wizard */
.atlas-ar-wizard{max-width:880px;margin:0 auto}
.atlas-ar-wizard-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:12px;margin-bottom:12px}
.atlas-ar-wizard-head h1{margin:0;font-size:23px;font-weight:400}
.atlas-ar-wizard-head p{flex:1;margin:0;color:var(--atlas-ar-muted)}
.atlas-ar-steps{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 16px;padding:0;list-style:none;counter-reset:step}
.atlas-ar-steps li{flex:1 1 120px;padding:8px 10px;border-bottom:3px solid var(--atlas-ar-line);color:var(--atlas-ar-muted);font-size:13px;counter-increment:step}
.atlas-ar-steps li::before{content:counter(step) ". "}
.atlas-ar-steps li.is-current{border-color:var(--atlas-ar-action);color:var(--atlas-ar-ink);font-weight:600}
.atlas-ar-steps li.is-done{border-color:var(--atlas-ar-brand)}
.atlas-ar-wizard .atlas-ar-section h2{margin:0 0 4px;font-size:18px}
.atlas-ar-wizard-nav{display:flex;align-items:center;justify-content:space-between;gap:12px}

/* A setting (UI.Field): the search scrolls to it, focuses it and marks it for 2 seconds (dashboard and product panel). */
.atlas-ar-field{margin-block:0 8px;margin-inline:-8px;padding:6px 8px;border-radius:var(--atlas-ar-radius-md);scroll-margin:24px}
.atlas-ar-field>.components-base-control{max-width:640px;margin-bottom:0}
.atlas-ar-field>.atlas-ar-swatches{margin-bottom:0}
.atlas-ar-field.is-found{box-shadow:0 0 0 2px var(--atlas-ar-action);animation:atlas-ar-found 2s ease-out forwards}
@keyframes atlas-ar-found{0%,55%{background-color:var(--atlas-ar-action-ground)}100%{background-color:transparent}}
@media (prefers-reduced-motion:reduce){.atlas-ar-field.is-found{animation:none}}
@media (forced-colors:active){.atlas-ar-field.is-found{outline:2px solid Highlight;outline-offset:-2px}}
.atlas-ar-chip--ok{background:var(--atlas-ar-brand-ground);color:var(--atlas-ar-brand)}
.atlas-ar-chip--note{background:var(--atlas-ar-pro-ground);color:var(--atlas-ar-pro-ink)}
.atlas-ar-empty-state{display:flex;flex-direction:column;align-items:center;gap:12px;padding:32px 16px;border:1px dashed var(--atlas-ar-line-strong);border-radius:var(--atlas-ar-radius-lg);background:var(--atlas-ar-surface);text-align:center}
.atlas-ar-empty-state p{max-width:520px;margin:0;color:var(--atlas-ar-ink-2)}

/*
 * Product panel (AR-182): inside the editor, no app frame. One column by default; beside each
 * other (preview | tabs) when the box is wide enough. A container query on the panel itself, so
 * it follows the box (block editor meta box, classic editor main column or narrow side column),
 * not the window.
 */
#atlas-ar-panel .inside{margin:0;padding:12px}
.atlas-ar-panel-wrap{container-type:inline-size;container-name:atlasarpanel;color:var(--atlas-ar-ink)}
.atlas-ar-panel-status{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 12px;padding:0;list-style:none}
.atlas-ar-panel-status li{margin:0}
.atlas-ar-panel-status .atlas-ar-chip{font-size:12px;padding:2px 8px}
.atlas-ar-panel{display:grid;grid-template-columns:minmax(0,1fr);align-items:start;gap:16px;color:var(--atlas-ar-ink)}
.atlas-ar-panel-view{display:flex;flex-direction:column;gap:8px;min-width:0}
/* The preview never draws outside its box (e.g. AtlasAR Pro's measurement labels near an edge). */
.atlas-ar-panel-view .atlas-ar-viewer-box,.atlas-ar-panel-view .atlas-ar-viewer-empty{overflow:hidden}
.atlas-ar-panel-side{display:flex;flex-direction:column;min-width:0}
/*
 * Rules of the panel's tabs (AR-182 review): the tabs wrap onto more rows rather than scroll
 * (every tab stays visible; a narrow box gets a select instead, see atlas-ar-product.js); the tab
 * content takes its natural height and never scrolls, sideways least of all; nothing in it is
 * wider than its column.
 */
/* More specific than the frame's .atlas-ar-tabs-panel rules (atlas-ar-shell.css), which may be on the same page. */
.atlas-ar-panel-wrap .atlas-ar-panel-tabs>.components-tab-panel__tabs{flex-wrap:wrap;overflow:visible;border-bottom:1px solid var(--atlas-ar-line)}
.atlas-ar-panel-tabs .components-tab-panel__tabs-item{flex:none;white-space:nowrap}
.atlas-ar-panel-tabs .components-tab-panel__tab-content,.atlas-ar-panel-side>.atlas-ar-tab-body{padding-top:12px;overflow:visible;min-width:0}
.atlas-ar-panel .atlas-ar-tab-body,.atlas-ar-panel .atlas-ar-tab-body>*{min-width:0;max-width:100%;box-sizing:border-box}
/* A field's room for its search mark lies inside the column here (no negative margin past the edge). */
.atlas-ar-panel .atlas-ar-field{margin-inline:0;padding-inline:4px}
.atlas-ar-panel-pick{margin:0 0 4px}
.atlas-ar-panel-heading{margin:16px 0 4px;font-size:13px;font-weight:600}
.atlas-ar-tab-body>.atlas-ar-panel-heading:first-child{margin-top:0}
.atlas-ar-panel-empty{padding:20px 12px}
.atlas-ar-panel-empty strong{font-size:14px}
.atlas-ar-panel-foot{margin-top:8px;padding-top:8px;border-top:1px solid var(--atlas-ar-surface-3)}
.atlas-ar-panel-foot .atlas-ar-savebar{margin:0}
.atlas-ar-panel-foot>.description{margin:4px 0 0}
.atlas-ar-panel .atlas-ar-model-line{margin-bottom:8px}
.atlas-ar-panel .atlas-ar-row .components-button{white-space:normal;height:auto;min-height:36px;text-align:start}
/* A plain row of tab buttons: only next to an older kit without UI.Tabs. */
.atlas-ar-tabs{display:flex;flex-wrap:wrap;gap:4px;margin-bottom:12px;border-bottom:1px solid var(--atlas-ar-line)}
.atlas-ar-tab{min-height:40px;margin-bottom:-1px;padding:8px 12px;border:0;border-bottom:3px solid transparent;background:none;color:var(--atlas-ar-muted);font-size:13px;cursor:pointer}
.atlas-ar-tab.is-current{border-color:var(--atlas-ar-action);color:var(--atlas-ar-ink);font-weight:600}
.atlas-ar-tab-body{display:flex;flex-direction:column;gap:10px}
.atlas-ar-tab-body>.atlas-ar-field{margin-block:0}
.atlas-ar-panel .atlas-ar-drop{padding:16px}
.atlas-ar-model-line{display:flex;flex-wrap:wrap;align-items:center;gap:4px}

@media (max-width:960px){
	.atlas-ar-split{grid-template-columns:1fr}
}

/*
 * A wide box: the preview beside the tabs, and it stays in view while the page scrolls past a long
 * tab (sticky, instead of a fixed-height box with its own scroll). Without a model there is no
 * preview column: the tabs (with the "No 3D model yet" card) take the whole width.
 */
@container atlasarpanel (min-width:640px){
	.atlas-ar-panel:not(.is-single){grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
	.atlas-ar-panel-view{position:sticky;top:calc(var(--wp-admin--admin-bar--height,32px) + 16px)}
}

/* AR-156: quick styles above the Appearance settings */
.atlas-ar-presets{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0 0 12px}
.atlas-ar-presets .atlas-ar-label{margin:0 4px 0 0}
.atlas-ar-subhead{margin:20px 0 8px;padding-top:12px;border-top:1px solid var(--atlas-ar-surface-3);font-size:13px}

/* AR-156: the "Your style" fields get room under their choice. (AR-180: Appearance's two panes are in atlas-ar-shell.css.) */
.atlas-ar-subgroup{display:grid;gap:12px;margin-top:16px;padding-top:4px}
/* Design system › RowActions: the actions of a row as one right-aligned group of equal height. */
.atlas-ar-row-actions{display:inline-flex;align-items:center;justify-content:flex-end;gap:8px}
.atlas-ar-row-actions .components-button{height:32px;min-height:32px}
.atlas-ar-row-actions .atlas-ar-view.has-icon{width:32px;min-width:32px;padding:0;justify-content:center;color:var(--atlas-ar-muted);box-shadow:inset 0 0 0 1px var(--atlas-ar-line-strong)}
.atlas-ar-row-actions .atlas-ar-view.has-icon:hover{color:var(--atlas-ar-action);box-shadow:inset 0 0 0 1px var(--atlas-ar-action)}
/* Design system: Get started is always there; folded it is one line. */
.atlas-ar-checklist-head{display:flex;flex-wrap:wrap;align-items:center;gap:12px}
.atlas-ar-checklist-head .atlas-ar-section-title{margin:0}
.atlas-ar-checklist-head .atlas-ar-progress{margin:0;color:var(--atlas-ar-muted)}
.atlas-ar-checklist-actions{display:inline-flex;gap:8px;margin-left:auto}
.atlas-ar-checklist.is-folded{padding-top:10px;padding-bottom:10px}
.atlas-ar-checklist .atlas-ar-lead{margin:12px 0 0}

/* AR-158: the wizard's last screen */
.atlas-ar-wizard-optin{margin:16px 0;padding:12px 16px;border:1px solid var(--atlas-ar-line);border-radius:6px;background:var(--atlas-ar-surface-2)}
.atlas-ar-suggested{margin-top:28px;padding-top:20px;border-top:1px solid var(--atlas-ar-surface-3)}
.atlas-ar-suggested-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;margin:12px 0;padding:0;list-style:none}
.atlas-ar-suggested-card{display:flex;flex-direction:column;gap:6px;margin:0;padding:16px;border:1px solid var(--atlas-ar-line);border-radius:6px;background:#fff}
.atlas-ar-suggested-card p{flex:1;margin:0;color:var(--atlas-ar-muted);font-size:12px;line-height:1.5;display:-webkit-box;-webkit-line-clamp:4;line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}
.atlas-ar-suggested-card .atlas-ar-row{align-items:center;gap:8px}
.atlas-ar-suggested h3{margin:0;font-size:13px;font-weight:600}
.atlas-ar-suggested-card .atlas-ar-badge{margin-left:0}
.atlas-ar-page-notice{margin:0 0 16px}

/* AR-161: Analytics */
.atlas-ar-range{margin:0 0 16px}
.atlas-ar-stat-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px;margin:0 0 16px}
.atlas-ar-stat-card{display:flex;flex-direction:column;gap:4px;padding:16px;border:1px solid var(--atlas-ar-line);border-radius:8px;background:#fff}
.atlas-ar-stat-card strong{font-size:24px;line-height:1.2;font-weight:600;color:var(--atlas-ar-ink)}
.atlas-ar-stat-label{color:var(--atlas-ar-muted);font-size:12px}
.atlas-ar-bars{display:flex;align-items:flex-end;gap:2px;height:120px;padding:8px 0;border-bottom:1px solid var(--atlas-ar-line)}
.atlas-ar-bar{flex:1;min-width:2px;background:var(--atlas-ar-brand);border-radius:2px 2px 0 0}
.atlas-ar-bars-axis{display:flex;justify-content:space-between;color:var(--atlas-ar-muted);font-size:12px;margin-top:4px}
.atlas-ar-table .num{text-align:right;white-space:nowrap}
.atlas-ar-stats-table td:first-child,.atlas-ar-stats-table th:first-child{min-width:200px}

/* AR-165: AtlasAR Cloud turned off on this site */
.atlas-ar-cloud-soon h3{margin:16px 0 4px;font-size:13px;font-weight:600}
.atlas-ar-cloud-soon ul{margin:0 0 8px 18px;list-style:disc}
.atlas-ar-cloud-soon .atlas-ar-badge{margin-left:0}
/* AR-168: a single field reads better at a measured width (not the whole window) */
.atlas-ar-section>.components-base-control,.atlas-ar-section>.atlas-ar-subgroup>.components-base-control{max-width:640px}
/* Try-on from a photo (product panel) */
.atlas-ar-tryon-photo{margin:12px 0;padding:10px 12px;border:1px solid #dcdcde;border-radius:8px;background:#f6f7f7}
.atlas-ar-tryon-photo h3{margin:0 0 4px}
.atlas-ar-tryon-photo-preview{display:block;max-width:220px;max-height:120px;margin:8px 0;object-fit:contain;background:#fff;border:1px solid #dcdcde;border-radius:6px}
