:root {
  --bg-top: #f3f7ff;
  --bg-bottom: #eef6f2;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --text: #1d2633;
  --muted: #5e6a7b;
  --border: #d9e3ef;
  --primary: #3a6196;
  --primary-hover: #2f507f;
  --danger: #b26a6e;
  --danger-hover: #9d5d61;
  --success-bg: #e6f8ea;
  --success-text: #166534;
  --error-bg: #fdeaea;
  --error-text: #991b1b;
  --shadow: 0 12px 28px rgba(22, 40, 73, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(165deg, var(--bg-top), var(--bg-bottom));
  padding: 1.5rem;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page-shell {
  max-width: 1120px;
  margin: 0 auto;
}

.container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.2px;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.page-title {
  margin: 0;
  font-size: 1.65rem;
}

.subtitle {
  color: var(--muted);
  margin: 0.35rem 0 0;
}

.muted {
  color: var(--muted);
}

.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  margin: 0 0 1rem;
}

.section-card h2,
.section-card h3 {
  margin-top: 0;
}

.hero-card {
  background: linear-gradient(145deg, #f9fbff, #f1f6ff);
}

.distribution-page {
  display: grid;
  gap: 0.62rem;
}

.distribution-page .section-card {
  padding: 1.02rem 1.08rem;
  margin: 0;
}

.distribution-page .hero-card {
  padding: 0.76rem 0.92rem;
}

.distribution-page .page-title {
  font-size: 1.4rem;
}

.distribution-page .status-badge {
  font-size: 0.74rem;
}

.distribution-page .section-card h2 {
  font-size: 1.15rem;
  margin-bottom: 0.55rem;
}

.distribution-page .alert {
  margin: 0;
}

.distribution-page .section-params {
  background: #fbfcff;
  border-color: #e5ebf5;
}

.distribution-page .section-params .meta-grid {
  gap: 0.42rem;
}

.distribution-page .section-params .meta-item {
  padding: 0.5rem 0.58rem;
  border-radius: 8px;
  border-color: #e8eef8;
  background: #f9fbff;
}

.distribution-page .section-params .meta-label {
  font-size: 0.75rem;
  margin-bottom: 0.12rem;
}

.distribution-page .section-params .meta-value {
  font-size: 0.93rem;
}

.distribution-page .section-slots {
  border-color: #d3ddea;
  box-shadow: 0 4px 14px rgba(29, 58, 107, 0.06);
}

.distribution-page .section-slots h2 {
  font-size: 1.22rem;
}

.distribution-page .section-selected {
  padding-top: 0.72rem;
  padding-bottom: 0.72rem;
  background: #fbfcff;
  border-color: #e6edf7;
}

.distribution-page .section-selected h2 {
  font-size: 1.02rem;
  color: #364a63;
  margin-bottom: 0.45rem;
}

.distribution-page .section-selected .empty-state {
  margin: 0;
  font-size: 0.88rem;
}

.distribution-page .timeslot-grid {
  gap: 0.48rem;
}

.distribution-page .timeslot-wrapper {
  gap: 0.24rem;
}

.distribution-page .timeslot-button {
  min-height: 50px;
  padding: 0.34rem 0.48rem;
  border-radius: 10px;
}

.distribution-page .timeslot-time {
  font-size: 0.88rem;
}

.distribution-page .section-selected .timeslot-grid-compact {
  grid-template-columns: repeat(auto-fill, minmax(122px, 1fr));
  gap: 0.38rem;
}

.distribution-page .section-selected .timeslot-button {
  min-height: 44px;
  padding: 0.3rem 0.42rem;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.65rem;
}

.meta-item {
  background: var(--surface-soft);
  border: 1px solid #e5edf8;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}

.meta-label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.meta-value {
  font-weight: 600;
}

.status-badge,
.role-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  border: 1px solid transparent;
}

.status-draft {
  background: #fff8e6;
  color: #8a5a00;
  border-color: #f5d48f;
}

.status-published {
  background: #e6f4ff;
  color: #0b4b94;
  border-color: #b7d8ff;
}

.role-organizer {
  background: #eef2ff;
  color: #363ea8;
  border-color: #c9d0ff;
}

.role-participant {
  background: #edfdf4;
  color: #146c43;
  border-color: #bfe9d0;
}

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.8rem;
}

.cards-grid {
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
}

.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 0.9rem;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.3rem;
}

