/* Circlo Iteration 7 - Circles.
   ASCII-only source to avoid encoding regressions. */

.i7-circles-view {
  width: min(1040px, calc(100% - 24px));
  margin: 18px auto 44px;
}

.i7-circles-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.i7-circles-head h2 {
  margin: 0 0 5px;
}

.i7-circles-head p {
  margin: 0;
  color: var(--muted, #64748b);
  line-height: 1.45;
}

.i7-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.i7-circle-list,
.i7-circle-detail {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 16px;
  background: var(--surface, #fff);
  overflow: hidden;
}

.i7-circle-list-head,
.i7-circle-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 15px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.i7-circle-list-head strong,
.i7-circle-detail-head h3 {
  margin: 0;
}

.i7-circle-buttons {
  display: grid;
  gap: 3px;
  padding: 7px;
}

.i7-circle-button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 11px;
  padding: 9px 10px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.i7-circle-button:hover,
.i7-circle-button.active {
  background: var(--surface-2, #f1f5f9);
}

.i7-circle-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand-soft, #dbeafe);
  color: var(--brand, #1d4ed8);
}

.i7-circle-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.i7-circle-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.i7-circle-kind {
  display: block;
  margin-top: 2px;
  color: var(--muted, #64748b);
  font-size: .75rem;
}

.i7-circle-count {
  min-width: 28px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-3, #e2e8f0);
  color: var(--muted, #475569);
  text-align: center;
  font-size: .78rem;
  font-weight: 700;
}

.i7-circle-detail-head {
  align-items: flex-start;
}

.i7-circle-detail-title {
  min-width: 0;
}

.i7-circle-detail-title h3 {
  overflow-wrap: anywhere;
}

.i7-circle-detail-title p {
  margin: 4px 0 0;
  color: var(--muted, #64748b);
  font-size: .84rem;
  line-height: 1.4;
}

.i7-circle-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.i7-member-list {
  display: grid;
  gap: 2px;
  padding: 8px;
}

.i7-member-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  min-width: 0;
  padding: 9px;
  border-radius: 12px;
}

.i7-member-row:hover {
  background: var(--surface-2, #f8fafc);
}

.i7-member-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #dbeafe;
  border: 1px solid var(--border, #dbe3ef);
}

.i7-member-avatar.i7-avatar-fallback {
  display: grid;
  place-items: center;
  color: #1d4ed8;
  font-weight: 800;
}

.i7-member-main {
  min-width: 0;
  cursor: pointer;
}

.i7-member-main strong,
.i7-member-main span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.i7-member-main span {
  margin-top: 2px;
  color: var(--muted, #64748b);
  font-size: .82rem;
}

.i7-empty,
.i7-loading {
  padding: 34px 18px;
  text-align: center;
  color: var(--muted, #64748b);
  line-height: 1.5;
}

.i7-circle-footnote {
  padding: 10px 14px 14px;
  color: var(--muted, #64748b);
  font-size: .78rem;
  line-height: 1.4;
}

.i7-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100900;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15,23,42,.68);
  backdrop-filter: blur(8px);
}

.i7-backdrop.hidden {
  display: none !important;
}

.i7-modal {
  width: min(660px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 18px;
  background: var(--surface, #fff);
  color: var(--text, #0f172a);
  box-shadow: 0 28px 80px rgba(0,0,0,.28);
}

body.dark .i7-modal {
  background: #111827;
  color: #e5e7eb;
}

.i7-modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 17px 18px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  background: inherit;
}

.i7-modal-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.i7-modal-body {
  padding: 16px 18px 18px;
}

.i7-form {
  display: grid;
  gap: 14px;
}

.i7-form label {
  display: grid;
  gap: 6px;
  font-weight: 650;
}

.i7-form input,
.i7-form textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface, #fff);
  color: inherit;
  font: inherit;
}

body.dark .i7-form input,
body.dark .i7-form textarea {
  background: #0f172a;
}

.i7-form textarea {
  min-height: 88px;
  resize: vertical;
}

.i7-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 4px;
}

.i7-error,
.i7-success {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: .88rem;
}

.i7-error {
  background: #fee2e2;
  color: #991b1b;
}

.i7-success {
  background: #dcfce7;
  color: #166534;
}

.i7-error.hidden,
.i7-success.hidden {
  display: none !important;
}

.i7-assign-list {
  display: grid;
  gap: 5px;
}

.i7-assign-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px;
  border-radius: 12px;
}

.i7-assign-row:hover {
  background: var(--surface-2, #f8fafc);
}

.i7-assign-row .i7-member-avatar {
  width: 46px;
  height: 46px;
}

.i7-assign-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
}

.i7-assign-note {
  margin: 0 0 12px;
  color: var(--muted, #64748b);
  font-size: .84rem;
  line-height: 1.45;
}

.i7-profile-circle-button {
  white-space: nowrap;
}

.i7-private-note {
  margin-top: 10px;
  color: var(--muted, #64748b);
  font-size: .78rem;
}

@media (max-width: 780px) {
  .i7-circles-view {
    width: calc(100% - 14px);
    margin-top: 10px;
  }

  .i7-layout {
    grid-template-columns: 1fr;
  }

  .i7-circle-list {
    max-height: 330px;
    overflow: auto;
  }

  .i7-circle-detail-head {
    flex-direction: column;
  }

  .i7-circle-detail-actions {
    width: 100%;
  }

  .i7-circle-detail-actions button {
    flex: 1;
  }

  .i7-backdrop {
    padding: 0;
    align-items: end;
  }

  .i7-modal {
    width: 100%;
    max-height: 94vh;
    border-radius: 18px 18px 0 0;
  }
}
