:root {
  --bg: #ece8e1;
  --surface: rgba(247, 244, 238, 0.88);
  --surface-2: rgba(242, 238, 231, 0.9);
  --text: #171614;
  --muted: #6e675f;
  --line: rgba(96, 84, 70, 0.14);
  --line-strong: rgba(78, 68, 56, 0.24);
  --accent: #1b1a18;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --shadow-soft: 0 10px 30px rgba(44, 34, 22, 0.06);
  --shadow-hover: 0 16px 38px rgba(44, 34, 22, 0.09);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top left, rgba(124, 104, 79, 0.08), transparent 24%),
    radial-gradient(circle at 85% 10%, rgba(76, 88, 100, 0.08), transparent 22%),
    linear-gradient(180deg, #f0ece5 0%, #e9e4dc 100%);
  color: var(--text);
  font-family: "Inter", "SF Pro Display", "PingFang SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

.topbar,
.panel,
.stat-card,
.mother-card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.topbar,
.panel {
  border-radius: var(--radius-xl);
}

.topbar {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
}

.kicker,
.section-tag,
.stat-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topbar h1,
.panel h2 {
  margin: 0;
  letter-spacing: -0.04em;
}

.topbar h1 {
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 0.96;
}

.subcopy,
.section-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
  align-content: flex-start;
  justify-content: flex-end;
  min-width: 0;
}

.topbar-copy {
  display: flex;
  align-items: flex-start;
  align-self: flex-start;
  padding-top: 14px;
}

.topbar-copy .kicker {
  margin: 0;
  max-width: 92px;
  color: #5d554c;
  font-size: 12px;
  font-weight: 800;
  line-height: 0.96;
  letter-spacing: 0.18em;
  text-wrap: balance;
  word-break: keep-all;
}

.topbar-actions > .remote-filter {
  order: 1;
  flex: 1 1 calc((100% - 24px) / 3);
  min-width: 210px;
 }

.topbar-actions > button {
  order: 2;
  flex: 0 0 auto;
}

#saveBtn {
  order: 1;
}

.remote-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.remote-filter span {
  white-space: nowrap;
}

.remote-filter select {
  width: 100%;
  min-width: 0;
  padding: 7px 9px;
}

.remote-filter-input {
  gap: 10px;
}

.remote-filter-input input {
  width: 100%;
  min-width: 0;
}

.topbar-actions .remote-filter-input input[type="password"] {
  width: 100%;
  min-width: 0;
}

@media (max-width: 1300px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .topbar-copy {
    align-self: auto;
  }

  .topbar-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 860px) {
  .topbar-actions > .remote-filter {
    flex-basis: 100%;
  }
}

.log-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.log-follow-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.log-follow-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.log-search-input {
  width: 180px;
  min-width: 180px;
}

.log-filter-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(146, 122, 88, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
}

.log-filter-chip {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 7px 11px;
  border-radius: 999px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.log-filter-chip:hover {
  background: rgba(91, 75, 56, 0.08);
  color: var(--text);
}

.log-filter-chip.active {
  background: var(--accent);
  color: #f6f1e8;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.is-hidden {
  display: none !important;
}

.provider-fields {
  width: 100%;
}

.provider-note {
  padding: 12px 14px;
  border: 1px solid rgba(91, 75, 56, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.provider-note-warning {
  border-color: rgba(180, 105, 56, 0.22);
  background: rgba(255, 244, 234, 0.72);
  color: #8d4f22;
}

.solo-grid {
  display: grid;
  gap: 18px;
}

.solo-storage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.solo-storage-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.52);
}

.solo-storage-card strong,
.solo-provider-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.solo-storage-card code {
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}

.solo-provider-list {
  display: grid;
  gap: 12px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 6px;
}

.solo-provider-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.56);
}

.solo-message-item {
  appearance: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--text);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.solo-message-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
  border-color: var(--line-strong);
}

.solo-provider-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.solo-detail-log {
  min-height: 260px;
  white-space: pre-wrap;
}

.diagnostics-box {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 252, 246, 0.74);
  border: 1px solid rgba(146, 122, 88, 0.14);
  color: var(--text);
  font-size: 12px;
  line-height: 1.6;
}

