/* IntelliClerk — Start a New Brief.
   Layered over dashboard-v3.css and form.css, in that order. The fields, the
   choice marks, and the form's foot come from form.css; this file adds the two
   expandable file pickers and the statement-of-facts area. */

/* ---------- statement of facts ---------- */

.field__area {
    display: block;
    width: 100%;
    min-height: 16rem;
    resize: vertical;
    font-family: var(--body);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--text);
    background: var(--plate);
    border: 1px solid var(--rule);
    border-radius: var(--radius-control);
    padding: 0.9rem 1rem;
    /* Ruled like a legal pad, so long dictation stays legible. */
    background-image: repeating-linear-gradient(
        180deg,
        transparent 0 calc(1.65em - 1px),
        rgba(207, 193, 168, 0.35) calc(1.65em - 1px) 1.65em
    );
    background-position: 0 1.35rem;
}

.field__area::placeholder {
    color: rgba(110, 97, 83, 0.55);
    font-style: italic;
}

.field__area:hover {
    border-color: var(--steel);
}

/* The matter carried over from the previous step — stated, not chosen, so it is
   set as text rather than dressed as a disabled control. */
.matter-line {
    margin: 0;
    font-family: var(--display);
    font-size: 1.875rem;
    line-height: 1.2;
}

/* ---------- uploading the statement instead ---------- */

.upload {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
    margin-top: 1.1rem;
}

/* The alternative, marked as one — the box above and this are two ways to the
   same thing, not two things to do. */
.upload__or {
    font-family: var(--data);
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

/* The file input itself is unstylable across browsers, so the label wears the
   button and the input is kept out of sight but reachable. */
.upload__input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.upload__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55em;
    font-family: var(--data);
    font-size: 0.8125rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--walnut);
    background: var(--plate);
    border: 1px solid var(--rule);
    border-radius: var(--radius-control);
    padding: 0.55rem 1rem;
    margin: 0;
    cursor: pointer;
    transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.upload__btn:hover {
    color: #FFFFFF;
    background: var(--brass);
    border-color: var(--brass);
}

/* The label is the control, so it takes the focus ring the hidden input earns. */
.upload__input:focus-visible + .upload__btn,
.upload__btn:focus-visible {
    outline: 2px solid var(--ochre);
    outline-offset: 3px;
}

.upload__name {
    font-family: var(--data);
    font-size: 0.8125rem;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.upload__name--set {
    color: var(--ink);
}

@media (max-width: 40rem) {
    .upload__name {
        width: 100%;
    }
}

/* ---------- file pickers ---------- */

.picker__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    flex-wrap: wrap;
}

.picker__acts {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Runs against the label, so counsel can see how much of the record is going
   into the brief without opening the list. */
.picker__count {
    font-family: var(--data);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.picker__count--some {
    color: var(--walnut);
}

.btn-mini,
.btn-expand {
    font-family: var(--data);
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--walnut);
    background: var(--plate);
    border: 1px solid var(--rule);
    border-radius: var(--radius-control);
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.btn-mini:hover,
.btn-expand:hover {
    color: #FFFFFF;
    background: var(--brass);
    border-color: var(--brass);
}

.btn-expand__chev {
    width: 0.9em;
    height: 0.9em;
    flex: 0 0 auto;
    transition: transform 160ms ease;
}

.btn-expand[aria-expanded="false"] .btn-expand__chev {
    transform: rotate(-90deg);
}

/* ---------- the list itself ---------- */

/* Capped, so a 41-item production scrolls inside the field instead of burying
   the rest of the form. */
.picks {
    list-style: none;
    margin: 0.9rem 0 0;
    padding: 0;
    max-height: 22rem;
    overflow-y: auto;
    background: var(--plate);
    border: 1px solid var(--rule);
    border-radius: var(--radius-control);
}

.pick + .pick {
    border-top: 1px solid var(--rule-soft);
}

.pick__row {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.6rem 0.9rem;
    margin: 0;
    cursor: pointer;
    transition: background 120ms ease;
}

.pick__row:hover {
    background: rgba(107, 74, 47, 0.05);
}

.pick__row input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* The base stylesheet strips native control chrome, so the box is drawn here —
   square, like the status marks. */
.pick__box {
    position: relative;
    width: 0.85rem;
    height: 0.85rem;
    flex: 0 0 auto;
    margin-top: 0.42rem;
    border: 1px solid var(--rule);
    background: #FFFFFF;
    transition: background 120ms ease, border-color 120ms ease;
}

.pick__row input:checked + .pick__box {
    background: var(--ink);
    border-color: var(--ink);
}

.pick__row input:checked + .pick__box::after {
    content: "";
    position: absolute;
    left: 0.22rem;
    top: 0.05rem;
    width: 0.25rem;
    height: 0.48rem;
    border: solid var(--parchment);
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(42deg);
}

.pick__row input:focus-visible + .pick__box {
    outline: 2px solid var(--ochre);
    outline-offset: 2px;
}

.pick__name {
    font-size: 1rem;
    line-height: 1.35;
}

.pick__note {
    display: block;
    margin-top: 0.1rem;
    font-family: var(--data);
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
    color: var(--muted);
}

/* A matter can have nothing on file yet; the picker says so rather than
   showing an empty box. */
.picks-empty {
    margin: 0.9rem 0 0;
    font-size: 0.9375rem;
    font-style: italic;
    color: var(--muted);
}

@media (max-width: 40rem) {
    .picker__head {
        align-items: flex-start;
    }

    .picks {
        max-height: 18rem;
    }
}
