/* МАЯК · profiles gallery + full editor */

/* ─────────────────────────────────────────
   SCREEN
   ───────────────────────────────────────── */
.profiles-screen {
  grid-column: 1 / -1;
  display: flex; flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  background: var(--bg);
}
.profile-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  gap: 14px;
  padding: 18px 22px;
  overflow-y: auto;
  min-height: 0;
}

/* gallery card */
.profile-card {
  --card-accent: var(--accent);
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 16px;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
  display: flex; flex-direction: column; gap: 12px;
  overflow: hidden;
}
.profile-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--card-accent);
}
.profile-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.profile-card-head {
  display: flex; align-items: flex-start; gap: 10px;
}
.profile-card-tag {
  width: 8px; height: 8px;
  border-radius: 999px;
  margin-top: 6px;
  flex-shrink: 0;
  display: none; /* using left border instead */
}
.profile-card-title { flex: 1; min-width: 0; }
.profile-card-title h3 {
  margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.005em;
  color: var(--fg);
}
.profile-card-desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}

.profile-card-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}
.profile-card-stats > div { display: flex; flex-direction: column; gap: 1px; }
.profile-card-stat {
  font-size: 16px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--fg);
}
.profile-card-foot {
  display: flex; align-items: center; justify-content: space-between;
}
.profile-card-chips { display: flex; flex-wrap: wrap; gap: 4px; }

/* ─────────────────────────────────────────
   FULL EDITOR
   ───────────────────────────────────────── */
.profile-editor-full {
  width: min(1080px, 100%);
  max-height: calc(100vh - 48px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-4);
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  overflow: hidden;
  color: var(--fg);
}

.pef-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 18px 22px 12px;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.pef-head-text { flex: 1; min-width: 0; }
.pef-title-input {
  font-size: 22px; font-weight: 600;
  letter-spacing: -0.01em;
  background: transparent;
  border: 0;
  padding: 2px 0;
  width: 100%;
  color: var(--fg);
  margin: 4px 0;
}
.pef-title-input:focus {
  outline: none;
  box-shadow: inset 0 -2px 0 var(--accent);
}
.pef-head-actions { display: flex; gap: 6px; }
.dirty-dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--warn);
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: middle;
}

.pef-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  padding: 0 14px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--bg-sub);
}
.pef-tabs::-webkit-scrollbar { display: none; }
.pef-tab {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 14px;
  background: transparent; border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.pef-tab:hover { color: var(--fg); }
.pef-tab.active { color: var(--fg); border-bottom-color: var(--accent); }

.pef-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  min-height: 0;
  overflow: hidden;
}
.pef-tab-body {
  padding: 18px 22px;
  overflow-y: auto;
}

/* ─────────────────────────────────────────
   PROFILE ROWS (the switch + label cards)
   ───────────────────────────────────────── */
.pe-grid-1 { display: flex; flex-direction: column; gap: 8px; }

.p-row {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.p-row.on { border-color: var(--accent-line); background: var(--accent-bg); }
.p-row-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.p-row-head {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}
.p-row-label { font-weight: 500; font-size: 13.5px; }
.p-row-hint { font-size: 11px; color: var(--muted); }
.p-row-detail {
  margin-top: 4px;
  padding: 8px 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-1);
}

/* switch is already styled in layout.css */

/* ─────────────────────────────────────────
   CONTROLS
   ───────────────────────────────────────── */
.p-inline {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}
.p-stack { display: flex; flex-direction: column; gap: 8px; }
.p-block { display: flex; flex-direction: column; gap: 8px; }

.p-stepper {
  display: inline-flex; align-items: center; gap: 4px;
  height: 28px;
  padding: 0 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-1);
}
.p-stepper input {
  height: 22px;
  border: 0;
  padding: 0 4px;
  text-align: center;
  background: transparent;
  font-size: 13px;
}
.p-stepper input:focus { box-shadow: none; outline: none; }
.p-stepper-btn {
  width: 22px; height: 22px;
  background: var(--bg-sub);
  border: 0;
  border-radius: 3px;
  color: var(--fg);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}
.p-stepper-btn:hover { background: var(--line); }
.p-stepper-unit {
  font-size: 11px;
  padding: 0 2px 0 4px;
}

.p-slider {
  display: flex; align-items: center; gap: 10px;
}
.p-slider input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
  height: 4px;
}
.p-slider-val { font-size: 13px; font-weight: 600; }

.p-weekdays {
  display: flex; gap: 4px;
}
.p-weekday {
  width: 36px; height: 30px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 500;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.p-weekday:hover { color: var(--fg); }
.p-weekday.on {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

.check-row {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
  font-size: 13px;
}
.check-row input { accent-color: var(--accent); cursor: pointer; }

/* ─────────────────────────────────────────
   CALLOUTS (light cards inside the tab)
   ───────────────────────────────────────── */
.pe-callouts { display: flex; flex-direction: column; gap: 10px; }
.p-callout {
  background: var(--bg-sub);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.p-callout > .eyebrow { margin-bottom: 2px; }
.p-callout-inner {
  background: var(--paper);
  padding: 10px 12px;
}
.p-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 14px; }
.p-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 14px; }
.p-hint-inline {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 10px;
  background: var(--accent-bg);
  border-radius: var(--r-2);
  font-size: 12px;
}
.p-hint-inline svg { color: var(--accent); flex-shrink: 0; margin-top: 1px; }

/* ─────────────────────────────────────────
   SUMMARY rail (right)
   ───────────────────────────────────────── */
.pe-summary {
  border-left: 1px solid var(--line);
  background: var(--bg-sub);
  padding: 16px;
  display: flex; flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}
.pe-summary-head { padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.pe-summary-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.pe-summary-val {
  font-size: 22px; font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
}
.pe-summary-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.pe-bar {
  height: 4px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.pe-bar-fill {
  display: block; height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width var(--t-med);
}
.pe-bar-fill.ok { background: var(--ok); }
.pe-bar-fill.warn { background: var(--warn); }
.pe-bar-fill.danger { background: var(--danger); }

/* ─────────────────────────────────────────
   FOOT
   ───────────────────────────────────────── */
.pef-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 22px;
  border-top: 1px solid var(--line);
  background: var(--bg-sub);
}

/* responsive */
@media (max-width: 960px) {
  .profile-editor-full { width: min(720px, 100%); }
  .pef-body { grid-template-columns: 1fr; }
  .pe-summary { border-left: 0; border-top: 1px solid var(--line); max-height: 260px; }
  .p-grid-3 { grid-template-columns: repeat(2, 1fr); }
}
