/*
 * Client layout (klient.) — the brand look of ponadlinia.pl, built only on variables from _tokens.css.
 * Calm on purpose: cream background, Libre Baskerville headings, Inter text, red used sparingly.
 * Since 27.09.2026 denser than before (product owner: "treść ma się mieścić") — a wider column, smaller
 * gaps; the character comes from the mock-up of the participant's space (ponad_linia/prototypy/
 * panel_uczestnika): the leaves motif under a white veil, the .eyebrow label, line icons, initials avatars.
 * Phones first — the bottom tab bar replaces the header navigation below 760px.
 * What the panel shares (page base, header, headings, cards, forms, buttons, and since 27.09.2026 the pages'
 * language — avatars, page header card, side cards, goal drawers, resource tiles, the balance's history)
 * lives in brand.css.
 */

/* ---------- Navigation ---------- */

.client-nav { display: flex; gap: 4px; }

.nav-link .icon { display: none; }

/* ---------- Page frame ---------- */

/* Wide enough for the home page's two columns; the side gutter shrinks with the screen. */
.client-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 40px 72px;
}

/* The client's screens are denser than the shared defaults in brand.css (the panel keeps those). */
.client .page-intro { margin-bottom: 28px; }
.client .section { margin-top: 44px; }

.contract-note {
  margin: 0;
  font-size: var(--text-body-sm-size);
  color: var(--muted);
}

.contract-note { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.contract-note .icon { color: var(--muted-warm); }

.section-lead { margin: -4px 0 24px; max-width: 640px; color: var(--muted); }

/* The label with a line before it (brand.css .eyebrow), in red on the client's content screens. */
.home .eyebrow,
.detail .eyebrow,
.org-hero .eyebrow { margin-bottom: 10px; color: var(--red); }
.home .eyebrow.eyebrow-muted,
.detail .eyebrow.eyebrow-muted { color: var(--muted-warm); }

/* ---------- Timeline ---------- */

/* The product owner's wireframe: the date above each node, the node a circle with a chevron (it opens the
   detail under the timeline), past sessions dark, planned and not-yet-dated ones grey, the red "+" last. */
.timeline-card {
  border: 1px solid rgba(30, 23, 16, 0.06);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(30, 23, 16, 0.04);
  overflow: hidden;
}

.timeline { position: relative; padding: 18px 0 6px; }

.timeline-track {
  display: flex;
  margin: 0;
  padding: 0 52px 10px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  -webkit-mask-image: linear-gradient(to right, transparent 12px, #000 52px, #000 calc(100% - 52px), transparent calc(100% - 12px));
  mask-image: linear-gradient(to right, transparent 12px, #000 52px, #000 calc(100% - 52px), transparent calc(100% - 12px));
}

.timeline-track:focus-visible { outline: 2px solid var(--brown); outline-offset: -2px; }

.tl-item {
  position: relative;
  flex: 0 0 128px;
  padding: 0 6px;
  text-align: center;
  scroll-snap-align: start;
}

/* The line through the nodes, drawn piece by piece under every item, at the height of the nodes' centre
   (date line 20 px + 8 px gap + half of the 30 px node). */
.tl-item::before {
  content: "";
  position: absolute;
  top: 42px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border);
}

.tl-item:first-child::before { left: 50%; }
.tl-plus::before { right: 50%; }

.tl-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 4px;
  border-radius: 12px;
  color: inherit !important;
  text-decoration: none;
}

.tl-link:focus-visible { outline: 2px solid var(--brown); outline-offset: 2px; }

.tl-date {
  display: block;
  height: 20px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
  white-space: nowrap;
  color: var(--brown);
}

.tl-dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin: 0 auto 8px;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--muted-warm);
  color: var(--surface);
  box-shadow: 0 0 0 4px var(--surface);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tl-link:hover .tl-dot { transform: scale(1.1); }

.tl-state { display: block; font-size: 12px; line-height: 1.35; color: var(--muted-warm); }

/* Past sessions dark; a past one the coach has not recorded yet — dark outline. */
.tl-held .tl-dot { background: var(--brown); }
.tl-unrecorded .tl-dot { border: 2px dashed var(--brown); background: var(--surface); color: var(--brown); }

/* Cancelled and forfeited: stated quietly, as facts (spec 02 "3b"). */
.tl-cancelled .tl-dot,
.tl-cancelled_with_bonus .tl-dot,
.tl-forfeited .tl-dot { border-color: var(--border); background: var(--surface); color: var(--muted-warm); }
.tl-cancelled .tl-date,
.tl-cancelled_with_bonus .tl-date,
.tl-forfeited .tl-date { color: var(--muted); font-weight: 400; }

