/* LipiCore-Documents - the product's own rules, loaded after the library's lipicore.css
   (platform.product.stylesheets). Everything shared - layout, header, buttons, forms,
   tables, admin console, filters, pager, cards, the chat transcript - is the library's;
   only what exists nowhere else is here, under the doc- prefix. */

/* ---- links ----
   The library's link recipe (.ins-link: body colour, semibold, no underline, primary
   on hover) for the names that carry their own class - a document in the list, a
   search result, a source under an answer. Links in running text use .ins-link. */
.doc-name,
.doc-result-title,
.doc-source-doc {
    color: var(--ins-text);
    font-weight: 600;
    text-decoration: none;
}

.doc-name:hover,
.doc-name:focus-visible,
.doc-result-title:hover,
.doc-result-title:focus-visible,
.doc-source-doc:hover,
.doc-source-doc:focus-visible {
    color: var(--ins-primary);
    text-decoration: none;
}

/* A secondary way on from a row ("Open passage"): muted until approached. */
.doc-result-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ins-muted);
    text-decoration: none;
    white-space: nowrap;
}

.doc-result-link:hover,
.doc-result-link:focus-visible {
    color: var(--ins-primary);
    text-decoration: none;
}

/* ---- home ----
   The shell, toolbar, cards, table view, Overview lists and Tips are the library's
   (lipicore.css "Home pages"); what is Documents' own is below. */

/* The three ways in on the Overview's tail - Documents, Search, the assistant - one row
   of cards, each a tinted icon, a title, two lines on what it does and the way there.
   Documents is a section switch, so one of them is a <button>. */
.doc-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.9rem;
}

.doc-feature {
    --card-accent: var(--ins-primary);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1rem 1.1rem;
    background: var(--ins-surface);
    border: 1px solid var(--ins-border);
    border-radius: var(--ins-border-radius);
    box-shadow: var(--ins-shadow-light);
    color: var(--ins-text);
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.doc-feature:hover {
    color: var(--ins-text);
    text-decoration: none;
    border-color: color-mix(in srgb, var(--card-accent) 45%, var(--ins-border));
    box-shadow: 0 10px 24px -12px var(--ins-shadow-strong);
    transform: translateY(-2px);
}

.doc-feature-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.doc-feature-title {
    font-size: 0.95rem;
    font-weight: 700;
}

.doc-feature-text {
    flex: 1;
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--ins-muted);
}

.doc-feature-go {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--card-accent);
}

.doc-feature:hover .doc-feature-go .bi {
    transform: translateX(2px);
}

.doc-feature-go .bi {
    transition: transform 0.15s ease;
}

.doc-meta-failed {
    color: var(--ins-danger);
}

/* The Documents section's title row carries the editors' Register and Upload. */
.doc-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ---- document status badge ---- */
.doc-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    background: color-mix(in srgb, var(--ins-muted) 15%, transparent);
    color: var(--ins-muted);
}

.doc-status .spinner-border {
    width: 0.7rem;
    height: 0.7rem;
    border-width: 0.12em;
}

.doc-status--pending,
.doc-status--extracting,
.doc-status--enriching,
.doc-status--indexing {
    background: color-mix(in srgb, var(--ins-hint) 15%, transparent);
    color: var(--ins-hint);
}

.doc-status--indexed {
    background: color-mix(in srgb, var(--ins-success) 15%, transparent);
    color: var(--ins-success);
}

.doc-status--failed {
    background: color-mix(in srgb, var(--ins-danger) 15%, transparent);
    color: var(--ins-danger);
}

/* ---- guide links ---- */
.doc-guide-links {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--ins-muted);
}

/* ---- the document list ---- */
/* The status tabs are links (each a filter URL), dressed as the library's segmented
   switch: no underline, one row that scrolls sideways on a phone instead of
   wrapping the page. */
.doc-seg {
    display: flex;
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
    margin-bottom: 0.75rem;
}