.diagnostics-summary-main {
  margin-bottom: 10px;
}

.diagnostics-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.diagnostics-card {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(146, 122, 88, 0.12);
  background: rgba(255, 255, 255, 0.62);
}

.diagnostics-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 12px;
}

.diagnostics-card-meta,
.diagnostics-card-path,
.diagnostics-card-note {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  word-break: break-word;
}

.diagnostics-card-note {
  margin-top: 6px;
  color: var(--text);
}

.diagnostics-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.diagnostics-item {
  padding: 9px 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(146, 122, 88, 0.12);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  word-break: break-word;
}

.maintenance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.maintenance-pill {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(146, 122, 88, 0.12);
  background: rgba(255, 255, 255, 0.62);
}

.maintenance-pill span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.maintenance-pill strong {
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
}

.maintenance-pill-wide {
  grid-column: 1 / -1;
}

.mother-session-strip {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(146, 122, 88, 0.12);
}

.mother-session-title {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mother-session-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.mother-session-item {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.9fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(146, 122, 88, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(248, 243, 236, 0.68));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.mother-session-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.mother-session-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  word-break: break-word;
}

.mother-session-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  word-break: break-word;
}

.mother-session-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.mother-session-detail {
  min-width: 0;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid rgba(146, 122, 88, 0.12);
  background: rgba(255, 255, 255, 0.66);
}

.mother-session-detail span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.mother-session-detail strong {
  display: block;
  color: var(--text);
  font-size: 11px;
  line-height: 1.45;
  word-break: break-word;
}

.mother-session-detail small {
  display: block;
  color: var(--text);
  font-size: 11px;
  line-height: 1.45;
  font-weight: 600;
  word-break: break-word;
}

.mother-session-error {
  margin-top: 8px;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid rgba(171, 88, 67, 0.16);
  background: rgba(250, 231, 226, 0.7);
  color: #8b4d41;
  font-size: 11px;
  line-height: 1.5;
  word-break: break-word;
}

.mother-session-note {
  margin-top: 8px;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid rgba(146, 122, 88, 0.14);
  background: rgba(255, 250, 243, 0.76);
  color: #5c4a38;
  font-size: 11px;
  line-height: 1.5;
  word-break: break-word;
}

.mother-session-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mother-session-badges-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
  align-content: start;
  margin-top: 38px;
}

.mother-fact {
  min-width: 0;
  min-height: 62px;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid rgba(146, 122, 88, 0.14);
  background: rgba(255, 255, 255, 0.72);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mother-fact span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.mother-fact strong {
  display: block;
  color: var(--text);
  font-size: 11px;
  line-height: 1.45;
  word-break: break-word;
}

.mother-fact-ok {
  background: rgba(225, 242, 232, 0.9);
  border-color: rgba(67, 131, 90, 0.18);
}

.mother-fact-ok strong {
  color: #285b3f;
}

.mother-fact-partial {
  background: rgba(250, 241, 214, 0.92);
  border-color: rgba(171, 130, 42, 0.2);
}

.mother-fact-partial strong {
  color: #8a641b;
}

.mother-fact-missing {
  background: rgba(250, 231, 226, 0.9);
  border-color: rgba(171, 88, 67, 0.18);
}

.mother-fact-missing strong {
  color: #8b4d41;
}

.mother-fact-neutral {
  background: rgba(255, 255, 255, 0.72);
}

.session-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(146, 122, 88, 0.14);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.session-badge.valid {
  color: #285b3f;
  background: rgba(225, 242, 232, 0.9);
  border-color: rgba(67, 131, 90, 0.18);
}

.session-badge.ok {
  color: #285b3f;
  background: rgba(225, 242, 232, 0.9);
  border-color: rgba(67, 131, 90, 0.18);
}

.session-badge.partial {
  color: #8a641b;
  background: rgba(250, 241, 214, 0.92);
  border-color: rgba(171, 130, 42, 0.2);
}

.session-badge.missing {
  color: #8b4d41;
  background: rgba(250, 231, 226, 0.9);
  border-color: rgba(171, 88, 67, 0.18);
}

.mother-note-badge {
  margin-top: 7px;
}

.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

.stat-card {
  flex: 0 0 122px;
  min-width: 122px;
  padding: 8px 10px;
  border-radius: 14px;
}

.stat-card-wide {
  flex-basis: 240px;
  min-width: 240px;
}

.stat-card strong {
  display: block;
  font-size: 15px;
  line-height: 1.22;
  letter-spacing: -0.03em;
}

#currentEmailBadge,
#currentMotherBadge {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.stat-label {
  margin-bottom: 6px;
  font-size: 10px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(720px, 1fr) 430px;
  gap: 10px;
  align-items: start;
}

