/*
 * The lookup family (TOOLS-PLAN 3.2 "Lookup", site/pages/free-tools/lookup.php, assets/js/ft/lookup-serial.js), after
 * ft-base.css and ft-calc.css (the field, result card and two-column layout it shares with the calculators). Tokens
 * only; every target 44 px or more. The tables of facts printed by nf_ft_table() (site/lib/free-tools/lookup-parts.php)
 * are ft-base.css's, so every family can print one.
 *
 *   .ft-lookup__row        equipment and brand side by side from 640 px
 *   .ft-lookup__serial     the serial field and Decode on one line
 *   .ft-lookup__result     the result card, its height reserved so the page does not jump when a result appears
 *   .ft-lookup__serial-show  the serial with the date characters marked (underlined and tinted: never colour alone)
 *   .ft-lookup__made / __age / __line / __note / __actions / __next / __formats / __save / __recent, .ft-check
 *   .ft-code-tables        the serial charts' code tables in columns
 */
.ft-lookup__row {
    display: grid;
    gap: var(--sp-4);
}

@media (min-width: 640px) {
    .ft-lookup__row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

.ft-lookup__serial {
    display: flex;
    gap: var(--sp-2);
}

.ft-lookup__serial .input {
    flex: 1 1 auto;
    min-width: 0;
}

.ft-lookup__serial .btn {
    flex: 0 0 auto;
    min-height: 44px;
}

.ft-lookup__input {
    font-family: var(--font-mono);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ft-lookup__result {
    min-height: 14rem;
}

.ft-lookup__answer {
    display: grid;
    gap: var(--sp-2);
    margin-top: var(--sp-3);
}

.ft-lookup__answer p {
    margin: 0;
}

.ft-lookup__serial-show {
    font-family: var(--font-mono);
    font-size: var(--fs-lg);
    letter-spacing: 0.06em;
    color: var(--c-text-2);
    overflow-wrap: anywhere;
}

/* The year is underlined once, the month or week twice, in the serial and in its key: never colour alone. */
.ft-lookup__serial-show mark,
.ft-lookup__key mark {
    padding: 0 1px;
    font-weight: var(--fw-bold);
    color: var(--c-ink);
    background: var(--c-brand-soft);
    border-bottom: 2px solid var(--c-brand);
    border-radius: 2px;
}

.ft-lookup__serial-show mark[data-kind="month"],
.ft-lookup__serial-show mark[data-kind="week"],
.ft-lookup__key mark[data-kind="month"],
.ft-lookup__key mark[data-kind="week"] {
    border-bottom: 4px double var(--c-brand);
}

.ft-lookup__serial-show mark + mark {
    margin-left: 3px;
}

.ft-lookup__key {
    font-size: var(--fs-sm);
    color: var(--c-text-2);
}

.ft-lookup__key mark {
    font-family: var(--font-mono);
}

.ft-lookup__result .ft-lookup__save {
    margin-top: var(--sp-4);
}

.ft-lookup__made {
    font-size: var(--fs-2xl);
    font-weight: var(--fw-bold);
    line-height: var(--lh-snug);
    color: var(--c-ink);
}

.ft-lookup__age {
    font-weight: var(--fw-semibold);
    color: var(--c-ink);
}

.ft-lookup__line,
.ft-lookup__note {
    font-size: var(--fs-sm);
    line-height: var(--lh-relaxed);
    color: var(--c-text-2);
}

.ft-lookup__note {
    padding: var(--sp-2) var(--sp-3);
    color: var(--c-text);
    background: var(--c-surface);
    border-left: 3px solid var(--c-line-strong);
}

.ft-lookup__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin-top: var(--sp-2);
}

.ft-lookup__actions .btn,
.ft-lookup__save .btn,
.ft-lookup__recent .btn {
    min-height: 44px;
}

.ft-check {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    min-height: 44px;
    font-size: var(--fs-sm);
    color: var(--c-text);
    cursor: pointer;
}

.ft-check input {
    width: 20px;
    height: 20px;
    margin: 0;
}

.ft-lookup__next a {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
    min-height: 44px;
    font-weight: var(--fw-semibold);
    color: var(--c-brand);
}

.ft-lookup__formats {
    display: grid;
    gap: var(--sp-2);
    margin: var(--sp-3) 0 0;
    padding-left: 1.25em;
    font-size: var(--fs-sm);
    color: var(--c-text);
    list-style: disc;
}

.ft-lookup__save {
    display: grid;
    gap: var(--sp-2);
    padding-top: var(--sp-3);
    border-top: 1px solid var(--c-line);
}

.ft-lookup__save-status {
    margin: 0;
    font-size: var(--fs-sm);
    color: var(--c-text-2);
}

.ft-lookup__save-status:empty {
    display: none;
}

.ft-lookup__recent {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin: 0 0 var(--sp-2);
    padding: 0;
    list-style: none;
}

.ft-lookup__recent .btn {
    font-family: var(--font-mono);
}

/* ---- the sections under the tool */
.ft-facts--first {
    margin-top: 0;
}

.ft-h2--next {
    margin-top: var(--sp-10);
}

/* the year-code and month-letter tables of the serial charts, side by side where there is room */
.ft-code-tables {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 0 var(--sp-4);
    align-items: start;
}

@media print {
    .ft-lookup__actions,
    .ft-lookup__save,
    .ft-lookup__next,
    .ft-check,
    .ft-lookup__serial .btn {
        display: none !important;
    }

    .ft-lookup__serial-show mark {
        background: none;
        border-bottom-color: currentColor;
    }
}
