/* The Settings page of the client portal, /editors/ and /admin/ (settings-ui.js builds the markup). One narrow column,
   sections told apart by a hairline and spacing, labels above their controls, small grey helper text. It only uses the
   colour tokens every page defines (--panel, --line, --muted, --accent, ...), so both themes follow. Loaded after the
   page's own CSS, so it wins ties with the shared .card / .field / .btn rules the company form still carries. */
.st{--st-control:36px;--st-radius:8px;--st-icon-info:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8 1a7 7 0 0 0 0 14A7 7 0 0 0 8 1zM7.25 7h1.5v5h-1.5zM7.25 4h1.5v1.5h-1.5z'/%3E%3C/svg%3E");max-width:640px;margin:0 auto;font-size:14px;line-height:1.5}
.st [hidden]{display:none!important}

/* Heading: a small breadcrumb, the title, one line of lead. */
.st-crumbs ol{display:flex;flex-wrap:wrap;align-items:center;gap:0 8px;list-style:none;font-size:13px;line-height:1.4;color:var(--dim)}
.st-crumbs li{min-width:0;overflow-wrap:anywhere}
.st-crumbs li:not(:empty) + li::before{content:"/";margin-right:8px;opacity:.6}
.st-crumbs [aria-current]{color:var(--muted)}
.st-head{margin:12px 0 32px}
.st-head h2{font-size:24px;font-weight:600;line-height:1.25;letter-spacing:-.02em}
.st-lead{margin-top:6px;font-size:15px;color:var(--muted)}

/* Sections: a hairline above, generous space around, a heading with its description. */
.st-section,.st-company .card{padding:32px 0;border-top:1px solid var(--line)}
.st-section-head{margin-bottom:24px}
.st-section-head h3,.st-company .card h3{font-size:18px;font-weight:600;line-height:1.3;letter-spacing:-.01em}
.st-section-head p,.st-company .card .hint{margin:4px 0 0;font-size:14px;line-height:1.45;color:var(--muted)}

/* Fields: the label above its control, the helper text below it; related fields share a row. */
.st-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px 24px;margin:0}
.st-avatar ~ .st-grid{margin-top:24px}
.st-label{display:block;margin-bottom:6px;font-size:14px;font-weight:500;line-height:1.4;color:var(--text)}
.st-help{margin-top:6px;font-size:13px;line-height:1.45;color:var(--dim)}
.st-value{font-size:15px;font-weight:500;overflow-wrap:anywhere}

/* Profile picture: the circle, then what can be done with it. */
.st-avatar{display:flex;align-items:center;gap:20px}
.st-avatar-frame{flex:none;display:block;width:72px;height:72px;border:1px solid var(--line);border-radius:50%;background:var(--panel-2);overflow:hidden}
.st-avatar-img{display:block;width:100%;height:100%;padding:20px;object-fit:cover}
.st-avatar-img.has-photo{padding:0;filter:none}
:root:not([data-theme="light"]) .st-avatar-img:not(.has-photo){filter:grayscale(1) invert(1)}
.st-avatar-main{min-width:0}
.st-avatar-main .st-label{margin-bottom:8px}
.st-avatar-main .st-help{margin-top:8px}
.st-actions{display:flex;flex-wrap:wrap;gap:8px}

/* Icons: Gravity UI files from /icons, drawn as masks so they take the colour of the text beside them. An element names one
   with data-icon (a company-form card or a section for its heading); headings, labels and buttons show it in front. */
.st [data-icon="person"]{--ico:url(/icons/ui/person.svg)}
.st [data-icon="palette"]{--ico:url(/icons/ui/palette.svg)}
.st [data-icon="companies"]{--ico:url(/icons/nav/companies.svg)}
.st [data-icon="users"]{--ico:url(/icons/ui/users.svg)}
.st [data-icon="link"]{--ico:url(/icons/ui/link.svg)}
.st [data-icon="envelope"]{--ico:url(/icons/ui/envelope.svg)}
.st [data-icon="shield-check"]{--ico:url(/icons/ui/shield-check.svg)}
.st [data-icon="sun"]{--ico:url(/icons/ui/sun.svg)}
.st [data-icon="globe"]{--ico:url(/icons/ui/globe.svg)}
.st [data-icon="upload"]{--ico:url(/icons/ui/upload.svg)}
.st [data-icon="trash-bin"]{--ico:url(/icons/ui/trash-bin.svg)}
.st [data-icon="file-text"]{--ico:url(/icons/ui/file-text.svg)}
.st [data-icon="map-pin"]{--ico:url(/icons/ui/map-pin.svg)}
.st [data-icon="smartphone"]{--ico:url(/icons/ui/smartphone.svg)}
.st [data-icon="instagram"]{--ico:url(/icons/brand/instagram.svg)}
.st [data-icon="facebook"]{--ico:url(/icons/brand/facebook.svg)}
.st [data-icon="tiktok"]{--ico:url(/icons/brand/tiktok.svg)}
.st-section[data-icon] h3::before,.st-company .card[data-icon] h3::before,.st-label[data-icon]::before,.st-company .field label[data-icon]::before,.st-btn[data-icon]::before{content:"";flex:none;width:16px;height:16px;background:currentColor;-webkit-mask:var(--ico) center/contain no-repeat;mask:var(--ico) center/contain no-repeat}
.st-section[data-icon] h3,.st-company .card[data-icon] h3{display:flex;align-items:center;gap:10px}
.st-section[data-icon] h3::before,.st-company .card[data-icon] h3::before{width:20px;height:20px}
.st-label[data-icon],.st-company .field label[data-icon]{display:flex;align-items:center;gap:8px}
.st-label[data-icon]::before,.st-company .field label[data-icon]::before{color:var(--muted)}