.card-head h3,
.card-head h4 {
  margin: 0;
}

.card-meta {
  display: grid;
  gap: 0.3rem;
  margin: 0.55rem 0;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.invite-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.distribution-page .hero-card .card-head {
  margin-bottom: 0.14rem;
}

.distribution-page .hero-card .subtitle {
  margin: 0.16rem 0 0;
  font-size: 0.94rem;
}

.distribution-page .hero-invite-row {
  margin-top: 0.38rem;
  padding-top: 0.32rem;
  border-top: 1px dashed #dbe5f2;
  gap: 0.42rem;
}

.distribution-page .hero-invite-row .invite-link {
  font-size: 0.85rem;
}

.distribution-page .hero-invite-row .btn {
  padding: 0.34rem 0.56rem;
  font-size: 0.78rem;
}

.invite-link {
  word-break: break-all;
}

.copy-feedback {
  min-height: 1rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.copy-feedback.success {
  color: #166534;
}

.copy-feedback.error {
  color: #991b1b;
}

.admin-edit-tools.is-collapsed {
  display: none !important;
}

.form-card {
  display: grid;
  gap: 0.55rem;
}

label {
  font-weight: 600;
  font-size: 0.92rem;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.62rem 0.72rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background: #ffffff;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.checkbox-row input {
  width: auto;
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0.58rem 0.85rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #f3f7fe;
  color: #2f507f;
  border-color: #b9cae4;
}

.btn-secondary:hover {
  background: #e9f1fc;
  border-color: #a9bddf;
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
  border-color: #a66a6e;
}

.btn-danger:hover {
  background: var(--danger-hover);
  border-color: #94585c;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  background: #f7f9fc;
}

.btn-sm {
  padding: 0.45rem 0.7rem;
  font-size: 0.82rem;
}

.inline-form {
  display: inline;
  margin: 0;
}

.alert {
  border-radius: 10px;
  padding: 0.68rem 0.8rem;
  border: 1px solid transparent;
  margin: 0 0 1rem;
}

.alert-error {
  background: var(--error-bg);
  color: var(--error-text);
  border-color: #f4c6c6;
}

.alert-success {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: #c5e7d1;
}

.helper-text {
  margin: 0.9rem 0 0;
}

.simple-list {
  margin: 0;
  padding-left: 1.1rem;
}

.empty-state {
  color: var(--muted);
  margin: 0.2rem 0;
}

@media (max-width: 900px) {
  body {
    padding: 0.9rem;
  }

  .container {
    padding: 1rem;
    border-radius: 14px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .distribution-page {
    gap: 0.6rem;
  }

  .distribution-page .section-card {
    padding: 0.84rem 0.9rem;
  }

  .distribution-page .timeslot-grid {
    gap: 0.42rem;
  }

  .distribution-page .section-selected .timeslot-grid-compact {
    grid-template-columns: repeat(auto-fill, minmax(114px, 1fr));
  }
}

.compact-row p {
  margin: 0;
}

.breaks-block {
  border-top: 1px solid var(--border);
  padding-top: 0.9rem;
  margin-top: 0.35rem;
}

.breaks-list {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.break-row {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: minmax(140px, 1fr) minmax(140px, 1fr) auto;
  align-items: end;
}

.break-row-actions {
  display: flex;
  align-items: flex-end;
}

.timeslot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.65rem;
}

.timeslot-grid-compact {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.5rem;
}

.timeslot-wrapper {
  display: grid;
  gap: 0.35rem;
}

.timeslot-form {
  margin: 0;
}

.timeslot-button {
  --slot-bg: #eaf8ee;
  --slot-border: #82c794;
  --slot-fill: #2fb95f;
  --slot-text: #11502b;
  --fill-pct: 0%;
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--slot-border);
  border-radius: 12px;
  background: var(--slot-bg);
  color: var(--slot-text);
  padding: 0.45rem 0.58rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, background 0.15s ease;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.timeslot-button::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--fill-pct);
  background: var(--slot-fill);
  opacity: 0.36;
  z-index: 0;
}

.timeslot-button > * {
  position: relative;
  z-index: 1;
}

.timeslot-button:hover:not(:disabled),
.timeslot-button:focus-visible {
  outline: none;
}

.timeslot-button.state-free:hover:not(:disabled),
.timeslot-button.state-free:focus-visible {
  border-color: #2f8f4b;
  box-shadow: 0 8px 16px rgba(23, 72, 39, 0.15);
  transform: translateY(-1px);
}

.timeslot-button.state-mine:hover:not(:disabled),
.timeslot-button.state-mine:focus-visible {
  border-color: #d14b4b;
  box-shadow: 0 0 0 2px rgba(209, 75, 75, 0.26), 0 10px 20px rgba(24, 50, 112, 0.28);
  background: #c9dcff;
  transform: translateY(-1px);
}

.timeslot-button:disabled,
.timeslot-button.state-unavailable,
.timeslot-button.state-full,
.timeslot-button.state-disabled {
  cursor: not-allowed;
  opacity: 1;
}

.timeslot-button.state-unavailable:hover,
.timeslot-button.state-full:hover,
.timeslot-button.state-disabled:hover,
.timeslot-button.state-unavailable:focus-visible,
.timeslot-button.state-full:focus-visible,
.timeslot-button.state-disabled:focus-visible {
  border-color: var(--slot-border);
  box-shadow: none;
  transform: none;
}

.timeslot-time {
  font-weight: 700;
  font-size: 0.96rem;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.timeslot-state {
  font-size: 0.74rem;
  color: #7a6421;
}

.timeslot-secondary-label {
  position: absolute;
  top: 0.34rem;
  right: 0.4rem;
  font-size: 0.64rem;
  line-height: 1;
  padding: 0.14rem 0.36rem;
  border-radius: 999px;
  background: rgba(111, 79, 0, 0.14);
  color: #7a5a0a;
}

.state-free {
  --slot-bg: #eaf8ee;
  --slot-border: #82c794;
  --slot-fill: #2fb95f;
  --slot-text: #11502b;
}

.state-mine {
  --slot-bg: #d5e5ff;
  --slot-border: #2f66de;
  --slot-fill: #1e4eb8;
  --slot-text: #0d2f78;
}

.state-mine::before {
  opacity: 0.46;
}

.state-unavailable,
.state-full,
.state-disabled {
  --slot-bg: #f1f3f6;
  --slot-border: #c8ced8;
  --slot-fill: #adb6c3;
  --slot-text: #4f5866;
}

.state-unavailable::before,
.state-full::before,
.state-disabled::before {
  opacity: 0.2;
}
.timeslot-manage {
  display: flex;
  gap: 0.4rem;
}
.my-slot-card {
  min-height: 54px;
}

@media (max-width: 900px) {
  .break-row {
    grid-template-columns: 1fr;
  }

  .break-row-actions {
    align-items: flex-start;
  }

  .timeslot-grid {
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  }

  .timeslot-grid-compact {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  }
}


.state-break {
  --slot-bg: #fff4cc;
  --slot-border: #e2c267;
  --slot-fill: #f0cc61;
  --slot-text: #6f4f00;
  --fill-pct: 0%;
  cursor: default;
  pointer-events: none;
}

.state-break::before {
  width: 0;
}

.state-break .timeslot-time {
  padding-right: 3.8rem;
}

.state-break .timeslot-state {
  color: #8a650b;
}

.state-break:hover,
.state-break:focus-visible {
  border-color: var(--slot-border);
  box-shadow: none;
  transform: none;
}

/* Dashboard */
.dashboard-page {
  display: grid;
  gap: 0.85rem;
}

.dashboard-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.1rem 0;
}

.dashboard-top .page-title {
  font-size: 1.45rem;
  margin: 0;
}

.dashboard-top .subtitle {
  margin-top: 0.2rem;
}

.dashboard-tabs-wrap {
  padding: 0;
}

.dashboard-tabs {
  display: inline-flex;
  gap: 0.24rem;
  padding: 0.2rem;
  border-radius: 11px;
  border: 1px solid #d8e3f0;
  background: #f3f7fe;
}

.dashboard-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  padding: 0.45rem 0.78rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.dashboard-tab:hover {
  color: #2b3b51;
  background: rgba(255, 255, 255, 0.72);
}

.dashboard-tab.is-active {
  color: var(--primary);
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(58, 97, 150, 0.14);
}

.dashboard-tab:focus-visible {
  outline: 2px solid #9eb9dc;
  outline-offset: 1px;
}

.dashboard-panel {
  display: none;
}

.dashboard-panel.is-active {
  display: block;
}

.dashboard-cards {
  gap: 0.58rem;
  align-items: stretch;
}

.dashboard-card {
  display: grid;
  gap: 0.2rem;
  padding: 0.72rem 0.78rem;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.dashboard-card .card-head {
  margin-bottom: 0.12rem;
}

.dashboard-card .card-meta {
  margin: 0;
  gap: 0.1rem;
}

.dashboard-card .card-meta p {
  margin: 0;
  font-size: 0.88rem;
}

.dashboard-card .card-description {
  margin: 0.08rem 0 0;
  font-size: 0.9rem;
  line-height: 1.35;
  min-height: 3.6em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dashboard-card .card-description.empty-state {
  color: var(--muted);
}

.dashboard-card:hover {
  border-color: #bdd0e7;
  box-shadow: 0 8px 18px rgba(22, 52, 102, 0.1);
  transform: translateY(-1px);
}

.dashboard-card:focus-visible {
  outline: 2px solid #9eb9dc;
  outline-offset: 1px;
}

.card-quick-actions {
  margin-top: 0.38rem;
  position: relative;
  z-index: 1;
}

.dashboard-empty {
  margin: 0;
}

@media (max-width: 900px) {
  .dashboard-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-tabs {
    width: 100%;
  }

  .dashboard-tab {
    flex: 1;
    text-align: center;
  }

  .dashboard-card {
    padding: 0.68rem 0.72rem;
  }

  .dashboard-card .card-description {
    min-height: 3.45em;
  }
}

body.modal-open {
  overflow: hidden;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.confirm-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.confirm-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(20, 31, 50, 0.46);
}

.confirm-modal-dialog {
  position: relative;
  width: min(100%, 460px);
  background: #ffffff;
  border: 1px solid #dce5f0;
  border-radius: 17px;
  box-shadow: 0 24px 52px rgba(18, 30, 52, 0.25);
  padding: 1.1rem 1.2rem 1rem;
}

.confirm-modal-title {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.3;
}

.confirm-modal-text {
  margin: 0.55rem 0 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.95rem;
}

.confirm-modal-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.48rem;
}

.confirm-modal-actions .btn {
  min-width: 106px;
}

@media (max-width: 900px) {
  .confirm-modal {
    padding: 0.75rem;
  }

  .confirm-modal-dialog {
    width: 100%;
    max-width: 460px;
    padding: 1rem;
    border-radius: 15px;
  }

  .confirm-modal-actions {
    margin-top: 0.9rem;
  }
}



.page-header .btn-secondary {
  background: #ffffff;
  color: #2d425f;
  border-color: #cfdae9;
}

.page-header .btn-secondary:hover {
  background: #f7f9fc;
  border-color: #c2d0e4;
}

.participants-head {
  align-items: center;
}

.participants-manage-panel {
  margin: 0.4rem 0 0.7rem;
  padding: 0.75rem;
  border: 1px solid #d9e4f1;
  border-radius: 11px;
  background: #f8fbff;
}

.participants-draft-note {
  margin-bottom: 0.55rem;
}

.participants-tabs {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.2rem;
  border-radius: 10px;
  border: 1px solid #d4dfed;
  background: #eef4fc;
}

.participants-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  padding: 0.4rem 0.68rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.participants-tab:hover {
  color: #324c70;
  background: rgba(255, 255, 255, 0.75);
}

.participants-tab.is-active {
  color: #2f507f;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(41, 70, 111, 0.12);
}

.participants-tab-panel {
  margin-top: 0.65rem;
}

.participants-search-row {
  display: grid;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}

.participants-search-label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.participants-search-input {
  max-width: 380px;
}

.participants-contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.38rem;
  max-height: 245px;
  overflow: auto;
  padding-right: 0.2rem;
}

.participants-contact-row-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
}

