/* @shonoweb/ui — workspace profile. Product styles own composition only. */
@import './tokens.css';
@font-face {
  font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('./fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('./fonts/inter-cyrillic.woff2') format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

.sw-workspace {
  color-scheme: light;
  --accent: var(--sw-workspace-accent);
  --accent-soft: #fff8d8;
  --background: var(--sw-workspace-crm-background);
  --ink: var(--sw-workspace-crm-ink);
  --muted: #626b78;
  --border: #dfe4eb;
  --border-strong: #b9c2cd;
  --focus: #48647e;
  --panel: var(--sw-brand-surface);
  --neutral-soft: #edf1f5;
  --danger: #b7322a;
  --danger-soft: #fff0ee;
  --success: #147a50;
  --success-soft: #eaf7f0;
  --warning: #856000;
  background: var(--background);
  color: var(--ink);
  font-family: var(--sw-workspace-body-font), Arial, sans-serif;
  line-height: 1.45;
}
.sw-workspace, .sw-workspace *, .sw-workspace *::before, .sw-workspace *::after { box-sizing: border-box; }
.sw-workspace :where(button, input, select) { color: inherit; font: inherit; }
.sw-workspace :where(button, select) { cursor: pointer; }
.sw-workspace :where(button, a):focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: none;
}
.sw-workspace :where(input, select, textarea):focus { outline: none; box-shadow: none; }
.sw-workspace :where(input, select, textarea):focus-visible { border-color: var(--focus); }
.sw-workspace :where(input[type='checkbox'], input[type='radio']):focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.sw-workspace [hidden] { display: none !important; }

.sw-button {
  align-items: center; display: inline-flex; justify-content: center; gap: 8px;
  background: var(--neutral-soft); border: 1px solid transparent;
  border-radius: var(--sw-workspace-crm-control-radius);
  color: var(--ink); min-height: var(--sw-workspace-control-min-height);
  padding: 10px 16px; font-size: 14px; font-weight: 600; line-height: 1.35;
  text-decoration: none; cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}
.sw-button:hover:not(:disabled) { background: #e3e9f0; }
.sw-button:active:not(:disabled) { background: #dce3ec; }
.sw-button--primary { background: var(--accent); }
.sw-button--primary:hover:not(:disabled) { background: #ffdf4d; }
.sw-button--primary:active:not(:disabled) { background: #efc517; }
.sw-button--danger { background: var(--danger-soft); color: var(--danger); }
.sw-button--danger:hover:not(:disabled) { background: #ffe3df; }
.sw-button--ghost { background: transparent; border-color: var(--border); }
.sw-button--ghost:hover:not(:disabled) { background: var(--neutral-soft); border-color: var(--border-strong); }
/* Approved quiet action: supplementary widget actions, no permanent box. */
.sw-button--quiet { background: transparent; border-color: transparent; }
.sw-button--quiet:hover:not(:disabled) { background: var(--neutral-soft); border-color: transparent; }
.sw-button--icon { width: 44px; height: 44px; padding: 0; flex: 0 0 auto; }
.sw-button :where(img, svg) { width: 18px; height: 18px; flex: 0 0 auto; }
.sw-button:disabled { cursor: not-allowed; opacity: .55; }
.sw-button[aria-busy='true'] { cursor: wait; }
.sw-button--full { width: 100%; }
/* Approved 2026-10-06 Care Analytics surface profile; controls stay shared. */
.sw-workspace[data-sw-profile='care-analytics'] { --background: #f8f9fb; }
.sw-workspace[data-sw-profile='care-analytics'] .sw-panel { border-color: transparent; box-shadow: 0 4px 24px rgb(32 38 46 / 2%); }
.sw-button--large { min-height: 50px; font-size: 15px; }

.sw-field { display: grid; gap: 7px; min-width: 0; }
.sw-field > :is(span, label):first-child { color: var(--muted); font-size: 14px; font-weight: 500; }
.sw-input {
  background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: var(--sw-workspace-crm-control-radius);
  min-height: var(--sw-workspace-control-min-height); width: 100%; min-width: 0;
  padding: 10px 12px; font-size: 14px; line-height: 1.35;
}
.sw-input:hover:not(:disabled) { border-color: #8894a3; }
.sw-input:focus-visible { border-color: var(--focus); }
.sw-input[aria-invalid='true'] { border-color: var(--danger); }
.sw-input:disabled { background: var(--neutral-soft); color: var(--muted); cursor: not-allowed; }
.sw-input--large { min-height: 48px; font-size: 16px; }
select.sw-input, .sw-select-trigger {
  appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23626b78' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 16px; background-position: right 12px center;
}
.sw-select { position: relative; min-width: 0; width: 100%; }
.sw-select-trigger { display: flex; align-items: center; text-align: left; cursor: pointer; }
.sw-select-trigger > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-select-trigger:focus:not(:focus-visible) { outline: none; box-shadow: none; }
.sw-select-trigger[data-pointer-focus]:focus { outline: none; box-shadow: none; border-color: var(--border-strong); }
.sw-select-menu, .sw-popover {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: 100%;
  display: flex; flex-direction: column; min-width: 0; padding: 10px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--panel);
  box-shadow: 0 12px 30px rgb(23 32 41 / 12.5%);
}
.sw-popover-host { position: relative; }
.sw-popover { width: 340px; overflow: auto; }
.sw-select-menu > input { flex: 0 0 auto; }
.sw-select-options { display: flex; flex-direction: column; gap: 4px; max-height: 260px; min-height: 0; overflow: auto; margin-top: 6px; }
.sw-select-option {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  min-height: 44px; padding: 12px 10px; border: 0; border-radius: 6px;
  background: transparent; text-align: left; font-size: 14px; line-height: 1.4;
  overflow-wrap: anywhere;
}
.sw-select-option:hover:not(:disabled):not([aria-current='true']) { background: var(--neutral-soft); }
.sw-select-option[aria-current='true'] { background: var(--accent-soft); }
.sw-select-option:disabled { color: var(--muted); opacity: .55; cursor: not-allowed; }
.sw-select-empty { margin: 0; padding: 10px; color: var(--muted); font-size: 14px; }
.sw-checkbox-option {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 12px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--sw-workspace-crm-control-radius); cursor: pointer; font-size: 14px;
}
.sw-checkbox-option:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
.sw-checkbox-option input { accent-color: var(--ink); height: 18px; width: 18px; margin: 0; flex: 0 0 auto; }

/* Local opt-in switch variant of the existing labelled native choice. */
.sw-checkbox-option--switch { justify-content: space-between; }
.sw-checkbox-option--switch input {
  appearance: none; position: relative; width: 40px; height: 24px;
  border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--neutral-soft); cursor: pointer;
}
.sw-checkbox-option--switch input::before {
  content: ''; display: block; width: 18px; height: 18px;
  position: absolute; top: 2px; left: 2px; border-radius: 50%;
  background: var(--panel); box-shadow: 0 1px 3px rgb(32 38 46 / 18%);
}
.sw-checkbox-option--switch input:checked { background: var(--accent); border-color: var(--accent); }
.sw-checkbox-option--switch input:checked::before { transform: translateX(16px); }
.sw-checkbox-option--switch:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.sw-checkbox-option--switch input:disabled { cursor: not-allowed; }
@media (prefers-reduced-motion: no-preference) {
  .sw-checkbox-option--switch input:not(:focus-visible) { transition: background-color 150ms ease-out, border-color 150ms ease-out; }
  .sw-checkbox-option--switch input:not(:focus-visible)::before { transition: transform 150ms ease-out; }
}

.sw-panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--sw-workspace-crm-card-radius);
  box-shadow: 0 2px 8px rgb(32 38 46 / 3%); min-width: 0; padding: 24px;
}
.sw-panel--flush { padding: 0; overflow: hidden; }
.sw-page-title { font-size: 32px; font-weight: 700; line-height: 1.2; margin: 0; letter-spacing: -.025em; }
.sw-section-title { font-size: 20px; font-weight: 650; line-height: 1.3; margin: 0; letter-spacing: -.015em; }
.sw-badge {
  display: inline-flex; align-items: center; border-radius: 8px; padding: 6px 9px;
  font-size: 12px; font-weight: 600; line-height: 1.35; white-space: nowrap;
  background: var(--neutral-soft); color: var(--muted);
}
.sw-badge--success { background: var(--success-soft); color: var(--success); }
.sw-badge--warning { background: var(--accent-soft); color: var(--warning); }
.sw-badge--danger { background: var(--danger-soft); color: var(--danger); }

.sw-segments { display: inline-flex; flex-wrap: wrap; max-width: 100%; gap: 3px; background: var(--neutral-soft); border-radius: 12px; padding: 4px; }
.sw-segment {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 0; border-radius: var(--sw-workspace-crm-control-radius);
  min-height: 44px; padding: 10px 14px; font-size: 14px; font-weight: 600; line-height: 1.3;
  background: transparent; color: var(--muted); white-space: nowrap;
}
.sw-segment:hover { background: rgb(255 255 255 / 55%); color: var(--ink); }
.sw-segment[aria-pressed='true'], .sw-segment[aria-expanded='true'], .sw-segment.is-active { background: white; color: var(--ink); box-shadow: 0 1px 4px rgb(32 38 46 / 8%); }
.sw-segment img { height: 16px; width: 16px; }
.sw-segment:disabled { opacity: .55; cursor: not-allowed; }

/* Experimental opt-in motion: one decorative surface, unchanged button geometry. */
.sw-segments--motion { position: relative; isolation: isolate; }
.sw-segments--motion > .sw-segment { position: relative; z-index: 1; }
.sw-segments--motion > .sw-segment[aria-pressed='true'],
.sw-segments--motion > .sw-segment.is-active { background: transparent; box-shadow: none; }
.sw-segment-surface {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  overflow: clip; border-radius: inherit;
}
.sw-segment-indicator {
  position: absolute; z-index: 0; pointer-events: none; transform-origin: top left;
  border-radius: var(--sw-workspace-crm-control-radius);
  background: var(--panel); box-shadow: 0 1px 4px rgb(32 38 46 / 8%);
}

@media (max-width: 620px) {
  .sw-panel { padding: 18px; }
  .sw-panel--flush { padding: 0; }
  .sw-page-title { font-size: 28px; }
  .sw-segments { display: flex; }
  .sw-segment { flex: 1 0 auto; padding-inline: 10px; }
  .sw-segments:has(> button:nth-of-type(5):last-of-type) { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .sw-segments:has(> button:nth-of-type(5):last-of-type) > button { grid-column: span 2; }
  .sw-segments:has(> button:nth-of-type(5):last-of-type) > button:nth-of-type(n + 4) { grid-column: span 3; }
}
@media (prefers-reduced-motion: reduce) {
  .sw-workspace *, .sw-workspace *::before, .sw-workspace *::after {
    scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important;
  }
}
.sw-icon { display: inline-block; flex: 0 0 auto; vertical-align: middle; }
.sw-icon-host { display: inline-flex; width: 20px; height: 20px; flex: 0 0 20px; color: var(--sw-workspace-ink); }

/* Opt-in data motion never hides semantic values from assistive technology. */
.sw-data-motion-host { position: relative; }
.sw-number-visual { position: absolute; pointer-events: none; white-space: nowrap; margin: 0; font-variant-numeric: tabular-nums; }