.left-column,
.right-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-matrix {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 10px;
}

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

.panel {
  padding: 12px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.compact-header {
  margin-bottom: 8px;
}

.panel h2 {
  font-size: 15px;
  line-height: 1.05;
}

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

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

.two-up {
  grid-template-columns: 130px minmax(0, 1fr);
}

.compact-grid {
  align-items: end;
}

.field {
  min-width: 0;
}

.field-full,
.field-span-2 {
  grid-column: 1 / -1;
}

.field span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

input::placeholder,
textarea::placeholder {
  color: #978e84;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--line-strong);
  background: rgba(250, 247, 242, 0.96);
  box-shadow: 0 0 0 4px rgba(54, 44, 32, 0.05);
}

textarea {
  resize: vertical;
  min-height: 64px;
}

.switch-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 2px;
}

.switch-line input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.switch-line em {
  font-style: normal;
  color: var(--text);
  font-size: 11px;
}

.team-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mother-card {
  border-radius: var(--radius-lg);
  padding: 8px;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.mother-card:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-hover);
}

.mother-grid {
  display: grid;
  grid-template-columns: 110px minmax(0, 1.15fr) minmax(0, 1.15fr) minmax(0, 1.2fr) 96px 74px;
  gap: 6px;
  margin-bottom: 6px;
  align-items: end;
}

.field-toggle {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.field-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0 0 6px;
  accent-color: var(--accent);
}

.btn {
  appearance: none;
  border-radius: 999px;
  padding: 8px 11px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-small {
  padding: 6px 9px;
  font-size: 10px;
}

.btn-primary {
  color: #ffffff;
  background: var(--accent);
  border: 1px solid var(--accent);
}

.btn-primary:hover {
  background: #2a2825;
  border-color: #2a2825;
  box-shadow: 0 12px 28px rgba(27, 24, 20, 0.14);
}

.btn-muted {
  color: var(--text);
  background: rgba(249, 246, 241, 0.86);
  border: 1px solid var(--line);
}

.btn-muted:hover {
  background: rgba(243, 238, 231, 0.92);
  border-color: var(--line-strong);
}

.log-panel {
  position: sticky;
  top: 20px;
  min-height: calc(100vh - 40px);
}

.log {
  min-height: 520px;
  max-height: calc(100vh - 130px);
  overflow: auto;
  padding: 12px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, #191714 0%, #11100f 100%);
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: #f1ece5;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.55;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
}

.members-shell {
  max-width: 1540px;
}

.members-layout {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  grid-template-areas:
    "remote children"
    "actions children"
    "mothers children";
  gap: 12px;
  align-items: start;
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.lifecycle-card-grid {
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
}

.lifecycle-card .member-meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lifecycle-card .member-meta span strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.lifecycle-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.members-shell .topbar {
  grid-template-columns: minmax(280px, 0.96fr) minmax(420px, 1.3fr);
  align-items: center;
  gap: 22px;
  padding: 20px 22px;
}

.members-shell .topbar-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  align-self: center;
  padding-top: 0;
}

.members-shell .topbar-copy .kicker {
  max-width: none;
  color: #6b6258;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.16em;
}

.members-shell .topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 10px;
}

.members-shell .topbar-actions > .remote-filter {
  order: 1;
  flex: 0 1 260px;
  min-width: 220px;
  margin-right: auto;
}

.members-shell .topbar-actions > button {
  order: 2;
  flex: 0 0 auto;
}

.members-shell .topbar-actions > button:last-child,
.members-shell .topbar-actions > button:nth-last-child(2) {
  order: 3;
}

.members-shell .topbar h1 {
  font-size: clamp(24px, 2.8vw, 34px);
  line-height: 1.04;
}