.participants-group-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.participants-group-row {
  border: 1px solid #d9e5f2;
  border-radius: 10px;
  background: #ffffff;
  padding: 0.5rem 0.56rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.participants-group-info {
  display: grid;
  gap: 0.08rem;
}

.participants-group-name {
  font-weight: 600;
}

.participants-group-meta {
  font-size: 0.82rem;
  color: var(--muted);
}
.participants-contact-row {
  border: 1px solid #d9e5f2;
  border-radius: 10px;
  background: #ffffff;
  padding: 0.42rem 0.5rem;
}

.participants-contact-label {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  cursor: pointer;
  font-weight: 500;
}

.participants-contact-label input {
  margin-top: 0.16rem;
  width: auto;
  flex: 0 0 auto;
}

.participants-contact-info {
  display: grid;
  gap: 0.08rem;
}

.participants-contact-username {
  font-weight: 600;
}

.participants-contact-email {
  color: var(--muted);
  font-size: 0.83rem;
}

.participants-bulk-form .actions-row {
  margin-top: 0.5rem;
}

#participants-search-empty {
  margin-top: 0.45rem;
}

@media (max-width: 900px) {
  .participants-manage-panel {
    padding: 0.62rem;
  }

  .participants-contact-list {
    max-height: 220px;
  }

  .participants-group-row {
    flex-direction: column;
    align-items: flex-start;
  }
}




