/* fileShareModal (Signal). Namespaced .fsm-host; CSS custom props set in JS (tokens). Inert when closed. */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

.fsm-host { font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.fsm-host * { box-sizing: border-box; }
.fsm-overlay { position: fixed; inset: 0; z-index: 4000; display: flex; align-items: center; justify-content: center;
    padding: 28px; background: rgba(15,18,40,.46); -webkit-font-smoothing: antialiased; animation: fsm-fade .14s var(--ease); }
@keyframes fsm-fade { from { opacity: 0; } }
.fsm-card { width: 560px; max-width: 100%; max-height: calc(100vh - 40px); display: flex; flex-direction: column;
    background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 18px;
    box-shadow: 0 30px 80px rgba(10,12,40,.4); overflow: hidden; animation: fsm-pop .18s var(--ease); }
@keyframes fsm-pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }

/* header */
.fsm-head { display: flex; align-items: center; gap: 13px; padding: 17px 20px; border-bottom: 1px solid var(--border); }
.fsm-head-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-50); color: var(--brand-600); display: flex; align-items: center; justify-content: center; flex: none; }
.fsm-head-tx { flex: 1; min-width: 0; }
.fsm-head-title { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.fsm-head-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.fsm-x { cursor: pointer; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); display: flex; align-items: center; justify-content: center; flex: none; transition: background .14s; }
.fsm-x:hover { background: var(--surface-2); color: var(--text); }

/* body */
.fsm-body { flex: 1; min-height: 0; overflow: auto; padding: 18px 20px 4px; position: relative; }
.fsm-body::-webkit-scrollbar { width: 9px; }
.fsm-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }

.fsm-file { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border: 1px solid var(--border); background: var(--surface-2); border-radius: 12px; margin-bottom: 16px; }
.fsm-file-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--bad-bg); color: var(--bad-fg); display: flex; align-items: center; justify-content: center; flex: none; }
.fsm-file-tx { flex: 1; min-width: 0; }
.fsm-file-name { font: 600 13px 'IBM Plex Mono'; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsm-file-meta { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* tabs */
.fsm-tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.fsm-tab { cursor: pointer; border: none; background: transparent; padding: 0 2px 11px; display: inline-flex; align-items: center; gap: 7px;
    font: 700 13px 'Plus Jakarta Sans'; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--muted); }
.fsm-tab-badge { font: 700 9.5px 'IBM Plex Mono'; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); border-radius: 99px; padding: 1px 7px; }

.fsm-lbl-row { font-size: 13px; font-weight: 700; margin-bottom: 8px; }

/* picker */
.fsm-pick { position: relative; }
.fsm-pick-in { position: relative; display: flex; align-items: center; }
.fsm-pick-ic { position: absolute; left: 12px; color: var(--faint); pointer-events: none; }
.fsm-in { width: 100%; height: 42px; border: 1px solid var(--border); background: var(--surface); border-radius: 11px; padding: 0 14px; font: 600 13.5px 'Plus Jakarta Sans'; color: var(--text); transition: border-color .14s, box-shadow .14s; }
.fsm-pick-in .fsm-in { padding-left: 36px; }
.fsm-in::placeholder { color: var(--faint); }
.fsm-in:focus { outline: none; border-color: var(--brand-400); box-shadow: 0 0 0 3px rgba(94,118,238,.14); }
.fsm-mono { font-family: 'IBM Plex Mono'; }
.fsm-sm { height: 38px; }

.fsm-menu { position: absolute; left: 0; right: 0; top: 48px; max-height: 268px; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--e2); z-index: 40; padding: 6px; }
.fsm-menu-grp { font: 700 9.5px 'Plus Jakarta Sans'; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 8px 9px 5px; }
.fsm-menu-item { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 9px; cursor: pointer; transition: background .12s; }
.fsm-menu-item:hover { background: var(--surface-2); }
.fsm-menu-name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsm-menu-empty { padding: 18px 12px; text-align: center; font-size: 12.5px; color: var(--muted); }
.fsm-tag { font: 700 9.5px 'Plus Jakarta Sans'; border-radius: 6px; padding: 3px 7px; flex: none; }
.fsm-tag-emp { background: var(--info-bg); color: var(--info-fg); }
.fsm-tag-con { background: var(--pur-bg); color: var(--pur-fg); }

.fsm-extlink { cursor: pointer; display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font: 700 12.5px 'Plus Jakarta Sans'; color: var(--brand-700); }