.members-shell .subcopy {
  max-width: 760px;
  margin-top: 10px;
}

.members-shell .stats-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 12px;
}

.members-shell .stat-card {
  min-height: 84px;
  padding: 14px 16px;
}

.members-shell .stat-label {
  font-size: 11px;
}

.members-shell .stat-card strong {
  font-size: 24px;
}

.panel-remote {
  grid-area: remote;
}

.panel-mothers {
  grid-area: mothers;
}

.panel-actions {
  grid-area: actions;
}

.panel-children {
  grid-area: children;
  min-height: 100%;
}

.panel-mothers .member-grid {
  grid-template-columns: 1fr;
}

.panel-children .member-grid {
  grid-template-columns: 1fr;
}

.child-group {
  border-radius: 20px;
  padding: 12px;
  border: 1px solid rgba(126, 105, 78, 0.16);
  background: rgba(255, 250, 244, 0.52);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.child-group + .child-group {
  margin-top: 12px;
}

.child-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(126, 105, 78, 0.12);
}

.child-group-title,
.child-group-subtitle {
  margin: 0;
}

.child-group-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.child-group-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  word-break: break-all;
}

.child-group-count {
  flex: 0 0 auto;
  min-width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(27, 26, 24, 0.08);
  border: 1px solid rgba(27, 26, 24, 0.12);
  font-size: 12px;
  font-weight: 700;
}

