/* Flakk Staff: Messages, Tools and AI panes (wave 3, agent D2). Phone first, light + dark, big touch targets, calm.
   Reads the shell's tokens (--bg, --surface, --ink, ...) and falls back to the Flakk guest app palette when a token is missing. */
.fm, .fm-modal {
  --f-bg-fb: #F2F6F8; --f-sf-fb: #FFFFFF; --f-sf2-fb: #EAF0F3; --f-ink-fb: #0E1824; --f-mut-fb: #4D5B68; --f-rule-fb: rgba(14, 24, 36, .14);
  --f-acc-fb: #0F2A47; --f-glow-fb: rgba(42, 127, 138, .4); --f-btn-fb: #0F2A47; --f-btnink-fb: #FFFFFF;
  --f-ok-fb: #17694A; --f-okbg-fb: #E2F3EA; --f-warn-fb: #7E520A; --f-warnbg-fb: #FBF0DA; --f-bad-fb: #9A3123; --f-badbg-fb: #F9E3DF; --f-info-fb: #245892; --f-infobg-fb: #E2ECF7;
  --f-shadow-fb: 0 1px 2px rgba(10, 29, 51, .06), 0 10px 30px -14px rgba(10, 29, 51, .25);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .fm, :root:not([data-theme="light"]) .fm-modal {
    --f-bg-fb: #0B141E; --f-sf-fb: #15202C; --f-sf2-fb: #1E2B39; --f-ink-fb: #EAF2F6; --f-mut-fb: #A9B7C3; --f-rule-fb: rgba(234, 242, 246, .14);
    --f-acc-fb: #F2A741; --f-btn-fb: #F2A741; --f-btnink-fb: #0A1D33;
    --f-ok-fb: #7FD3AA; --f-okbg-fb: rgba(31, 138, 91, .22); --f-warn-fb: #F2C46E; --f-warnbg-fb: rgba(201, 134, 18, .2); --f-bad-fb: #F2A196; --f-badbg-fb: rgba(194, 64, 47, .22); --f-info-fb: #9CC3EE; --f-infobg-fb: rgba(47, 111, 179, .24);
  }
}
:root[data-theme="dark"] .fm, :root[data-theme="dark"] .fm-modal {
  --f-bg-fb: #0B141E; --f-sf-fb: #15202C; --f-sf2-fb: #1E2B39; --f-ink-fb: #EAF2F6; --f-mut-fb: #A9B7C3; --f-rule-fb: rgba(234, 242, 246, .14);
  --f-acc-fb: #F2A741; --f-btn-fb: #F2A741; --f-btnink-fb: #0A1D33;
  --f-ok-fb: #7FD3AA; --f-okbg-fb: rgba(31, 138, 91, .22); --f-warn-fb: #F2C46E; --f-warnbg-fb: rgba(201, 134, 18, .2); --f-bad-fb: #F2A196; --f-badbg-fb: rgba(194, 64, 47, .22); --f-info-fb: #9CC3EE; --f-infobg-fb: rgba(47, 111, 179, .24);
}
.fm, .fm-modal {
  --f-bg: var(--ground, var(--bg, var(--f-bg-fb))); --f-sf: var(--surf, var(--surface, var(--f-sf-fb))); --f-sf2: var(--surf-2, var(--surface-2, var(--f-sf2-fb))); --f-ink: var(--ink, var(--f-ink-fb));
  --f-mut: var(--ink-mute, var(--muted, var(--f-mut-fb))); --f-rule: var(--rule, var(--f-rule-fb)); --f-line: var(--rule-strong, var(--rule, var(--f-rule-fb)));
  --f-acc: var(--btn, var(--accent-strong, var(--f-acc-fb))); --f-glow: var(--accent-glow, var(--f-glow-fb)); --f-btn: var(--btn, var(--f-btn-fb)); --f-btnink: var(--btn-ink, var(--f-btnink-fb));
  --f-ok: var(--ok-ink, var(--f-ok-fb)); --f-okbg: var(--ok-bg, var(--f-okbg-fb)); --f-warn: var(--warn-ink, var(--f-warn-fb)); --f-warnbg: var(--warn-bg, var(--f-warnbg-fb));
  --f-bad: var(--bad-ink, var(--f-bad-fb)); --f-badbg: var(--bad-bg, var(--f-badbg-fb)); --f-info: var(--info-ink, var(--f-info-fb)); --f-infobg: var(--info-bg, var(--f-infobg-fb));
  --f-amber: var(--amber, #F2A741); --f-navy: var(--navy, #0F2A47); --f-shadow: var(--shadow, var(--f-shadow-fb)); --f-focus: var(--focus, 0 0 0 3px rgba(242, 167, 65, .55));
  --f-r: 18px; --f-navh: var(--tab-h, var(--nav-h, 62px)); --f-toph: calc(var(--top-h, 56px) + env(safe-area-inset-top, 0px));
  color: var(--f-ink); font-family: var(--ui, var(--font, system-ui, -apple-system, 'Segoe UI', sans-serif));
}
.fm { display: block; min-width: 0; max-width: 100%; }
.fm *, .fm-modal * { box-sizing: border-box; }
.fm .sr, .fm-modal .sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fm-ic { width: 22px; height: 22px; flex: none; display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fm-ic.sm { width: 18px; height: 18px; }
.fm :focus-visible, .fm-modal :focus-visible { outline: 3px solid var(--f-amber); outline-offset: 2px; border-radius: 10px; }
.fm button, .fm input, .fm textarea, .fm select, .fm-modal button, .fm-modal input, .fm-modal textarea, .fm-modal select { font: inherit; color: inherit; }
.fm p { margin: 0; }
.fm-p { margin: 6px 0 12px !important; line-height: 1.5; }
.fm-mute { color: var(--f-mut); font-size: 14px; }
.fm-bad { color: var(--f-bad); font-size: 14px; display: block; }
.fm-wrap { display: block; min-width: 0; }
.fm-view { min-width: 0; }

/* status bar: offline chip + waiting pill */
.fm-bar { display: none; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.fm-bar.on { display: flex; }
.fm-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; min-height: 28px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--f-sf2); color: var(--f-ink); white-space: nowrap; border: 0; max-width: 100%; }
.fm-chip.ok { background: var(--f-okbg); color: var(--f-ok); } .fm-chip.warn { background: var(--f-warnbg); color: var(--f-warn); }
.fm-chip.info { background: var(--f-infobg); color: var(--f-info); } .fm-chip.bad { background: var(--f-badbg); color: var(--f-bad); }
.fm-chip.mute { background: transparent; border: 1px solid var(--f-rule); color: var(--f-mut); font-weight: 500; white-space: normal; text-align: left; }
button.fm-chip { cursor: pointer; min-height: 40px; padding: 0 14px; }
.fm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }

/* headers */
.fm-head { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; min-height: 48px; }
.fm-h { font-size: 22px; line-height: 1.2; letter-spacing: -.01em; margin: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 700; }
.fm h3 { font-size: 17px; line-height: 1.3; margin: 0 0 8px; font-weight: 700; }
.fm h4 { margin: 0; font-size: 15px; }
.fm-modal h3 { margin: 0 0 8px; font-size: 19px; line-height: 1.25; }
.fm-h3i { display: flex; align-items: center; gap: 8px; }
.fm-sec { margin-top: 22px; }

/* buttons */
.fm-btn { min-height: 48px; padding: 0 18px; border-radius: 14px; border: 1.5px solid var(--f-line); background: var(--f-sf); color: var(--f-ink); font-weight: 600; font-size: 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; line-height: 1.2; text-align: center; max-width: 100%; touch-action: manipulation; }
.fm-btn span { min-width: 0; overflow-wrap: anywhere; }
.fm-btn.pri { background: var(--f-btn); color: var(--f-btnink); border-color: transparent; }
.fm-btn.danger { background: #C2402F; color: #fff; border-color: transparent; }
.fm-btn.sec { background: var(--f-sf); }
.fm-btn.block { display: flex; width: 100%; }
.fm-btn.big { min-height: 56px; font-size: 17px; }
.fm-btn.sm { min-height: 44px; padding: 0 14px; font-size: 15px; }
.fm-btn:disabled, .fm-btn.dis { opacity: .5; cursor: default; pointer-events: none; }
.fm-btn.busy { opacity: .7; }
.fm-btn + .fm-btn.block, .fm-btn.block + .fm-btn.block { margin-top: 10px; }
.fm-ib { width: 48px; height: 48px; padding: 0; border-radius: 14px; border: 1.5px solid var(--f-line); background: var(--f-sf); color: var(--f-ink); display: inline-grid; place-items: center; cursor: pointer; flex: none; touch-action: manipulation; }
.fm-ib.sm { width: 44px; height: 44px; border-radius: 12px; }
.fm-ib.plain { border-color: transparent; background: transparent; }
.fm-ib.sec { background: var(--f-sf); }
.fm-ib.send { border: 0; border-radius: 50%; background: var(--f-amber); color: #2A1A04; width: 48px; height: 48px; }
.fm-ib:disabled { opacity: .5; }
.fm-row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.fm-row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.fm-row3 .fm-btn { padding: 0 6px; font-size: 14.5px; gap: 5px; }
@media (max-width: 359px) { .fm-row3 { grid-template-columns: 1fr; } .fm-row2 { grid-template-columns: 1fr; } }

/* forms */
.fm-field { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; min-width: 0; }
.fm-field > label, .fm-lbl { font-weight: 600; font-size: 15px; }
.fm-hint { color: var(--f-mut); font-size: 13.5px; line-height: 1.4; }
.fm input:not([type=checkbox]):not([type=file]), .fm textarea, .fm select, .fm-modal input:not([type=checkbox]), .fm-modal textarea, .fm-modal select {
  width: 100%; min-width: 0; border: 1.5px solid var(--f-line); border-radius: 14px; background: var(--f-sf); padding: 12px 14px; min-height: 48px; font-size: 16px; line-height: 1.35; }
.fm textarea, .fm-modal textarea { resize: vertical; min-height: 96px; }
.fm input:focus, .fm textarea:focus, .fm select:focus, .fm-modal input:focus, .fm-modal textarea:focus { outline: none; border-color: var(--f-amber); box-shadow: var(--f-focus); }
.fm-sel { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; padding-right: 38px !important; text-overflow: ellipsis; }
.fm-sel.sm { min-height: 44px !important; padding-top: 8px !important; padding-bottom: 8px !important; }
.fm-ferr { margin: 12px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--f-badbg); color: var(--f-bad); font-size: 14.5px; font-weight: 500; }
.fm-ferr[hidden] { display: none; }
.fm-err { padding: 14px; border-radius: 16px; background: var(--f-badbg); color: var(--f-bad); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.fm-note { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--f-mut); margin: 8px 0; line-height: 1.4; }
.fm-note .fm-ic { margin-top: 1px; }
.fm-note.ok { color: var(--f-ok); }
.fm-empty { padding: 20px 16px; text-align: center; color: var(--f-mut); border: 1.5px dashed var(--f-rule); border-radius: 16px; display: flex; flex-direction: column; gap: 8px; align-items: center; margin-top: 8px; }
.fm-skel { display: grid; gap: 10px; margin-top: 8px; }
.fm-skel i { display: block; height: 56px; border-radius: 14px; background: var(--f-sf2); }
.fm-skel i:nth-child(2) { width: 82%; } .fm-skel i:nth-child(3) { width: 64%; }

/* segmented controls and badges */
.fm-seg { display: flex; gap: 4px; padding: 4px; background: var(--f-sf2); border-radius: 16px; margin: 0 0 14px; }
.fm-segb { flex: 1 1 auto; min-width: 0; min-height: 44px; border: 0; background: transparent; border-radius: 12px; font-weight: 600; font-size: 14.5px; color: var(--f-mut); display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; padding: 0 6px; }
.fm-segb span { min-width: 0; white-space: normal; text-align: center; line-height: 1.15; overflow-wrap: anywhere; }
.fm-segb[aria-selected="true"], .fm-segb[aria-pressed="true"] { background: var(--f-sf); color: var(--f-ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.fm-seg2 { margin-top: 4px; }
.fm-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #C2402F; color: #fff; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; line-height: 1; }
.fm-badge.pos { position: absolute; top: 8px; right: 8px; }

/* lists and rows */
.fm-list { display: flex; flex-direction: column; gap: 8px; }
.fm-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--f-sf); border: 1px solid var(--f-rule); min-height: 60px; width: 100%; text-align: left; cursor: pointer; color: var(--f-ink); position: relative; }
.fm-row.static { cursor: default; }
.fm-row.unread { border-color: var(--f-acc); box-shadow: inset 4px 0 0 var(--f-acc); }
.fm-row .grow, .fm-qi .grow { flex: 1; min-width: 0; }
.fm-row .grow b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.fm-row .grow > span { display: block; font-size: 14px; color: var(--f-mut); overflow-wrap: anywhere; }
.fm-row .grow > .fm-prev { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fm-rico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--f-acc) 16%, var(--f-sf)); color: var(--f-acc); }
.fm-dot { width: 10px; height: 10px; border-radius: 50%; background: #C2402F; flex: none; }
.fm-chev { color: var(--f-mut); }
.fm-card { background: var(--f-sf); border: 1px solid var(--f-rule); border-radius: var(--f-r); padding: 16px; box-shadow: var(--f-shadow); margin-top: 14px; }
.fm-card h3 { display: flex; align-items: center; gap: 8px; }
.fm-cards { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.fm-card2 { background: var(--f-sf); border: 1px solid var(--f-rule); border-radius: 16px; padding: 14px; min-width: 0; }
.fm-card2.urg { border-color: var(--f-bad); box-shadow: inset 4px 0 0 var(--f-bad); }
.fm-card2 p { margin-top: 4px; overflow-wrap: anywhere; }
.fm-c2h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.fm-c2h b { min-width: 0; overflow-wrap: anywhere; }
.fm-c2f { margin-top: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fm-c2f .fm-lbl { font-size: 14px; color: var(--f-mut); font-weight: 500; }
.fm-c2f .fm-sel { flex: 1 1 140px; width: auto; }

/* compose: recipient choice, anonymous switch */
.fm-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fm-choice:has(.fm-chb:only-child) { grid-template-columns: 1fr; }
.fm-chb { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; min-height: 96px; border-radius: 16px; border: 2px solid var(--f-rule); background: var(--f-sf); text-align: left; cursor: pointer; color: var(--f-ink); }
.fm-chb small { color: var(--f-mut); font-size: 13px; line-height: 1.3; }
.fm-chb[aria-checked="true"] { border-color: var(--f-acc); background: color-mix(in srgb, var(--f-acc) 12%, var(--f-sf)); box-shadow: 0 0 0 3px var(--f-glow); }
.fm-chb .fm-ic { color: var(--f-acc); }
.fm-anon { margin-top: 18px; padding: 14px; border-radius: 16px; background: var(--f-sf2); }
.fm-swrow { display: flex; align-items: center; gap: 14px; min-height: 56px; }
.fm-swrow label { flex: 1; min-height: 48px; display: flex; align-items: center; cursor: pointer; }
.fm-switch { appearance: none; -webkit-appearance: none; width: 56px !important; height: 32px !important; min-height: 32px !important; padding: 0 !important; border-radius: 16px !important; background: var(--f-rule) !important; border: 0 !important; position: relative; flex: none; margin: 0; cursor: pointer; transition: background .2s; }
.fm-switch::before { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); transition: transform .2s; }
.fm-switch:checked { background: var(--f-acc) !important; }
.fm-switch:checked::before { transform: translateX(24px); }
.fm-switch:disabled { opacity: .45; cursor: default; }
.fm-anon-ex { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--f-sf); border: 1px solid var(--f-rule); }
.fm-anon-ex[hidden] { display: none; }
.fm-anon-ex h4 { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.fm-anon-ex ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; line-height: 1.4; }

/* thread */
.fm-msgs { list-style: none; margin: 8px 0 12px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.fm-bub { max-width: 88%; padding: 10px 14px; border-radius: 18px; line-height: 1.45; overflow-wrap: anywhere; }
.fm-bub p { white-space: pre-wrap; }
.fm-bub.me { align-self: flex-end; background: var(--f-btn); color: var(--f-btnink); border-bottom-right-radius: 6px; }
.fm-bub.them { align-self: flex-start; background: var(--f-sf); border: 1px solid var(--f-rule); border-bottom-left-radius: 6px; }
.fm-bub.wait { opacity: .75; border: 1.5px dashed currentColor; }
.fm-bt { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; opacity: .8; margin-bottom: 2px; }
.fm-comp { display: flex; gap: 8px; align-items: flex-end; position: sticky; bottom: calc(var(--f-navh) + env(safe-area-inset-bottom, 0px) + 8px); background: var(--f-bg); padding: 8px 0; z-index: 5; }
.fm-comp textarea { flex: 1; min-height: 48px !important; max-height: 140px; resize: none; border-radius: 24px !important; padding: 12px 16px !important; }
body.kbup .fm-comp, body.kbup .fm-sticky-a, html.fm-kbv .fm-comp, html.fm-kbv .fm-sticky-a { bottom: calc(max(var(--kb, 0px), var(--fm-kb, 0px)) + 6px); }
.fm-foot { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.fm-foot .fm-btn { flex: 1 1 160px; }
.fm-notes, .fm-news { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.fm-nt { padding: 12px 14px; background: var(--f-sf); border: 1px solid var(--f-rule); border-radius: 14px; }
.fm-nt p { white-space: pre-wrap; overflow-wrap: anywhere; }
.fm-nt small, .fm-annf small { color: var(--f-mut); }
.fm-ann { padding: 14px; background: var(--f-sf); border: 1px solid var(--f-rule); border-radius: 16px; }
.fm-ann.unread { border-color: var(--f-acc); box-shadow: inset 4px 0 0 var(--f-acc); }
.fm-annh { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.fm-annh time { color: var(--f-mut); margin-left: auto; font-size: 13px; }
.fm-ann p { margin: 8px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.fm-annf { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.fm-pick { gap: 8px; }
.fm-pickb { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--f-rule); background: var(--f-sf); font-weight: 600; font-size: 14.5px; cursor: pointer; color: var(--f-mut); }
.fm-pickb[aria-pressed="true"] { background: var(--f-acc); border-color: var(--f-acc); color: var(--f-btnink); }

/* modals (appended to <body>) */
.fm-modal { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center; }
.fm-scrim { position: absolute; inset: 0; background: rgba(5, 10, 16, .55); }
.fm-sheet { position: relative; width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; overflow: auto; overscroll-behavior: contain; background: var(--f-bg); border-radius: 24px 24px 0 0; box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, .45); animation: fm-up .24s cubic-bezier(.2, .8, .2, 1); }
.fm-sheet-b { padding: 20px 18px calc(22px + env(safe-area-inset-bottom, 0px)); }
.fm-modal .fm-sheet { padding-bottom: max(var(--kb, 0px), var(--fm-kb, 0px)); }
@media (min-width: 720px) { .fm-modal { align-items: center; } .fm-sheet { border-radius: 24px; } }
@keyframes fm-up { from { transform: translateY(32px); opacity: .5; } to { transform: none; opacity: 1; } }
html.fm-modal-open { overflow: hidden; }
.fm-keybox { text-align: center; }
.fm-bigic { width: 56px; height: 56px; border-radius: 18px; display: inline-grid; place-items: center; background: color-mix(in srgb, var(--f-acc) 16%, var(--f-sf)); color: var(--f-acc); margin-bottom: 8px; }
.fm-key { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 20px; letter-spacing: .04em; line-height: 1.5; word-break: break-all; padding: 14px; margin: 12px 0; border-radius: 14px; background: var(--f-sf2); border: 1.5px dashed var(--f-acc); user-select: all; -webkit-user-select: all; }
.fm-keybox .fm-note { text-align: left; }
.fm-ql { list-style: none; margin: 8px 0 14px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.fm-qi { padding: 12px 14px; border-radius: 14px; background: var(--f-sf); border: 1px solid var(--f-rule); display: flex; flex-direction: column; gap: 8px; }
.fm-qi span { display: block; font-size: 14px; color: var(--f-mut); overflow-wrap: anywhere; }
.fm-qi .fm-bad { color: var(--f-bad); }
.fm-qa { display: flex; gap: 8px; flex-wrap: wrap; }
.fm-qa .fm-btn { flex: 1 1 100px; }

/* tools grid */
.fm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.fm-tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-height: 120px; padding: 14px; border-radius: 16px; border: 1px solid var(--f-rule); background: var(--f-sf); cursor: pointer; text-align: left; box-shadow: var(--f-shadow); width: 100%; color: var(--f-ink); min-width: 0; }
.fm-tile b { font-size: 16px; line-height: 1.2; overflow-wrap: anywhere; }
.fm-tile small { color: var(--f-mut); font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
.fm-tic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: color-mix(in srgb, var(--f-acc) 16%, var(--f-sf)); color: var(--f-acc); }

/* checklist */
.fm-prog-w { position: sticky; top: var(--f-toph); z-index: 6; background: var(--f-bg); padding: 8px 0 10px; display: flex; align-items: center; gap: 12px; }
.fm-prog { flex: 1; height: 14px; border-radius: 7px; background: var(--f-sf2); overflow: hidden; border: 1px solid var(--f-rule); }
.fm-prog i { display: block; height: 100%; background: var(--f-acc); border-radius: 7px; transition: width .25s; }
.fm-prog.full i { background: var(--f-ok); }
.fm-prog-t { font-size: 14px; white-space: nowrap; }
.fm-chk { position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 14px; min-height: 60px; background: var(--f-sf); border: 1px solid var(--f-rule); border-radius: 14px; cursor: pointer; }
.fm-chk input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fm-box { width: 30px; height: 30px; flex: none; border-radius: 9px; border: 2px solid var(--f-mut); display: grid; place-items: center; color: var(--f-btnink); }
.fm-box .fm-ic { opacity: 0; width: 18px; height: 18px; stroke-width: 2.6; }
.fm-chk input:checked + .fm-box { background: var(--f-acc); border-color: var(--f-acc); }
.fm-chk input:checked + .fm-box .fm-ic { opacity: 1; }
.fm-chk input:checked ~ .fm-lblt { color: var(--f-mut); }
.fm-chk input:focus-visible + .fm-box { outline: 3px solid var(--f-amber); outline-offset: 2px; }
.fm-lblt { min-width: 0; overflow-wrap: anywhere; line-height: 1.35; }
.fm-sticky-a { position: sticky; bottom: calc(var(--f-navh) + env(safe-area-inset-bottom, 0px) + 8px); z-index: 5; background: linear-gradient(to top, var(--f-bg) 78%, transparent); padding: 14px 0 6px; margin-top: 8px; }
.fm-total { text-align: center; font-weight: 600; margin: 0 0 8px; }

/* supplies */
.fm-sup { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fm-supi { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; min-height: 60px; background: var(--f-sf); border: 1px solid var(--f-rule); border-radius: 14px; }
.fm-supi.on { border-color: var(--f-acc); background: color-mix(in srgb, var(--f-acc) 9%, var(--f-sf)); }
.fm-supi .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.fm-step { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.fm-qty { min-width: 34px; text-align: center; font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.fm-qrow { display: flex; }

/* shifts */
.fm-weeknav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0 12px; }
.fm-wk { flex: 1; text-align: center; font-size: 16px; }
.fm-days { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fm-dayr { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; padding: 10px 12px; background: var(--f-sf); border: 1px solid var(--f-rule); border-radius: 14px; align-items: start; }
.fm-dayr.today { border-color: var(--f-acc); box-shadow: inset 4px 0 0 var(--f-acc); }
.fm-dh { display: flex; flex-direction: column; font-size: 13px; color: var(--f-mut); }
.fm-dh b { font-size: 16px; color: var(--f-ink); text-transform: capitalize; }
.fm-dc { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fm-sh { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.fm-sh b { font-variant-numeric: tabular-nums; }
.fm-sh span { color: var(--f-mut); font-size: 14px; overflow-wrap: anywhere; }
.fm-sh.now b { color: var(--f-ok); }

/* time on task */
.fm-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 8px 0 14px; }
.fm-stat { background: var(--f-sf); border: 1px solid var(--f-rule); border-radius: 14px; padding: 12px 8px; text-align: center; min-width: 0; }
.fm-stat b { display: block; font-size: 20px; line-height: 1.2; overflow-wrap: anywhere; }
.fm-stat span { font-size: 12.5px; color: var(--f-mut); display: block; line-height: 1.25; }
.fm-mins { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fm-mins.run { color: var(--f-info); }

/* incident */
.fm-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fm-typ { display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-height: 56px; border-radius: 14px; border: 2px solid var(--f-rule); background: var(--f-sf); cursor: pointer; text-align: left; font-weight: 600; font-size: 15px; color: var(--f-ink); min-width: 0; }
.fm-typ span { min-width: 0; overflow-wrap: anywhere; line-height: 1.2; }
.fm-typ .fm-ic { color: var(--f-acc); }
.fm-typ.urg .fm-ic { color: var(--f-bad); }
.fm-typ[aria-checked="true"] { border-color: var(--f-acc); background: color-mix(in srgb, var(--f-acc) 12%, var(--f-sf)); }
.fm-typ.urg[aria-checked="true"] { border-color: var(--f-bad); background: var(--f-badbg); }
.fm-urgent { display: flex; gap: 12px; align-items: flex-start; margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--f-badbg); color: var(--f-bad); }
.fm-urgent[hidden] { display: none; }
.fm-urgent p { font-size: 14.5px; line-height: 1.4; margin-top: 2px; }
.fm-done { text-align: center; padding: 24px 8px; }
.fm-done > .fm-ic { width: 44px; height: 44px; padding: 10px; border-radius: 50%; background: var(--f-okbg); color: var(--f-ok); margin: 0 auto 10px; box-sizing: content-box; }
.fm-done p { margin: 6px 0 16px; color: var(--f-mut); }

/* photos */
.fm-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.fm-th { position: relative; width: 96px; height: 96px; margin: 0; border-radius: 12px; overflow: hidden; background: var(--f-sf2); border: 1px solid var(--f-rule); }
.fm-th img, .fm-ph { width: 100%; height: 100%; object-fit: cover; display: block; }
.fm-thx { position: absolute; top: 2px; right: 2px; background: rgba(0, 0, 0, .6) !important; color: #fff !important; border: 0 !important; width: 44px !important; height: 44px !important; border-radius: 50% !important; }
.fm-thx .fm-ic { width: 18px; height: 18px; }
.fm-photo-btns { margin-top: 6px; }
label.fm-btn { cursor: pointer; }
label.fm-btn.dis { opacity: .5; pointer-events: none; }
.fm-file:focus-visible + label { outline: 3px solid var(--f-amber); }

/* language helper + manuals */
.fm-out { margin-top: 14px; padding: 14px; border-radius: 14px; background: var(--f-sf2); }
.fm-out[hidden] { display: none; }
.fm-outt { font-size: 18px; line-height: 1.45; margin: 8px 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.fm-memhead { display: flex; align-items: center; gap: 8px; margin: 14px 0 4px; color: var(--f-mut); }
.fm-mark { border-radius: 50%; flex: none; }
.fm-det { margin-top: 8px; } .fm-det summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; } .fm-det p { white-space: pre-wrap; line-height: 1.5; }
.fm-serial { margin-top: 8px; font-size: 14px; color: var(--f-mut); } .fm-serial code { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--f-ink); overflow-wrap: anywhere; }

/* AI */
.fm-ai-h { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.fm-ai-h .grow { flex: 1; min-width: 0; } .fm-ai-h p { color: var(--f-mut); font-size: 14.5px; }
.fm-ptr { width: 56px; height: 56px; flex: none; display: block; border-radius: 50%; overflow: hidden; }
.fm-ptr > *, .fm-ptr img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; display: block; }
.fm-initial { display: inline-grid; place-items: center; border-radius: 50%; background: var(--f-navy); color: var(--f-amber); font-weight: 700; font-size: 22px; }
.fm-sugg { display: flex; flex-wrap: wrap; gap: 8px; }
.fm-sugb { min-height: 44px; padding: 8px 16px; border-radius: 22px; border: 1.5px solid var(--f-rule); background: var(--f-sf); font-size: 15px; font-weight: 600; cursor: pointer; color: var(--f-ink); text-align: left; max-width: 100%; overflow-wrap: anywhere; line-height: 1.25; }
.fm-sugb:active { background: var(--f-sf2); }
.fm-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.fm-hello { padding: 14px; border-radius: 16px; background: var(--f-sf); border: 1px solid var(--f-rule); color: var(--f-mut); line-height: 1.45; }
.fm-q { align-self: flex-end; max-width: 88%; margin-left: auto; padding: 10px 14px; border-radius: 18px 18px 6px 18px; background: var(--f-btn); color: var(--f-btnink); overflow-wrap: anywhere; width: fit-content; }
.fm-a { margin-top: 8px; padding: 14px; border-radius: 6px 18px 18px 18px; background: var(--f-sf); border: 1px solid var(--f-rule); overflow-wrap: anywhere; }
.fm-at { line-height: 1.5; white-space: pre-wrap; }
.fm-ah { margin: 12px 0 4px !important; color: var(--f-mut); font-size: 13.5px !important; text-transform: uppercase; letter-spacing: .04em; }
.fm-alist { margin: 10px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
ul.fm-alist { list-style: disc; } .fm-alist li::marker { color: var(--f-acc); font-weight: 700; }
.fm-it { display: flex; flex-direction: column; gap: 3px; min-width: 0; } .fm-it > span { color: var(--f-mut); font-size: 14px; } .fm-it .fm-chips { margin: 2px 0 0; }
.fm-facts { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.fm-facts li { display: flex; gap: 10px; justify-content: space-between; align-items: baseline; padding: 8px 10px; background: var(--f-sf2); border-radius: 10px; font-size: 14.5px; }
.fm-facts li span { color: var(--f-mut); min-width: 0; } .fm-facts li b { text-align: right; min-width: 0; overflow-wrap: anywhere; }
.fm-src { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.fm-srcl { font-size: 12.5px; color: var(--f-mut); }
.fm-fl { margin-top: 12px; } .fm-bring { display: flex; align-items: center; gap: 6px; margin-top: 8px !important; color: var(--f-mut); }
.fm-wait { display: flex; align-items: center; gap: 10px; color: var(--f-mut); }
.fm-typing { display: inline-flex; gap: 4px; flex: none; } .fm-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--f-mut); animation: fm-blink 1.2s infinite; } .fm-typing i:nth-child(2) { animation-delay: .2s; } .fm-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes fm-blink { 50% { opacity: .2; } }
.fm-aerr { color: var(--f-bad); margin-bottom: 8px; }
.fm-comp.ai { margin-top: 14px; }
.fm-foot-l { font-size: 12.5px; color: var(--f-mut); margin-top: 4px; line-height: 1.4; }
.fm-draft { list-style: none; background: var(--f-sf); border: 1px solid var(--f-rule); border-radius: 16px; padding: 14px; }
.fm-draft.approved_not_sent { border-color: var(--f-ok); } .fm-draft.rejected { opacity: .65; }
.fm-gq { margin: 8px 0; padding: 8px 12px; border-left: 4px solid var(--f-rule); color: var(--f-mut); font-size: 14.5px; overflow-wrap: anywhere; } .fm-gq small { display: block; margin-bottom: 2px; }
.fm-dtext { margin: 8px 0; line-height: 1.5; white-space: pre-wrap; font-size: 16.5px; overflow-wrap: anywhere; }
.fm-dedit { margin-top: 8px; }
.fm-den { margin: 6px 0; padding: 8px 12px; background: var(--f-sf2); border-radius: 10px; font-size: 14.5px; } .fm-den small { display: block; color: var(--f-mut); }
.fm-draft .fm-btn.sm.block { margin-top: 8px; }

@media (min-width: 720px) { .fm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .fm-types { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .fm-typing i { animation: none; opacity: .6; } .fm-sheet { animation: none; } }

/* the shell switches text selection off outside typing fields; what staff copy or read out remains selectable */
.fm .fm-outt, .fm .fm-dtext, .fm .fm-den, .fm .fm-gq, .fm .fm-at, .fm .fm-bub p, .fm .fm-nt p, .fm .fm-ann p, .fm .fm-card2 p, .fm .fm-det p, .fm-modal .fm-key, .fm .fm-alist, .fm .fm-facts { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }

.fm-facts li.long { flex-direction: column; align-items: flex-start; gap: 2px; }
.fm-facts li.long b { text-align: left; font-weight: 500; }
.fm-facts li span { flex: 0 1 auto; }
.fm-facts li b { flex: 1 1 auto; }

.fm-it > span.fm-ln { color: var(--f-ink); font-size: 15px; line-height: 1.4; }

[dir="rtl"] .fm-ic.fm-flip { transform: scaleX(-1); }

/* G3 (05.11.2026, owner meeting #8 + #5): the cancellation / refund request, the owner's "Waiting for your yes" card, hotel knowledge */
.fm-yes { margin: 0 0 16px; padding: 14px; border-radius: 18px; border: 2px solid var(--f-amber); background: color-mix(in srgb, var(--f-amber) 9%, var(--f-sf)); box-shadow: var(--f-shadow); min-width: 0; }
.fm-yes-h { display: flex; align-items: center; gap: 12px; }
.fm-yes-h .grow { flex: 1; min-width: 0; }
.fm-yes-h h3 { margin: 0; overflow-wrap: anywhere; }
.fm-yes-l { list-style: none; margin: 12px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fm-yes-l li { padding: 10px 12px; border-radius: 12px; background: var(--f-sf); border: 1px solid var(--f-rule); min-width: 0; }
.fm-yes-l b { display: block; overflow-wrap: anywhere; line-height: 1.3; }
.fm-yes-l span { display: block; font-size: 14px; color: var(--f-mut); overflow-wrap: anywhere; line-height: 1.35; margin-top: 2px; }
.fm-pol h3 span { min-width: 0; overflow-wrap: anywhere; }
.fm-policy { margin: 6px 0 8px; padding: 12px 14px; border-left: 4px solid var(--f-acc); border-radius: 0 12px 12px 0; background: var(--f-sf2); color: var(--f-ink); font-size: 16px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
[dir="rtl"] .fm-policy { border-left: 0; border-right: 4px solid var(--f-acc); border-radius: 12px 0 0 12px; }
.fm-never, .fm-record { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; padding: 12px 14px; border-radius: 14px; font-weight: 600; font-size: 15px; line-height: 1.4; }
.fm-never { background: var(--f-warnbg); color: var(--f-warn); }
.fm-record { background: var(--f-infobg); color: var(--f-info); }
.fm-never .fm-ic, .fm-record .fm-ic { margin-top: 1px; }
.fm-never span, .fm-record span { min-width: 0; overflow-wrap: anywhere; }
.fm-card2.wait { border-color: var(--f-amber); box-shadow: inset 4px 0 0 var(--f-amber); }
.fm-dec { display: flex; gap: 8px; align-items: center; margin-top: 8px !important; font-weight: 600; }
.fm-dec span { min-width: 0; overflow-wrap: anywhere; }
.fm-dec.ok { color: var(--f-ok); } .fm-dec.no { color: var(--f-bad); }
.fm-c2f .fm-btn.block { flex: 1 1 100%; }
.fm-kq { display: block; font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.fm-ka { font-size: 16px; line-height: 1.45; margin-top: 6px !important; }
.fm-kmeta { display: flex; align-items: center; gap: 8px; margin-top: 10px !important; font-size: 13.5px; color: var(--f-mut); line-height: 1.35; }
.fm-kmeta .fm-mark { flex: none; }
.fm-kmeta span { min-width: 0; overflow-wrap: anywhere; }
.fm-ksearch { margin-top: 14px; }
.fm-ksearch input[type=search] { -webkit-appearance: none; appearance: none; }
.fm-cnt { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--f-sf); color: var(--f-mut); font-size: 12.5px; font-weight: 700; display: inline-grid; place-items: center; line-height: 1; border: 1px solid var(--f-rule); flex: none; }
.fm-askown { margin-top: 10px; }
.fm .fm-kq, .fm .fm-ka, .fm .fm-yes-l { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