.tl-uncovered .tl-dot { border: 2px dashed var(--muted-warm); background: var(--surface); color: var(--muted-warm); }

/* Sessions with no date yet: the lightest grey. */
.tl-free .tl-dot { background: var(--border); color: var(--muted); }
.tl-free .tl-date { color: var(--muted); font-weight: 400; }

.tl-today .tl-date { color: var(--red); }
.tl-today .tl-dot {
  width: 12px;
  height: 12px;
  margin: 9px auto 17px;
  background: var(--red);
  box-shadow: 0 0 0 5px var(--surface-primary);
}

.tl-end .tl-dot {
  width: 2px;
  height: 30px;
  border: 0;
  border-radius: 0;
  background: var(--brown);
  box-shadow: none;
}

.tl-plus .tl-dot { background: var(--red); }
.tl-plus .tl-date { color: var(--red); }
.tl-plus .tl-link:hover .tl-dot { background: var(--red-hover); }

/* The node whose detail is open under the timeline. */
.tl-item.is-selected .tl-dot { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--red); }
.tl-item.is-selected .tl-state { color: var(--brown); }

.timeline-arrow {
  position: absolute;
  top: 44px;
  z-index: 2;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--brown);
  font: inherit;
  font-size: 18px;
  line-height: 28px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(30, 23, 16, 0.08);
}

.timeline-arrow-back { left: 10px; }
.timeline-arrow-forward { right: 10px; }
.timeline-arrow:hover { background: var(--cream); }

@media (hover: none) {
  .timeline-arrow { display: none; }
}

/* ---------- Detail under the timeline (Turbo Frame "session-detail") ---------- */

.session-detail { display: block; border-top: 1px solid var(--border); }
.session-detail[busy] { opacity: 0.6; transition: opacity 0.2s ease; }

.detail { padding: 20px 28px 24px; }
.detail p { margin: 0 0 8px; }
.detail p:last-child { margin-bottom: 0; }

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: 18px;
}

.detail-title {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.detail .detail-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: var(--text-body-sm-size);
  color: var(--muted);
}

.detail-meta .icon { color: var(--muted-warm); }

.detail-open {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  font-size: var(--text-body-sm-size);
  white-space: nowrap;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 36px;
}

.detail-wide { grid-column: 1 / -1; }

.detail-label {
  margin: 0 0 8px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-warm);
}

.thread-list-compact li { padding: 10px 0; font-size: 17px; }
.thread-list-compact li:first-child { padding-top: 0; }

.detail .dash-item { padding: 8px 0; }
.detail-commitments .commitment-list li { font-size: 16px; }

.detail .detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 14px; }

.detail-empty { margin: 0; padding: 20px 28px; color: var(--muted); }

.detail .detail-note {
  max-width: 720px;
  margin: 0;
  padding: 14px 18px;
  border-left: 3px solid var(--muted-warm);
  border-radius: 4px 12px 12px 4px;
  background: var(--cream);
  color: var(--muted);
}

.detail-note.state-cancelled_with_bonus { border-left-color: var(--green); }

.offer-rows { margin: 0 0 8px; padding: 0; list-style: none; }

.offer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}

.offer-row-name { display: flex; flex-direction: column; font-size: 15px; }
.offer-row .hint { font-size: 13px; }

/* ---------- Home ---------- */

/* Two columns (the product owner's wireframe): the process on the left, the coach and the focus on the right. */
.home {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(300px, 25vw, 360px);
  gap: 28px;
  align-items: start;
}

.home-main,
.home-side { display: flex; flex-direction: column; min-width: 0; }

.home-main { gap: 32px; }
.home-side { gap: 14px; }

.home-block .section-head { margin-bottom: 14px; }
.home-block .section-title { font-size: 24px; }

/* "This is me": the client's name with their initials, on the leaves motif of ponadlinia.pl. */
.me-head {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 28px;
  border: 1px solid rgba(30, 23, 16, 0.06);
  border-radius: 20px;
  background-color: var(--surface);
  background-image: linear-gradient(90deg, var(--surface) 30%, #ffffff00 80%), url("/assets/liscie-da537256.webp");
  background-size: 100% 100%, cover;
  background-position: 0 0, right 35%;
  background-repeat: no-repeat;
}

.avatar-me { width: 64px; height: 64px; border: 0; background: var(--brown); color: var(--cream); font-size: 22px; }

.client h1.me-name { margin: 0 0 4px; font-size: 38px; line-height: 1.15; }

.me-lead { margin: 0; font-size: 16px; color: var(--muted); }

.notice-box {
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.6);
  font-size: 15px;
}

