/* Shared final overrides. The component layers are emitted as direct,
   fingerprinted links by render_app_stylesheets() so browsers can discover
   and fetch them in parallel while preserving this file as the last layer. */

/* Prevent iOS Safari from zooming the page when a compact form control receives focus. */
@media (max-width: 720px), (hover: none) and (pointer: coarse) {
    :where(
        input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="hidden"]),
        select,
        textarea
    ) {
        font-size: 16px !important;
    }
}

.rich-text-label { margin-bottom:.4rem; }
.rich-text-editor { overflow:hidden; border:1px solid var(--line, #35505a); border-radius:8px; background:var(--input-bg, #0f1b20); transition:border-color .16s ease, box-shadow .16s ease; }
.rich-text-editor:focus-within { border-color:var(--accent, #55d6ca); box-shadow:0 0 0 2px color-mix(in srgb, var(--accent, #55d6ca) 18%, transparent); }
.markdown-toolbar { display:flex; flex-wrap:wrap; gap:.25rem; padding:.35rem; border-bottom:1px solid var(--line, #35505a); background:var(--surface-2, #16262d); }
.markdown-toolbar button { display:inline-grid; place-items:center; min-width:2rem; height:2rem; border:1px solid transparent; background:transparent; color:inherit; border-radius:6px; padding:0 .45rem; font:inherit; font-size:.78rem; cursor:pointer; }
.markdown-toolbar button:hover, .markdown-toolbar button:focus-visible, .markdown-toolbar button[aria-pressed="true"] { border-color:var(--accent, #55d6ca); color:var(--accent, #55d6ca); background:color-mix(in srgb, var(--accent, #55d6ca) 10%, transparent); }
.markdown-editor { min-height:108px; padding:.75rem; color:inherit; line-height:1.55; outline:none; white-space:pre-wrap; overflow-wrap:anywhere; }
.markdown-editor:empty::before { content:attr(data-placeholder); color:var(--muted); pointer-events:none; }
.markdown-editor p { margin:0 0 .55rem; }.markdown-editor p:last-child { margin-bottom:0; }.markdown-editor ul,.markdown-editor ol { margin:.25rem 0 .65rem; padding-left:1.6rem; }.markdown-editor li + li { margin-top:.2rem; }.markdown-editor code { padding:.08rem .3rem; border-radius:4px; background:var(--surface-3, #0b1519); }.markdown-editor a { color:var(--accent, #55d6ca); text-decoration:underline; text-underline-offset:2px; }

/* Shared keyboard affordances. Keep these after every imported layer so local
   hover styles cannot accidentally erase the visible focus indicator. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid var(--accent) !important;
    outline-offset: 3px;
}
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.app-skip-link {
    position: fixed;
    top: max(10px, env(safe-area-inset-top));
    left: 12px;
    z-index: 10000;
    transform: translateY(calc(-100% - 24px));
    padding: 10px 14px;
    border: 2px solid var(--accent);
    border-radius: 10px;
    background: var(--card);
    color: var(--text);
    box-shadow: var(--shadow);
    font-weight: 800;
    text-decoration: none;
    transition: transform .12s ease;
}
.app-skip-link:focus { transform: translateY(0); }

@media (forced-colors: active) {
    :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
        outline-color: Highlight !important;
    }
    :where(button, input, select, textarea, summary, .node-card, .module-card) {
        border-color: CanvasText;
    }
    :where([aria-current="page"], [aria-selected="true"], [aria-pressed="true"], .active, .selected) {
        outline: 2px solid Highlight;
        outline-offset: 1px;
    }
    .visual-svg-canvas path { stroke: CanvasText !important; }
    .visual-node-svg rect { fill: Canvas !important; stroke: CanvasText !important; }
    .visual-node-svg text, .visual-status-symbol { fill: CanvasText !important; }
    .visual-node-svg .visual-deadline-rail { stroke: Highlight !important; filter: none !important; }
    .visual-node-svg[aria-selected="true"] rect { stroke: Highlight !important; stroke-width: 4; }
}
