/* SanatMap UI standard v1. Scope only to the surfaces approved in docs/UI_SYSTEM.md. */
:root{--ds-brand:#002b66;--ds-accent:#ff7900;--ds-surface:#fff;--ds-canvas:#f3f6fa;--ds-ink:#172b49;--ds-muted:#566780;--ds-line:#dce3ed;--ds-soft:#edf3fa;--ds-danger:#a92c30;--ds-radius:16px;--ds-control-radius:10px;--ds-gap:24px}
.ui-scope{color:var(--ds-ink);min-width:0}
.ui-scope .button{font-size:14px;min-height:44px;border-radius:var(--ds-control-radius);padding:10px 16px;gap:8px;white-space:normal;text-align:center}
.ui-scope .button.outline{border-color:var(--ds-line)}
.ui-scope .button.outline:hover,.ui-scope .button.outline:focus-visible{background:var(--ds-soft);border-color:#9eb5d0;color:var(--ds-brand)}
.ui-scope .button.primary{background:var(--ds-brand);color:#fff}
.ui-scope .button.primary:hover{background:#174981}
.ui-scope .button.danger{color:var(--ds-danger);background:#fff;border-color:#e8cdd0}
.ui-scope .button.danger:hover{background:#fff2f2;border-color:var(--ds-danger)}
.ui-scope .button .icon{width:18px;height:18px}
.ui-scope .field{gap:8px;margin-bottom:20px}
.ui-scope .field label{font-size:14px}
.ui-scope input,.ui-scope select,.ui-scope textarea{border-color:#b8c7d9;border-radius:var(--ds-control-radius);font-size:15px}
.ui-scope .field-help{font-size:13px;line-height:1.9}
.ui-scope .page-heading{margin-bottom:24px}
.ui-scope .page-heading h1{font-size:30px}
.ui-scope .page-heading p{font-size:15px;margin-top:6px;color:var(--ds-muted)}
.ui-scope .ds-panel{background:var(--ds-surface);border:1px solid var(--ds-line);border-radius:var(--ds-radius);padding:24px;min-width:0;box-shadow:none;margin:0}
.ui-scope .ds-heading{display:flex;align-items:flex-start;gap:12px;margin-bottom:24px}
.ui-scope .ds-heading>.icon{width:22px;height:22px;margin-top:4px;color:var(--ds-brand)}
.ui-scope .ds-heading>div{flex:1;min-width:0}
.ui-scope .ds-heading h2{font-size:20px;line-height:1.6;margin:0}
.ui-scope .ds-heading p,.ui-scope .ds-secondary{font-size:13px;color:var(--ds-muted);line-height:1.9;margin:4px 0 0;overflow-wrap:anywhere}
.ui-scope .ds-help-box{font-size:13px;line-height:2;background:var(--ds-soft);padding:16px;border-radius:10px;margin:16px 0;color:var(--ds-muted)}
.ui-scope .ds-help-box>.icon{width:18px;height:18px;margin-inline-end:6px}
.ui-scope .ds-count{font-size:12px;white-space:nowrap;color:var(--ds-muted);padding:3px 9px;border:1px solid var(--ds-line);border-radius:8px}
.ui-scope .ds-section{scroll-margin-top:110px}
.ds-nav{display:flex;gap:8px;min-width:0}
.ds-nav a{display:flex;align-items:center;gap:8px;min-height:44px;padding:10px 16px;font-size:14px;font-weight:600;border-radius:10px;color:var(--ds-muted);transition:background-color .18s,color .18s}
.ds-nav a>.icon{width:19px;height:19px}
.ds-nav a:hover,.ds-nav a.active{background:var(--ds-soft);color:var(--ds-brand)}
.ds-quick-nav{position:sticky;top:12px;z-index:30;margin-bottom:24px;padding:7px;background:#fff;border:1px solid var(--ds-line);border-radius:14px;box-shadow:0 3px 12px #002b6606}
.settings-layout{display:grid;grid-template-columns:200px minmax(0,1fr);gap:24px;align-items:start}
.ui-scope .settings-local-menu{position:sticky;top:104px;padding:16px}
.settings-local-menu h2{font-size:14px;padding:8px 12px;margin-bottom:10px}
.ds-local-nav{flex-direction:column;gap:6px}
.settings-content{min-width:0;display:grid;gap:24px}
.ui-scope .settings-page{display:grid;gap:24px;max-width:none}
.ui-scope .settings-page>.ds-panel{max-width:none;width:100%}
.ui-scope .settings-page .ds-panel>.field-help{margin:-10px 0 24px}
.ui-scope .settings-save{position:static;margin:0;display:flex;justify-content:flex-end;padding:0;background:transparent;border:0}
.ui-scope .license-setting{margin:24px 0 0;border:1px solid var(--ds-line);border-radius:12px;padding:16px}
.ui-scope .license-setting legend{padding:0 8px;color:var(--ds-muted);font-size:13px}
.ui-scope .license-setting .field:last-child{margin-bottom:0;grid-column:1/-1}
.ds-management-layout{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(280px,1fr);gap:24px;align-items:start}
.ds-account-list{display:grid;gap:16px}
.ds-account-row{border:1px solid var(--ds-line);border-radius:12px;padding:20px;min-width:0}
.ds-person-heading{display:flex;align-items:center;gap:12px}
.ds-avatar{display:inline-flex;align-items:center;justify-content:center;width:48px;height:48px;flex:0 0 48px;border-radius:50%;background:var(--ds-soft);color:var(--ds-brand)}
.ds-avatar>.icon{width:23px;height:23px}.ds-avatar.large{width:72px;height:72px;margin-bottom:12px}.ds-avatar.large>.icon{width:32px;height:32px}
.ds-person-name{flex:1;min-width:0}.ds-person-name h3{font-size:16px;overflow-wrap:anywhere;text-wrap:wrap}
.ds-person-name bdi{font-size:13px;overflow-wrap:anywhere}
.ds-person-meta{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0 16px;font-size:12px;color:var(--ds-muted)}
.ds-person-meta>span+span{border-inline-start:1px solid var(--ds-line);padding-inline-start:8px}
.ds-status{display:inline-flex;align-items:center;gap:6px;border-radius:7px;padding:3px 8px;font-size:12px;font-weight:650;white-space:nowrap}
.ds-status::before{content:'';width:5px;height:5px;border-radius:50%;background:currentColor}
.ds-status.is-active{color:#126342;background:#e7f5ee}.ds-status.is-inactive{color:#765740;background:#f7efe8}
.ds-disclosure{border:1px solid var(--ds-line);border-radius:10px;overflow:hidden}
.ds-disclosure summary{list-style:none;display:flex;align-items:center;gap:8px;min-height:44px;padding:10px 12px;font-size:13px;font-weight:600;cursor:pointer;color:var(--ds-brand)}
.ds-disclosure summary::-webkit-details-marker{display:none}
.ds-disclosure summary>.icon{width:18px;height:18px}.ds-disclosure summary>.disclosure-chevron{margin-inline-start:auto;transition:transform .18s}
.ds-disclosure[open]>summary{background:var(--ds-soft);border-bottom:1px solid var(--ds-line)}
.ds-disclosure[open]>summary>.disclosure-chevron{transform:rotate(180deg)}
.ds-disclosure-body{padding:16px}.ds-disclosure-body>.ds-secondary{margin:0 0 16px}
.ds-disclosure-body>.ds-disclosure{margin-top:20px}
.ds-account-note{display:flex;gap:8px;align-items:center;font-size:12px;color:var(--ds-muted);border-top:1px solid var(--ds-line);padding-top:12px}
.ds-account-note>.icon{width:16px;height:16px}
.ds-create-person{position:sticky;top:24px}

.ds-ownership-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 0;border-top:1px solid var(--ds-line)}
.ds-ownership-row h3{font-size:16px}
.ds-security-layout{display:grid;grid-template-columns:280px minmax(0,680px);gap:24px;align-items:start}
.ds-identity-card{text-align:center}.ds-identity-card .ds-heading{text-align:right}
.ds-identity-card h3{font-size:20px}

.ds-security-main{min-width:0}.ui-scope .account-form{max-width:none}
.ui-scope .account-form>p{font-size:14px;color:var(--ds-muted);margin:0 0 24px}
.ds-form-footer{border-top:1px solid var(--ds-line);padding-top:20px;display:grid;gap:20px;justify-items:start}
.factory-editor-aside{gap:20px}
.ui-scope.factory-editor-aside .ds-panel{padding:20px}
.factory-editor-aside .ds-heading{gap:8px;flex-wrap:wrap;margin-bottom:16px}
.factory-editor-aside .ds-heading h2{font-size:18px}
.factory-editor-aside .ds-heading>.badge{margin:0;flex-basis:auto;font-size:11px}
.factory-editor-aside .publication-card>.ds-secondary{margin-bottom:20px}
.ds-action-stack{display:grid;gap:10px;margin-bottom:12px}

.factory-editor-aside .ds-panel .button{font-size:13px;padding-inline:10px;margin:0}
.factory-editor-aside .logo-card #logo-preview{display:flex;justify-content:center;margin:0}
.factory-editor-aside .logo-card #logo-preview:not(:empty){padding:12px;margin-bottom:20px;background:#f8fafd;border:1px solid var(--ds-line);border-radius:12px}
.factory-editor-aside #logo-preview img{object-fit:contain;width:120px;height:120px;max-height:none}
.factory-editor-aside .upload-zone.compact{margin:0;min-height:144px;border-radius:12px;padding:16px;gap:8px}
.ds-logo-remove{margin-top:16px}.ds-logo-remove:has([hidden]){display:none}
.ds-checklist{list-style:none;padding:0;margin:0}
.ds-checklist li+li{border-top:1px solid var(--ds-line)}
.ds-checklist a{display:flex;gap:10px;align-items:center;padding:14px 0;min-height:64px}
.ds-checklist a>.icon:first-child{width:20px;height:20px;color:var(--ds-muted)}
.ds-checklist a>.icon:last-child{width:16px;height:16px;margin-inline-start:auto;color:var(--ds-muted)}
.ds-checklist strong{font-size:13px;display:block}.ds-checklist small{display:block;font-size:12px;line-height:1.8;color:var(--ds-muted)}
.ds-checklist a:hover strong{color:var(--ds-brand);text-decoration:underline;text-underline-offset:4px}
body:has(.factory-public){background:var(--ds-canvas)}
.factory-public .factory-masthead{background:#fff;border:1px solid var(--ds-line);border-radius:16px;padding:32px;box-shadow:none;gap:24px;align-items:start}

.factory-public .factory-identity h1{font-size:32px;line-height:1.6}
.factory-public .factory-summary{font-size:15px;line-height:2.1;color:var(--ds-muted);max-width:none;margin-top:16px}

.factory-public .contact-item{padding:16px 0;background:transparent;border:0;border-bottom:1px solid var(--ds-line);border-radius:0;margin:0}
.factory-public .contact-item:last-child{border-bottom:0}
.factory-public .contact-item dt{display:flex;gap:8px;align-items:center;font-size:12px;font-weight:500;color:var(--ds-muted);margin-bottom:7px}
.factory-public .contact-item dt>.icon{width:17px;height:17px;color:var(--ds-muted)}
.factory-public .contact-item dd{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0;font-size:15px;line-height:1.9}
.factory-public .contact-item dd>span{min-width:0;overflow-wrap:anywhere}
.factory-public .contact-item dd .icon-button{width:44px;height:44px;border:1px solid var(--ds-line);border-radius:9px;background:#f9fbfd;padding:9px}
.factory-public .contact-item dd .icon-button:hover{background:var(--ds-soft)}

.factory-public .rich-section h2{font-size:20px;line-height:1.7;margin:0 0 20px;padding-inline-start:12px;border-inline-start:3px solid var(--ds-accent)}
.factory-public .rich-section .section-heading{align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:20px}
.factory-public .rich-section .section-heading h2{margin:0}
.factory-public .prose{font-size:15px;line-height:2.15;color:#425771}
.factory-public .photo-gallery{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:0}
.factory-public .photo-gallery img{width:100%;height:auto;aspect-ratio:1930/1080;object-fit:cover;border-radius:10px}
.factory-public .photo-gallery figure{overflow:hidden}
.factory-public .map{border-radius:12px;height:310px}
.factory-public .map-note{font-size:12px;color:var(--ds-muted);margin-top:12px}
.factory-public .updated-line{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end;font-size:12px;color:var(--ds-muted);margin:0;padding:0 4px}
.factory-public .factory-rating .unrated{padding:8px 12px;background:var(--ds-soft);border-radius:8px;font-size:12px}

@media(max-width:1199px){.settings-layout{grid-template-columns:176px minmax(0,1fr);gap:20px}.ds-management-layout{grid-template-columns:minmax(0,1.2fr) minmax(260px,1fr)}.ds-security-layout{grid-template-columns:240px minmax(0,1fr)}}
@media(max-width:1000px){.settings-layout{grid-template-columns:1fr}.settings-local-menu{display:none}.ds-management-layout{grid-template-columns:1fr}.ds-create-person{position:static}.ds-security-layout{grid-template-columns:1fr}.ds-security-layout>.ds-identity-card{display:block}}
@media(max-width:767px){.ui-scope .ds-panel{padding:18px}.ui-scope .ds-heading{margin-bottom:20px;gap:10px}.ui-scope .ds-heading h2{font-size:18px}.ui-scope .page-heading h1{font-size:25px}.ui-scope .page-heading p{font-size:13px}.ui-scope .button{font-size:13px}.ui-scope .form-grid{grid-template-columns:1fr}.ds-quick-nav{top:8px;gap:2px;overflow-x:auto;padding:5px;margin-bottom:20px}.ds-nav a{padding:10px 12px;font-size:13px;white-space:nowrap}.ds-nav a>.icon{width:17px;height:17px}.ds-count{align-self:center}.ds-account-row{padding:16px}.ds-person-heading{gap:10px;flex-wrap:wrap}.ds-person-name{min-width:110px}.ds-person-meta{margin-bottom:14px}.ds-ownership-row{align-items:start;flex-direction:column;gap:12px}.ds-security-layout{gap:20px}.ds-disclosure-body{padding:14px}.ds-disclosure-body .button{width:100%}.factory-editor-aside{flex-direction:column}.factory-editor-aside .ds-heading{flex-wrap:nowrap}.factory-editor-aside .ds-heading>.badge{font-size:11px}.factory-public .factory-masthead{padding:20px;gap:16px}.factory-public .factory-identity h1{font-size:26px}.factory-public .factory-summary{font-size:14px;margin-top:12px}.factory-public .rich-section h2{font-size:19px}.factory-public .prose{font-size:14px}.factory-public .photo-gallery{gap:10px}.factory-public .map{height:265px}}
@media(max-width:359px){.ui-scope .ds-panel{padding:16px}.ds-person-heading .ds-status{margin-inline-start:58px}.factory-public .factory-masthead{padding:16px}.factory-public .factory-identity h1{font-size:24px}.factory-public .photo-gallery{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){.ds-nav a,.ds-disclosure summary>.disclosure-chevron{transition:none}}

/* Slim, brand-colored scrollbars for local navigation rails. */
.ds-quick-nav{scrollbar-width:thin;scrollbar-color:#9eb5d0 transparent}
.ds-quick-nav::-webkit-scrollbar{height:5px}
.ds-quick-nav::-webkit-scrollbar-thumb{background:#9eb5d0;border-radius:8px}
.ds-quick-nav::-webkit-scrollbar-button{display:none}

.factory-editor-aside .logo-card .upload-zone{position:relative;overflow:hidden}
.factory-editor-aside .logo-card .upload-zone input[type=file]{position:absolute;inset:0;width:100%;height:100%;padding:0;margin:0;opacity:0;cursor:pointer}
.factory-editor-aside .logo-card .upload-zone:focus-within{outline:3px solid #d96700;outline-offset:3px}

@media(max-width:767px){
.factory-public .factory-masthead{display:grid;grid-template-columns:84px minmax(0,1fr);align-items:start}
.factory-public .factory-identity{display:contents}
.factory-public .factory-name-line{grid-column:2;min-width:0}
.factory-public .factory-summary{grid-column:1/-1;margin:0;text-align:right;justify-content:flex-start}

}
@media(max-width:359px){.factory-public .factory-masthead{grid-template-columns:72px minmax(0,1fr)}}

/* Factory editing: group actions and keep the submission checklist plain. */
.factory-unpublish{border-top:1px solid var(--border,#d5dfec);margin-top:16px;padding-top:16px}
.factory-unpublish p{margin:8px 0 0;font-size:12px;line-height:1.9;color:var(--muted,#536b8e)}
.factory-editor-heading{align-items:flex-start;gap:16px;flex-wrap:wrap}
.factory-editor-actions{gap:8px;align-self:center}
.factory-editor-actions .button{padding-inline:14px}
.preparation-card .ds-checklist .preparation-description{margin:3px 0 0;padding:0;border:0;background:none}
.factory-experience .preview-notice{align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.preview-notice-copy{flex:1 1 auto;min-width:0}
.preview-notice-copy strong{display:block}
.preview-notice-copy p{margin:3px 0 0;font-size:13px}
.factory-experience .preview-notice .button{border-radius:8px;min-height:44px;flex-shrink:0}
@media(max-width:767px){
.factory-editor-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;min-width:0}
.factory-editor-actions .button{width:100%;min-width:0;min-height:46px;white-space:normal;font-size:13px;padding-inline:10px}
.factory-editor-actions [data-factory-resources]{grid-column:1/-1;justify-self:stretch}
}
@media(max-width:399px){.factory-editor-actions{grid-template-columns:minmax(0,1fr)}}
@media(max-width:639px){.factory-experience .preview-notice{gap:12px}.factory-experience .preview-notice .button{width:100%}}