.notice-box p { margin: 0; }
.notice-box p + p,
.notice-box form + p { margin-top: 8px; }
.notice-box form { margin-top: 10px; }

/* The organization context — in Phase 1 an invitation, not a locked feature (spec 02). */
.org-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  border-radius: 14px;
  background: var(--dark);
  color: var(--cream) !important;
  font-size: 14px;
  line-height: 1.35;
  text-decoration: none;
}

.org-link span { flex: 1; }
.org-link .icon-arrow { transition: transform 0.2s ease; }
.org-link:hover { background: var(--brown); }
.org-link:hover .icon-arrow { transform: translateX(3px); }

/* The coach's card on the leaves motif under a white veil — the mock-up's .panel. */
.coach-card {
  background-image: linear-gradient(#ffffffd9, #ffffffd9), url("/assets/liscie-da537256.webp");
  background-size: 100% 100%, cover;
  background-position: top right;
  background-repeat: no-repeat;
}

.coach { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }

.coach-name {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 19px;
  line-height: 1.3;
}

.coach-contact { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: var(--text-body-sm-size); overflow-wrap: anywhere; }
.coach-contact .icon { flex-shrink: 0; color: var(--muted-warm); }

/* "Fokus na teraz" in the light green of the mock-up's next-card. */
.focus-card { border-color: transparent; background: var(--surface-secondary); box-shadow: none; }
.home .focus-card .eyebrow { color: var(--green-dark); }
.focus-card .task-list { margin: 12px 0 0; }
.focus-card .task-toggle { padding: 10px 0; font-size: 15px; }
.focus-card .card-text { margin: 8px 0 0; font-size: 15px; }

.commitment-list-small li { margin-bottom: 8px; font-size: 15px; }

.side-note {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  color: var(--muted);
}

.side-note p { margin: 0; }
.side-note p + p { margin-top: 6px; }
.side-note strong { color: var(--brown); font-weight: 500; }

.focus-card .res-icon { background: var(--surface); }

/* ---------- Organization (an invitation in Phase 1) ---------- */

.org-hero {
  margin-bottom: 16px;
  padding: 32px 36px;
  border: 1px solid rgba(30, 23, 16, 0.06);
  border-radius: 20px;
  background-color: var(--surface);
  background-image: linear-gradient(90deg, var(--surface) 35%, #ffffff00 85%), url("/assets/liscie-da537256.webp");
  background-size: 100% 100%, cover;
  background-position: 0 0, right 35%;
  background-repeat: no-repeat;
}

.org-hero .lead { max-width: 720px; }
.org-hero { display: flex; align-items: center; gap: 24px; }

.org-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  align-items: start;
}

/* ---------- Home on narrower screens: one column ----------
 * The two columns dissolve (display: contents) and the blocks line up in the order that matters between
 * sessions: who I am, what I focus on now, my goals, the timeline, my coach, resources, the organization. */
@media (max-width: 1080px) {
  .home { display: flex; flex-direction: column; align-items: stretch; gap: 22px; }
  .home-main,
  .home-side { display: contents; }
  /* now flex items of .home: without this, the timeline's scrolling track would widen the page */
  .home-main > *,
  .home-side > * { min-width: 0; }

  .me-head { order: 1; }
  .home-consent { order: 2; }
  .focus-card { order: 3; }
  .home-goals { order: 4; }
  .home-timeline { order: 5; }
  .coach-card { order: 6; }
  .home-resources { order: 7; }
  .offer-card { order: 8; }
  .org-link { order: 9; }
  .side-note { order: 10; }
}

/* ---------- Session ---------- */

.thread-list { margin: 0; padding: 0; list-style: none; }

.thread-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.thread-list li:first-child { padding-top: 4px; }
.thread-list li:last-child { border-bottom: 0; padding-bottom: 0; }

.card-commitment { background: var(--surface-primary); border-color: transparent; box-shadow: none; }

.commitment-list { margin: 0; padding: 0; list-style: none; }

.commitment-list li {
  margin: 0 0 12px;
  padding-left: 16px;
  border-left: 2px solid var(--red);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 18px;
  line-height: 1.45;
}

.commitment-list li:last-child { margin-bottom: 0; }

/* The session's own page: the same body as the detail under the timeline, in a card. */
.session-body { padding: 0; overflow: hidden; }
.session-body .detail { padding: 24px 28px 26px; }
.session-body .detail-empty { padding: 0; }
.session-body .detail-grid { gap: 24px 40px; }
.session-body .thread-list-compact li { font-size: 19px; }

/* ---------- Goal ---------- */

.goal-now {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px 40px;
}

.goal-now .goal-label { margin-top: 0; }
.goal-text-large { font-size: 17px; line-height: 1.55; }

/* How the goal changed: a vertical line, the current version on top with a red dot. */
.goal-history { margin: 0; padding: 0 0 0 8px; list-style: none; }

.goal-history .version {
  position: relative;
  padding: 0 0 26px 30px;
  border-left: 2px solid var(--border);
}

.goal-history .version:last-child { padding-bottom: 0; border-left-color: transparent; }

.goal-history .version::before {
  content: "";
  position: absolute;
  top: 2px;
  left: -8px;
  width: 14px;
  height: 14px;
  border: 2px solid var(--muted-warm);
  border-radius: 50%;
  background: var(--cream);
}

.goal-history .version.is-current::before { border-color: var(--red); background: var(--red); box-shadow: 0 0 0 4px var(--surface-primary); }

.version-dates { margin: 0 0 6px; font-size: 13px; color: var(--muted-warm); }
.is-current .version-dates { color: var(--red); font-weight: 500; }

.version-content {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.4;
  color: var(--muted);
}

.is-current .version-content { color: var(--brown); font-size: 20px; }

.goal-list { margin: 10px 0 14px; padding: 0; list-style: none; }

.goal-list a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  margin: 0 -12px;
  border-radius: 10px;
  color: var(--brown) !important;
  text-decoration: none;
}

