/* Dashboard form page + rich text editor. Everything is scoped to .qform / .qrt / .qd so tables, filters and other pages keep their compact sizes. */
:root { --q-top: 64px; --q-bar: 76px; --q-line: #e2e8f0; --q-soft: #f8fafc; --q-brand: #4338ca; --q-brand-soft: #eef2ff; --q-text: #0f172a; --q-mute: #64748b; --q-card: #fff; }
html.dark { --q-line: #26314f; --q-soft: #0f1730; --q-brand: #a5b4fc; --q-brand-soft: rgba(99,102,241,.2); --q-text: #f1f5f9; --q-mute: #9aa8bf; --q-card: #131a2e; }
html.qfocus { --q-top: 0px; }
html.qfocus .flex.min-h-screen > aside, html.qfocus .flex.min-h-screen > div > header { display: none !important; }
html.qd-lock, html.qrt-lock { overflow: hidden; }

/* ---------- page shell ---------- */
main:has(.qform) { max-width: none !important; padding-top: 0; }
.qform { font-size: 16px; line-height: 1.55; }
.qbar { position: sticky; top: var(--q-top); z-index: 30; margin: 0 -1rem 1.5rem; padding: .8rem 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem;
  background: rgba(248,250,252,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--q-line); }
@media (min-width: 1024px) { .qbar { margin: 0 -2rem 1.75rem; padding: .8rem 2rem; } }
html.dark .qbar { background: rgba(11,16,32,.9); }
.qbar h1 { font-size: 1.5rem; line-height: 1.2; }
.qbar .btn, .qform .btn { min-height: 44px; padding: .55rem 1.1rem; font-size: 15px; border-radius: 12px; }
.qbar .qsave { box-shadow: 0 1px 2px rgba(67,56,202,.35); }
.qstate { display: inline-flex; align-items: center; gap: .4rem; font-size: 13px; font-weight: 600; padding: .35rem .7rem; border-radius: 999px; }
.qstate.dirty { background: #fef3c7; color: #92400e; } .qstate.clean { background: transparent; color: var(--q-mute); font-weight: 500; }
html.dark .qstate.dirty { background: rgba(245,158,11,.18); color: #fcd34d; }
.qgrid-main { display: grid; gap: 1.75rem; align-items: start; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .qgrid-main { grid-template-columns: minmax(0, 1fr) 360px; } }
.qside { display: flex; flex-direction: column; gap: 1.25rem; }
@media (min-width: 1100px) { .qside { position: sticky; top: calc(var(--q-top) + var(--q-bar) + 12px); max-height: calc(100vh - var(--q-top) - var(--q-bar) - 28px); overflow-y: auto; padding-right: 4px; scrollbar-width: thin; } }
.qcard { background: var(--q-card); border: 1px solid var(--q-line); border-radius: 16px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.qcard-h { display: flex; align-items: center; gap: .6rem; width: 100%; padding: 1.1rem 1.5rem; text-align: left; font-family: Poppins, Inter, sans-serif; font-weight: 600; font-size: 1.05rem; color: var(--q-text); }
.qcard-h .chev { margin-left: auto; transition: transform .2s; color: var(--q-mute); } .qcard-h.closed .chev { transform: rotate(-90deg); }
.qcard-b { padding: .25rem 1.5rem 1.6rem; }
.qcard-b.flat { padding-top: 1.5rem; }
.qside .qcard { padding: 1.15rem 1.25rem; }
.qtabs { display: flex; gap: .25rem; overflow-x: auto; border-bottom: 1px solid var(--q-line); scrollbar-width: none; }
.qtabs button { padding: .8rem 1.25rem; font-size: 15px; font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; color: var(--q-mute); }
.qtabs button:hover { color: var(--q-text); } .qtabs button.on { border-color: #4338ca; color: var(--q-brand); }
.qfields { display: grid; gap: 1.5rem 1.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .qfields { grid-template-columns: repeat(2, minmax(0, 1fr)); } .qfields > .qwide { grid-column: span 2; } }

/* bigger controls, only inside the form page */
.qform .inp { min-height: 46px; padding: .7rem .95rem; font-size: 16px; border-radius: 12px; }
.qform textarea.inp { min-height: 9.75rem; line-height: 1.55; resize: vertical; }
.qform textarea.inp.font-mono { font-size: 14px; }
.qform .lbl { font-size: 14px; font-weight: 600; margin-bottom: .45rem; color: var(--q-text); }
html.dark .qform .lbl { color: #e2e8f0; }
.qform .fhelp { font-size: 13.5px; color: var(--q-mute); margin-top: .4rem; line-height: 1.45; }
.qform input[type=date], .qform input[type=datetime-local] { min-height: 46px; }
.qform .tgl { min-height: 44px; }
.qform .qhint { font-size: 13px; }
.qform .qside .inp, .qform .qside .btn { font-size: 15px; }

/* inline repeaters */
.qrow { border: 1px solid var(--q-line); border-radius: 14px; background: var(--q-soft); padding: 1rem 1.1rem; display: flex; gap: .9rem; align-items: flex-start; }
.qrow:hover { border-color: #c7d2fe; }
.qrow .qrow-n { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--q-mute); margin-bottom: .6rem; }
.qrow-del { display: inline-flex; align-items: center; gap: .35rem; font-size: 13.5px; font-weight: 600; color: #b91c1c; padding: .45rem .7rem; border-radius: 10px; }
.qrow-del:hover { background: #fee2e2; } html.dark .qrow-del:hover { background: rgba(244,63,94,.15); }
.qdrop { border: 2px dashed #cbd5e1; border-radius: 16px; padding: 2rem 1rem; text-align: center; margin-bottom: 1.25rem; transition: .15s; }
html.dark .qdrop { border-color: #334155; }

/* ---------- rich text editor ---------- */
.qrt { border: 1px solid #cbd5e1; border-radius: 14px; background: var(--q-card); position: relative; }
html.dark .qrt { border-color: #26314f; }
.qrt.qrt-focus { border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79,70,229,.14); }
.qrt-toolbar { position: sticky; top: calc(var(--q-top) + var(--q-bar)); z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .2rem; padding: .5rem .6rem; background: var(--q-soft); border-bottom: 1px solid var(--q-line); border-radius: 14px 14px 0 0; }
.qg { display: flex; align-items: center; gap: 2px; } .qg-r { margin-left: auto; }
.qs { width: 1px; height: 24px; background: var(--q-line); margin: 0 .3rem; }
.qb { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-width: 38px; height: 38px; padding: 0 .5rem; border-radius: 9px; color: #334155; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .12s; white-space: nowrap; }
html.dark .qb { color: #cbd5e1; }
.qb svg { width: 18px; height: 18px; flex: none; }
.qb:hover { background: #e2e8f0; } html.dark .qb:hover { background: #1e2a4a; }
.qb.is-on { background: var(--q-brand-soft); color: var(--q-brand); }
.qb:disabled { opacity: .35; cursor: default; }
.qb-t { padding: 0 .7rem; }
.qsel { height: 38px; border: 1px solid #cbd5e1; border-radius: 9px; background: var(--q-card); padding: 0 .6rem; font-size: 14px; font-weight: 600; color: var(--q-text); min-width: 138px; cursor: pointer; }
html.dark .qsel { border-color: #26314f; }
.qrt { container-type: inline-size; }
@container (max-width: 640px) { .qb-t .ql { display: none; } .qb-t { padding: 0 .5rem; } .qb[data-act=help] .ql, .qb[data-act=full] .ql { display: none; } }
.qrt-tablebar { position: sticky; top: calc(var(--q-top) + var(--q-bar) + 55px); z-index: 19; display: flex; flex-wrap: wrap; align-items: center; gap: .2rem; padding: .35rem .6rem; background: var(--q-brand-soft); border-bottom: 1px solid var(--q-line); }
.qrt-tablebar[hidden] { display: none; }
.qt-l { display: inline-flex; align-items: center; gap: .35rem; font-size: 13px; font-weight: 700; color: var(--q-brand); margin-right: .4rem; } .qt-l svg { width: 16px; height: 16px; }
.qrt-tablebar .qb { height: 34px; font-size: 13px; } .qrt-tablebar .qb svg { width: 16px; height: 16px; }
.qrt-status { padding: .5rem 1rem; font-size: 13px; background: #eef2ff; color: #3730a3; display: flex; gap: 1rem; align-items: center; } .qrt-status[hidden] { display: none; } .qrt-status.err { background: #fee2e2; color: #991b1b; }
.qs-bar { flex: 1; height: 6px; background: rgba(79,70,229,.2); border-radius: 9px; overflow: hidden; } .qs-bar i { display: block; height: 100%; width: 0; background: #4f46e5; transition: width .15s; }
.qrt-wrap { position: relative; }
.qrt-mount .ProseMirror { min-height: 60vh; padding: 2rem 2.5rem 4rem; outline: none; font-size: 17px; line-height: 1.75; }
@media (max-width: 720px) { .qrt-mount .ProseMirror { padding: 1.25rem 1rem 3rem; } }
.qrt-content.rt { max-inline-size: none; hyphens: manual; }
.qrt-content.rt img { margin-inline: 0; }
.qrt-content p.is-editor-empty:first-child::before { content: attr(data-placeholder); color: #94a3b8; float: left; height: 0; pointer-events: none; }
.qrt-content .ProseMirror-selectednode { outline: 3px solid #6366f1; outline-offset: 3px; border-radius: 8px; }
.qrt-content figure { cursor: pointer; } .qrt-content iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 12px; display: block; }
.qrt-content video { width: 100%; }
.qrt-content .qvar { display: inline-block; background: #e0e7ff; color: #3730a3; border: 1px dashed #818cf8; border-radius: 7px; padding: 0 .4rem; font-size: .84em; font-family: ui-monospace, Menlo, monospace; line-height: 1.5; cursor: default; user-select: none; }
html.dark .qrt-content .qvar { background: rgba(99,102,241,.25); color: #c7d2fe; }
.qrt-content .rt-cta a { cursor: pointer; }
.qrt-content table { table-layout: fixed; width: 100%; border-collapse: collapse; margin: 1.2em 0; }
.qrt-content td, .qrt-content th { border: 1px solid var(--q-line); padding: .55em .8em; vertical-align: top; position: relative; min-width: 3em; }
.qrt-content th { background: var(--q-soft); font-weight: 700; text-align: start; }
.qrt-content .selectedCell::after { content: ''; position: absolute; inset: 0; background: rgba(99,102,241,.18); pointer-events: none; }
.qrt-content li > p { margin: 0; }
.qrt-content ul { list-style: disc; } .qrt-content ol { list-style: decimal; }
html.dark .qrt-content { --rt-fg: #e2e8f0; --rt-muted: #9aa8bf; --rt-link: #a5b4fc; --rt-border: #26314f; --rt-bg-soft: #1a2340; }
.qrt-html { display: block; width: 100%; min-height: 60vh; border: 0; padding: 1.5rem 2rem; font: 14px/1.6 ui-monospace, Menlo, monospace; background: var(--q-soft); color: var(--q-text); outline: none; resize: vertical; }
.qrt-html[hidden] { display: none; }
.qrt-foot { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 1rem; border-top: 1px solid var(--q-line); font-size: 13px; color: var(--q-mute); background: var(--q-soft); border-radius: 0 0 14px 14px; }
.qf-save.on::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #22c55e; margin-right: .4rem; }
.qrt-bubble { position: absolute; z-index: 15; display: flex; gap: 2px; padding: 4px; background: #0f172a; border-radius: 11px; box-shadow: 0 8px 24px rgba(2,6,23,.3); }
.qrt-bubble[hidden] { display: none; }
.qrt-bubble .qb { color: #e2e8f0; height: 34px; min-width: 34px; } .qrt-bubble .qb:hover { background: #1e293b; } .qrt-bubble .qb.is-on { background: #4f46e5; color: #fff; }
.qrt-bubble .qb-t .ql { display: inline !important; }
/* popovers */
.qp { position: absolute; z-index: 40; min-width: 250px; max-width: 360px; background: var(--q-card); border: 1px solid var(--q-line); border-radius: 14px; box-shadow: 0 16px 40px rgba(2,6,23,.18); padding: .75rem; }
.qp-t { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--q-mute); margin: .1rem .25rem .5rem; } .qp-t2 { margin-top: .8rem; }
.qp-s { font-size: 13px; color: var(--q-mute); margin: 0 .25rem .6rem; }
.qp-i { display: flex; align-items: center; justify-content: space-between; gap: .6rem; width: 100%; padding: .55rem .6rem; border-radius: 9px; font-size: 14.5px; text-align: left; color: var(--q-text); }
.qp-i:hover, .qp-i.on { background: var(--q-brand-soft); } .qp-i svg { width: 17px; height: 17px; } .qp-i code { font-size: 12px; color: var(--q-mute); }
.qsw { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-bottom: .5rem; } .sw { aspect-ratio: 1; border-radius: 8px; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); cursor: pointer; } .sw.on, .sw:hover { border-color: #4f46e5; }
.qgrid { display: grid; gap: 3px; padding: 0 .25rem; } .qgrid i { width: 22px; height: 22px; border: 1px solid #cbd5e1; border-radius: 4px; cursor: pointer; } .qgrid i.on { background: #c7d2fe; border-color: #6366f1; } .qgl { margin-top: .6rem; }
.qco svg { color: inherit; } .qco-info { color: #1d4ed8; } .qco-tip { color: #15803d; } .qco-warning { color: #b45309; } .qco-danger { color: #b91c1c; }
.qp-vars { width: 340px; } .qvl { max-height: 320px; overflow: auto; }
.qp-help { width: 380px; } .qhelp { font-size: 14px; line-height: 1.5; padding: 0 .3rem; display: grid; gap: .55rem; list-style: none; } .qhelp kbd { border: 1px solid var(--q-line); border-radius: 4px; padding: 0 4px; font-size: 12px; }
/* full screen */
.qrt.qrt-full { position: fixed; inset: 0; z-index: 45; border-radius: 0; display: flex; flex-direction: column; overflow: hidden; }
.qrt.qrt-full .qrt-toolbar { top: 0; border-radius: 0; position: relative; } .qrt.qrt-full .qrt-tablebar { position: relative; top: 0; }
.qrt.qrt-full .qrt-wrap { flex: 1; overflow: auto; } .qrt.qrt-full .qrt-mount .ProseMirror { max-width: 900px; margin: 0 auto; min-height: 100%; }
.qrt.qrt-full .qrt-foot { border-radius: 0; }
.qrt.qrt-src .qrt-mount { display: none; }

/* writing helper card */
.qwh h3 { font-family: Poppins, Inter, sans-serif; }
.qwh .row { display: flex; justify-content: space-between; font-size: 14px; padding: .3rem 0; }
.qwh .outline button { display: block; width: 100%; text-align: left; font-size: 14px; padding: .28rem .4rem; border-radius: 7px; color: var(--q-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .qwh .outline button:hover { background: var(--q-brand-soft); }
.qwh .warn { font-size: 13.5px; background: #fffbeb; color: #92400e; border-radius: 10px; padding: .55rem .7rem; display: flex; gap: .5rem; margin-top: .5rem; } html.dark .qwh .warn { background: rgba(245,158,11,.14); color: #fcd34d; }
.qwh .ok { font-size: 13.5px; color: #15803d; margin-top: .4rem; } .qwh .mute { color: var(--q-mute); font-size: 13.5px; }

/* ---------- dialogs ---------- */
.qd-ov { position: fixed; inset: 0; z-index: 52; background: rgba(15,23,42,.55); display: grid; place-items: center; padding: 1rem; overflow: auto; }
.qd { width: 520px; max-width: 100%; max-height: calc(100vh - 2rem); display: flex; flex-direction: column; background: var(--q-card); color: var(--q-text); border-radius: 18px; box-shadow: 0 24px 60px rgba(2,6,23,.4); font-size: 15px; }
.qd-wide { width: 780px; }
.qd-h { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--q-line); } .qd-h h3 { font-family: Poppins, Inter, sans-serif; font-weight: 600; font-size: 1.15rem; }
.qd-x { padding: .35rem; border-radius: 8px; color: var(--q-mute); } .qd-x:hover { background: var(--q-soft); }
.qd-b { padding: 1.25rem 1.4rem; overflow: auto; display: grid; gap: 1rem; align-content: start; }
.qd-f { display: flex; gap: .6rem; padding: 1rem 1.4rem; border-top: 1px solid var(--q-line); } .qd-f:empty { display: none; } .qd-sp { flex: 1; }
.qd-l { display: block; font-weight: 600; font-size: 14px; } .qd-l .req { color: #dc2626; font-size: 12px; margin-left: .3rem; } .qd-l2 { font-weight: 600; font-size: 14px; margin-bottom: .4rem; }
.qd-i { display: block; width: 100%; margin-top: .4rem; min-height: 46px; padding: .65rem .9rem; border: 1px solid #cbd5e1; border-radius: 11px; font-size: 16px; background: var(--q-card); color: var(--q-text); outline: none; font-weight: 400; }
.qd-i:focus { border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79,70,229,.15); } html.dark .qd-i { border-color: #26314f; background: #0d1426; }
.qd-c { display: flex; align-items: center; gap: .55rem; font-size: 15px; } .qd-c input { width: 18px; height: 18px; }
.qd-btn { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: 0 1.2rem; border-radius: 11px; border: 1px solid #cbd5e1; font-weight: 600; font-size: 15px; background: var(--q-card); color: var(--q-text); cursor: pointer; } html.dark .qd-btn { border-color: #26314f; }
.qd-btn:hover { background: var(--q-soft); } .qd-pri { background: #4338ca; border-color: #4338ca; color: #fff; } .qd-pri:hover { background: #3730a3; } .qd-danger { color: #b91c1c; border-color: #fecaca; }
.qd-tabs { display: flex; gap: .25rem; padding: 4px; background: var(--q-soft); border-radius: 12px; border: 1px solid var(--q-line); }
.qd-tabs button { flex: 1; min-height: 38px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--q-mute); } .qd-tabs button.on { background: var(--q-card); color: var(--q-brand); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.qd-seg { display: inline-flex; padding: 3px; border: 1px solid var(--q-line); border-radius: 11px; background: var(--q-soft); flex-wrap: wrap; } .qd-seg button { min-height: 38px; padding: 0 .9rem; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--q-mute); } .qd-seg button.on { background: var(--q-card); color: var(--q-brand); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.qd-2 { display: grid; gap: 1.2rem; grid-template-columns: 1.2fr 1fr; align-items: start; } @media (max-width: 680px) { .qd-2 { grid-template-columns: 1fr; } }
.qd-3 { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.qd-drop { display: grid; place-items: center; gap: .3rem; text-align: center; padding: 1.8rem 1rem; border: 2px dashed #cbd5e1; border-radius: 14px; cursor: pointer; margin-top: .75rem; } .qd-drop:hover, .qd-drop.on { border-color: #6366f1; background: var(--q-brand-soft); } .qd-drop svg { width: 30px; height: 30px; color: var(--q-mute); } .qd-drop small, .qd-muted { color: var(--q-mute); font-size: 13.5px; font-weight: 400; }
.qd-prev { min-height: 190px; border: 1px solid var(--q-line); border-radius: 14px; background: var(--q-soft); display: grid; place-items: center; overflow: hidden; } .qd-prev img { max-width: 100%; max-height: 260px; display: block; } .qd-prev span { display: grid; place-items: center; gap: .3rem; color: var(--q-mute); }
.qd-hint { display: flex; gap: .5rem; font-size: 13.5px; color: #3730a3; background: #eef2ff; border-radius: 10px; padding: .6rem .8rem; margin-top: -.4rem; } .qd-hint svg { width: 16px; height: 16px; flex: none; margin-top: 2px; } html.dark .qd-hint { background: rgba(99,102,241,.16); color: #c7d2fe; }
.qd-err { background: #fef2f2; color: #b91c1c; border-radius: 10px; padding: .6rem .8rem; font-size: 14px; } .qd-err[hidden] { display: none; }
.qd-bar { height: 8px; background: #e0e7ff; border-radius: 9px; overflow: hidden; margin-top: .6rem; } .qd-bar[hidden] { display: none; } .qd-bar i { display: block; height: 100%; width: 0; background: #4f46e5; transition: width .15s; }
.qd-or { text-align: center; color: var(--q-mute); font-size: 13px; }
.qd-pgr { max-height: 240px; overflow: auto; margin-top: .5rem; border: 1px solid var(--q-line); border-radius: 12px; } .qd-grp { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--q-mute); padding: .5rem .8rem .2rem; background: var(--q-soft); }
.qd-res { display: block; width: 100%; text-align: left; padding: .5rem .8rem; } .qd-res:hover { background: var(--q-brand-soft); } .qd-res small { display: block; color: var(--q-mute); font-size: 12.5px; } .qd-pgr .qd-muted { padding: .8rem; }
.qd-pv-miss { display: flex; gap: .6rem; padding: .8rem 1rem; background: #fffbeb; color: #92400e; border-radius: 12px; font-size: 14px; } .qd-pv-miss[hidden] { display: none; } .qd-pv-miss code { background: #fef3c7; padding: 0 .3rem; border-radius: 5px; }
.qd-pv { border: 1px solid var(--q-line); border-radius: 14px; padding: 1.5rem 1.75rem; max-height: 52vh; overflow: auto; background: #fff; color: #1f2937; } html.dark .qd-pv { background: #0d1426; color: #e2e8f0; --rt-fg: #e2e8f0; --rt-link: #a5b4fc; --rt-border: #26314f; --rt-bg-soft: #1a2340; }
.qd-pv mark.rt-missing, .rt mark.rt-missing { background: #fecaca; color: #991b1b; border-radius: 5px; padding: 0 .3rem; font-family: ui-monospace, monospace; font-size: .85em; outline: 1px dashed #ef4444; }
.qd-pv-sel { max-width: 420px; }
@media (max-width: 1099px) { .qbar h1 { font-size: 1.25rem; } }

/* ---------- staff form UX layer (formux.js) ---------- */
.qinvalid { border-color: #e11d48 !important; box-shadow: 0 0 0 3px rgba(225,29,72,.12) !important; }
.qerr { color: #be123c; font-size: 13px; margin-top: .35rem; }
html.dark .qerr { color: #fda4af; }
.qsum { margin: .5rem 0 0 1.1rem; list-style: disc; font-size: 13.5px; }
.qsum a { font-weight: 600; text-decoration: underline; }
.qcount { font-size: 12px; color: var(--q-mute); margin-top: .3rem; text-align: right; }
.qcount.near { color: #b45309; } .qcount.over { color: #be123c; font-weight: 700; }
.qspin { display: inline-block; width: 14px; height: 14px; margin-right: .45rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: qspin .7s linear infinite; vertical-align: -2px; }
@keyframes qspin { to { transform: rotate(360deg); } }
form.is-saving { cursor: progress; }
form.is-saving button[type=submit], form.is-saving .qsave { opacity: .65; pointer-events: none; }
form.is-saving .qbusy { opacity: 1; }
.qform .qbusy::after, form[data-qux] .qbusy::after { content: ""; width: 14px; height: 14px; margin-left: .45rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: qspin .7s linear infinite; }
.qdraft { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1.25rem; padding: .75rem 1rem; border: 1px solid #fde68a; background: #fffbeb; color: #92400e; border-radius: 12px; font-size: 14px; }
html.dark .qdraft { background: transparent; border-color: #78350f; color: #fcd34d; }
.qlink { text-decoration: underline; font-size: 14px; }
/* sticky save bar for simple forms */
.qsavebar { position: sticky; bottom: 0; z-index: 25; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 1.25rem -1rem 0; padding: .8rem 1rem; background: rgba(248,250,252,.94); backdrop-filter: blur(8px); border-top: 1px solid var(--q-line); }
html.dark .qsavebar { background: rgba(11,16,32,.92); }
.qsavebar .btn { min-height: 44px; }
.qsavebar .qhint { color: var(--q-mute); font-size: 13px; margin-left: auto; }
/* RTL-safe text inputs */
.inp[dir=rtl], .qform .inp[dir=rtl] { text-align: right; font-family: "Noto Naskh Arabic", "Segoe UI", Tahoma, sans-serif; line-height: 1.8; }
/* tablet / phone */
@media (max-width: 720px) {
  .qform .inp, form[data-qux] .inp { font-size: 16px; }
  .qsavebar .btn { flex: 1 1 auto; justify-content: center; }
  .qsavebar .qhint { display: none; }
}
@media (max-width: 1023px) { .qbar .btn span.hidden { display: none; } }
