@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;800;900&display=swap");

:root {
  --ink: #1a1a2e;
  --ink-soft: #5a5a78;
  --paper: #f3f3f5;
  --paper-2: #ffffff;
  --line: rgba(26, 26, 46, 0.11);
  --wine: #2f5fd0;
  --wine-deep: #24499f;
  --moss: #3c5b62;
  --sand: #ab9dff;
  --danger: #b42318;
  --ok: #2f6a48;
  --warn: #9a5b16;
  --shadow: 0 18px 40px rgba(26, 26, 46, 0.12);
  --radius: 22px;
  --touch: 44px;
  --dock-h: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: Manrope, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1100px 460px at 8% -12%, rgba(99, 128, 224, 0.13), transparent 60%),
    radial-gradient(820px 380px at 100% -4%, rgba(255, 45, 143, 0.07), transparent 58%),
    var(--paper);
  background-attachment: fixed;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
}

.update-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + var(--safe-bottom));
  z-index: 1000;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 16px;
  background: #1a1a2e;
  color: #fff;
  box-shadow: 0 16px 40px rgba(26, 26, 46, 0.35);
  font-weight: 700;
  font-size: 0.92rem;
}
.update-banner .btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: #ff2d8f;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
@media (min-width: 860px) {
  .update-banner {
    left: auto;
    right: 20px;
    bottom: 20px;
    width: min(420px, calc(100vw - 40px));
  }
}

.motivation-toast {
  position: fixed;
  left: 14px;
  right: 14px;
  top: auto;
  bottom: calc(18px + var(--safe-bottom));
  z-index: 90;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(26, 26, 46, 0.94);
  color: #fff;
  box-shadow: 0 18px 40px rgba(26, 26, 46, 0.28);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.28s ease, transform 0.28s ease;
  pointer-events: none;
}
.motivation-toast.is-in {
  opacity: 1;
  transform: translateY(0);
}
.motivation-toast.is-out {
  opacity: 0;
  transform: translateY(10px);
}
.motivation-toast-ico {
  flex: 0 0 auto;
  margin-top: 2px;
  opacity: 0.92;
}
.motivation-toast-ico svg { display: block; }
.motivation-toast-text {
  margin: 0;
  font-style: italic;
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.4;
}
@media (min-width: 981px) {
  .motivation-toast { display: none !important; }
}