/* Under a section's title rule the tabs keep the gap the platform's controls row keeps
   (.ins-home-controls), instead of touching the rule. */
.ins-home-toolbar + .doc-seg {
    margin-top: 0.65rem;
}

.ins-view-seg-btn--text {
    width: auto;
    padding: 0 0.7rem;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.ins-view-seg-btn--text:hover {
    text-decoration: none;
}

/* Text tab groups (the list's statuses, the results' Documents/Passages) stand at the
   controls' height, level with the search box and the selects around them; the
   library's 36px icon switch stays for the title rows it was made for. */
.doc-tabs {
    height: var(--ins-control-height);
}

/* The pager (documents/fragments :: pager) follows a card (the list) or the passages (the
   detail page) directly, so it keeps the search results' 0.7rem gap itself... */
.doc-pager {
    margin-top: 0.7rem;
}

/* ...except in the search results' column, whose own gap is that same 0.7rem. */
.ins-results > .doc-pager {
    margin-top: 0;
}

.doc-tabs .ins-view-seg-btn--text {
    height: 100%;
    padding: 0 0.85rem;
    font-size: 0.875rem;
}

/* A select inside a form field, enhanced into the themed dropdown like every other:
   it fills the field at the inputs' height. */
.doc-field-select .ins-select {
    display: block;
}

.doc-field-select .ins-dash-select,
.doc-field-select .ins-select-toggle {
    width: 100%;
    min-width: 0;
    height: var(--ins-control-height);
    border-radius: var(--ins-radius-control);
    font-size: 0.9rem;
    font-weight: 400;
}

.doc-seg-count {
    display: inline-block;
    min-width: 1.5rem;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    background: color-mix(in srgb, var(--ins-text) 10%, transparent);
}

.doc-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.doc-search-box {
    flex: 1 1 16rem;
}

.doc-refresh-note {
    margin-left: 0.3rem;
    font-size: 0.7rem;
    color: var(--ins-muted);
}

.doc-card {
    background: var(--ins-surface);
    border: 1px solid var(--ins-border);
    border-radius: var(--ins-radius-control, 10px);
    overflow: hidden;
}

.doc-table thead th {
    white-space: nowrap;
}

.doc-num {
    text-align: right;
    white-space: nowrap;
}


.doc-filename,
.doc-note {
    font-size: 0.75rem;
    color: var(--ins-muted);
    word-break: break-word;
}

.doc-note--error {
    color: var(--ins-danger);
}

.doc-muted {
    color: var(--ins-muted);
}

.doc-btn-danger {
    color: var(--ins-danger);
}

/* ---- one document ---- */
.doc-cols {
    display: grid;
    grid-template-columns: minmax(18rem, 1fr) 2fr;
    gap: 1rem;
    align-items: start;
}

@media (max-width: 900px) {
    .doc-cols {
        grid-template-columns: 1fr;
    }
}

.doc-section + .doc-section {
    margin-top: 1rem;
}

.doc-kv {
    margin: 0;
}

.doc-kv > div {
    display: grid;
    grid-template-columns: 7rem 1fr;
    gap: 0.5rem;
    padding: 0.4rem 0;
    border-top: 1px solid var(--ins-border);
    font-size: 0.85rem;
}

.doc-kv > div:first-child {
    border-top: 0;
}

.doc-kv dt {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--ins-muted);
    margin: 0;
}

.doc-kv dd {
    margin: 0;
    word-break: break-word;
}

.doc-checksum {
    font-size: 0.75rem;
}