.profile-subtabs-wrap {
  padding: 0;
  border: 0;
  background: transparent;
}

.profile-contacts-subpanel {
  display: none;
}

.profile-contacts-subpanel.is-active {
  display: block;
}

.profile-group-create-form {
  margin-bottom: 0.75rem;
}

.profile-group-card .actions-row {
  margin-top: 0.45rem;
}
/* Compact user rows for participants and group editor */
.participants-contact-row,
.participants-group-row,
.group-user-row {
  border: 1px solid #d9e5f2;
  border-radius: 10px;
  background: #ffffff;
}

.participants-contact-row {
  padding: 0.38rem 0.48rem;
}

.participants-contact-label {
  display: flex;
  gap: 0.52rem;
  align-items: center;
  cursor: pointer;
  font-weight: 500;
}

.participants-contact-label input {
  margin: 0;
  width: auto;
  flex: 0 0 auto;
}

.participants-contact-info {
  display: grid;
  gap: 0.04rem;
}

.participants-contact-username,
.participants-group-name,
.group-user-name {
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.2;
}

.participants-contact-email,
.participants-group-meta,
.group-user-email {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.2;
}

.participants-group-row {
  padding: 0.44rem 0.52rem;
}

.participants-group-info {
  display: grid;
  gap: 0.05rem;
}

