/* Structure, controls and icon conventions adapted from studio-dewelopera/modules/shell.css
   and Centrala/projekt-panelu, order 018. Brand: od-dzis.pl, read 14.11.2026. */
@font-face {
  font-family: Satoshi;
  src: url(assets/Satoshi-Variable.woff2) format("woff2");
  font-weight: 300 900;
  font-display: swap;
}
@font-face {
  font-family: Marcellus;
  src: url(assets/marcellus.ttf) format("truetype");
  font-weight: 400;
  font-display: swap;
}
:root {
  font-family: Satoshi, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color-scheme: light;
  --bg: #f4f3ef;
  --surface: #fdfcf9;
  --soft: #eeede8;
  --line: #dcded9;
  --text: #252e2d;
  --muted: #56615c;
  --context-bg: #e9ece3;
  --highlight-bg: #f8f3e7;
  --accent: #385662;
  --on: #fffdf8;
  --tint: #e7eff0;
  --tint-ink: #334f5a;
  --warn: #805521;
  --warn-bg: #f8efdf;
  --ok: #3e6250;
  --radius: 12px;
  --gutter: 36px;
  --shadow: 0 14px 40px #283b3720;
  -webkit-tap-highlight-color: transparent;
  background: var(--bg);
  color: var(--text);
  font-synthesis: none;
}
html[data-theme="dark"] {
  --context-bg: #29372f;
  --highlight-bg: #363329;
  color-scheme: dark;
  --bg: #1c2321;
  --surface: #252d2a;
  --soft: #303a36;
  --line: #46504c;
  --text: #eaece6;
  --muted: #adb9b2;
  --accent: #b6d0d9;
  --on: #1c3039;
  --tint: #2e4146;
  --tint-ink: #c6dce1;
  --warn: #f2ce96;
  --warn-bg: #453b2c;
  --ok: #b6d4c2;
  --shadow: 0 14px 40px #10171450;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button,
a {
  color: inherit;
}
a {
  text-decoration: none;
}
button {
  border: 0;
}
button:active {
  transform: translateY(1px);
}
button:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}
button,
input,
select,
textarea,
a {
  outline-offset: 4px;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}
.menu-backdrop {
  display: none;
}
.sidebar .nav-link,
.sidebar #scenario-button {
  justify-content: flex-start;
  text-align: left;
  border: 1px solid transparent;
}
.sidebar .utility-nav {
  background: var(--soft);
  border-color: var(--line);
}
.sidebar .nav-link:hover {
  background: var(--soft);
  color: var(--text);
}
.sidebar .nav-link[aria-current="page"] {
  background: var(--tint);
  color: var(--tint-ink);
}
[hidden] {
  display: none !important;
}
.sr-only,
.skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.skip:focus {
  position: fixed;
  z-index: 10;
  background: var(--surface);
  padding: 16px;
}
.topbar {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.brand {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 48px;
  border-radius: 6px;
}
.brand img {
  object-fit: contain;
  flex: none;
}
html[data-theme="dark"] .brand img {
  filter: brightness(0) invert(0.92);
}
.brand > span {
  border-left: 1px solid var(--line);
  padding-left: 24px;
  color: var(--muted);
  font-size: 0.86rem;
}
.top-actions,
.actions,
.toolbar,
.row,
.segments,
.inline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.top-actions {
  gap: 8px;
}
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.87rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  transition:
    background 0.18s,
    color 0.18s;
  overflow-wrap: anywhere;
}
.btn:hover {
  background: var(--soft);
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on);
}
.btn.primary:hover {
  filter: brightness(0.93);
}
.btn.quiet {
  border-color: transparent;
  background: transparent;
}
.btn.quiet:hover {
  background: var(--soft);
}
.btn.small-btn {
  font-size: 0.8rem;
  padding: 8px 12px;
  min-height: 40px;
}
.btn.danger {
  color: var(--warn);
}
.icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.app-shell {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  min-height: calc(100dvh - 84px);
}
.sidebar {
  display: flex;
  flex-direction: column;
  padding: 32px 16px 20px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.sidebar-heading {
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0 16px 16px;
}
.sidebar nav {
  display: grid;
  gap: 8px;
}
.nav-link {
  display: flex;
  gap: 13px;
  align-items: center;
  min-height: 48px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  text-align: left;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.9rem;
}
.nav-link:hover {
  background: var(--soft);
  color: var(--text);
}
.nav-link[aria-current="page"] {
  background: var(--tint);
  color: var(--tint-ink);
}
.sidebar-bottom {
  margin-top: auto;
  padding: 64px 16px 0;
}
.small {
  font-size: 0.85rem;
  color: var(--muted);
}
.privacy-line {
  font-size: 0.7rem;
  color: var(--muted);
  padding-top: 20px;
  border-top: 1px solid var(--line);
  margin-top: 24px;
}
main {
  padding: 32px var(--gutter) 64px;
  min-width: 0;
}
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.page-head .actions {
  padding-top: 8px;
}
.eyebrow {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 8px;
}
.page-head h1 {
  font-family: Marcellus, Georgia, serif;
  font-size: 2.3rem;
  font-weight: 400;
  line-height: 1.2;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}
.page-head p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}
h2 {
  font-size: 1.1rem;
  line-height: 1.4;
  margin: 0 0 12px;
  font-weight: 600;
}
h3 {
  font-size: 0.96rem;
  line-height: 1.5;
  margin: 0 0 8px;
}
p {
  margin: 0 0 14px;
}
p:last-child {
  margin-bottom: 0;
}
.muted {
  color: var(--muted);
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: clip;
}
.card-pad {
  padding: 28px;
}
.toolbar {
  justify-content: space-between;
  margin-bottom: 20px;
  align-items: flex-end;
}
.segments {
  display: inline-flex;
  gap: 0;
  padding: 4px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  max-width: 100%;
}
.segments button {
  min-height: 40px;
  padding: 9px 17px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.84rem;
}
.segments button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px #263d3012;
}
.filters {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.field {
  display: grid;
  gap: 8px;
  min-width: 0;
  font-size: 0.85rem;
}
.field > span {
  font-weight: 500;
}
.field input,
.field select,
.field textarea,
input.control,
select,
textarea {
  min-height: 44px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  max-width: 100%;
}
.field textarea,
textarea {
  resize: vertical;
  min-height: 150px;
  line-height: 1.85;
}
.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
}
.search-field {
  width: 260px;
}
.table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.86rem;
}
.table th {
  background: var(--soft);
  padding: 14px 20px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.table th:first-child {
  width: 30%;
}
.table th:last-child {
  width: 9%;
}
.table td,
.client-title,
.client-title > div,
.life-text,
.issue-description {
  overflow-wrap: anywhere;
  min-width: 0;
}
.client-name {
  max-width: 100%;
}
.client-name > span:not(.client-kind) {
  min-width: 0;
  overflow-wrap: anywhere;
}
.client-head {
  flex-wrap: wrap;
}
.client-title {
  flex: 1;
}
.table td {
  padding: 19px 20px;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.table tr:last-child td {
  border: 0;
}
.table tbody tr:hover {
  background: var(--soft);
}
.client-result {
  position: relative;
}
.client-result .client-name::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.client-result:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background: var(--soft);
}
.client-result .client-name:focus-visible {
  outline: none;
}
.client-result:active {
  background: var(--soft);
}
@media (hover: hover) {
  .mobile-card.client-result:hover {
    background: var(--soft);
  }
}
.client-name {
  background: transparent;
  padding: 0;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 500;
  min-height: 44px;
  line-height: 1.5;
}
.client-kind {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  background: var(--tint);
  color: var(--tint-ink);
  font-size: 0.8rem;
  font-weight: 500;
}
.client-name small {
  display: block;
  font-size: 0.73rem;
  color: var(--muted);
  font-weight: 400;
  margin-top: 3px;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.73rem;
  font-weight: 500;
  border-radius: 5px;
  padding: 3px 7px;
  background: var(--soft);
  color: var(--muted);
  white-space: normal;
}
.tag.accent {
  background: var(--tint);
  color: var(--tint-ink);
}
.tag.warm {
  background: var(--warn-bg);
  color: var(--warn);
}
.mobile-clients {
  display: none;
}
.list-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  color: var(--muted);
  font-size: 0.77rem;
}
.back-button {
  margin: 0 0 16px;
  padding-left: 0;
}
.client-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.client-head {
  border-bottom: 1px solid var(--line);
  padding: 28px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}