.goal-list a:hover,
.goal-list .is-current a { background: var(--cream); }

.goal-list-number {
  font-family: var(--font-serif);
  font-size: var(--text-kicker-size);
  letter-spacing: var(--text-kicker-tracking);
  text-transform: uppercase;
  color: var(--red);
}

.goal-list-text { font-family: var(--font-serif); font-size: 15px; line-height: 1.4; }

/* ---------- Focus ---------- */

.focus-tasks .task-list { margin-top: 6px; }
.focus-tasks .task-toggle { font-size: 17px; }

.task-list { margin: 0 0 12px; padding: 0; list-style: none; }
.task-form { margin: 0; }

.task-toggle {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px dashed var(--border);
  background: none;
  color: var(--brown);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.task:last-child .task-toggle { border-bottom: 0; }

.task-box {
  position: relative;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border: 1.5px solid var(--muted-warm);
  border-radius: 6px;
  background: var(--surface);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.task-toggle:hover .task-box { border-color: var(--brown); }

.is-done .task-box { border-color: var(--green); background: var(--green); }

.is-done .task-box::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid var(--surface);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.is-done .task-text { color: var(--muted-warm); }

/* ---------- Resources: the library ----------
 * After the owner's mock-up (panel_uczestnika: .search-line, .filter-chips, .library-card). */

.library-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
}

.searchbox {
  position: relative;
  display: flex;
  flex: 1 1 360px;
  align-items: center;
  gap: 8px;
  max-width: 560px;
}

.searchbox > .icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-warm);
  pointer-events: none;
}

.searchbox input {
  flex: 1;
  min-width: 0;
  padding: 11px 16px 11px 44px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--brown);
  font: inherit;
  font-size: 15px;
}

.searchbox input:focus-visible { outline: 2px solid var(--brown); outline-offset: 1px; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--cream);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.badge-green { background: var(--surface-secondary); color: var(--green-dark); }

/* ---------- Balance and offer ---------- */

.metric {
  margin: 4px 0 12px;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 64px;
  line-height: 1;
  letter-spacing: var(--text-metric-tracking);
}

/* The pool at a glance: in the pool, planned, still to plan. */
.pool-stats { display: grid; grid-template-columns: 1.4fr 1fr 1fr; margin: 0; }

.pool-stat { padding: 2px 24px; border-left: 1px dashed var(--border); }
.pool-stat:first-child { padding-left: 0; border-left: 0; }

.pool-stat dt {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-warm);
}

