/* ==========================================================================
   Kinora — report a title (v0.0.487)

   Only what is inside the card. The overlay, the card surface, the head row and
   the close button come from .mv-modal in title-v404a.css, so this sheet never
   sets a background, a z-index or a position:fixed — if it did, two rules would
   own the same dialog and one of them would eventually be wrong.

   The whole design decision here is that a report is a *tap*, not a form. The
   seven reasons are the only required input; everything below them is optional
   and looks optional. That is why the reasons are large targets at the top and
   the note and address are quiet fields underneath, rather than a form with a
   category dropdown in it.
   ========================================================================== */

.ktrp {
    width: min(468px, 100%);
    max-height: min(88vh, 760px);
    gap: 14px;
}

/* Every panel in here is toggled with the `hidden` attribute, and every one of
   them is also given a display by a rule below — an author `display` beats the
   UA stylesheet's `[hidden] { display: none }`, so without this the form would
   stay on screen underneath the success panel. */
.ktrp [hidden] { display: none !important; }

/* ------------------------------------------------------- the menu entry */

/* The taste menu is re-homed onto .kt-site at runtime by title-actions-v365.js,
   so this cannot be scoped through the hero — it is matched on the menu itself. */
.mv-feedback__rule {
    height: 1px;
    margin: 4px 8px;
    background: rgba(var(--kt-ink-rgb), 0.1);
}

/* ------------------------------------------------------------- the subject */

.ktrp-subject {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border: 1px solid rgba(var(--kt-ink-rgb), 0.1);
    border-radius: 12px;
    background: rgba(var(--kt-ink-rgb), 0.03);
}

.ktrp-subject img {
    flex: none;
    width: 34px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
    background: rgba(var(--kt-ink-rgb), 0.08);
}

.ktrp-subject > span { display: grid; gap: 2px; min-width: 0; }