.client-head .client-kind {
  width: 56px;
  height: 56px;
  font-size: 1rem;
}
.client-head h1 {
  font-size: 1.8rem;
  margin-bottom: 10px;
}
.client-title {
  display: flex;
  gap: 18px;
  align-items: center;
}
.record-section {
  padding: 28px;
  border-bottom: 1px solid var(--line);
}
.record-section:last-child {
  border-bottom: 0;
}
.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}
.section-head > div {
  flex: 1 1 10rem;
  min-width: 0;
}
.section-head > .btn {
  flex: none;
  margin-inline-start: auto;
}
.section-title h2 {
  min-width: 0;
  overflow-wrap: anywhere;
}
.textarea-size-toggle {
  white-space: nowrap;
}
.textarea-size-toggle > span {
  overflow-wrap: normal;
}
.section-head h2 {
  margin-bottom: 6px;
}
.section-head p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.section-title {
  display: flex;
  gap: 12px;
  align-items: center;
}
.life-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(190px, 1fr);
  gap: 32px;
}
.life-text {
  max-width: 68ch;
  line-height: 1.9;
  font-size: 0.9rem;
}
.relatives {
  border-left: 1px solid var(--line);
  padding-left: 28px;
}
.relatives p {
  font-size: 0.85rem;
  margin: 8px 0;
}
.proposal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 16px 0 0;
  margin-top: 20px;
  border-top: 1px dashed var(--line);
}
.proposal .tag {
  margin-bottom: 8px;
}
.proposal p {
  font-size: 0.85rem;
}
.issue {
  border-top: 1px solid var(--line);
}
.issue:last-child {
  border-bottom: 1px solid var(--line);
}
.issue-toggle {
  padding: 20px 0;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  text-align: left;
  background: transparent;
  color: var(--text);
}
.issue-top {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.issue-title {
  font-size: 0.95rem;
  font-weight: 500;
}
.issue-description {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.7;
  margin: 8px 0 0;
  max-width: 85ch;
}
.issue-toggle > .icon {
  margin-top: 6px;
  transition: transform 0.2s;
}
.issue-toggle[aria-expanded="true"] > .icon {
  transform: rotate(180deg);
}
.issue-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.22s ease;
}
.issue-panel > div {
  min-height: 0;
  overflow: hidden;
}
.issue-panel.open {
  grid-template-rows: 1fr;
}
.issue-panel-content {
  padding: 0 0 20px;
}
.source {
  border-left: 2px solid var(--line);
  padding-left: 16px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.85rem;
  max-width: 78ch;
}
.source strong {
  color: var(--text);
  display: block;
  font-size: 0.8rem;
  margin-bottom: 5px;
  font-weight: 500;
}
.issue-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.issue-board .issue {
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.issue-board .issue-toggle {
  padding: 20px 0;
}
.issue-board .issue-top {
  align-items: flex-start;
}
.count-large {
  font-family: Marcellus, serif;
  font-size: 2rem;
  line-height: 1;
  color: var(--accent);
  display: block;
  margin: 14px 0 4px;
}
.session-row {
  width: 100%;
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  padding: 19px 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}
.session-row:hover {
  background: var(--soft);
}
.session-row + .session-row {
  margin-top: 8px;
}
.session-row time {
  min-width: 100px;
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
}
.session-preview {
  flex: 1;
  min-width: 0;
}
.session-preview span {
  display: block;
  font-size: 0.88rem;
}
.session-preview small {
  display: block;
  margin-top: 4px;
  font-size: 0.76rem;
  color: var(--muted);
}
.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: start;
}
.stack {
  display: grid;
  gap: 24px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.recording {
  padding: 24px;
  border-bottom: 1px solid var(--line);
}
.recording-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}
.record-time {
  font-size: 2rem;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.3;
}
.record-status {
  font-size: 0.8rem;
  color: var(--ok);
  margin: 8px 0 16px;
}
.recorder-wave {
  display: flex;
  gap: 4px;
  align-items: center;
  height: 40px;
  color: var(--accent);
}
.recorder-wave i {
  display: block;
  width: 3px;
  height: var(--h);
  background: currentColor;
  border-radius: 2px;
}
.recording[data-state="recording"] .recorder-wave i {
  animation: voice 0.8s ease-in-out infinite alternate;
  animation-delay: var(--delay);
}
@keyframes voice {
  from {
    transform: scaleY(0.4);
  }
  to {
    transform: scaleY(1);
  }
}
.notice {
  border-left: 3px solid var(--accent);
  padding: 14px 16px;
  background: var(--tint);
  color: var(--tint-ink);
  font-size: 0.84rem;
  border-radius: 0 8px 8px 0;
  margin: 16px 0;
}
.notice.warning {
  border-color: var(--warn);
  background: var(--warn-bg);
  color: var(--warn);
}
.note-body {
  padding: 24px;
}
.save-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  position: sticky;
  bottom: 0;
  z-index: 1;
  flex-wrap: wrap;
}
.save-status {
  font-size: 0.8rem;
  color: var(--muted);
}
.helper {
  font-size: 0.77rem;
  color: var(--muted);
  line-height: 1.8;
}
.scenario-panel {
  border-top: 1px dashed var(--line);
  padding-top: 20px;
  margin-top: 20px;
}
.scenario-panel .actions {
  gap: 8px;
}
.photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}
.photo-preview img,
.session-photo {
  max-width: 160px;
  max-height: 130px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 620px;
  overflow: visible;
}
.chat-sidebar {
  padding: 20px 28px;
  min-width: 0;
  border-bottom: 1px solid var(--line);
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  background: var(--soft);
}
.chat-sidebar label {
  margin-bottom: 24px;
}
.chat-main {
  padding: 28px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.chat-title {
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}
.chat-title h2 {
  margin-bottom: 4px;
}
.chat-title p {
  font-size: 0.8rem;
  color: var(--muted);
}
.chat-log {
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 260px;
}
.message {
  max-width: 85%;
  font-size: 0.9rem;
  line-height: 1.9;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.message.user {
  align-self: flex-end;
  padding: 14px 18px;
  border-radius: 10px;
  background: var(--tint);
  color: var(--tint-ink);
}
.message.assistant {
  align-self: flex-start;
}
.message-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 8px;
}
.suggestions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  margin-bottom: 16px;
}
.chat-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}
.chat-input textarea {
  min-height: 80px;
  max-height: 240px;
}
.settings {
  max-width: none;
}
.settings .record-section > .field {
  max-width: 760px;
}
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.setting-row h3 {
  margin: 0 0 6px;
}
.setting-row p {
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 65ch;
}
.setting-row select {
  width: auto;
  min-width: 160px;
}
/* Urządzenia z Face ID (zlecenie 161; z klocków ustawień, prototyp go nie miał) */
.passkey-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 16px;
}
.passkey-item {
  padding: 14px 0;
}
.passkey-item h3 {
  font-size: 0.95rem;
}
.passkey-hint {
  margin: 0 0 16px;
}
.auth {
  max-width: 470px;
  margin: 48px auto;
  padding: 36px;
}
.auth h1 {
  font-family: Marcellus, serif;
  font-size: 2.2rem;
  font-weight: 400;
  line-height: 1.2;
  margin: 0 0 16px;
}
.auth .field {
  margin: 24px 0;
}
.auth > .btn {
  width: 100%;
  margin-top: 12px;
}
.auth .auth-back {
  justify-content: flex-start;
  padding-inline: 0;
  font-size: 0.875rem;
}
.auth .lock-symbol {
  padding: 16px;
  border-radius: 50%;
  background: var(--tint);
  color: var(--accent);
  width: 56px;
  height: 56px;
  margin-bottom: 24px;
  display: grid;
  place-items: center;
}
.auth .helper {
  margin-top: 24px;
}
.unlock-action {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}
.unlock-action .btn {
  min-height: 48px;
}
.auth .unlock-method {
  margin: 0;
  text-align: center;
  line-height: 1.5;
}
.empty {
  padding: 48px 24px;
  text-align: center;
  max-width: 660px;
  margin: auto;
}
.empty p {
  color: var(--muted);
  margin: 12px auto 24px;
  max-width: 52ch;
}
.empty .actions {
  justify-content: center;
}
.progress {
  height: 8px;
  background: var(--soft);
  border-radius: 4px;
  overflow: hidden;
  margin: 24px 0;
}
.progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.3s;
}
.import-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin: 24px 0;
}
.import-stats strong {
  display: block;
  font-family: Marcellus, serif;
  font-size: 2rem;
  font-weight: 400;
}
.import-stats span {
  font-size: 0.8rem;
  color: var(--muted);
}
.import-card {
  display: grid;
  gap: 24px;
}
.import-card > h2,
.import-card > p,
.import-card > .notice,
.import-card > .import-stats,
.import-card > .progress {
  margin: 0;
}
.import-intro {
  display: grid;
  gap: 12px;
}
.import-intro > * {
  margin: 0;
}
.import-file {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.import-file .error-text {
  margin: 0;
}
.import-file input::file-selector-button {
  margin-right: 12px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  color: var(--text);
  background: var(--soft);
  cursor: pointer;
}
.skeleton {
  background: var(--soft);
  border-radius: 6px;
  min-height: 22px;
  margin: 16px 0;
  width: 90%;
}
.skeleton:nth-child(even) {
  width: 65%;
}
.mobile-menu {
  display: none;
}
dialog {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  width: min(560px, calc(100% - 32px));
  max-height: calc(100dvh - 40px);
  overflow: auto;
  box-shadow: var(--shadow);
}
dialog::backdrop {
  background: #10242166;
}
.dialog-head {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.dialog-head h2 {
  margin: 0;
}
dialog .actions {
  margin-top: 24px;
  justify-content: flex-end;
}
dialog .field {
  margin-top: 20px;
}
.recovery-code {
  padding: 24px 16px;
  background: var(--soft);
  font-size: 1.3rem;
  letter-spacing: 0.08em;
  text-align: center;
  overflow-wrap: anywhere;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 22px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow);
  z-index: 8;
  max-width: calc(100% - 32px);
  font-size: 0.85rem;
}
html.auth-screen .sidebar,
html.auth-screen #discreet {
  display: none;
}
html.auth-screen .app-shell {
  grid-template-columns: 1fr;
}
.mobile-card {
  padding: 20px;
}
.mobile-card + .mobile-card {
  border-top: 1px solid var(--line);
}
.mobile-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  font-size: 0.77rem;
}
.mobile-card-meta strong {
  display: block;
  font-weight: 500;
  margin-top: 4px;
}
.mobile-card-meta .muted {
  font-size: 0.7rem;
}
.status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--ok);
}
.status-line:before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.recovery-print {
  display: none;
}
.error-text {
  color: var(--warn);
  font-size: 0.83rem;
}
.screen-note {
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 20px;
}
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media (min-width: 1600px) {
  :root {
    --gutter: 48px;
  }
  .app-shell {
    grid-template-columns: 248px minmax(0, 1fr);
  }
}
@media (max-width: 1100px) {
  :root {
    --gutter: 24px;
  }
  .app-shell {
    grid-template-columns: 196px minmax(0, 1fr);
  }
  .brand > span {
    display: none;
  }
  .table td,
  .table th {
    padding: 16px 14px;
  }
  .editor-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .editor-layout > aside {
    order: 2;
  }
  .page-head {
    flex-wrap: wrap;
  }
  .life-layout {
    grid-template-columns: 1fr;
  }
  .relatives {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 20px 0 0;
  }
  .chat-layout {
    grid-template-columns: 1fr;
  }
  .chat-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 20px;
  }
  .chat-sidebar label {
    margin: 0;
  }
  .chat-sidebar > p {
    display: none;
  }
}
@media (max-width: 760px) {
  :root {
    font-size: 16px;
    --gutter: 16px;
  }
  .topbar {
    min-height: 76px;
    padding: 12px 16px;
    gap: 12px;
    flex-wrap: wrap;
  }
  .brand {
    gap: 0;
  }
  .brand img {
    width: 84px;
    height: 35px;
  }
  .top-actions {
    margin-left: auto;
  }
  .top-actions .btn {
    padding: 8px;
    font-size: 0.75rem;
    min-height: 40px;
  }
  .top-actions #discreet {
    display: none;
  }
  .theme-label select {
    font-size: 0.75rem;
    padding: 8px;
    min-height: 40px;
    width: 74px;
  }
  .mobile-menu {
    display: inline-flex;
  }
  .app-shell {
    display: block;
    min-height: calc(100dvh - 72px);
  }
  .sidebar {
    display: flex;
    position: fixed;
    z-index: 6;
    inset: 0 auto 0 0;
    width: min(320px, calc(100% - 48px));
    height: 100dvh;
    padding: 32px 24px;
    transform: translateX(-100%);
    visibility: hidden;
    pointer-events: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    transition:
      transform 0.24s ease,
      visibility 0s linear 0.24s;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    transition:
      transform 0.24s ease,
      visibility 0s;
  }
  .menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 5;
    background: #10242166;
    opacity: 0;
    visibility: hidden;
    transition:
      opacity 0.24s ease,
      visibility 0s linear 0.24s;
  }
  body.menu-open .menu-backdrop {
    opacity: 1;
    visibility: visible;
    transition:
      opacity 0.24s ease,
      visibility 0s;
  }
  .sidebar.mobile-open nav {
    margin-top: 16px;
  }
  .sidebar.mobile-open .sidebar-bottom {
    padding-top: 32px;
  }
  .sidebar.mobile-open .sidebar-heading {
    font-family: Marcellus, serif;
    font-size: 1.6rem;
    color: var(--text);
  }
  main {
    padding-top: 24px;
    padding-bottom: 40px;
  }
  .page-head {
    gap: 16px;
    margin-bottom: 24px;
  }
  .page-head h1 {
    font-size: 2rem;
  }
  .page-head .actions {
    padding-top: 0;
    width: 100%;
  }
  .page-head .actions > .btn {
    flex: 1;
  }
  .page-head p:last-child {
    font-size: 0.82rem;
  }
  .toolbar {
    gap: 20px;
  }
  .segments {
    width: 100%;
    justify-content: stretch;
  }
  .segments button {
    flex: 1;
    padding: 8px 10px;
    font-size: 0.78rem;
  }
  .filters {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 118px;
  }
  .search-field {
    width: auto;
  }
  .table {
    display: none;
  }
  .mobile-clients {
    display: block;
  }
  .card-pad,
  .record-section,
  .client-head {
    padding: 20px;
  }
  .client-head {
    display: block;
  }
  .client-head .actions {
    margin-top: 20px;
  }
  .client-head .actions > .btn {
    flex: 1;
  }
  .client-title {
    align-items: flex-start;
    gap: 12px;
  }
  .client-head .client-kind {
    width: 42px;
    height: 42px;
    font-size: 0.8rem;
  }
  .client-head h1 {
    font-size: 1.6rem;
  }
  .client-meta {
    gap: 8px;
    font-size: 0.8rem;
  }
  .record-section {
    padding-top: 24px;
    padding-bottom: 24px;
  }
  .section-head {
    gap: 12px;
  }
  .section-head h2 {
    font-size: 1.03rem;
  }
  .section-head .btn {
    padding: 8px;
    min-height: 40px;
    font-size: 0.77rem;
  }
  .proposal {
    display: block;
  }
  .proposal .actions {
    margin-top: 16px;
  }
  .issue-board {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .issue-board .issue {
    padding: 0 16px;
  }
  .issue-toggle {
    padding: 20px 0;
  }
  .issue-description {
    font-size: 0.84rem;
  }
  .issue-panel .actions {
    gap: 8px;
  }
  .session-row {
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .session-row time {
    min-width: 0;
    width: 100%;
  }
  .session-row .icon {
    margin-left: auto;
  }
  .session-preview {
    min-width: 180px;
  }
  .form-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .recording,
  .note-body {
    padding: 20px;
  }
  .record-time {
    font-size: 2rem;
  }
  .recording-head {
    align-items: flex-start;
  }
  .recorder-wave {
    gap: 3px;
    max-width: 120px;
    overflow: hidden;
  }
  .save-bar {
    padding: 16px;
    gap: 12px;
  }
  .save-bar > .btn {
    flex: 1;
  }
  .save-status {
    width: 100%;
  }
  .chat-main {
    padding: 20px;
  }
  .chat-layout {
    min-height: 580px;
  }
  .message {
    max-width: 100%;
  }
  .chat-input {
    grid-template-columns: 1fr;
  }
  .chat-input > .btn {
    justify-self: end;
  }
  .chat-log {
    min-height: 180px;
  }
  .setting-row {
    display: block;
  }
  .setting-row > .btn,
  .setting-row > select {
    margin-top: 16px;
  }
  .setting-row > .tag {
    display: inline-block;
    margin-top: 12px;
  }
  .passkey-list .setting-row > .btn {
    margin-top: 10px;
  }
  .setting-row .actions {
    margin-top: 16px;
  }
  .setting-row .actions .btn {
    margin: 0;
  }
  .auth {
    margin: 24px auto;
    padding: 24px;
  }
  .auth h1 {
    font-size: 1.8rem;
  }
  .import-stats {
    gap: 12px;
  }
  .import-stats strong {
    font-size: 1.6rem;
  }
  .import-stats span {
    font-size: 0.7rem;
  }
  .list-footer {
    font-size: 0.7rem;
    padding: 16px;
    flex-wrap: wrap;
  }
  dialog {
    padding: 20px;
  }
  .dialog-head .btn {
    padding: 8px;
  }
  .dialog-head {
    gap: 12px;
  }
  .top-actions #lock-button {
    display: none;
  }
  .section-title {
    align-items: flex-start;
  }
  .sidebar-bottom {
    margin-top: 40px;
  }
  .recording > .actions > .btn {
    flex: 1;
  }
  .life-text {
    line-height: 1.85;
  }
  .issue-top {
    gap: 8px;
  }
}
@media (max-width: 360px) {
  .brand img {
    width: 68px;
  }
  .topbar {
    gap: 8px;
  }
  .top-actions {
    gap: 8px;
  }
  .theme-label select {
    width: 70px;
  }
  .top-actions .btn {
    font-size: 0.7rem;
  }
  .client-head .actions {
    flex-direction: column;
    align-items: stretch;
  }
  .filters {
    grid-template-columns: 1fr;
  }
  .issue-board .issue {
    padding: 0 12px;
  }
  .tag {
    font-size: 0.68rem;
  }
}
@media print {
  body > *:not(.recovery-print) {
    display: none !important;
  }
  .recovery-print {
    display: block;
    padding: 40px;
    color: #222;
    background: #fff;
  }
  .recovery-print h1 {
    font-family: Marcellus, serif;
  }
  .recovery-print p {
    margin-top: 24px;
  }
  .recovery-code {
    background: #eee;
  }
}
main:focus {
  outline: none;
}
.issue-panel {
  visibility: hidden;
  transition:
    grid-template-rows 0.22s ease,
    visibility 0.22s;
}
.issue-panel.open {
  visibility: visible;
}
.issue-board .issue {
  padding: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}