.login {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(24px, var(--safe-top)) 16px max(40px, var(--safe-bottom));
  position: relative;
  overflow: hidden;
  font-family: Montserrat, Manrope, "Segoe UI", sans-serif;
  background: #fafaff;
  isolation: isolate;
}
.login-decor { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.login .blob {
  position: absolute;
  border-radius: 50%;
}
.login .blob.b1 {
  width: min(52vw, 420px);
  height: min(52vw, 420px);
  top: -120px;
  left: -80px;
  background: #ebb3d8;
  opacity: 0.9;
}
.login .blob.b2 {
  width: min(48vw, 380px);
  height: min(48vw, 380px);
  bottom: -100px;
  right: -70px;
  background: #ab9dff;
  opacity: 0.85;
}
.login .blob.b3 {
  width: min(32vw, 260px);
  height: min(32vw, 260px);
  top: 38%;
  right: 12%;
  background: #6380e0;
  opacity: 0.35;
}
.login .blob.b4 {
  width: min(28vw, 220px);
  height: min(28vw, 220px);
  bottom: 18%;
  left: 8%;
  background: #ff7dd5;
  opacity: 0.55;
}
.login-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 10px;
  display: flex;
  z-index: 1;
}
.login-bar span { flex: 1; }
.login-bar span:nth-child(1) { background: #6380e0; }
.login-bar span:nth-child(2) { background: #ab9dff; }
.login-bar span:nth-child(3) { background: #ff7dd5; }
.login-bar span:nth-child(4) { background: #ed5cab; }
.login-bar span:nth-child(5) { background: #ebb3d8; }
.login-stack {
  width: min(420px, 100%);
  position: relative;
  z-index: 2;
  display: grid;
  gap: 12px;
}
.login-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(99, 128, 224, 0.18);
  border-radius: 28px;
  padding: 32px 28px 28px;
  box-shadow: 0 22px 50px rgba(99, 128, 224, 0.18);
  backdrop-filter: blur(10px);
}
.install-hint {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(99, 128, 224, 0.18);
  border-radius: 20px;
  padding: 14px 16px;
  box-shadow: 0 12px 28px rgba(99, 128, 224, 0.12);
}
.install-hint p {
  margin: 0 0 10px;
  color: #5a5a78;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}
.install-hint-steps {
  margin: 0 0 10px 18px;
  padding: 0;
  color: #5a5a78;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}
.install-hint-steps li { margin-bottom: 6px; }
.install-hint-steps b { color: #1a1a2e; }
.install-hint-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.install-hint .btn {
  min-height: 40px;
  padding: 8px 14px;
  background: #ff7dd5;
  color: #fff;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
}
.install-hint .btn.ghost {
  background: transparent;
  color: #6380e0;
  box-shadow: inset 0 0 0 1px rgba(99, 128, 224, 0.28);
}
@media (min-width: 860px) {
  .install-hint { display: none; }
}
@media (display-mode: standalone) {
  .install-hint { display: none !important; }
}
.login-install-restore {
  margin: 10px 0 0;
  text-align: center;
}
.login-install-restore-btn {
  border: 0;
  background: transparent;
  color: #6380e0;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 6px 4px;
}
.login-install-restore-btn:hover { color: #ff7dd5; }
@media (display-mode: standalone) {
  .login-install-restore { display: none !important; }
}
.login-logo {
  display: block;
  width: min(280px, 100%);
  height: auto;
  margin: 0 auto 10px;
}
.login .sub {
  text-align: center;
  color: #ed5cab;
  margin: 0 0 22px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.login .field { margin-bottom: 12px; }
.login .field span { color: #6380e0; }
.login .field input {
  width: 100%;
  max-width: none;
  border-color: rgba(99, 128, 224, 0.28);
  font-size: 16px;
  min-height: 48px;
  padding: 13px 16px;
}
.login .field input:focus {
  outline: 2px solid #ff7dd5;
  outline-offset: 1px;
  border-color: #ff7dd5;
}
.login .btn {
  width: 100%;
  background: #ff7dd5;
  color: #fff;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  min-height: 48px;
  padding: 13px 16px;
}
.login .btn:hover { background: #ed5cab; }
.login .error {
  background: #fde8f4;
  color: #ed5cab;
}
.people { display: grid; gap: 8px; margin-bottom: 16px; max-height: 46vh; overflow: auto; }
.person {
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.person.active {
  border-color: var(--wine);
  box-shadow: inset 0 0 0 1px var(--wine);
}
.person b { display: block; }
.role { font-size: 12px; color: var(--ink-soft); }
.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.check-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  margin: 0;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
  height: 36px;
  white-space: nowrap;
}
.check-chip > span {
  display: inline;
  margin: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
}
.check-chip input[type="checkbox"] {
  appearance: auto;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  flex: none;
  accent-color: var(--wine);
}
.assignee-pick {
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.assignee-pick .check-chip {
  width: 100%;
  height: auto;
  min-height: 36px;
  border-radius: 12px;
  white-space: normal;
}
.assignee-pick .check-chip > span {
  white-space: normal;
}
.team-compact .field { margin-bottom: 6px; }
.team-compact .field input,
.team-compact .field select {
  padding: 5px 8px;
  min-height: 28px;
  border-radius: 8px;
  font-size: 14px;
}
.team-compact .card h3,
.team-compact h3 { margin-bottom: 8px; }
.profile-card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 300px);
  gap: 20px;
  align-items: start;
}
.profile-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 4px;
}
.profile-head-text { flex: 1; min-width: 0; }
.profile-head-action { flex: 0 0 auto; }
.profile-avatar {
  width: 300px;
  max-width: 100%;
  justify-self: end;
}
.profile-avatar-inline { display: none; }
.profile-avatar-edit-mobile { display: none; }
.profile-avatar-frame {
  width: 300px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #e9eaf2;
}
.profile-avatar-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-avatar-empty {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--ink-soft);
  font-size: 14px;
  text-align: center;
  padding: 12px;
}
@media (max-width: 720px) {
  .profile-card-grid {
    grid-template-columns: 1fr;
  }
  .profile-avatar-desk { display: none; }
  .profile-avatar-inline {
    display: block;
    width: 48px;
    flex: 0 0 48px;
    justify-self: auto;
  }
  .profile-avatar-inline .profile-avatar-frame,
  .profile-avatar-frame.profile-avatar-icon {
    width: 48px;
    border-radius: 999px;
  }
  .profile-avatar-inline .profile-avatar-empty {
    font-size: 9px;
    padding: 4px;
    line-height: 1.1;
  }
  .profile-avatar-edit-mobile { display: block; margin-top: 14px; }
  .profile-head {
    flex-wrap: wrap;
    align-items: center;
  }
  .profile-head-action {
    width: 100%;
    order: 3;
  }
}
.team-bday-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f3e4c8;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
}
.item.birthday-month,
.team-edit.birthday-month {
  border-color: #c9a46a;
  background: linear-gradient(180deg, #fff6e6 0%, #fff 70%);
  box-shadow: inset 3px 0 0 #b8843a;
}
.pill.birthday {
  background: #f0d7a8;
  color: #6b4510;
}
.team-edit {
  padding: 12px 14px;
}
.team-edit .field { margin-bottom: 8px; }
.team-person {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.team-person-main {
  flex: 1;
  min-width: 0;
}
.team-person-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-start;
  flex-shrink: 0;
}
.team-avatar {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: #e9eaf2;
}
.team-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.team-avatar-empty {
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}
.team-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}
.team-actions .btn {
  width: auto;
  min-width: 120px;
  padding: 8px 14px;
  min-height: 40px;
}
.field { display: grid; gap: 3px; margin-bottom: 6px; align-content: start; }
.field[hidden],
[data-task-assignees][hidden],
[data-task-audience-preview][hidden],
[data-schedule-panel][hidden] {
  display: none !important;
}
.month-days {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}
[data-recur-monthdays][hidden] {
  display: none !important;
}
.day-chip {
  min-width: 40px;
  justify-content: center;
  padding: 6px 8px;
}
.assignee-pick-ro .check-chip {
  cursor: default;
  background: #fff;
}
.field > span:first-child { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-soft); }
.field-hint {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-soft);
  line-height: 1.25;
}
.field input, .field select, .field textarea {
  width: 100%;
  max-width: 240px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 14px;
  min-height: 28px;
  line-height: 1.25;
}
.field textarea { min-height: 48px; max-width: 480px; resize: vertical; }
.field input[type="file"] { max-width: 480px; }
.row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 240px));
  gap: 8px;
  align-items: start;
  justify-content: start;
}
.client-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
  align-items: stretch;
}
.client-duo.is-adult {
  grid-template-columns: 1fr;
  max-width: 640px;
}
.client-duo > .card {
  margin: 0;
  height: 100%;
}
.client-duo-col .row {
  grid-template-columns: 1fr 1fr;
  max-width: 100%;
}
.client-duo-col .field input,
.client-duo-col .field select,
.client-duo-col .phone-input,
.client-duo-col .parent-pick {
  max-width: none;
  width: 100%;
}
.btn {
  border: 0;
  background: var(--wine);
  color: #fff;
  border-radius: 16px;
  padding: 13px 16px;
  font-weight: 700;
  min-height: var(--touch);
}
a.btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn:disabled { opacity: 0.55; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ok { background: var(--ok); }
.btn.warn { background: var(--warn); }
.btn.wide { width: 100%; }
.error {
  background: #f8e4e0;
  color: var(--danger);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 260px 1fr; }
.side {
  background:
    linear-gradient(90deg, #6380e0, #ab9dff, #ff7dd5, #ed5cab) top left / 100% 3px no-repeat,
    radial-gradient(520px 320px at 0% 0%, rgba(99, 128, 224, 0.26), transparent 70%),
    radial-gradient(420px 300px at 100% 100%, rgba(255, 45, 143, 0.13), transparent 70%),
    var(--ink);
  color: #eef0f8;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: auto;
  border-right: 1px solid rgba(238, 240, 248, 0.08);
}
.app-nav { display: flex; flex-direction: column; gap: 8px; }
.app-nav-dock { display: none; }
.who-mobile { display: none; }
.brand { font-family: Unbounded, sans-serif; font-size: 26px; margin: 0 0 4px; }
.brand-hit {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  padding: 0;
  font: inherit;
  font-family: Unbounded, sans-serif;
  font-size: 26px;
  margin: 0 0 4px;
}
.brand-hit:hover,
.brand-hit:focus-visible,
.brand-hit.active {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 5px;
}
.brand-mobile {
  display: none;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0 0 6px;
  font-family: Unbounded, sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--wine);
  cursor: pointer;
}
.brand-mobile.active { text-decoration: underline; text-underline-offset: 4px; }
.brand-sub {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 22px;
  max-width: 24ch;
}
.brand-sub-icon {
  flex: 0 0 auto;
  margin-top: 2px;
  color: #fff;
  opacity: 0.92;
}
.brand-sub-icon svg {
  display: block;
}
.brand-sub-text {
  margin: 0;
  font-style: italic;
  font-weight: 400;
  color: #fff;
}
.nav-btn {
  text-align: left;
  background: transparent;
  color: inherit;
  border: 0;
  border-radius: 14px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-btn.active { background: rgba(255, 255, 255, 0.1); }
.nav-ico {
  position: relative;
  display: none;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}
.nav-ico svg { display: block; width: 22px; height: 22px; }
.nav-badge {
  position: absolute;
  top: -7px;
  right: -9px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ff2d8f;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}
.nav-label { display: inline; }
.who { margin-top: auto; padding-top: 18px; color: rgba(238, 240, 248, 0.72); }
.who b { color: #fff; display: block; margin-bottom: 8px; }
.side .btn.ghost {
  color: #eef0f8;
  border-color: rgba(238, 240, 248, 0.4);
}

.main { padding: 28px; }
.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.top h2 {
  font-family: Unbounded, sans-serif;
  font-size: 30px;
  margin: 0 0 4px;
}
.muted { color: var(--ink-soft); }
.date-nav { display: flex; gap: 8px; align-items: center; }
.date-nav input { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 12px; font-size: 16px; min-height: var(--touch); }
.phone-input {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  min-height: 28px;
  height: 28px;
  width: 100%;
  max-width: 240px;
}
.phone-prefix {
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
  background: rgba(26, 26, 46, 0.04);
  border-right: 1px solid var(--line);
  flex-shrink: 0;
}
.phone-input input {
  border: 0 !important;
  border-radius: 0 !important;
  flex: 1;
  min-width: 0;
  min-height: 0 !important;
  height: 100%;
  padding: 5px 8px !important;
  box-shadow: none !important;
}
.parent-pick { position: relative; width: 100%; }
.parent-pick input[type="search"] {
  width: 100%;
  max-width: none;
}
.parent-pick-chosen {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
}
.parent-pick-chosen[hidden],
.parent-pick [data-client-parent-searchwrap][hidden] {
  display: none !important;
}
.parent-pick-chosen .btn {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 10px;
}
.parent-pick-list {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 4px;
  max-height: 240px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(26, 26, 46, 0.12);
}
.parent-pick-list button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.parent-pick-list button:hover {
  background: rgba(255, 125, 213, 0.16);
}
.parent-pick-list .empty {
  padding: 10px;
  margin: 0;
}
.parent-dup {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff4d6;
  border: 1px solid #efd089;
  display: grid;
  gap: 6px;
}
.parent-dup[hidden] { display: none !important; }
.parent-dup .btn {
  justify-self: start;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 10px;
}
.client-pending-del {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff4d6;
  border: 1px solid #efd089;
  font-size: 13px;
  line-height: 1.35;
}
.lead-card {
  border: 1px solid rgba(255, 45, 143, 0.28);
  background: linear-gradient(180deg, rgba(255, 125, 213, 0.08), transparent 48%);
}
.lead-card-focus {
  box-shadow: 0 0 0 2px rgba(255, 45, 143, 0.35);
}
.lead-matches {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}
.lead-match-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(26, 26, 46, 0.04);
}
.lead-admit {
  padding-top: 8px;
  border-top: 1px dashed rgba(26, 26, 46, 0.12);
}
.client-highlight {
  box-shadow: 0 0 0 2px rgba(255, 45, 143, 0.28);
}
select[data-lesson-teacher] {
  min-height: 38px;
  max-width: 220px;
}

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.overview-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}
.overview-stats .kicker { display: block; margin-bottom: 4px; }
.overview-stats b { font-size: 15px; }
.overview-period-bar .seg-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.overview-period-bar .seg {
  width: auto;
  min-width: 0;
  padding: 8px 12px;
  min-height: 40px;
  border-radius: 12px;
  font-size: 14px;
}
.overview-period-bar .seg.active {
  background: var(--wine);
  color: #fff;
  border-color: var(--wine);
}
.overview-fold-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.overview-fold-main { min-width: 0; flex: 1; }
.overview-fold-title {
  margin: 0;
  font-size: 20px;
  font-family: Unbounded, sans-serif;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.overview-fold-nested .overview-fold-title { font-size: 16px; }
.overview-fold-summary {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}
.overview-fold-btn {
  flex: 0 0 auto;
  white-space: nowrap;
  min-height: 40px;
  padding: 8px 12px;
}
.overview-fold-body { margin-top: 12px; }
.overview-fold-body[hidden] { display: none !important; }
.overview-fold-nested {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.overview-fold-nested .overview-fold-head { align-items: baseline; }
.overview-fold-nested .overview-fold-body { margin-top: 8px; }
.overview-fold.is-folded .overview-fold-summary { font-size: 14px; }
.overview-ekb-sites {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}
.overview-ekb-site {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafbfe;
}
.overview-ekb-site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.overview-ekb-site-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}
.system-progress {
  margin-bottom: 8px;
  background: #eef0f6;
  border-color: rgba(60, 91, 72, 0.2);
}
.system-progress-bar {
  margin-top: 8px;
  height: 6px;
  border-radius: 999px;
  background: rgba(26, 26, 46, 0.08);
  overflow: hidden;
}
.system-progress-bar > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ok, #2f6b4f);
}
.card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 10px 24px rgba(26, 26, 46, 0.05);
}
.card h3 { margin: 0 0 10px; font-size: 20px; font-family: Unbounded, sans-serif; }
.prize-panel {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.prize-panel-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.prize-panel-head b { font-size: 14px; }
.prize-panel-grid,
.prize-panel-form {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 6px 10px;
  align-items: end;
}
.prize-panel-form { margin-top: 8px; }
.prize-panel-comment { grid-column: 1 / -1; }
.prize-panel .field { margin-bottom: 0; }
.prize-panel .field input,
.prize-panel .field select {
  max-width: none;
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
}
.prize-panel-list { display: grid; gap: 4px; margin-top: 8px; }
.prize-panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
}
.prize-panel-row .btn {
  min-height: 30px;
  padding: 4px 10px;
  width: auto;
}
.prize-panel-form .btn {
  min-height: 34px;
  padding: 6px 12px;
  width: auto;
  justify-self: start;
}
@media (max-width: 640px) {
  .prize-panel-grid,
  .prize-panel-form { grid-template-columns: 1fr; }
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  background: #eef0f6;
}
.pill.ok { background: #d8efe3; color: var(--ok); }
.offer-agreed-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #d8efe3;
  color: var(--ok);
  font-weight: 900;
  font-size: 14px;
  line-height: 1;
  vertical-align: middle;
  cursor: help;
}
.offer-agreed-chip input:checked + span {
  font-weight: 900;
  color: var(--ok);
}
.pill.online {
  background: #d8efe3;
  color: var(--ok);
}
.pill.online::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.pill.bad { background: #fae3e0; color: var(--danger); }
.pill.client-debt-mark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pill.client-debt-mark .client-debt-d { font-weight: 700; }
.pill.client-debt-mark .client-debt-sum {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pill.warn { background: #fbeecf; color: var(--warn); }
.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.task-meta-compact {
  gap: 8px;
  margin-top: 4px;
  align-items: center;
}
.task-meta-inline {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  line-height: 1.3;
}
.task-meta-inline-due {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef0f6;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}
.task-meta-inline-due.warn {
  background: #fbeecf;
  color: var(--warn);
}
.task-meta-inline-due.bad {
  background: #fae3e0;
  color: var(--danger);
}
.task-meta-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 12px;
  background: #eef0f6;
  border: 1px solid rgba(26, 26, 46, 0.08);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}
.task-meta-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.task-meta-place {
  background: #e8eefb;
  border-color: rgba(47, 95, 208, 0.16);
}
.task-meta-from {
  background: #efecfd;
  border-color: rgba(171, 157, 255, 0.3);
}
.task-meta-due {
  background: #eef0f6;
}
.task-meta-due.warn {
  background: #fbeecf;
  color: var(--warn);
  border-color: rgba(154, 91, 22, 0.25);
}
.task-meta-due.bad {
  background: #fae3e0;
  color: var(--danger);
  border-color: rgba(156, 42, 34, 0.25);
}
.list { display: grid; gap: 8px; }
.list-tasks { gap: 6px; }
.item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: #fff;
  display: grid;
  gap: 6px;
}
.item.item-task {
  border-radius: 12px;
  padding: 10px 12px;
  gap: 4px;
}
.item.item-task.done {
  opacity: 0.78;
  background: #f7f8fb;
}
.item-task .item-body {
  min-width: 0;
  flex: 1;
}
.item-task .item-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
}
.item-task .item-title-script {
  font-weight: 400;
}
.item-task .item-title-script b {
  font-weight: 700;
}
.item-task.done .item-title.item-title-script {
  font-weight: 400;
}
.item-script {
  margin-top: 6px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--ink);
}
.item-script b {
  font-weight: 800;
}
.item-task.done .item-title {
  font-weight: 600;
  color: var(--ink-soft);
}
.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
  flex: 0 0 auto;
  max-width: 42%;
}
.btn.btn-sm {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 10px;
  font-weight: 700;
}
.item-task .check {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 13px;
}
.task-done-fold {
  margin-top: 10px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  background: #f5f6fa;
}
.task-done-fold > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  list-style: none;
  user-select: none;
}
.task-done-fold > summary::-webkit-details-marker { display: none; }
.task-done-fold > summary::before {
  content: "▸ ";
  color: var(--ink-soft);
}
.task-done-fold[open] > summary::before { content: "▾ "; }
.task-done-fold[open] > summary { margin-bottom: 8px; }
.task-done-fold .list-tasks { margin-top: 4px; }