.ktrp-subject b {
    overflow: hidden;
    color: var(--kt-ink);
    font-size: 13.5px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ktrp-subject i {
    color: rgba(var(--kt-ink-rgb), 0.44);
    font-size: 12px;
    font-style: normal;
    font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------------------- scroller */

/* The card is a flex column with a fixed head and foot; only the middle moves,
   so the send button never scrolls out of reach on a short phone. */
.ktrp form { display: flex; flex-direction: column; gap: 14px; min-height: 0; }

.ktrp-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    min-height: 0;
    margin: 0 -4px;
    padding: 0 4px;
    scrollbar-width: thin;
}

/* ---------------------------------------------------------------- reasons */

.ktrp-cats { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; }

.ktrp-cats legend {
    padding: 0 0 8px;
    color: rgba(var(--kt-ink-rgb), 0.5);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ktrp-cat {
    position: relative; /* anchors the visually-hidden input to its own row */
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: start;
    gap: 11px;
    padding: 10px 12px;
    border: 1px solid rgba(var(--kt-ink-rgb), 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.16s ease, background 0.16s ease;
}

.ktrp-cat:hover { border-color: rgba(var(--kt-ink-rgb), 0.22); background: rgba(var(--kt-ink-rgb), 0.03); }

/* The native control stays in the DOM and keeps the keyboard and the screen
   reader working; only its painting is replaced. */
.ktrp-cat input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.ktrp-cat__mark {
    position: relative;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border: 1.6px solid rgba(var(--kt-ink-rgb), 0.28);
    border-radius: 50%;
    transition: border-color 0.16s ease;
}

.ktrp-cat__mark::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--kt-accent);
    transform: scale(0);
    transition: transform 0.16s ease;
}

.ktrp-cat__copy { display: grid; gap: 2px; min-width: 0; }

.ktrp-cat__copy b {
    color: var(--kt-ink);
    font-size: 13.5px;
    font-weight: 650;
    line-height: 1.3;
}

.ktrp-cat__copy i {
    color: rgba(var(--kt-ink-rgb), 0.44);
    font-size: 11.5px;
    font-style: normal;
    line-height: 1.35;
}

/* Selection is carried by .is-on, written by report-v487.js on change, which is
   this codebase's convention for JS state everywhere else on the title page.
   `:has(input:checked)` expresses the same thing declaratively and is kept as
   the no-JS path, but it cannot be the only one: it depends on the engine
   re-running a :has() match when a descendant's :checked flips, and that
   invalidation is the first thing to go missing in an embedded webview — it did
   not fire in the verification harness at all, leaving every row untinted while
   the radio underneath was genuinely checked.

   The sibling rule below needs no :has() and no script, so the dot fills in even
   where both fail. Between the three, the row is never silently unselectable. */
.ktrp-cat.is-on,
.ktrp-cat:has(input:checked) {
    border-color: rgba(var(--kt-accent-rgb), 0.5);
    background: rgba(var(--kt-accent-rgb), 0.07);
}

.ktrp-cat.is-on .ktrp-cat__mark,
.ktrp-cat:has(input:checked) .ktrp-cat__mark,
.ktrp-cat input:checked ~ .ktrp-cat__mark { border-color: var(--kt-accent); }

.ktrp-cat.is-on .ktrp-cat__mark::after,
.ktrp-cat:has(input:checked) .ktrp-cat__mark::after,
.ktrp-cat input:checked ~ .ktrp-cat__mark::after { transform: scale(1); }

/* Keyboard users get the ring on the row, since the input itself is 1px.
   :focus-visible rather than :focus-within on purpose — the latter would leave
   an outline behind after every mouse click, because the hidden radio takes
   focus either way. */
.ktrp-cat:has(input:focus-visible) { outline: 2px solid var(--kt-accent); outline-offset: 2px; }

/* ------------------------------------------------------------- the notice */

.ktrp-notice {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid rgba(var(--kt-accent-rgb), 0.28);
    border-radius: 12px;
    background: rgba(var(--kt-accent-rgb), 0.07);
    color: rgba(var(--kt-ink-rgb), 0.72);
    font-size: 12px;
    line-height: 1.5;
}

.ktrp-notice a { color: var(--kt-accent); font-weight: 650; text-decoration: none; white-space: nowrap; }
.ktrp-notice a:hover { text-decoration: underline; }

/* --------------------------------------------------------------- fields */

.ktrp-field { display: grid; gap: 6px; }

.ktrp-field__label {
    display: flex;
    align-items: baseline;
    gap: 7px;
    color: rgba(var(--kt-ink-rgb), 0.66);
    font-size: 12.5px;
    font-weight: 650;
}

.ktrp-field__label i {
    color: rgba(var(--kt-ink-rgb), 0.38);
    font-size: 11px;
    font-style: normal;
    font-weight: 600;
}

.ktrp-field__label i.is-required { color: var(--kt-accent); }

.ktrp-field textarea,
.ktrp-field input[type="email"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(var(--kt-ink-rgb), 0.14);
    border-radius: 12px;
    background: rgba(var(--kt-ink-rgb), 0.03);
    color: var(--kt-ink);
    font: inherit;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
}

.ktrp-field textarea::placeholder,
.ktrp-field input::placeholder { color: rgba(var(--kt-ink-rgb), 0.32); }

.ktrp-field textarea:focus,
.ktrp-field input[type="email"]:focus {
    border-color: rgba(var(--kt-accent-rgb), 0.55);
    outline: none;
}

.ktrp-field__hint { color: rgba(var(--kt-ink-rgb), 0.38); font-size: 11px; line-height: 1.4; }

.ktrp-asyou {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    color: rgba(var(--kt-ink-rgb), 0.42);
    font-size: 11.5px;
}

.ktrp-asyou b { color: rgba(var(--kt-ink-rgb), 0.66); font-weight: 650; }

.ktrp-error {
    margin: 0;
    color: #ff6b5e;
    font-size: 12px;
    line-height: 1.45;
}

/* The honeypot is hidden from people without display:none, which some bots
   check for, and taken out of the tab order in the markup. */
.ktrp-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* --------------------------------------------------------------- actions */

.ktrp-foot { display: flex; justify-content: flex-end; gap: 9px; }

.ktrp-btn {
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 11px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}

.ktrp-btn--ghost {
    border-color: rgba(var(--kt-ink-rgb), 0.16);
    background: transparent;
    color: rgba(var(--kt-ink-rgb), 0.72);
}

.ktrp-btn--ghost:hover { border-color: rgba(var(--kt-ink-rgb), 0.3); color: var(--kt-ink); }

.ktrp-btn--go { background: var(--kt-accent); color: var(--kt-on-accent, #14090a); }
.ktrp-btn--go:hover { filter: brightness(1.06); }
.ktrp-btn--go:disabled { opacity: 0.55; cursor: default; filter: none; }

/* ------------------------------------------------------------------- done */

.ktrp-done {
    display: grid;
    justify-items: center;
    gap: 9px;
    padding: 14px 8px 6px;
    text-align: center;
}

.ktrp-done__check {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-bottom: 3px;
    border: 1px solid rgba(var(--kt-accent-rgb), 0.3);
    border-radius: 50%;
    background: rgba(var(--kt-accent-rgb), 0.1);
    color: var(--kt-accent);
}

.ktrp-done b { color: var(--kt-ink); font-size: 15px; font-weight: 750; }
.ktrp-done > span { color: rgba(var(--kt-ink-rgb), 0.55); font-size: 12.5px; line-height: 1.5; }

.ktrp-done code {
    padding: 4px 10px;
    border-radius: 7px;
    background: rgba(var(--kt-ink-rgb), 0.07);
    color: rgba(var(--kt-ink-rgb), 0.5);
    font-size: 11px;
    letter-spacing: 0.03em;
}

.ktrp-done .ktrp-btn { margin-top: 6px; }

/* ------------------------------------------------------------- light theme */

.kt-site[data-theme="light"] .ktrp-subject { background: rgba(17, 17, 17, 0.03); }

.kt-site[data-theme="light"] .ktrp-field textarea,
.kt-site[data-theme="light"] .ktrp-field input[type="email"] { background: #fff; }

.kt-site[data-theme="light"] .ktrp-error { color: #c0392b; }

/* -------------------------------------------------------------- responsive */

@media (max-width: 520px) {
    .ktrp { max-height: 92vh; }
    .ktrp-cat { padding: 9px 11px; }
    .ktrp-cat__copy b { font-size: 13px; }
    .ktrp-foot { flex-direction: column-reverse; }
    .ktrp-foot .ktrp-btn { width: 100%; }
}