.participants-bulk-form .actions-row {
  margin-top: 0.42rem;
}

/* Group editor */
.group-editor-page {
  display: grid;
  gap: 0.72rem;
}

.group-editor-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.08rem 0;
}

.group-editor-top .page-title {
  font-size: 1.38rem;
  margin: 0;
}

.group-editor-top .subtitle {
  margin-top: 0.16rem;
}

.group-editor-card {
  padding: 0.86rem 0.94rem;
  margin: 0;
}

.group-editor-card h2 {
  margin: 0 0 0.46rem;
  font-size: 1.03rem;
}

.group-editor-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.36rem;
}

.group-editor-rename .group-editor-form {
  gap: 0.42rem;
}

.group-editor-search-row {
  margin-bottom: 0.42rem;
}

.group-user-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.38rem;
}

.group-user-row {
  padding: 0.38rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.56rem;
}

.group-user-info {
  min-width: 0;
  display: grid;
  gap: 0.04rem;
}

.group-user-name,
.group-user-email {
  overflow-wrap: anywhere;
}

.group-user-action-form {
  flex: 0 0 auto;
}

.group-user-action-form .btn {
  min-width: 88px;
}

.group-search-results {
  max-height: 300px;
  overflow: auto;
  padding-right: 0.2rem;
}