.doc-chips {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.doc-chip {
    display: inline-block;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    background: color-mix(in srgb, var(--ins-primary) 15%, transparent);
    color: var(--ins-text);
}

/* An editable row: label, value, and the edit control at the row's right end - the
   library's square icon action, the pencil of every admin table. The label centres on
   the row so it lines up with the chips beside it. Editing swaps the value and the
   control for the inline form, which takes the whole value cell. */
.doc-kv > .doc-kv-edit {
    align-items: center;
}

.doc-kv-edit dd {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 28px;
}

.doc-kv-value {
    flex: 1 1 auto;
    min-width: 0;
}

.doc-edit-btn {
    flex-shrink: 0;
    margin-left: auto;
}

/* the action's own display would otherwise out-vote the hidden attribute */
.doc-edit-btn[hidden] {
    display: none;
}

.doc-inline-form {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.doc-inline-form[hidden] {
    display: none;
}

.doc-inline-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 2rem;
    padding: 0 0.6rem;
    border: 1px solid var(--ins-border);
    border-radius: var(--ins-radius-control, 10px);
    background: var(--ins-surface);
    color: var(--ins-text);
    font-size: 0.85rem;
}

.doc-inline-input:focus {
    outline: none;
    border-color: var(--ins-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ins-primary) 12%, transparent);
}

/* Save and cancel: squares at the input's height, so the three read as one control. */
.doc-inline-btn {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    padding: 0;
    justify-content: center;
    border-radius: 7px;
}

/* ---- upload ---- */
.doc-upload-settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.doc-dropzone {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    border: 2px dashed var(--ins-border);
    border-radius: var(--ins-radius-control, 10px);
    background: var(--ins-background);
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
}

.doc-dropzone:hover,
.doc-dropzone:focus-visible,
.doc-dropzone.is-over {
    border-color: var(--ins-primary);
    background: color-mix(in srgb, var(--ins-primary) 8%, var(--ins-background));
    outline: none;
}

.doc-dropzone-icon {
    font-size: 2rem;
    color: var(--ins-primary);
}

.doc-dropzone-hint {
    font-size: 0.75rem;
    color: var(--ins-muted);
}

.doc-upload-queue {
    margin-top: 1rem;
}

.doc-progress {
    height: 0.5rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--ins-text) 10%, transparent);
    overflow: hidden;
    min-width: 6rem;
}

.doc-progress-bar {
    height: 100%;
    background: var(--ins-primary);
    transition: width 0.2s;
}

.doc-status--queued,
.doc-status--uploading {
    background: color-mix(in srgb, var(--ins-hint) 15%, transparent);
    color: var(--ins-hint);
}

.doc-status--duplicate {
    background: color-mix(in srgb, var(--ins-warning) 15%, transparent);
    color: var(--ins-warning);
}

/* ---- passages on the document page ---- */
.doc-summary {
    font-size: 0.9rem;
    line-height: 1.5;
}

.doc-kv-label {
    display: inline-block;
    margin-right: 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--ins-muted);
}

.doc-passages {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.doc-passage {
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--ins-border);
    border-radius: var(--ins-radius-control, 10px);
    background: var(--ins-background);
}

.doc-passage--target {
    border-color: var(--ins-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ins-primary) 25%, transparent);
}

.doc-passage-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
    font-size: 0.75rem;
    color: var(--ins-muted);
}

.doc-passage-index {
    font-weight: 700;
    color: var(--ins-primary);
}

.doc-passage-heading {
    font-weight: 600;
    color: var(--ins-text);
}

.doc-passage-text {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ---- search ---- */
.doc-filter-workspace {
    margin-bottom: 0.75rem;
}

.doc-filter-workspace .ins-home-tool-field {
    width: 100%;
}

.doc-filter-hint {
    font-size: 0.8rem;
}

.doc-query-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.doc-query-row .doc-search-box {
    flex: 1 1 18rem;
}

.doc-scope-note {
    margin-bottom: 0.75rem;
}

.doc-results-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.doc-error {
    margin-bottom: 0.75rem;
}

.doc-result-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.doc-result {
    padding: 0.8rem 1rem;
    background: var(--ins-surface);
    border: 1px solid var(--ins-border);
    border-radius: var(--ins-radius-control, 10px);
}

.doc-result-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
}

