/* ─── Circle Page Layout ─────────────────────────────────────────────────── */
.circle-page {
  max-width: 600px;
  margin: 0 auto;
}

/* ─── Back button ────────────────────────────────────────────────────────── */
.circle-back-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--kith-surface);
  border: 1px solid var(--kith-border);
  color: var(--kith-text);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: border-color 0.2s;
}

.circle-back-btn:hover {
  border-color: var(--kith-text-muted);
}

/* ─── Sticky circle header bar ───────────────────────────────────────────── */
.circle-sticky-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--kith-bg);
  border-bottom: 1px solid var(--kith-border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: 56px;
}

.circle-header-center {
  flex: 1;
  text-align: center;
  min-width: 0;
}

.circle-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--kith-text);
}

.circle-subtitle {
  font-size: var(--text-xs);
  color: var(--kith-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.circle-description-bar {
  font-size: 0.8rem;
  color: var(--kith-text-muted);
  padding: 10px 20px 0;
  text-align: center;
  line-height: 1.4;
}

/* ─── Circle visualization ───────────────────────────────────────────────── */
.circle-viz-wrap {
  width: 280px;
  height: 280px;
  margin: 20px auto;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

/* ─── SVG text styles ────────────────────────────────────────────────────── */
.wedge-label {
  font-size: 12px;
  font-weight: 600;
  fill: #ffffff;
  text-anchor: middle;
  dominant-baseline: middle;
  font-family: 'Helvetica Neue', sans-serif;
}

.wedge-sublabel {
  font-size: 10px;
  fill: rgba(255,255,255,0.65);
  text-anchor: middle;
  dominant-baseline: middle;
  font-family: 'Helvetica Neue', sans-serif;
}

.circle-center-text {
  font-size: 13px;
  fill: rgba(255,255,255,0.55);
  text-anchor: middle;
  dominant-baseline: middle;
  font-family: 'Helvetica Neue', sans-serif;
}

.bubble-initials {
  font-size: 11px;
  font-weight: 600;
  fill: var(--kith-text);
  text-anchor: middle;
  dominant-baseline: middle;
  font-family: 'Helvetica Neue', sans-serif;
}

/* ─── Add sub-circle row ─────────────────────────────────────────────────── */
.circle-actions {
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
}

.subtle-btn {
  background: transparent;
  border: 1px solid var(--kith-border);
  color: var(--kith-text-dim);
  border-radius: var(--radius-lg);
  padding: 6px 16px;
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.15s;
}

.subtle-btn:hover {
  border-color: var(--kith-text-muted);
  color: var(--kith-text-muted);
}

/* ─── Circle members section ─────────────────────────────────────────────── */
.circle-members-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 8px;
}

.circle-member-count {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--kith-text-dim);
}

.circle-members-list {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 20px;
}

/* ─── Circles list page (top-level view) ─────────────────────────────────── */
.circles-list-page {
  max-width: 600px;
  margin: 0 auto;
}

.circles-list {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.circle-list-card {
  background: var(--kith-surface);
  border: 1px solid var(--kith-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.circle-list-card:hover {
  border-color: var(--kith-text-muted);
}

.circle-list-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.circle-list-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--kith-text);
  flex: 1;
}

.circle-list-meta {
  font-size: var(--text-sm);
  color: var(--kith-text-muted);
}

.circles-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 8px;
}

/* ─── Circle list card (with disc + description) ─────────────────────────── */
.circle-list-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

.circle-list-disc {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.circle-list-info {
  flex: 1;
  min-width: 0;
}

.circle-list-desc {
  font-size: 0.75rem;
  color: var(--kith-text-dim);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Circle header with edit button ────────────────────────────────────── */
.circle-header {
  position: relative;
  padding: 20px 20px 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.circle-header-center {
  flex: 1;
  text-align: center;
}

.circle-description {
  font-size: 0.8rem;
  color: var(--kith-text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.circle-edit-btn {
  background: transparent;
  border: 1px solid var(--kith-border);
  color: var(--kith-text-dim);
  border-radius: var(--radius-lg);
  padding: 5px 12px;
  font-size: 0.75rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}

.circle-edit-btn:hover {
  border-color: var(--kith-green);
  color: var(--kith-green);
}

/* ─── Modal ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0 80px;
}

.modal-box {
  background: var(--kith-surface);
  border: 1px solid var(--kith-border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 20px;
  width: 100%;
  max-width: 600px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--kith-text);
}

.modal-close {
  background: none;
  border: none;
  color: var(--kith-text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
}

.modal-field {
  margin-bottom: 14px;
}

.modal-field-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.modal-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--kith-text-dim);
  margin-bottom: 6px;
}

.modal-input {
  width: 100%;
  background: var(--kith-surface-2);
  border: 1px solid var(--kith-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--kith-text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.modal-input:focus { border-color: var(--kith-green); }
.modal-textarea { resize: none; }

.color-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 0;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
}

.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { border-color: #fff; transform: scale(1.1); }

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-cancel {
  flex: 1;
  background: transparent;
  border: 1px solid var(--kith-border);
  color: var(--kith-text-muted);
  border-radius: var(--radius-lg);
  padding: 12px;
  font-size: 0.9rem;
  cursor: pointer;
}

.modal-save {
  flex: 2;
  background: var(--kith-green);
  border: none;
  color: #000;
  border-radius: var(--radius-lg);
  padding: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.modal-save:hover { opacity: 0.9; }

.modal-delete-row {
  margin-top: 16px;
  display: flex;
  justify-content: center;
}

.modal-delete-btn {
  background: transparent;
  border: none;
  color: var(--kith-red);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px 8px;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.modal-delete-btn:hover { opacity: 1; }

.modal-warning-text {
  font-size: 0.9rem;
  color: var(--kith-text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.modal-warning-text strong { color: var(--kith-text); }

.modal-delete-confirm {
  flex: 2;
  background: var(--kith-red);
  border: none;
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.modal-delete-confirm:hover { opacity: 0.9; }