@media (max-width: 900px) {
  .group-editor-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .group-editor-card {
    padding: 0.78rem 0.82rem;
  }

  .group-user-row,
  .participants-group-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .group-user-action-form,
  .participants-group-row .inline-form {
    width: 100%;
  }

  .group-user-action-form .btn,
  .participants-group-row .btn {
    width: 100%;
  }
}
/* Profile UI refinement: compact contacts and clickable group cards */
.profile-user-cards {
  gap: 0.44rem;
}

.profile-user-card {
  padding: 0.56rem 0.64rem;
  border-radius: 10px;
}

.profile-user-card .card-head {
  margin-bottom: 0.08rem;
}

.profile-user-card .card-head h4 {
  font-size: 0.95rem;
  line-height: 1.2;
}

.profile-user-card .muted {
  margin: 0;
  font-size: 0.81rem;
  line-height: 1.2;
}

.profile-user-card .actions-row {
  margin-top: 0.34rem;
}

.profile-group-cards {
  gap: 0.5rem;
}

.profile-group-card {
  padding: 0.62rem 0.72rem;
  border-radius: 11px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.profile-group-card:hover {
  border-color: #bfd2ea;
  box-shadow: 0 8px 16px rgba(27, 54, 102, 0.09);
  transform: translateY(-1px);
}

.profile-group-card:focus-visible {
  outline: 2px solid #9eb9dc;
  outline-offset: 1px;
}

.profile-group-card .card-head {
  margin-bottom: 0.18rem;
}

.profile-group-card .card-head h4 {
  font-size: 0.97rem;
  line-height: 1.2;
}

.profile-group-card .status-badge {
  font-size: 0.72rem;
}

.profile-group-card .card-quick-actions {
  margin-top: 0.3rem;
}

.profile-group-card .card-action-form {
  position: relative;
  z-index: 2;
}

/* Group editor hierarchy and compactness */
.group-editor-primary {
  border-color: #d8e4f2;
  box-shadow: 0 2px 8px rgba(29, 58, 107, 0.05);
}

.group-editor-secondary {
  background: #fafcff;
  border-color: #e5edf7;
  box-shadow: none;
}

.group-editor-secondary h2 {
  margin-bottom: 0.3rem;
  font-size: 0.95rem;
  color: #56657a;
}

.group-editor-rename-form {
  gap: 0.3rem;
}

.group-editor-rename-form input {
  max-width: 420px;
}

.group-editor-rename-actions {
  margin-top: 0.12rem;
}

.group-editor-rename-actions .btn {
  padding: 0.4rem 0.66rem;
}

.group-user-list {
  gap: 0.32rem;
}

.group-user-row {
  padding: 0.34rem 0.46rem;
  border-radius: 9px;
}

.group-user-action-form .btn {
  min-width: 86px;
  padding: 0.38rem 0.64rem;
  font-size: 0.79rem;
}

.group-editor-search-row {
  margin-bottom: 0.34rem;
}

@media (max-width: 900px) {
  .profile-user-card,
  .profile-group-card {
    padding: 0.54rem 0.6rem;
  }

  .group-editor-secondary h2 {
    font-size: 0.92rem;
  }
}
/* One-time success and compact profile cards */
.flash-once-message {
  animation: none;
}

.profile-user-cards {
  gap: 0.38rem;
}

.profile-user-card {
  padding: 0.48rem 0.58rem;
  border-radius: 10px;
}

.profile-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.58rem;
}