.group-fold {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-2);
  padding: 0;
  overflow: hidden;
}
.group-fold > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: baseline;
  justify-content: space-between;
  padding: 12px 14px;
  font-weight: 700;
}
.group-fold > summary::-webkit-details-marker { display: none; }
.group-fold > summary::before {
  content: "▸ ";
  color: var(--ink-soft);
  font-weight: 800;
}
.group-fold[open] > summary::before { content: "▾ "; }
.group-fold-title { flex: 1 1 auto; min-width: 140px; }
.group-fold-meta {
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 600;
}
.group-fold-body {
  padding: 0 14px 14px;
  border-top: 1px solid var(--line);
}
.group-slot {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.45);
}
.team-fold {
  padding: 0;
  overflow: hidden;
}
.team-fold > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
}
.team-fold > summary::-webkit-details-marker { display: none; }
.team-fold > summary::before {
  content: "▸ ";
  color: var(--ink-soft);
  font-weight: 700;
}
.team-fold[open] > summary::before { content: "▾ "; }
.team-fold-summary .team-person {
  display: flex;
  gap: 12px;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.team-fold-body {
  padding: 0 14px 14px;
  border-top: 1px solid var(--line);
}
.weekday-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
button.item.item-open {
  width: 100%;
  margin: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
button.item.item-open:hover,
button.item.item-open:focus-visible {
  border-color: #b9c4e4;
  background: #fafbfe;
  box-shadow: 0 1px 0 rgba(60, 40, 10, 0.04);
  outline: none;
}
.item.done { opacity: 0.72; }
.item-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.kicker { font-size: 12px; color: var(--ink-soft); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.stack { display: grid; gap: 14px; }
.split { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 14px; }
.tasks-page-split {
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 16px;
}
.tasks-page-mine,
.tasks-page-create {
  min-width: 0;
}
.tasks-page-mine > .card:last-child,
.tasks-page-mine > .banner:last-child {
  margin-bottom: 0;
}
.tasks-page-create .card {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 28px);
  overflow: auto;
}
.table-wrap { overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); }
table.month { font-size: 12px; }
table.month th, table.month td { text-align: center; padding: 6px 4px; min-width: 28px; }
table.month th:first-child, table.month td:first-child { text-align: left; min-width: 220px; }
table.month tr.month-person td {
  text-align: left;
  padding-top: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 92%, var(--ink) 8%);
}
table.month tr.month-cat td:first-child {
  padding-left: 12px;
  color: var(--ink-soft);
}