.child-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.member-action-log {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 140px;
  max-height: 280px;
  overflow: auto;
  padding: 10px;
  border-radius: 16px;
  background: linear-gradient(180deg, #181614 0%, #11100f 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.member-action-hint {
  padding: 8px 2px 8px 12px;
  color: rgba(238, 231, 221, 0.55);
  font-size: 11px;
  line-height: 1.5;
  border-left: 2px solid rgba(255, 255, 255, 0.14);
}

.member-action-entry {
  padding: 7px 2px 7px 12px;
  border-radius: 0;
  font-size: 11px;
  line-height: 1.5;
  color: #eee7dd;
  background: transparent;
  border: 0;
  border-left: 2px solid rgba(255, 255, 255, 0.14);
  word-break: break-word;
  box-shadow: none;
}

.member-action-info {
  color: #efe8de;
  border-left-color: rgba(255, 255, 255, 0.18);
}

.member-action-success {
  color: #d8f0d5;
  border-left-color: rgba(104, 186, 115, 0.9);
}

.member-action-warn {
  color: #f2dec0;
  border-left-color: rgba(214, 167, 78, 0.9);
}

.member-action-error {
  color: #f1c6c1;
  border-left-color: rgba(220, 107, 90, 0.95);
}

.member-card {
  position: relative;
  border-radius: 18px;
  padding: 14px 14px 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(248, 242, 234, 0.86));
  border: 1px solid var(--line);
  box-shadow:
    0 10px 30px rgba(108, 90, 62, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.member-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.member-title,
.member-email {
  margin: 0;
}

.member-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  word-break: break-all;
}

.member-email {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  word-break: break-all;
}

.member-badge {
  white-space: nowrap;
  border-radius: 999px;
  padding: 6px 9px;
  border: 1px solid rgba(146, 122, 88, 0.22);
  background: rgba(255, 252, 246, 0.86);
  font-size: 10px;
  font-weight: 700;
  color: #5f4e35;
}

.member-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.lifecycle-meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lifecycle-table-wrap {
  overflow: auto;
  border: 1px solid rgba(146, 122, 88, 0.12);
  border-radius: 18px;
  background: rgba(255, 252, 246, 0.5);
}

.lifecycle-table-head,
.lifecycle-row {
  display: grid;
  grid-template-columns:
    minmax(220px, 1.35fr)
    minmax(180px, 1.05fr)
    minmax(140px, 0.9fr)
    minmax(110px, 0.75fr)
    minmax(200px, 1.15fr)
    minmax(180px, 1fr)
    96px
    minmax(156px, 1fr)
    minmax(156px, 1fr)
    100px
    108px;
  gap: 10px;
  align-items: center;
}

.mother-lifecycle-head,
.mother-lifecycle-row {
  grid-template-columns:
    minmax(220px, 1.6fr)
    minmax(120px, 0.8fr)
    minmax(180px, 1fr)
    minmax(180px, 1fr)
    minmax(180px, 1fr)
    minmax(120px, 0.8fr)
    108px;
}

.lifecycle-table-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(146, 122, 88, 0.14);
  background: rgba(244, 238, 230, 0.92);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lifecycle-table-body {
  display: flex;
  flex-direction: column;
}

.lifecycle-row {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(146, 122, 88, 0.1);
  background: rgba(255, 255, 255, 0.48);
}

.lifecycle-row:last-child {
  border-bottom: 0;
}

.lifecycle-cell {
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}

.lifecycle-time-cell {
  white-space: nowrap;
  word-break: normal;
}

.lifecycle-email {
  font-weight: 700;
  font-size: 13px;
}

.lifecycle-mother-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.lifecycle-mother-email {
  color: var(--muted);
  font-size: 11px;
}

.lifecycle-actions {
  display: flex;
  justify-content: flex-end;
}

.lifecycle-empty {
  margin: 12px;
}

.member-meta span {
  display: block;
  min-height: 60px;
  padding: 12px 12px 11px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(122, 104, 81, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  word-break: break-word;
}

.member-meta span strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  height: 24px;
  margin-bottom: 8px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(154, 128, 93, 0.12);
  background: linear-gradient(180deg, rgba(252, 249, 244, 0.96) 0%, rgba(246, 241, 233, 0.9) 100%);
  color: #6a5d50;
  font-size: 11px;
  font-weight: 700;
  line-height: 24px;
  letter-spacing: 0.03em;
  text-align: center;
  vertical-align: middle;
}

.member-meta-value {
  display: block;
  color: #171614;
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.member-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.member-batch-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.member-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.member-filter-bar .remote-filter select {
  min-width: 136px;
}

.member-batch-count {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(146, 122, 88, 0.18);
  background: rgba(255, 252, 246, 0.82);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.member-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.member-select input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.member-empty {
  padding: 28px 18px;
  border-radius: 18px;
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.45);
}

@media (max-width: 1080px) {
  .members-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "remote"
      "actions"
      "mothers"
      "children";
  }

  .members-shell .stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .members-shell .stats-row {
    grid-template-columns: 1fr 1fr;
  }

  .member-meta {
    grid-template-columns: 1fr;
  }

  .member-card {
    padding: 12px;
  }

  .lifecycle-card-grid {
    grid-template-columns: 1fr;
  }
}

.log-entry {
  padding: 5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text;
  -webkit-user-select: text;
}

.log-entry:last-child {
  border-bottom: 0;
}

@media (max-width: 1280px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .settings-matrix {
    grid-template-columns: 1fr;
  }

  .log-panel {
    position: static;
    min-height: auto;
  }

  .log {
    min-height: 320px;
    max-height: 52vh;
  }
}

@media (max-width: 900px) {
  .topbar,
  .field-grid,
  .inline-grid,
  .mother-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    flex: 1 1 calc(50% - 10px);
    min-width: 0;
  }

  .topbar {
    align-items: stretch;
  }

  .topbar-actions,
  .panel-header {
    justify-content: flex-start;
  }

  .members-shell .topbar {
    grid-template-columns: 1fr;
  }

  .members-shell .topbar-copy {
    align-self: stretch;
  }

  .members-shell .topbar-actions {
    justify-content: flex-start;
  }

  .members-shell .topbar-actions > .remote-filter {
    margin-right: 0;
  }

  .mother-session-item {
    grid-template-columns: 1fr;
  }

  .mother-session-badges-grid,
  .mother-session-detail-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 12px;
  }

  .topbar,
  .panel {
    padding: 14px;
    border-radius: 18px;
  }

  .topbar-actions,
  .panel-header {
    flex-direction: column;
    align-items: stretch;
  }

  .members-shell .topbar-actions > .remote-filter,
  .members-shell .topbar-actions > button {
    flex-basis: 100%;
    width: 100%;
  }

  .btn {
    width: 100%;
  }

  .stat-card {
    flex: 1 1 100%;
  }

  .mother-session-badges-grid,
  .mother-session-detail-grid {
    grid-template-columns: 1fr;
  }
}