.profile-user-main {
  min-width: 0;
  display: grid;
  gap: 0.02rem;
}

.profile-user-name {
  margin: 0;
  font-size: 0.93rem;
  line-height: 1.2;
  font-weight: 600;
}

.profile-user-email {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.2;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.profile-user-action {
  margin: 0;
  flex: 0 0 auto;
}

.profile-user-action .btn {
  min-width: 82px;
}

/* Group editor: rename block is secondary and compact */
.group-editor-secondary {
  background: #fbfdff;
  border-color: #e5edf8;
  box-shadow: none;
  padding: 0.68rem 0.78rem;
}

.group-editor-secondary h2 {
  margin-bottom: 0.24rem;
  font-size: 0.92rem;
  color: #5a6a80;
}

.group-editor-rename-form {
  display: grid;
  grid-template-columns: minmax(220px, 420px) auto;
  align-items: center;
  gap: 0.4rem 0.46rem;
  margin: 0;
}

.group-editor-rename-form input {
  max-width: 100%;
}

.group-editor-rename-actions {
  margin: 0 !important;
}

.group-editor-rename-actions .btn {
  padding: 0.38rem 0.64rem;
  font-size: 0.8rem;
}

/* Keep group and search rows compact and consistent */
.group-user-list {
  gap: 0.3rem;
}

.group-user-row {
  padding: 0.32rem 0.44rem;
  border-radius: 9px;
}

.group-user-info {
  gap: 0.02rem;
}

.group-user-name {
  font-size: 0.92rem;
}

.group-user-email {
  font-size: 0.8rem;
}

.group-user-action-form {
  margin: 0;
}

.group-user-action-form .btn {
  min-width: 82px;
  padding: 0.36rem 0.62rem;
  font-size: 0.79rem;
}

@media (max-width: 900px) {
  .profile-user-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-user-action {
    width: 100%;
  }

  .profile-user-action .btn {
    width: 100%;
  }

  .group-editor-rename-form {
    grid-template-columns: 1fr;
  }

  .group-editor-rename-actions {
    width: 100%;
  }

  .group-editor-rename-actions .btn {
    width: 100%;
  }
}
/* Group statuses in distribution participants panel */
.participants-group-meta-muted {
  color: var(--muted);
}

.participants-group-meta-success {
  color: #2f7a4b;
}
/* Compact participants rows in distribution detail */
.participants-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.34rem;
}

.participants-item {
  border: 1px solid #d9e5f2;
  border-radius: 10px;
  background: #ffffff;
  padding: 0.4rem 0.52rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.68rem;
}

.participants-item-name {
  font-weight: 600;
  font-size: 0.93rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.participants-item-main {
  min-width: 0;
  display: grid;
  gap: 0.22rem;
}

.participants-item-selections {
  display: flex;
  flex-wrap: wrap;
  gap: 0.24rem;
}

.participants-item-selection {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.38rem;
  border-radius: 999px;
  border: 1px solid #dbe6f3;
  background: #f6f9fd;
  color: #4e6279;
  font-size: 0.74rem;
  line-height: 1.18;
  max-width: 100%;
}

.participants-item-actions {
  display: flex;
  align-items: center;
  gap: 0.34rem;
  flex: 0 0 auto;
}

.participants-item-remove-form {
  margin: 0;
}

.participants-item-remove-form .btn {
  padding: 0.34rem 0.62rem;
  font-size: 0.78rem;
}

@media (max-width: 900px) {
  .participants-item {
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 0.42rem 0.5rem;
  }

  .participants-item-actions {
    width: 100%;
    justify-content: flex-start;
  }
}
/* Variants list editor */
.section-variants {
  border-color: #d9e4f2;
}

.variants-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
}

.variants-editor-form {
  display: grid;
  gap: 0.55rem;
}

.variants-editor-list {
  display: grid;
  gap: 0.36rem;
}

.variant-editor-entry {
  display: grid;
  gap: 0.28rem;
}

.variant-editor-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto auto;
  gap: 0.35rem;
  align-items: center;
}

