/* ---------- Hypotheses (SA-004) ---------- */

.hyp-section {
    margin-bottom: 20px;
}

.hyp-section__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.hyp-section__head h2 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.hyp-section__head .section-note {
    margin: 2px 0 0;
}

.hyp-section__tools .tabs {
    margin: 0;
}

.hyp-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
    gap: 14px;
    align-items: start;
}

.hyp {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
    border: 1px solid var(--border-gray);
    border-radius: var(--radius);
    background: var(--white);
    font-size: 0.88rem;
}

.hyp--saved { border-color: var(--primary); }
.hyp--rejected { opacity: 0.6; }
.hyp--editing { grid-column: 1 / -1; }

.hyp__head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-gray);
}

.hyp__kind {
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--primary);
    color: var(--white);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.66rem;
}

.hyp__head .badge {
    margin-left: auto;
    min-width: 0;
}

.hyp__statement {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.hyp__field p {
    margin-top: 1px;
}

.stimuli {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 3px;
}

.stimulus {
    display: flex;
    gap: 8px;
    align-items: baseline;
    padding: 7px 10px;
    border-radius: 8px;
    background: var(--light-gray);
}

.stimulus__label {
    flex: 0 0 auto;
    min-width: 22px;
    font-weight: 800;
    font-size: 0.76rem;
    color: var(--accent);
}

.hyp__evidence > .fold-details__head {
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-gray);
}

.hyp__evidence blockquote {
    margin: 8px 0 0;
    padding-left: 10px;
    border-left: 3px solid var(--accent);
    font-style: italic;
    color: var(--text-gray);
}

.hyp__evidence cite {
    font-style: normal;
    font-weight: 600;
    color: var(--primary);
}

.hyp__why {
    margin-top: 8px;
    color: var(--text-gray);
}

.hyp__acts {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}

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

.stim-edit {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.stim-edit__row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.stim-edit__row .stim-edit__lf {
    flex: 0 0 90px;
}

.stim-edit__row .stim-edit__tf {
    flex: 1;
    min-width: 0;
}

.ac-dialog .hyp-list {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* ---------- Personality data (SA-005) ---------- */

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

.tile {
    padding: 16px 18px;
    border: 1px solid var(--border-gray);
    border-radius: var(--radius);
}

.tile__value {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.tile__label {
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--text-gray);
}

.data-table--static tbody tr { cursor: default; }

.data-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.data-table .z { color: var(--text-gray); }
.data-table .row-thin td { opacity: 0.45; }
.data-table .z--up { color: var(--primary); font-weight: 700; }
.data-table .z--down { color: var(--accent-dark); font-weight: 700; }

.th-label {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    cursor: pointer;
}

.th-label:hover { color: var(--primary); }

.sort-arrow {
    font-size: 0.7rem;
    color: var(--accent);
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* The search box (book-forms controls.js `search`). */
.ac-search {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.ac-search input.ac-search__input {
    width: 280px;
    padding: 9px 32px 9px 36px;
}

.ac-search__icon {
    position: absolute;
    left: 12px;
    color: var(--text-faint);
    pointer-events: none;
}

.ac-search__clear {
    position: absolute;
    right: 8px;
    display: inline-flex;
    padding: 2px;
    background: none;
    border: 0;
    border-radius: 4px;
    line-height: 0;
    color: var(--text-faint);
    cursor: pointer;
}

.ac-search__clear:hover { color: var(--primary); }

/* ---------- Segment bounds (SA-006) ---------- */

.seg-summary {
    margin-bottom: 20px;
    /* The panel's own padding: its fold button stands where the other blocks' do. */
}

.seg-summary__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.seg-summary__head h2 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.seg-summary__head .section-note { margin: 2px 0 0; }

.seg-bar {
    display: flex;
    height: 12px;
    border-radius: 6px;
    background: var(--light-gray);
    overflow: hidden;
}

.seg-bar__part + .seg-bar__part { border-left: 2px solid var(--white); }

.seg-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 10px;
    font-size: 0.82rem;
}

.seg-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.seg-legend__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.seg-legend__rest {
    font-weight: 400;
    color: var(--text-gray);
}

.seg {
    padding-top: 12px;
    border-top: 1px dashed var(--border-gray);
    font-size: 0.84rem;
}

.seg:empty { display: none; }

.seg__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.seg__edit {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-dark);
    cursor: pointer;
}

.seg__edit:hover { text-decoration: underline; }

.seg__none { color: var(--text-gray); }

.seg__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    color: var(--text-gray);
    margin-bottom: 8px;
}

.seg__share {
    color: var(--primary);
    font-weight: 700;
}

.seg__countries {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.seg__country {
    display: flex;
    align-items: center;
    gap: 8px;
}

.seg__country b { margin-left: auto; font-variant-numeric: tabular-nums; }
.seg__more { color: var(--text-gray); font-size: 0.78rem; }
.seg__people { color: var(--text-gray); font-size: 0.74rem; font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }
.seg__country--other { color: var(--text-gray); }
.seg__country > * { flex-shrink: 0; }
.seg__country > span:first-child { flex-shrink: 1; min-width: 0; }
.seg__country .badge { min-width: 0; padding: 2px 8px; font-size: 0.68rem; }

.tilt--strong { border-color: var(--primary); color: var(--primary); font-weight: 600; }
.tilt--clear { color: var(--primary); }
.tilt--slight { color: var(--text-gray); }

.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.seg-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.seg-form__shares {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.seg-form__share {
    display: grid;
    grid-template-columns: 1fr 110px 20px;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.seg-form__tilt {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.seg-form__tiltrow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px 150px 44px;
    gap: 8px;
}

.seg-form__tiltrow .icon-only { height: var(--ac-control-h); }

@media (max-width: 860px) {
    .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