.pool-stat dd { margin: 0; font-family: var(--font-serif); font-size: 36px; line-height: 1; }
.pool-stat-main dd.metric { margin: 0; font-size: 56px; }
.pool-note { margin: 16px 0 0; }

.offers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 14px;
}

.offer { display: flex; flex-direction: column; }
.offer .hint { margin: 0 0 8px; }
.offer form { margin-top: auto; padding-top: 16px; }

.offer-name {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.3;
}

.offer-price {
  margin: 0 0 4px;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: var(--text-metric-size);
  line-height: var(--text-metric-line);
  letter-spacing: var(--text-metric-tracking);
}

.rules-card .dash-item { padding: 10px 0; font-size: 14px; }

/* ---------- Settings ---------- */

/* The sections' list on the left (with each one's state), the cards on the right. */
.settings-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.settings-nav {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
}

.settings-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--brown) !important;
  font-size: 14px;
  text-decoration: none;
}

.settings-nav a:hover { background: var(--surface); }
.settings-nav .icon { flex-shrink: 0; color: var(--muted-warm); }
.nav-state { margin-left: auto; font-size: 11px; white-space: nowrap; color: var(--muted-warm); }
.nav-state.is-on { color: var(--green-dark); }
.nav-state.is-alert { color: var(--red); }

.settings-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.settings-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 18px;
  align-items: stretch;
}

.settings-card { display: flex; flex-direction: column; scroll-margin-top: 90px; }

.settings-card-head { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px 12px; margin-bottom: 14px; }
.settings-card-head .card-heading { margin: 0; font-size: 20px; }
.settings-card-meta { grid-column: 1 / -1; }

.settings-icon {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--brown);
}

.settings-card .card-text { font-size: 15px; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: auto 0 0; padding-top: 14px; }

.status {
  display: inline-block;
  align-self: flex-start;
  margin: 0 0 12px;
  padding: 3px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--cream);
  font-size: 13px;
  color: var(--muted);
}

.status-on { border-color: transparent; background: var(--surface-secondary); color: var(--green-dark); }

.disclosure { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }
.disclosure summary { cursor: pointer; font-weight: 500; }
.disclosure .form { margin: 12px 0 4px; max-width: 420px; }

/* Consents as cards, each with its state on top: given (green), an older text, missing — and the art. 9
   consent, without which the portal shows no content, marked in red when missing. */
.consent-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.consent {
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.6);
}

.consent.is-granted { border-color: #c9dccf; background: var(--surface-secondary); }
.consent.is-needed { border-color: var(--red); background: var(--surface-primary); }

.consent-state { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 13px; font-weight: 500; color: var(--muted); }
.is-granted .consent-state { color: var(--green-dark); }
.is-needed .consent-state { color: var(--red); }

.consent-title { margin: 0 0 6px; font-size: 16px; font-weight: 500; }
.consent-text { margin: 0 0 10px; font-size: var(--text-body-sm-size); color: var(--muted); }
.consent .hint { margin: 0 0 10px; font-size: 13px; }
.is-needed .hint { color: var(--brown); }

.consent-action { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 8px; }
.consent-action form { margin: 0; }

.data-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 20px 36px;
}

.data-layout .dash-item { font-size: 14px; }
.data-export { padding: 18px 20px; border-radius: 14px; background: var(--cream); }
.data-export .form { margin: 10px 0 0; }
.data-export .form .hint { margin: 0; font-size: 13px; }
.data-export .actions { margin-top: 6px; }

.data-delete {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
  color: var(--muted);
}

.data-delete .icon { flex-shrink: 0; color: var(--muted-warm); }

.link-quiet { color: var(--muted) !important; font-size: var(--text-body-sm-size); }

.form-card { max-width: 560px; }
.form-card .form { margin: 0; }

.deletion-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  align-items: start;
}

/* ---------- The other pages on narrower screens: one column ---------- */
@media (max-width: 1080px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { display: none; }
}

/* ---------- Phones ---------- */