/* Controls: one height (36px, 44px on phones) and one radius for buttons, inputs, menus and the language switch. */
.st-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:var(--st-control);padding:0 14px;border:1px solid var(--line);border-radius:var(--st-radius);background:var(--panel);color:var(--text);font:inherit;font-size:14px;font-weight:500;line-height:1;white-space:nowrap;cursor:pointer;transition:background-color .15s,border-color .15s,color .15s}
.st-btn:hover:not(:disabled){border-color:var(--focus);background:var(--panel-2)}
.st-btn:disabled{opacity:.55;cursor:default}
.st-btn-quiet{border-color:transparent;background:transparent;color:var(--muted)}
.st-btn-quiet:hover:not(:disabled){border-color:transparent;background:var(--error-bg);color:var(--error-text)}
.st .v-control{width:100%;height:var(--st-control);min-height:var(--st-control);padding:0 12px;border-radius:var(--st-radius);background:var(--panel);font-size:14px}
.st .v-control:hover,.st .v-control[aria-expanded="true"]{background:var(--panel-2)}
.st-seg{display:flex;gap:2px;height:var(--st-control);padding:3px;border:1px solid var(--line);border-radius:var(--st-radius);background:var(--panel-2)}
.st-seg button{flex:1 1 0;min-width:0;padding:0 8px;border:0;border-radius:6px;background:transparent;color:var(--muted);font:inherit;font-size:14px;font-weight:500;white-space:nowrap;cursor:pointer;transition:background-color .15s,color .15s}
.st-seg button:hover:not([aria-pressed="true"]){color:var(--text)}
.st-seg button[aria-pressed="true"]{background:var(--accent);color:var(--on-accent)}

/* Notices: quiet, one line or two, with the tone of the message (the same tokens as the app's toasts). */
.st-note{display:flex;align-items:flex-start;gap:8px;margin-top:16px;padding:10px 12px;border:1px solid var(--tone-line,var(--line));border-radius:var(--st-radius);background:var(--tone-bg,var(--panel-2));color:var(--tone-fg,var(--muted));font-size:14px;line-height:1.45}
.st-note::before{content:"";flex:none;width:16px;height:16px;margin-top:calc((1lh - 16px) / 2);background:currentColor;-webkit-mask:var(--tone-icon,var(--st-icon-info)) center/contain no-repeat;mask:var(--tone-icon,var(--st-icon-info)) center/contain no-repeat}
.st-note[data-tone="error"]{--tone-fg:var(--error-text);--tone-bg:var(--error-bg);--tone-line:var(--error-border);--tone-icon:var(--icon-error)}
.st-note[data-tone="success"]{--tone-fg:var(--success-text);--tone-bg:var(--success-bg);--tone-line:var(--success-border);--tone-icon:var(--icon-success)}
.st-note[data-tone="warning"]{--tone-fg:var(--warning-text);--tone-bg:var(--warning-bg);--tone-line:var(--warning-border);--tone-icon:var(--icon-warning)}

/* The company form (client only). app.js moves the same form here from the first-visit questions; only its look
   changes: each block becomes a section, the fields share the grid and the button sits right under them. */
.st-company .company-fields{min-width:0;margin:0;padding:0;border:0}
.st-company .card{margin:0;border-right:0;border-bottom:0;border-left:0;border-radius:0;background:none;box-shadow:none}
.st .st-company .card{box-shadow:none}
.st-company .card + .card{margin-top:0}
.st-company .card .hint{margin-bottom:24px}
.st-company .grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px 24px}
.st-company .field{margin:0}
.st-company .field label{margin-bottom:6px;font-size:14px;font-weight:500;line-height:1.4;color:var(--text)}
.st-company .field input{height:var(--st-control);padding:0 12px;border-radius:var(--st-radius);background:var(--panel);font-size:14px}
.st-company .onboarding-actions{display:flex;justify-content:flex-end;margin:0;padding-top:24px;border-top:1px solid var(--line)}
.st-company #saveOnboard{width:auto;height:var(--st-control);margin:0;padding:0 16px;border-radius:var(--st-radius);font-size:14px;font-weight:500;line-height:1}
.st-company .msg{margin-top:16px}

@media(max-width:640px){
  .st{--st-control:44px}
  .st-head{margin-bottom:24px}
  .st-section,.st-company .card{padding:24px 0}
  .st-section-head{margin-bottom:20px}
  .st-grid,.st-company .grid2{grid-template-columns:minmax(0,1fr)}
  .st-avatar{align-items:flex-start;gap:16px}
  .st-avatar-frame{width:64px;height:64px}
  .st-avatar-img{padding:18px}
  .st-actions .st-btn{flex:1 1 auto}
  .st .v-control,.st-company .field input{font-size:16px}
  .st-company .onboarding-actions{justify-content:stretch}
  .st-company #saveOnboard{width:100%}
}