/* external panel */
.fsm-ext { margin-top: 14px; }
.fsm-ext-email, .fsm-ext-contact { border: 1px solid var(--border); background: var(--surface-2); border-radius: 13px; padding: 14px 15px; }
.fsm-ext-contact { display: flex; align-items: center; gap: 9px; }
.fsm-ext-contact-tx { flex: 1; min-width: 0; font: 600 12.5px 'IBM Plex Mono'; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsm-ext-email-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.fsm-mini-ic { width: 24px; height: 24px; border-radius: 7px; background: var(--info-bg); color: var(--info-fg); display: flex; align-items: center; justify-content: center; flex: none; }
.fsm-mini-ok { background: var(--ok-bg); color: var(--ok-fg); }
.fsm-ext-email-title { flex: 1; font-size: 13px; font-weight: 700; }
.fsm-cancel { cursor: pointer; font: 700 12px 'Plus Jakarta Sans'; color: var(--muted); }
.fsm-cancel:hover { color: var(--text); }
.fsm-hint { font-size: 11px; color: var(--faint); margin-top: 7px; }
.fsm-faint { color: var(--faint); font-weight: 600; }

.fsm-ext-opts { border: 1px solid var(--border); border-radius: 13px; padding: 15px; margin-top: 12px; }
.fsm-ext-opts-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.fsm-ext-opts-title { font-size: 13px; font-weight: 800; }
.fsm-grid3 { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 11px; }
.fsm-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 11px; }
.fsm-fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fsm-flbl { font: 700 10px 'Plus Jakarta Sans'; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.fsm-cyc { cursor: pointer; height: 38px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--border); background: var(--surface); border-radius: 9px; padding: 0 11px; }
.fsm-cyc-tx { flex: 1; text-align: left; font-size: 13px; font-weight: 700; color: var(--text); }
.fsm-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.fsm-select { height: 38px; border: 1px solid var(--border); background: var(--surface); border-radius: 9px; padding: 0 10px; font: 600 13px 'Plus Jakarta Sans'; color: var(--text); cursor: pointer; }
.fsm-select:focus { outline: none; border-color: var(--brand-400); }

.fsm-otp { display: flex; align-items: center; gap: 11px; margin-top: 14px; cursor: pointer; }
.fsm-switch { width: 38px; height: 22px; border-radius: 99px; background: var(--border-strong); position: relative; flex: none; transition: background .16s; }
.fsm-switch-on { background: var(--brand-600); }
.fsm-knob { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .16s; }
.fsm-switch-on .fsm-knob { left: 18px; }
.fsm-otp-tx { font-size: 12.5px; font-weight: 600; color: var(--text-2); }