@media (max-width: 760px) {
  /* The navigation becomes a tab bar at the bottom of the screen. */
  .client-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    gap: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--border);
  }

  .nav-link {
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding: 6px 0;
    border-radius: 12px;
    font-size: 11px;
    letter-spacing: 0;
    color: var(--muted) !important;
  }

  .nav-link .icon { display: block; }
  .nav-link.is-active { background: none; box-shadow: none; color: var(--red) !important; }
  .client-logout { display: none; }

  .client-main { padding: 20px 16px 56px; }
  body.has-nav .client-main { padding-bottom: 104px; }
  .client .section { margin-top: 36px; }

  /* Home */
  .home { gap: 18px; }
  .me-head { gap: 14px; padding: 18px; border-radius: 16px; background-position: 0 0, 70% 35%; }
  .avatar-me { width: 48px; height: 48px; font-size: 17px; }
  .client h1.me-name { font-size: 28px; }
  .me-lead { font-size: 15px; }
  .home-block .section-title { font-size: 22px; }

  .timeline-card { border-radius: 16px; }
  .timeline-arrow { display: none; }
  .timeline-track {
    padding: 0 12px 8px;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent);
    mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent);
  }
  .tl-item { flex-basis: 108px; padding: 0 4px; }
  .tl-date { font-size: 12px; }
  .tl-state { font-size: 11px; }

  .detail { padding: 16px 18px 20px; }
  .detail-empty { padding: 16px 18px; }
  .detail-head { flex-direction: column; margin-bottom: 14px; }
  .detail-title { font-size: 20px; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .thread-list-compact li { font-size: 16px; }

  .org-hero { padding: 22px 18px; border-radius: 16px; }

  .thread-list li { font-size: 18px; }

  .metric { font-size: 52px; }

  /* The other pages */
  .session-body { padding: 0; }
  .session-body .detail { padding: 18px 18px 20px; }
  .session-body .thread-list-compact li { font-size: 17px; }

  .searchbox { flex-basis: 100%; }

  .pool-stat { padding: 2px 12px; }
  .pool-stat dt { font-size: 11px; letter-spacing: 0.03em; }
  .pool-stat dd { font-size: 28px; }
  .pool-stat-main dd.metric { font-size: 44px; }

  .data-layout { grid-template-columns: minmax(0, 1fr); }
  .data-export { padding: 16px; }

}

/* ---------- Login and the other screens before entering (shared/_auth_frame) ----------
 * Half and half, copied from the product owner's mock-up of the participant's space
 * (ponad_linia/prototypy/panel_uczestnika: app.js login(), styles.css and mobile.css .login-*):
 * the valley photo with a quote on the left, the form on the leaves motif on the right.
 * On phones (≤ 600 px) the photo goes, as in the mock-up. Photos: app/assets/images, from ponadlinia.pl. */

/* The frame goes edge to edge under the header, instead of the page's centred column. */
.client-main:has(> .login-layout) { max-width: none; padding: 0; }

.login-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: max(660px, calc(100vh - 65px)); /* the rest of the screen under the 65 px header */
  background: var(--surface);
}

.login-photo { position: relative; min-height: 540px; background: var(--dark); }

.login-photo > img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% 50%; /* keeps the person in the frame when the column is taller than in the mock-up */
  opacity: 0.7;
}

.login-quote {
  position: absolute;
  bottom: 60px;
  left: 12%;
  right: 12%;
  color: #fff;
}

.login-quote-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 37px;
  line-height: 1.4;
  letter-spacing: -0.035em;
}

.login-quote-title em { font-weight: 400; }

.login-quote-text { margin: 20px 0 0; font-size: 13px; color: #e5d7c8; } /* the mock-up's warm light grey */

/* The leaves motif of ponadlinia.pl under a white veil, as in the mock-up (--watermark on .login-form). */
.login-form {
  width: 100%;
  max-width: 600px;
  margin: 0 auto; /* full height of the column, so the leaves motif does not end in the middle of the screen */
  padding: 70px 65px;
  background-image: linear-gradient(#ffffffbd, #ffffffbd), url("/assets/liscie-da537256.webp");
  background-size: 100% 100%, cover;
  background-position: top right;
  background-repeat: no-repeat;
}

.client .login-form h1 {
  margin: 15px 0;
  font-size: 36px;
  line-height: 1.3;
  letter-spacing: -0.035em;
}

.login-hint {
  margin: 27px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 800px) {
  .login-layout { grid-template-columns: 0.8fr 1fr; }
  .login-form { padding: 45px 28px; }
  .login-quote { bottom: 40px; }
  .login-quote-title { font-size: 28px; }
}

@media (max-width: 767px) {
  .login-form { padding: 30px 20px; }
  .client .login-form h1 { font-size: 30px; }
}

@media (max-width: 600px) {
  /* the white form fills the phone's screen under the 57 px header (the mock-up has a footer there instead) */
  .login-layout { grid-template-columns: 1fr; min-height: calc(100vh - 57px); }
  .login-photo { display: none; }
}