.variant-editor-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f1f5fb;
  border: 1px solid #d7e2f0;
  font-size: 0.82rem;
  font-weight: 700;
  color: #496384;
}

.variant-editor-title-input {
  min-width: 0;
}

.variant-editor-description {
  padding-left: 2rem;
}

.variant-editor-description textarea {
  min-height: 66px;
}

.variant-editor-description.is-hidden {
  display: none;
}

.variants-inline-error {
  margin: 0;
}

.variants-import-feedback {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.35;
}

.variants-import-feedback.is-error {
  color: var(--error-text);
}

.variants-import-feedback.is-success {
  color: #166534;
}

.variants-editor-actions {
  margin-top: 0.12rem;
}

.variant-choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.46rem;
}

.variant-choice-wrapper {
  display: grid;
}

.variant-choice-form {
  margin: 0;
}

.variant-choice-button {
  min-height: 60px;
  padding: 0.44rem 0.58rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  gap: 0.2rem;
}

.variant-choice-button.variant-card--title-only {
  min-height: 52px;
  padding-top: 0.36rem;
  padding-bottom: 0.36rem;
  justify-content: center;
  gap: 0;
}

.variant-choice-button.variant-card--title-only .variant-choice-title {
  margin: 0;
}

.variant-choice-title {
  display: block;
  width: 100%;
  font-weight: 700;
  font-size: 0.91rem;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
}

.variant-choice-description {
  display: block;
  width: 100%;
  font-size: 0.8rem;
  line-height: 1.28;
  opacity: 0.92;
  white-space: normal;
  overflow-wrap: anywhere;
}

.variant-choice-button.state-unavailable .variant-choice-description,
.variant-choice-button.state-full .variant-choice-description,
.variant-choice-button.state-disabled .variant-choice-description {
  opacity: 0.78;
}

@media (max-width: 900px) {
  .variant-editor-row {
    grid-template-columns: 26px minmax(0, 1fr);
  }

  .variant-editor-row .variant-editor-description-toggle,
  .variant-editor-row .variant-editor-remove {
    grid-column: 2;
    justify-self: start;
  }

  .variant-editor-description {
    padding-left: 0;
  }

  .variant-choice-grid {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
}







/* Start page */
.start-page {
  display: grid;
  gap: 0.78rem;
}

.start-page .section-card {
  margin: 0;
  padding: 0.98rem 1.06rem;
}

.start-hero {
  padding: 1.08rem 1.14rem;
}

.start-hero .page-title {
  font-size: 1.84rem;
  line-height: 1.2;
  max-width: 820px;
}

.start-hero .subtitle {
  max-width: 760px;
  margin-top: 0.42rem;
  font-size: 0.97rem;
}

.start-hero-actions {
  margin-top: 0.72rem;
}

.start-modes h2,
.start-features h2,
.start-steps h2 {
  font-size: 1.14rem;
  margin-bottom: 0.56rem;
}

.start-modes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 0.62rem;
}

.start-mode-card {
  border: 1px solid #dbe6f3;
  border-radius: 10px;
  background: #f9fbff;
  padding: 0.72rem 0.78rem;
}

.start-mode-card h3 {
  margin: 0 0 0.3rem;
  font-size: 1rem;
}

.start-mode-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.start-feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 0.38rem 0.7rem;
}

.start-feature-list li {
  padding: 0.44rem 0.56rem;
  border: 1px solid #e1e9f5;
  border-radius: 9px;
  background: #fbfdff;
  font-size: 0.9rem;
}

.start-step-list {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.26rem;
}

.start-step-list li {
  padding-left: 0.08rem;
  color: #2b3a4f;
  font-size: 0.92rem;
}

@media (max-width: 900px) {
  .start-page {
    gap: 0.66rem;
  }

  .start-page .section-card {
    padding: 0.86rem 0.92rem;
  }

  .start-hero .page-title {
    font-size: 1.42rem;
  }

  .start-modes-grid,
  .start-feature-list {
    grid-template-columns: 1fr;
  }
}