.check {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 12px;
  font-weight: 700;
  background: var(--moss);
  color: #fff;
  min-height: var(--touch);
}
.check.done { background: #d8efe3; color: var(--ok); }
.banner {
  background: var(--ink);
  color: #eef0f8;
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.banner .btn.ghost {
  color: #eef0f8;
  border-color: rgba(238, 240, 248, 0.4);
}
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice .card { cursor: pointer; min-height: 140px; }
.choice .card:hover { border-color: var(--wine); }
.empty { color: var(--ink-soft); padding: 8px 0; }
.org-page { display: grid; gap: 14px; }
.org-page .field input,
.org-page .field textarea { max-width: none; }
.org-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: stretch;
}
.org-company {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
}
.org-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.org-card-head h3 { margin: 0; }
.org-card-head .btn { flex: 0 0 auto; }
.org-row {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.org-row > span {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-top: 2px;
}
.org-row > b {
  text-align: right;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-weight: 700;
}
.org-row-val {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: flex-end;
  text-align: right;
}
.org-row-val b { white-space: pre-wrap; word-break: break-word; }
.org-empty { color: var(--ink-soft); font-weight: 500; }
.org-links { display: flex; flex-wrap: wrap; gap: 8px; }
.org-link {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(47, 95, 208, 0.09);
  color: inherit;
  font-weight: 700;
  text-decoration: none;
  min-height: var(--touch);
}
.org-link:hover { background: rgba(47, 95, 208, 0.16); }
.org-link-dead { opacity: 0.7; }
.org-text { white-space: pre-wrap; line-height: 1.55; }
.org-file-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.org-file-form input[type="file"] { max-width: 100%; }
.org-doc-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
    padding-top: calc(var(--dock-h) + var(--safe-top));
    padding-bottom: max(16px, var(--safe-bottom));
  }
  .side { display: none; }
  .who-mobile { display: block; }
  .brand-mobile { display: block; }
  .app-nav-dock {
    display: flex;
    flex-direction: row;
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: auto;
    z-index: 40;
    gap: 4px;
    padding: calc(6px + var(--safe-top)) 8px 8px;
    background:
      linear-gradient(90deg, #6380e0, #ab9dff, #ff7dd5, #ed5cab) bottom left / 100% 2px no-repeat,
      var(--ink);
    color: #eef0f8;
    box-shadow: 0 10px 24px rgba(26, 26, 46, 0.18);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .app-nav-dock .nav-btn {
    flex: 1 1 0;
    min-width: 44px;
    min-height: var(--touch);
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    padding: 8px 4px;
    white-space: nowrap;
    line-height: 1.2;
    justify-content: center;
    gap: 0;
  }
  .app-nav-dock .nav-ico { display: inline-flex; }
  .app-nav-dock .nav-label { display: none; }
  .grid-3, .split, .org-cards, .choice, .row, .overview-stats, .client-duo, .tasks-page-split, .overview-ekb-sites, .overview-pair { grid-template-columns: 1fr; }
  .tasks-page-create .card {
    position: static;
    max-height: none;
  }
  .main { padding: 16px 16px 24px; }
  .top h2 { font-size: 22px; }
  .date-nav { width: 100%; flex-wrap: wrap; }
  .date-nav input { flex: 1; min-width: 140px; }
  .item-top { flex-wrap: wrap; }
  .item-top .check { width: 100%; }
  .item-actions {
    max-width: none;
    width: 100%;
    justify-content: stretch;
  }
  .item-actions .btn,
  .item-actions .check {
    flex: 1 1 auto;
    width: auto;
    min-width: calc(33.33% - 6px);
  }
  .banner { flex-direction: column; align-items: stretch; }
  .banner .btn { width: 100%; }
  .table-wrap:has(table.month)::after {
    content: "На телефоне таблицу можно листать вправо";
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: var(--ink-soft);
  }
  table:not(.month) thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  table:not(.month),
  table:not(.month) tbody {
    display: block;
    width: 100%;
  }
  table:not(.month) tr {
    display: block;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 10px 12px;
    margin-bottom: 8px;
  }
  table:not(.month) td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    border: 0;
    padding: 6px 0;
  }
  table:not(.month) td[data-col]::before {
    content: attr(data-col);
    flex: 0 0 42%;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-soft);
  }
  table:not(.month) td:not([data-col]) {
    display: block;
    padding-top: 8px;
  }
}

