/* ================================================================
   FriendsByChance — components/privacy-editor.css
   FBC.ui.PrivacyEditor (.pe namespace): the table of who may do what
   with one thing — what it comes to (first), its rows, the row that adds
   one, what makes no sense, what it inherits (folded) — and the presets'
   sheets.
   ================================================================ */

.pe {
    display:        flex;
    flex-direction: column;
    gap:            14px;
}

/* ── The table ──────────────────────────────────────────────────────── */

.pe-table {
    width:           100%;
    border-collapse: collapse;
    table-layout:    auto;
}
.pe-th {
    padding:        6px 6px;
    font-size:      0.72rem;
    font-weight:    700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color:          var(--color-text-muted);
    text-align:     left;
    border-bottom:  1px solid var(--color-divider);
}
.pe-th-cell    { width: 76px; text-align: center; }
.pe-th-actions { width: 44px; }

.pe-row > td {
    padding:        8px 6px;
    vertical-align: top;
    border-bottom:  1px solid var(--color-divider);
}
.pe-who        { min-width: 0; }
.pe-who-label  { font-weight: 600; font-size: 0.92rem; line-height: 30px; }
.pe-members    { margin-top: 4px; }
/* What this row says that may not be what was meant ("off while …"). */
.pe-row-note {
    margin-top: 4px;
    font-size:  0.8rem;
    color:      var(--color-text-secondary);
}
.pe-cell       { text-align: center; }
.pe-cell-box   { width: 20px; height: 20px; margin-top: 5px; cursor: pointer; }
.pe-actions    { text-align: right; }

/* A row off: kept, saying nothing. */
.pe-row--off .pe-who-label,
.pe-row--off .pe-members { opacity: 0.45; }

/* The last row: one button per kind of row. */
.pe-add > td { padding: 10px 6px 4px; }
.pe-add-label {
    margin-bottom: 6px;
    font-size:     0.78rem;
    color:         var(--color-text-secondary);
}
.pe-add-btns {
    display:   flex;
    flex-wrap: wrap;
    gap:       6px;
}

/* ── What it comes to (under the title), and what makes no sense ─────── */

.pe-note {
    margin:    0;
    font-size: 0.82rem;
    color:     var(--color-text-secondary);
}
.pe-result {
    display:        flex;
    flex-direction: column;
    gap:            6px;
    padding:        10px 12px;
    border-radius:  8px;
    background:     var(--color-hover);
    transition:     opacity var(--transition);
}
.pe-result--asking { opacity: 0.6; }
.pe-result-line    { margin: 0; font-weight: 600; font-size: 0.92rem; }
.pe-result-note    { margin: 0; font-size: 0.82rem; color: var(--color-text-secondary); }
.pe-result-warning {
    display:     flex;
    align-items: flex-start;
    gap:         6px;
    margin:      0;
    font-size:   0.82rem;
    color:       var(--color-danger);
}
.pe-result-warning-icon { flex: 0 0 auto; line-height: 0; margin-top: 2px; }
.pe-error {
    margin:    0;
    font-size: 0.85rem;
    color:     var(--color-danger);
}
.pe-sense { display: flex; flex-direction: column; gap: 4px; }
.pe-sense-note {
    margin:    0;
    font-size: 0.82rem;
    color:     var(--color-text-secondary);
}

/* ── What it inherits, folded ───────────────────────────────────────── */

.pe-inherited { border-top: 1px solid var(--color-divider); padding-top: 10px; }
.pe-inherited-head {
    display:     flex;
    align-items: center;
    gap:         6px;
    min-height:  36px;
    padding:     0 6px;
    border:      none;
    border-radius: 8px;
    background:  none;
    font:        inherit;
    font-size:   0.85rem;
    font-weight: 600;
    color:       var(--color-text-secondary);
    cursor:      pointer;
}
.pe-inherited-head:hover { background: var(--color-hover); }
.pe-inherited-chevron { line-height: 0; transform: rotate(-90deg); transition: transform var(--transition); }
.pe-inherited--open .pe-inherited-chevron { transform: none; }
.pe-inherited-list {
    display:        flex;
    flex-direction: column;
    gap:            8px;
    margin:         8px 0 0;
    padding:        0;
    list-style:     none;
}
.pe-inherited-item {
    margin-left:   calc(var(--depth, 0) * 14px);
    padding:       6px 10px;
    border-left:   2px solid var(--color-divider);
}
.pe-inherited-item--own { border-left-color: var(--color-primary); }
.pe-inherited-title { font-weight: 600; font-size: 0.86rem; }
.pe-inherited-line  { font-size: 0.8rem; color: var(--color-text-secondary); }

/* ── Presets: the menu's one in use, the name asked, all of them ─────── */

.pe-preset-menu-item--used:disabled { opacity: 1; font-weight: 700; }
.pe-preset-menu-item--used svg { color: var(--color-text); }

.pe-preset-ask { display: flex; flex-direction: column; gap: 8px; }
.pe-preset-ask .form-hint { margin: 0; }
.pe-preset-error { margin: 0; font-size: 0.82rem; color: var(--color-danger); }
.pe-preset-error:empty { display: none; }

.pe-presets { display: flex; flex-direction: column; gap: 14px; }
.pe-presets-intro { margin: 0; }
.pe-presets-tools { display: flex; align-items: center; gap: 8px; }
.pe-presets-search { flex: 1 1 auto; min-width: 0; }
.pe-preset-list {
    display:        flex;
    flex-direction: column;
    gap:            6px;
    margin:         0;
    padding:        0;
    list-style:     none;
}
.pe-preset-item {
    border:        1px solid var(--color-divider);
    border-radius: 10px;
}
.pe-preset-item-row {
    display:     flex;
    align-items: center;
    gap:         8px;
    padding:     4px 6px 4px 4px;
}
.pe-preset-item-name {
    display:     flex;
    align-items: center;
    gap:         6px;
    flex:        1 1 auto;
    min-width:   0;
    min-height:  40px;
    padding:     0 6px;
    border:      none;
    border-radius: 8px;
    background:  none;
    font:        inherit;
    font-weight: 600;
    text-align:  left;
    color:       var(--color-text);
    cursor:      pointer;
}
.pe-preset-item-name:hover { background: var(--color-hover); }
.pe-preset-item-name > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pe-preset-chevron { line-height: 0; transform: rotate(-90deg); transition: transform var(--transition); }
.pe-preset-item--open .pe-preset-chevron { transform: none; }
.pe-preset-used {
    display:     inline-flex;
    align-items: center;
    gap:         4px;
    font-size:   0.78rem;
    font-weight: 600;
    color:       var(--color-text);
    white-space: nowrap;
}
.pe-preset-rows {
    margin:     0;
    padding:    0 14px 10px 40px;
    font-size:  0.82rem;
    color:      var(--color-text-secondary);
}
.pe-preset-rows li + li { margin-top: 2px; }
.pe-preset-none { color: var(--color-text-muted); font-size: 0.85rem; list-style: none; }

/* The footer's way back to what is above: apart from Cancel and Save. */
.pe-clear { margin-right: auto; }