.doc-result-head .doc-filetype {
    color: var(--ins-primary);
}

.doc-result-title {
    font-size: 0.95rem;
}

.doc-result-meta,
.doc-result-passage {
    font-size: 0.75rem;
    color: var(--ins-muted);
}

.doc-result-passage {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.2rem;
}

.doc-snippet {
    margin: 0.4rem 0 0;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--ins-text);
}

.doc-result-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.4rem;
}


.ins-suggest-item small {
    color: var(--ins-muted);
    margin-left: 0.4rem;
}

/* The list's filter box is a 300px toolbar field: its suggestions may grow past it, so a
   name and its file stay on one line. */
.doc-toolbar .ins-suggest {
    right: auto;
    min-width: 100%;
    width: max-content;
    max-width: min(32rem, calc(100vw - 2rem));
}

/* ---------- AI assistant ----------
   The viewport-locked chat shell: the transcript scrolls, the scope row and the
   composer stay put. The transcript, bubbles, typing dots and composer are the
   library's (.ins-ai-*); what is Documents' own is the scope row, the citations
   and the markdown an answer is drawn with. ai.js stamps doc-body--ai on <body>
   while the page is on screen (the in-place swap replaces <main> only). */
.doc-body--ai {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
}

.doc-main--ai {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.doc-ai-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.doc-ai-reset {
    white-space: nowrap;
}

.doc-ai {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    min-height: 0;
}

.doc-ai-empty-hint {
    font-size: 0.85rem;
    max-width: 560px;
    margin: 0.4rem auto 0;
}

.doc-ai-context {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    padding: 0.3rem calc(0.7rem + var(--ins-scrollbar-inset, 0px)) 0.2rem 0;
}

.doc-ai-context-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-width: 0;
    flex: 1 1 320px;
}

.doc-ai-docbox {
    max-width: 280px;
    flex: 0 1 280px;
}

/* The picker sits at the foot of a viewport-locked page: its suggestions open upward,
   over the transcript, instead of under the composer and past the window's edge. */
.doc-ai-docbox .ins-suggest {
    top: auto;
    bottom: calc(100% + 4px);
    box-shadow: 0 -12px 28px -12px var(--ins-shadow-strong);
}

/* the send hint keeps to the right edge, past whatever the left group wraps into */
.doc-ai-hint {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--ins-muted);
    white-space: nowrap;
}

/* a chip with its own remove control */
.doc-chip--removable {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding-right: 0.3rem;
}

.doc-chip-remove {
    border: 0;
    background: none;
    padding: 0;
    width: 1rem;
    height: 1rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: inherit;
    cursor: pointer;
    font-size: 0.7rem;
    line-height: 1;
}

.doc-chip-remove:hover {
    background: color-mix(in srgb, var(--ins-text) 12%, transparent);
}

/* the numbered marker an answer cites with - inline in the prose, and on the
   Sources line beneath it */
.doc-cite {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.3rem;
    margin: 0 0.1rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--ins-primary) 40%, transparent);
    background: color-mix(in srgb, var(--ins-primary) 10%, transparent);
    color: var(--ins-primary);
    font: inherit;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1;
    vertical-align: baseline;
    cursor: pointer;
}

.doc-cite:hover,
.doc-cite:focus-visible {
    background: var(--ins-primary);
    color: #fff;
}

.doc-cite--static {
    cursor: default;
}

.doc-cite--static:hover {
    background: color-mix(in srgb, var(--ins-primary) 10%, transparent);
    color: var(--ins-primary);
}