.fsm-create { cursor: pointer; margin-top: 14px; height: 42px; width: 100%; border: none; border-radius: 11px; font: 700 13.5px 'Plus Jakarta Sans'; color: #fff; background: var(--brand-grad); display: flex; align-items: center; justify-content: center; gap: 9px; box-shadow: 0 4px 14px rgba(76,99,230,.26); }
.fsm-create:disabled { opacity: .75; cursor: default; }
.fsm-spin { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; display: inline-block; vertical-align: middle; animation: fsm-spin .7s linear infinite; }
@keyframes fsm-spin { to { transform: rotate(360deg); } }
.fsm-link { margin-top: 14px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--ok-fg); background: var(--ok-bg); border-radius: 11px; padding: 9px 11px; }
.fsm-link-url { flex: 1; font: 600 12px 'IBM Plex Mono'; color: var(--ok-fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsm-copy { cursor: pointer; height: 30px; padding: 0 12px; border: none; border-radius: 8px; background: var(--ok-fg); color: #fff; font: 700 11.5px 'Plus Jakarta Sans'; }

/* shared list */
.fsm-shared-head { display: flex; align-items: center; gap: 9px; margin: 20px 0 9px; font-size: 13px; font-weight: 700; }
.fsm-count { font: 700 10.5px 'IBM Plex Mono'; background: var(--brand-50); color: var(--brand-700); border-radius: 99px; padding: 2px 8px; }
.fsm-shared { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.fsm-shared-cols, .fsm-srow { display: grid; grid-template-columns: minmax(0,1fr) 128px 64px; gap: 12px; align-items: center; padding: 9px 13px; }
.fsm-shared-cols { background: var(--surface-2); border-bottom: 1px solid var(--border); font: 700 9.5px 'Plus Jakarta Sans'; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.fsm-srow { border-top: 1px solid var(--border); transition: background .12s; }
.fsm-srow:first-child { border-top: none; }
.fsm-srow:hover { background: var(--surface-2); }
.fsm-sname { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fsm-av { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 800 11px 'Plus Jakarta Sans'; flex: none; }
.fsm-sname-tx { min-width: 0; }
.fsm-sname-line { display: flex; align-items: center; gap: 7px; }
.fsm-sname-name { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsm-kind { font: 700 8.5px 'Plus Jakarta Sans'; letter-spacing: .04em; text-transform: uppercase; border-radius: 5px; padding: 2px 5px; flex: none; }
.fsm-ip { font: 700 8.5px 'Plus Jakarta Sans'; letter-spacing: .04em; background: var(--info-bg); color: var(--info-fg); border-radius: 5px; padding: 2px 5px; flex: none; cursor: help; }
.fsm-semail { display: block; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsm-perm { cursor: pointer; height: 30px; display: flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 0 9px; }
.fsm-perm > span { flex: 1; text-align: left; font-size: 12px; font-weight: 700; }
.fsm-perm:disabled { opacity: .5; cursor: default; }
.fsm-sactions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.fsm-iconbtn { cursor: pointer; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); display: flex; align-items: center; justify-content: center; color: var(--muted); flex: none; transition: background .14s, color .14s; }
.fsm-iconbtn:hover { background: var(--surface-2); color: var(--text); }
.fsm-iconbtn-danger:hover { background: var(--bad-bg); color: var(--bad-fg); border-color: var(--bad-bg); }
.fsm-none { border: 1px dashed var(--border-strong); border-radius: 12px; padding: 22px; text-align: center; font-size: 12.5px; color: var(--muted); }

/* access log */
.fsm-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.fsm-stat { border: 1px solid var(--border); background: var(--surface-2); border-radius: 12px; padding: 11px 13px; }
.fsm-stat-v { font: 800 21px 'Plus Jakarta Sans'; letter-spacing: -.01em; }
.fsm-stat-l { font-size: 11px; color: var(--muted); margin-top: 1px; }
.fsm-logbar { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 12px; }
.fsm-chip { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border: 1px solid var(--border); border-radius: 9px; font: 700 12px 'Plus Jakarta Sans'; }
.fsm-chip-c { font: 700 9.5px 'IBM Plex Mono'; border-radius: 99px; padding: 1px 6px; }
.fsm-spacer { flex: 1; }
.fsm-export { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--border); background: var(--surface); border-radius: 9px; font: 700 12px 'Plus Jakarta Sans'; color: var(--text-2); }
.fsm-log { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.fsm-levt { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-bottom: 1px solid var(--border); }
.fsm-levt:last-child { border-bottom: none; }
.fsm-levt:hover { background: var(--surface-2); }
.fsm-levt-ic { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex: none; }
.fsm-levt-tx { flex: 1; min-width: 0; }
.fsm-levt-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.fsm-levt-who { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsm-levt-verb { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.fsm-levt-sub { font-size: 11px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsm-levt-meta { text-align: right; flex: none; }
.fsm-levt-time { font: 700 11.5px 'Plus Jakarta Sans'; color: var(--text-2); white-space: nowrap; }
.fsm-levt-ip { font: 600 11px 'IBM Plex Mono'; color: var(--muted); white-space: nowrap; margin-top: 2px; }
.fsm-log-note { display: flex; align-items: center; gap: 7px; margin-top: 11px; font-size: 11px; color: var(--faint); line-height: 1.45; }

/* footer */
.fsm-foot { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface); }
.fsm-foot-note { flex: 1; display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); }
.fsm-btn { cursor: pointer; height: 40px; border-radius: 11px; font: 700 13px 'Plus Jakarta Sans'; border: 1px solid transparent; }
.fsm-btn-primary { padding: 0 26px; border: none; color: #fff; background: var(--brand-600); box-shadow: 0 2px 8px rgba(76,99,230,.22); }
.fsm-btn-primary:hover { filter: brightness(1.05); }

@media (max-width: 560px) {
    .fsm-overlay { padding: 0; }
    .fsm-card { max-height: 100vh; height: 100%; border-radius: 0; width: 100%; }
    .fsm-grid3, .fsm-grid2 { grid-template-columns: 1fr; }
}