button,
.check-chip,
.parent-pick-list button,
.person {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transform: translateZ(0);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    filter 0.12s ease,
    background-color 0.15s ease,
    border-color 0.15s ease,
    opacity 0.15s ease;
}
.btn,
.check,
.nav-btn,
.check-chip,
.parent-pick-list button {
  box-shadow: 0 1px 0 rgba(26, 26, 46, 0.08);
}
.btn:hover:not(:disabled):not(.is-busy),
.check:hover:not(:disabled):not(.is-busy),
.nav-btn:hover:not(.active):not(.is-busy),
.check-chip:hover,
.parent-pick-list button:hover,
.login .btn:hover:not(:disabled):not(.is-busy) {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(26, 26, 46, 0.14);
  filter: brightness(1.04);
}
.btn.ghost:hover:not(:disabled):not(.is-busy) {
  background: rgba(26, 26, 46, 0.04);
}
.nav-btn:hover:not(.active):not(.is-busy) {
  background: rgba(255, 255, 255, 0.08);
}
.btn:active:not(:disabled),
.check:active:not(:disabled),
.nav-btn:active,
.check-chip:active,
.parent-pick-list button:active,
.person:active,
.btn.is-pressed,
.check.is-pressed,
.nav-btn.is-pressed,
button.is-busy,
.check.is-busy,
.nav-btn.is-busy {
  transform: scale(0.96) translateY(1px);
  box-shadow: inset 0 2px 6px rgba(26, 26, 46, 0.22);
  filter: brightness(0.9);
}
.btn.is-busy,
.check.is-busy,
.nav-btn.is-busy,
.login .btn.is-busy {
  pointer-events: none;
  animation: btn-busy 0.7s ease infinite;
}
@keyframes btn-busy {
  0%,
  100% { filter: brightness(0.9); }
  50% { filter: brightness(1.08); }
}
.btn.is-busy,
.check.is-busy {
  position: relative;
}
.btn.is-busy::after,
.check.is-busy::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  right: 10px;
  top: 50%;
  margin-top: -7px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.55s linear infinite;
  opacity: 0.9;
  pointer-events: none;
}
.date-nav .btn.is-busy::after,
.nav-btn.is-busy::after {
  content: none;
}
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  button,
  .check-chip,
  .parent-pick-list button,
  .person {
    transition: none;
  }
  .btn.is-busy,
  .check.is-busy,
  .nav-btn.is-busy,
  .login .btn.is-busy,
  .btn.is-busy::after,
  .check.is-busy::after {
    animation: none;
  }
}

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.row-between { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.event-form {
  width: 100%;
  max-width: none;
  margin: 12px 0 18px;
  padding: 12px 14px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafafa;
}
.event-form .field { margin-bottom: 0; }
.event-form .field input,
.event-form .field select,
.event-form .field textarea {
  max-width: none;
  width: 100%;
}
.event-form textarea { min-height: 52px; }
.event-line {
  display: grid;
  gap: 10px 12px;
  align-items: start;
  margin-bottom: 10px;
}
.event-line-head {
  grid-template-columns: minmax(240px, 2.2fr) minmax(150px, 200px) minmax(260px, 1.4fr) 120px;
}
.event-line-who {
  grid-template-columns: minmax(220px, 1.1fr) minmax(180px, 1fr) minmax(280px, 1.3fr);
}
.event-line-notes {
  grid-template-columns: 1fr 1fr minmax(210px, 240px);
}
.event-date-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.event-date-fields .field { flex: 1 1 130px; }
.event-money {
  display: grid;
  grid-template-columns: repeat(3, minmax(70px, 1fr));
  gap: 8px;
  margin-bottom: 6px;
}
.event-form-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}
.event-form-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.event-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 32px;
}
.event-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 0;
}
@media (max-width: 980px) {
  .event-line-head,
  .event-line-who,
  .event-line-notes {
    grid-template-columns: 1fr 1fr;
  }
}
.events-table-wrap { overflow-x: auto; }
table.events-table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0 12px;
  font-size: 13px;
}
table.events-table thead th {
  text-align: left;
  padding: 6px 12px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border: 0;
  background: transparent;
}
table.events-table tbody tr.event-item-row td {
  padding: 12px 14px;
  vertical-align: middle;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 0;
  border-right: 0;
  box-shadow: 0 1px 2px rgba(26, 26, 46, 0.04);
}
table.events-table tbody tr.event-item-row td:first-child {
  border-left: 1px solid var(--line);
  border-radius: 12px 0 0 12px;
  box-shadow: inset 4px 0 0 var(--pink);
}
table.events-table tbody tr.event-item-row td:last-child {
  border-right: 1px solid var(--line);
  border-radius: 0 12px 12px 0;
}
table.events-table tbody tr.event-item-row:has(+ tr.event-edit-row) td:first-child {
  border-radius: 12px 0 0 0;
}
table.events-table tbody tr.event-item-row:has(+ tr.event-edit-row) td:last-child {
  border-radius: 0 12px 0 0;
}
table.events-table tbody tr.event-edit-row td {
  padding: 0 12px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 1px 2px rgba(26, 26, 46, 0.04);
}
.event-edit-row .event-form {
  margin: 4px 0 0;
  border: 0;
  background: #f8f8fb;
}
table.events-table tbody tr.event-row-past td {
  background: #f6f6f8;
  box-shadow: none;
}
.event-edit-row > td {
  padding: 0 12px 12px;
  background: #fff;
  border-bottom: 0;
}
.event-row-past td {
  text-decoration: line-through;
  color: #8a8aa0;
}
.event-row-past td .btn,
.event-row-past td .muted {
  text-decoration: none;
}