.sidebar nav > .utility-nav {
  display: none;
}
.sidebar nav > .logout-nav {
  display: flex;
}
@media (max-width: 760px) {
  .sidebar nav > .utility-nav {
    display: flex;
  }
}

/* 157b: phone is the primary workplace. Secondary copy stays at least 14 px. */
.small,
.helper,
.eyebrow,
.sidebar-heading,
.privacy-line,
.field,
.client-name small,
.tag,
.list-footer,
.section-head p,
.source strong,
.session-preview small,
.chat-title p,
.message-label,
.setting-row p,
.screen-note,
.record-status,
.save-status,
.context-meta,
.error-text {
  font-size: 0.875rem;
}
.btn,
.nav-link,
.table,
.life-text,
.session-preview span,
.chat-input,
.issue-title,
.field textarea {
  font-size: 1rem;
}
.table th {
  font-size: 0.875rem;
}
.issue-description {
  font-size: 0.95rem;
}
.client-name > span:not(.client-kind) {
  min-width: 0;
  overflow-wrap: anywhere;
}
.client-kind .icon {
  width: 24px;
  height: 24px;
}
.kind-pair {
  background: #ece9d9;
  color: #62552c;
}
.kind-all {
  background: var(--tint);
  color: var(--tint-ink);
}
.kind-woman {
  background: #ece7ee;
  color: #64506b;
}
.kind-man {
  background: #e0eae2;
  color: #355c42;
}
html[data-theme="dark"] .kind-pair {
  background: #48402d;
  color: #edddb2;
}
html[data-theme="dark"] .kind-woman {
  background: #403347;
  color: #dfcce5;
}
html[data-theme="dark"] .kind-man {
  background: #2f4336;
  color: #c1dec9;
}
.icon-button {
  width: 48px;
  min-height: 48px;
  padding: 12px;
}
.icon-button .icon {
  width: 22px;
  height: 22px;
}
.type-filter {
  gap: 8px;
  padding: 4px;
}
.type-filter .filter-icon {
  width: 48px;
  min-height: 48px;
  padding: 12px;
  flex: none;
  border-radius: 6px;
}
.type-filter .filter-icon .icon {
  width: 23px;
  height: 23px;
}
.life-section {
  background: var(--context-bg);
}
.highlights-section {
  background: var(--highlight-bg);
}
.life-section + .highlights-section,
.highlights-section + .sessions-section {
  border-top: 8px solid var(--bg);
}
.context-summary {
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.65;
}
.context-meta {
  color: var(--muted);
  margin: 0;
}
.context-panel {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition:
    grid-template-rows 0.22s ease,
    visibility 0.22s;
}
.context-panel.open {
  grid-template-rows: 1fr;
  visibility: visible;
}
.context-panel > div {
  min-height: 0;
  overflow: hidden;
}
.context-body {
  padding-top: 20px;
}
.context-body > .actions {
  margin-bottom: 20px;
}
.issue-history {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}
.issue-history .count-large {
  margin: 0;
  min-width: 42px;
}
.issue-history .helper {
  line-height: 1.7;
}
.note-client-list {
  display: grid;
  gap: 12px;
}
.note-client-option {
  width: 100%;
  text-align: left;
  justify-content: flex-start;
  gap: 12px;
  padding: 12px;
}
.note-client-option > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.note-client-option > .icon {
  margin-left: auto;
}
.note-client-option small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.875rem;
}
.mobile-nav,
.thumb-record-controls,
.thumb-record-state {
  display: none;
}
.record-start {
  color: var(--on);
  background: var(--accent);
  border-color: var(--accent);
}
.record-start:hover {
  background: var(--accent);
  filter: brightness(0.95);
}
.dock-meta {
  flex: 1;
  min-width: 0;
}
.page-head > div {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.page-head h1 {
  overflow-wrap: anywhere;
}
.actions > .btn {
  min-width: 0;
  max-width: 100%;
}
.btn > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.btn.small-btn,
.brand > span,
.session-row time {
  font-size: 0.875rem;
}
.notice,
.source,
.proposal p,
.relatives p {
  font-size: 1rem;
}

@media (max-width: 760px) {
  main {
    padding-top: 16px;
    padding-bottom: calc(144px + env(safe-area-inset-bottom, 0px));
  }
  .topbar {
    min-height: 72px;
  }
  .top-actions .btn {
    min-height: 48px;
    font-size: 0.95rem;
    padding: 10px;
  }
  .top-actions .icon-button {
    width: 48px;
  }
  .top-actions .mobile-menu {
    min-width: 64px;
  }
  .btn,
  .btn.small-btn,
  .section-head .btn {
    min-height: 48px;
  }
  .field input,
  .field select,
  .field textarea {
    font-size: max(1rem, 16px);
    min-height: 48px;
  }
  .type-filter {
    width: auto;
  }
  .type-filter .filter-icon {
    width: 52px;
    min-height: 48px;
    flex: none;
  }
  .page-head {
    margin-bottom: 20px;
  }
  .page-head .eyebrow {
    display: none;
  }
  .page-head h1 {
    font-size: 2rem;
  }
  .page-head p:last-child {
    font-size: 1rem;
  }
  .filters {
    grid-template-columns: minmax(0, 1fr);
  }
  .back-button {
    margin-bottom: 8px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .client-head {
    padding: 20px;
  }
  .client-head h1 {
    font-size: 1.5rem;
    line-height: 1.25;
    margin: 0 0 10px;
  }
  .client-head .client-kind {
    width: 44px;
    height: 44px;
  }
  .client-head .actions {
    display: none;
  }
  .client-head .client-note-action {
    display: none;
  }
  .client-head .actions > .btn {
    flex: none;
    width: 100%;
  }
  .client-meta {
    font-size: 0.875rem;
    line-height: 1.6;
  }
  .record-section {
    padding: 20px;
  }
  .section-head {
    margin-bottom: 14px;
    align-items: flex-start;
  }
  .section-head h2 {
    font-size: 1.25rem;
    line-height: 1.3;
  }
  .section-head .btn {
    font-size: 0.875rem;
    padding: 10px 12px;
  }
  .section-title {
    gap: 10px;
    align-items: center;
  }
  .life-text,
  .relatives p {
    font-size: 1rem;
  }
  .issue-board {
    gap: 16px;
  }
  .issue-board .issue {
    padding: 0;
  }
  .issue-board .issue-toggle {
    padding: 18px 0;
  }
  .issue-toggle > .icon {
    margin-top: 2px;
  }
  .issue-top {
    gap: 8px;
  }
  .issue-title {
    font-size: 1.05rem;
    font-weight: 600;
  }
  .issue-description {
    font-size: 1rem;
    line-height: 1.6;
  }
  .issue-history .count-large {
    font-size: 1.9rem;
  }
  .mobile-card {
    padding: 20px;
  }
  .mobile-card > .tag {
    margin-top: 12px;
  }
  .mobile-card-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 12px;
    font-size: 1rem;
  }
  .mobile-card-meta .muted {
    font-size: 0.875rem;
  }
  .mobile-card-meta > div {
    min-width: 0;
  }
  .mobile-card-meta strong {
    overflow-wrap: anywhere;
  }
  .mobile-nav {
    display: grid;
    grid-template-columns: 1fr 1.35fr 1fr;
    gap: 8px;
    position: fixed;
    z-index: 3;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line);
    background: var(--surface);
  }
  .mobile-nav .bottom-action {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    min-height: 64px;
    border: 0;
    font-size: 0.875rem;
    line-height: 1.25;
  }
  .mobile-nav .bottom-action .icon {
    width: 23px;
    height: 23px;
  }
  .mobile-nav .bottom-action[aria-current="page"] {
    color: var(--tint-ink);
    background: var(--tint);
  }
  .mobile-nav .note-shortcut {
    background: var(--accent);
    color: var(--on);
  }
  html.auth-screen .mobile-nav,
  html[data-screen="note"] .mobile-nav,
  body.menu-open .mobile-nav {
    display: none;
  }
  html[data-screen="note"] main {
    padding-bottom: calc(var(--note-dock-space, 160px) + 24px);
  }
  .recording > .record-controls {
    display: none;
  }
  .note-save-bar {
    position: fixed;
    z-index: 3;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    gap: 8px;
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px #1c23210a;
  }
  .note-save-bar .dock-meta {
    flex-basis: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
  }
  .note-save-bar .save-status {
    width: auto;
    font-size: 0.875rem;
  }
  .thumb-record-state {
    display: block;
    font-size: 0.875rem;
    text-align: right;
    color: var(--muted);
  }
  .thumb-record-controls,
  .thumb-record-controls .record-controls {
    display: contents;
  }
  .thumb-record-controls .btn,
  .note-save-bar > .btn {
    flex: 1 1 0;
    min-width: max-content;
    min-height: 52px;
    font-size: 1rem;
    padding: 10px;
    white-space: nowrap;
  }
  .thumb-record-controls .btn > .icon,
  .note-save-bar > .btn > .icon {
    display: none;
  }
  .note-save-bar .record-start {
    background: var(--tint);
    color: var(--tint-ink);
    border-color: var(--line);
  }
  .sidebar.mobile-open {
    padding-top: 84px;
    overflow-y: auto;
  }
  .sidebar.mobile-open .menu-close {
    position: absolute;
    right: 16px;
    top: 16px;
    width: 48px;
    height: 48px;
    padding: 12px;
  }
  .sidebar.mobile-open .menu-close .icon {
    width: 24px;
    height: 24px;
  }
  .sidebar.mobile-open .sidebar-heading {
    padding-left: 16px;
    padding-right: 0;
    font-size: 1.6rem;
    line-height: 1.25;
  }
  .sidebar.mobile-open .nav-link {
    min-height: 52px;
    font-size: 1.1rem;
  }
  #toast {
    bottom: calc(112px + env(safe-area-inset-bottom, 0px));
  }
  html[data-screen="note"] #toast {
    bottom: calc(var(--note-dock-space, 160px) + 12px);
  }
  .chat-main,
  .chat-sidebar {
    padding: 20px;
  }
  .chat-title h2 {
    font-size: 1.2rem;
  }
  .message {
    font-size: 1rem;
  }
}
@media (max-width: 360px) {
  .filters {
    grid-template-columns: 1fr;
  }
  .client-meta {
    display: grid;
  }
  .recording-head {
    flex-wrap: wrap;
  }
}
.sidebar-bottom #scenario-button {
  margin-top: 12px;
  justify-content: flex-start;
  width: 100%;
}
.client-type-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.client-type-choice {
  flex-direction: column;
  padding: 12px 6px;
  font-size: 0.875rem;
  gap: 8px;
}
.client-type-choice[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--tint);
}
.settings-assistant {
  background: var(--context-bg);
}
.client-picker {
  position: relative;
  display: grid;
  gap: 8px;
  min-width: 0;
}
.client-picker-popover {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.chat-sidebar .client-picker label {
  margin: 0;
}
.client-picker input {
  font-size: 1rem;
}
.client-suggestions {
  max-height: min(20rem, 35dvh);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.client-suggestion {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 12px;
  cursor: pointer;
}
.client-suggestion + .client-suggestion {
  border-top: 1px solid var(--line);
}
.client-suggestion:hover,
.client-suggestion[aria-selected="true"] {
  background: var(--tint);
}
.client-suggestion-text {
  display: grid;
  gap: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.client-suggestion strong {
  font-size: 1rem;
  font-weight: 600;
}
.client-suggestion small {
  font-size: 0.875rem;
  color: var(--muted);
}
.client-search-status {
  margin: 0;
}
.chat-sidebar > .client-picker {
  margin-bottom: 12px;
}
@media (min-width: 1101px) {
  .chat-sidebar .client-picker-popover {
    position: absolute;
    z-index: 4;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }
  .chat-sidebar .client-suggestions {
    max-height: min(28rem, 45dvh);
    border: 0;
    border-radius: 4px;
  }
  .chat-sidebar .client-suggestion {
    min-height: 56px;
    padding: 8px 12px;
  }
  .chat-sidebar .client-suggestion-text {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
  }
  .chat-sidebar .client-suggestion strong {
    min-width: 0;
  }
  .chat-sidebar .client-suggestion small {
    text-align: right;
  }
  .chat-sidebar .client-search-status {
    padding: 0 12px 4px;
  }
}
.note-client-choice {
  display: grid;
  gap: 24px;
}
dialog .note-client-choice .field,
dialog .note-client-choice .actions {
  margin-top: 0;
}
.mobile-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
}
.mobile-meta-next {
  order: -1;
  flex-basis: 100%;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.mobile-meta-next strong {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.mobile-meta-next strong > span {
  white-space: nowrap;
}
.appointment-time {
  color: var(--tint-ink);
}
.mobile-meta-last {
  flex: 1 1 auto;
}
.record-section .empty {
  grid-column: 1 / -1;
  max-width: none;
  margin: 0;
  padding: 24px 0;
  text-align: left;
}
.record-section .empty p {
  margin: 8px 0 20px;
  max-width: 65ch;
}
.record-section .empty .actions {
  justify-content: flex-start;
}
.client-appointment {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  flex-basis: 100%;
  gap: 12px;
  min-width: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.appointment-edit {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  min-height: 48px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  text-align: left;
}
.appointment-edit > .icon {
  width: 20px;
  height: 20px;
  color: var(--muted);
}
.appointment-edit > .icon:last-child {
  margin-left: 4px;
  width: 18px;
  height: 18px;
}
.appointment-edit:hover > .icon,
.appointment-edit:focus-visible > .icon {
  color: var(--accent);
}
.client-appointment-info {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.client-appointment-info > .helper {
  line-height: 1.5rem;
}
.appointment-edit > .icon:first-child {
  align-self: flex-start;
  margin-top: calc((1.5rem - 20px) / 2);
}
.appointment-date {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.appointment-date span {
  white-space: nowrap;
}
.client-appointment .appointment-feedback {
  flex-basis: 100%;
  margin: 0;
  padding: 12px;
  font-size: 0.875rem;
}
@media (max-width: 760px) {
  .client-appointment {
    margin-top: 16px;
  }
}
.session-highlights {
  background: var(--highlight-bg);
}
.client-record {
  display: grid;
  gap: 12px;
  border: 0;
  background: transparent;
  overflow: visible;
}
.client-record > .client-head,
.client-record > .record-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.client-record > .client-head {
  background: var(--surface);
}
.client-head h1,
.record-section .section-head h2 {
  font-family: Marcellus, serif;
  font-weight: 400;
  line-height: 1.25;
}
.record-section .section-head h2 {
  font-size: 1.5rem;
}
.client-name > span:not(.client-kind) {
  font-family: Marcellus, serif;
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.4;
}
.client-name small {
  font-family: Satoshi, Arial, sans-serif;
}
@media (max-width: 760px) {
  .record-section .section-head h2 {
    font-size: 1.35rem;
  }
}
.settings-security {
  background: var(--surface);
}
.client-record > .homework-section {
  padding: 0;
  background: var(--surface);
}
.homework-section .section-head {
  margin: 0;
}
.homework-section .section-head > div,
.homework-section .section-title,
.homework-section h2 {
  width: 100%;
  margin: 0;
}
.homework-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 20px 28px;
  border-radius: var(--radius);
  background: transparent;
  font: inherit;
  line-height: inherit;
  text-align: left;
}
.homework-toggle > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.homework-toggle > .icon {
  margin-left: auto;
  transition: transform 0.22s ease;
}
.homework-toggle[aria-expanded="true"] > .icon {
  transform: rotate(180deg);
}
.homework-toggle:hover,
.homework-toggle:active {
  background: var(--soft);
}
.homework-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
}
.homework-count {
  display: grid;
  place-items: center;
  flex: none;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--tint);
  color: var(--tint-ink);
  font:
    600 0.875rem/1 Satoshi,
    Arial,
    sans-serif;
}
.homework-body {
  padding: 0 28px 24px;
}
.homework-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}
.homework-item {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.homework-item:last-child {
  padding-bottom: 0;
}
.homework-check {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  min-height: 44px;
  cursor: pointer;
}
.homework-check input {
  width: 22px;
  height: 22px;
  margin: 3px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.homework-text {
  max-width: 72ch;
  overflow-wrap: anywhere;
}
.homework-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 4px 0 0 34px;
  font-size: 0.875rem;
  color: var(--muted);
}
.homework-meta time {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.homework-source {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.homework-item.is-complete .homework-text {
  color: var(--muted);
}
.homework-item.is-complete .homework-state {
  color: var(--ok);
  font-weight: 600;
}
.homework-empty {
  margin: 0 0 8px;
}
.homework-feedback {
  margin-top: 20px;
}
@media (max-width: 760px) {
  .homework-toggle {
    padding: 16px 20px;
  }
  .homework-body {
    padding: 0 20px 20px;
  }
}
.settings-data {
  background: var(--highlight-bg);
}
.settings .record-section + .record-section {
  border-top: 12px solid var(--bg);
}
.settings .section-head h2 {
  font-size: 1.25rem;
}
.settings .instruction-input {
  resize: none;
  overflow-y: hidden;
  min-height: 12rem;
}
.settings .instruction-input.is-expanded {
  min-height: max(22rem, 55dvh);
}
.textarea-size-toggle[aria-expanded="true"] .icon {
  transform: rotate(180deg);
}
.context-toggle[aria-expanded="true"] .icon {
  transform: rotate(180deg);
}
@media (max-width: 760px) {
  #client-results.card {
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
  }
  .mobile-clients {
    display: grid;
    gap: 16px;
  }
  .mobile-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
  }
  .mobile-card + .mobile-card {
    border-top: 1px solid var(--line);
  }
  .settings-save-bar {
    bottom: calc(var(--mobile-nav-space, 80px) + 12px);
    z-index: 2;
    margin-top: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }
}

/* Zlecenie 162 (z klocków prototypu; prototyp tych elementów nie miał): przypomnienie o kopii nad listą klientów
   i „Materiały do pracy” w Ustawieniach. */
.backup-reminder {
  margin: 0 0 20px;
}
.backup-reminder p {
  margin: 0 0 12px;
}
.backup-reminder .actions {
  flex-wrap: wrap;
}
.settings-materials {
  background: var(--context-bg);
  border-top: 1px solid var(--line);
}
.material-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.material-item h3 {
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}
.material-item .actions {
  flex-shrink: 0;
}
.material-form .material-text {
  min-height: 220px;
}

/* Zlecenie 163 (z klocków prototypu): dane klienta, usuwanie sesji i klienta, cofnięcie importu, twardy podgląd. */
.btn.danger-text {
  color: var(--warn);
}
.danger-zone {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.danger-zone h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}
.person-fields {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px 4px;
  margin: 0 0 16px;
}
.person-fields legend {
  padding: 0 6px;
  font-weight: 600;
}
.import-undo {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.import-undo h3 {
  margin: 0 0 6px;
}
.import-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  list-style: none;
  margin: 12px 0 4px;
  padding: 0;
}
.import-confirm {
  margin: 16px 0;
}