/* the answer's markdown, drawn block by block from the parser in ai.js */
.doc-md > :first-child { margin-top: 0; }
.doc-md p { margin: 0 0 0.5rem; }
.doc-md p:last-child { margin-bottom: 0; }
.doc-md ul, .doc-md ol { margin: 0 0 0.5rem; padding-left: 1.2rem; }
.doc-md li > ul, .doc-md li > ol { margin-bottom: 0; }
.doc-md pre {
    background: color-mix(in srgb, var(--ins-text) 6%, transparent);
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    overflow-x: auto;
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
}
.doc-md code {
    font-size: 0.85em;
}
.doc-md blockquote {
    border-left: 3px solid var(--ins-border);
    margin: 0 0 0.5rem;
    padding: 0.1rem 0.6rem;
    color: var(--ins-muted);
}
.doc-md-h {
    font-weight: 600;
    margin: 0.6rem 0 0.3rem;
}
.doc-md-h1 { font-size: 1.05rem; }
.doc-md-h2 { font-size: 1rem; }
.doc-md-table {
    overflow-x: auto;
    margin: 0 0 0.5rem;
}
.doc-md table {
    border-collapse: collapse;
    font-size: 0.85rem;
    width: 100%;
}
.doc-md th, .doc-md td {
    border: 1px solid var(--ins-border);
    padding: 0.25rem 0.5rem;
    text-align: left;
    vertical-align: top;
}
.doc-md th {
    background: color-mix(in srgb, var(--ins-text) 4%, transparent);
}
.doc-md hr {
    border: 0;
    border-top: 1px solid var(--ins-border);
    margin: 0.6rem 0;
}

/* the Sources line under an answer: each document once, then its citations */
.doc-sources {
    margin-top: 0.6rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--ins-border);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.8rem;
}

.doc-sources-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ins-muted);
}

.doc-source {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.doc-source-doc {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    max-width: 100%;
}

.doc-source-ref {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border: 0;
    background: none;
    padding: 0 0.2rem;
    border-radius: 6px;
    color: var(--ins-muted);
    font: inherit;
    font-size: 0.78rem;
    cursor: pointer;
}

.doc-source-ref:hover {
    background: color-mix(in srgb, var(--ins-primary) 8%, transparent);
    color: var(--ins-text);
}

/* the citation panel */
.doc-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 1040;
}

.doc-side-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(480px, 100%);
    background: var(--ins-surface, #fff);
    color: var(--ins-text);
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    display: flex;
    flex-direction: column;
}

.doc-side-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--ins-border);
}

.doc-side-panel-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-side-panel-body {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.doc-side-panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.doc-kv--tight {
    margin-bottom: 0.8rem;
}

.doc-passage {
    white-space: pre-wrap;
    font-size: 0.9rem;
    line-height: 1.5;
    background: color-mix(in srgb, var(--ins-text) 4%, transparent);
    border-radius: 8px;
    padding: 0.7rem 0.8rem;
}

.doc-ai-enter {
    animation: doc-ai-enter 0.35s ease both;
}

@keyframes doc-ai-enter {
    from { opacity: 0; transform: translateY(8px); }
}

@media (prefers-reduced-motion: reduce) {
    .doc-ai-enter {
        animation: none;
    }
}

/* Phones: the hint costs a line it cannot spare; the New Conversation button
   shrinks to its icon in the top corner and the tagline goes - the head never
   scrolls away here, so every line of it is permanent chrome. */
@media (max-width: 640px) {
    .doc-ai-hint {
        display: none;
    }

    .doc-ai-head {
        display: block;
        position: relative;
        margin-bottom: 0.4rem;
    }

    .doc-ai-head .ins-page-desc {
        display: none;
    }

    .doc-ai-head .ins-page-title {
        padding-right: 3.5rem;
        line-height: 40px;
    }

    .doc-ai-reset {
        position: absolute;
        top: 0;
        right: 0;
        width: 40px;
        padding: 0;
        justify-content: center;
    }

    .doc-ai-reset .doc-ai-reset-label {
        display: none;
    }

    .doc-ai-docbox {
        max-width: 100%;
        flex-basis: 100%;
    }

    .doc-body--ai .ins-footer {
        display: none;
    }

    .doc-main--ai {
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
    }
}
