/* ══════════════════════════════════════════════════════════════════════
   FaxSafe Web App — design system
   Sidebar shell + cards + forms used by the /web/* application pages.
   ══════════════════════════════════════════════════════════════════════ */

:root {
  --ff-bg:            #f4f5f7;
  --ff-surface:       #ffffff;
  --ff-line:          #e9ebef;
  --ff-line-strong:   #dfe3e8;
  --ff-ink:           #14161a;
  --ff-ink-2:         #3f454e;
  --ff-muted:         #767d88;
  --ff-muted-2:       #9aa1ab;
  --ff-blue:          #0B5CFF;
  --ff-blue-hover:    #0a4ed9;
  --ff-blue-soft:     #e8f0ff;
  --ff-accent:        #0B5CFF;
  --ff-dark:          #16181d;
  --ff-green:         #157a4b;
  --ff-green-soft:    #ddf6e8;
  --ff-amber:         #8a6116;
  --ff-amber-soft:    #fdf1d8;
  --ff-red:           #b42318;
  --ff-red-soft:      #fdeceb;
  --ff-radius:        18px;
  --ff-radius-sm:     12px;
  --ff-sidebar:       248px;
  --ff-content:       1088px;
  /* Same face as the landing page (loaded in app/base.html). */
  --ff-sans:          'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --ff-mono:          ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
}

/* ── Base ──────────────────────────────────────────────────────────── */
.ff-app, .ff-app * { box-sizing: border-box; }
body.ff-body {
  margin: 0;
  background: var(--ff-bg);
  color: var(--ff-ink);
  font-family: var(--ff-sans);
  -webkit-font-smoothing: antialiased;
}
html { scrollbar-gutter: stable; overflow-x: clip; }
body.ff-body { overflow-x: clip; }

/* ── Shell ─────────────────────────────────────────────────────────── */
.ff-shell { display: flex; min-height: 100vh; }

.ff-sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--ff-sidebar);
  background: var(--ff-surface); border-right: 1px solid var(--ff-line);
  display: flex; flex-direction: column; padding: 26px 16px 18px; z-index: 40;
}
.ff-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; margin-bottom: 30px; text-decoration: none; }
.ff-brand-mark {
  width: 40px; height: 40px; border-radius: 9px; flex: none;
  display: block; object-fit: contain;
}
.ff-brand-name { font-size: 23px; font-weight: 700; color: var(--ff-ink); letter-spacing: -.01em; }

.ff-nav { display: flex; flex-direction: column; gap: 4px; }
.ff-nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 13px;
  font-size: 15px; font-weight: 500; color: var(--ff-ink-2);
  text-decoration: none; transition: background .15s, color .15s; position: relative;
}
.ff-nav-item:hover { background: #f5f6f8; color: var(--ff-ink); }
.ff-nav-item.is-active { background: var(--ff-dark); color: #fff; }
.ff-nav-item.is-active:hover { background: var(--ff-dark); color: #fff; }
.ff-nav-item svg { width: 19px; height: 19px; flex: none; }
.ff-nav-lock { margin-left: auto; color: var(--ff-muted-2); display: none; }
.ff-nav-lock svg { width: 14px; height: 14px; }
body:not(.ff-auth) .ff-nav-lock { display: block; }
.ff-nav-count {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--ff-blue); color: #fff;
  font-size: 11.5px; font-weight: 700; display: none;
  align-items: center; justify-content: center;
}
.ff-nav-count.is-on { display: inline-flex; }
.ff-nav-item.is-active .ff-nav-count { background: #fff; color: var(--ff-dark); }

.ff-sidebar-foot { margin-top: auto; }
.ff-privacy-card {
  border: 1px solid var(--ff-line); border-radius: 15px; padding: 14px;
  background: var(--ff-surface);
}
.ff-privacy-card .ff-pc-icon { color: var(--ff-blue); margin-bottom: 10px; display: block; }
.ff-privacy-card p { margin: 0 0 10px; font-size: 12.5px; line-height: 1.55; color: var(--ff-muted); }
.ff-privacy-card p b { color: var(--ff-ink); font-weight: 700; }
.ff-signin-link {
  display: inline-flex; align-items: center; gap: 7px; background: none; border: 0; padding: 0;
  color: var(--ff-blue); font-size: 13.5px; font-weight: 700; cursor: pointer;
  font-family: inherit; text-decoration: underline; text-underline-offset: 3px;
}
.ff-signin-link svg { width: 15px; height: 15px; }
/* Plan status, above the account block. Free accounts get the loud variant so
   the upgrade is the one thing that stands out in the footer. */
.ff-plan-card {
  display: block; text-decoration: none; margin-bottom: 10px;
  border: 1px solid var(--ff-line); border-radius: 15px; padding: 12px 13px;
  background: var(--ff-surface);
  transition: border-color .15s ease, background .15s ease;
}
.ff-plan-card:hover { border-color: var(--ff-line-strong); }
.ff-plan-card-head { display: flex; align-items: center; gap: 7px; }
.ff-plan-dot { width: 7px; height: 7px; border-radius: 999px; flex: none; background: var(--ff-muted-2); }
.ff-plan-status { font-size: 12.5px; font-weight: 700; color: var(--ff-ink); }
.ff-plan-note { display: block; margin-top: 4px; font-size: 11.5px; line-height: 1.45; color: var(--ff-muted); }
.ff-plan-action {
  display: flex; align-items: center; gap: 6px; margin-top: 9px;
  font-size: 13px; font-weight: 700; color: var(--ff-blue);
}
.ff-plan-action svg { width: 14px; height: 14px; transition: transform .15s ease; }
.ff-plan-card:hover .ff-plan-action svg { transform: translateX(2px); }

.ff-plan-card.is-free { background: var(--ff-blue-soft); border-color: #d3e2ff; }
.ff-plan-card.is-free:hover { border-color: #bcd3ff; }
.ff-plan-card.is-free .ff-plan-dot { background: var(--ff-blue); }

/* The sidebar is white, so tint the calm state or the card disappears. */
.ff-plan-card.is-active { background: var(--ff-bg); }
.ff-plan-card.is-active .ff-plan-dot { background: var(--ff-green); }
.ff-plan-card.is-active .ff-plan-action { color: var(--ff-ink-2); }

.ff-plan-card.is-expired { background: var(--ff-amber-soft); border-color: #f0dcae; }
.ff-plan-card.is-expired .ff-plan-dot { background: var(--ff-amber); }
.ff-plan-card.is-expired .ff-plan-action { color: var(--ff-amber); }

.ff-user-card { display: flex; align-items: center; gap: 11px; padding: 6px 8px; }
.ff-avatar {
  width: 32px; height: 32px; border-radius: 999px; flex: none;
  background: var(--ff-blue-soft); color: var(--ff-blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; text-transform: uppercase;
}
.ff-user-card .ff-uc-name { font-size: 13.5px; font-weight: 700; color: var(--ff-ink); line-height: 1.3; }
.ff-user-card .ff-uc-mail { font-size: 12px; color: var(--ff-muted); line-height: 1.3; word-break: break-all; }

.ff-main { flex: 1; min-width: 0; margin-left: var(--ff-sidebar); padding: 34px 40px 72px; }
.ff-container { max-width: var(--ff-content); margin: 0 auto; }

/* ── Page header ───────────────────────────────────────────────────── */
.ff-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.ff-eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; color: var(--ff-accent); margin-bottom: 8px; }
.ff-h1 { font-size: 46px; font-weight: 400; letter-spacing: -.02em; line-height: 1.05; margin: 0; color: var(--ff-ink); }
.ff-sub { font-size: 15px; color: var(--ff-muted); margin: 12px 0 0; line-height: 1.5; }
.ff-back {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px;
  font-size: 13.5px; font-weight: 600; color: var(--ff-muted); text-decoration: none;
}
.ff-back:hover { color: var(--ff-ink); }
.ff-back svg { width: 16px; height: 16px; }

.ff-note-pill {
  display: inline-flex; align-items: center; gap: 9px; flex: none;
  background: var(--ff-surface); border: 1px solid var(--ff-line);
  border-radius: 999px; padding: 11px 18px; font-size: 13px; color: var(--ff-ink-2);
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.ff-note-pill svg { width: 16px; height: 16px; color: var(--ff-green); flex: none; }
.ff-note-pill.is-block { border-radius: 14px; text-align: left; align-items: flex-start; padding: 13px 18px; }
.ff-note-pill .ff-np-title { font-size: 12.5px; font-weight: 700; color: var(--ff-ink); }
.ff-note-pill .ff-np-hint { font-size: 11.5px; color: var(--ff-muted); margin-top: 2px; }

/* ── Cards ─────────────────────────────────────────────────────────── */
.ff-card {
  background: var(--ff-surface); border: 1px solid var(--ff-line);
  border-radius: var(--ff-radius); box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.ff-card-pad { padding: 26px 28px; }
.ff-card-title { font-size: 16.5px; font-weight: 700; color: var(--ff-ink); margin: 0; }

.ff-split { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 26px; align-items: start; }
.ff-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 22px; }

/* ── Steps ─────────────────────────────────────────────────────────── */
.ff-step { display: flex; gap: 14px; }
.ff-step-no {
  width: 27px; height: 27px; border-radius: 999px; flex: none; margin-top: 1px;
  background: var(--ff-dark); color: #fff; font-size: 12.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.ff-step-title { font-size: 18px; font-weight: 500; color: var(--ff-ink); margin: 0; }
.ff-step-hint { font-size: 13px; color: var(--ff-muted); margin: 4px 0 0; }
.ff-divider { height: 1px; background: var(--ff-line); margin: 26px 0; }

/* ── Forms ─────────────────────────────────────────────────────────── */
.ff-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ff-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ff-ink); }
.ff-label .ff-optional { font-size: 12px; font-weight: 400; color: var(--ff-muted-2); }
.ff-label-icon { display: inline-flex; align-items: center; gap: 7px; }
.ff-label-icon svg { width: 15px; height: 15px; color: var(--ff-muted); }

.ff-input, .ff-select {
  width: 100%; height: 47px; border: 1px solid var(--ff-line-strong); border-radius: var(--ff-radius-sm);
  padding: 0 14px; font-size: 14.5px; font-family: inherit; color: var(--ff-ink);
  background: var(--ff-surface); outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.ff-input { height: auto; padding: 12px 14px; line-height: 1.55; resize: vertical; }
.ff-input::placeholder { color: var(--ff-muted-2); }
.ff-input:focus, .ff-select:focus { border-color: var(--ff-blue); box-shadow: 0 0 0 3px rgba(11,92,255,.14); }
.ff-input:disabled, .ff-select:disabled { background: #f7f8fa; color: var(--ff-muted); cursor: not-allowed; }
.ff-input.is-num { font-family: var(--ff-mono); letter-spacing: .02em; }
.ff-select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23767d88' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; background-size: 17px; padding-right: 38px;
}
.ff-row-3 { display: grid; grid-template-columns: 1.05fr 1fr 1.25fr; gap: 14px; }
.ff-row-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }

/* Country combo */
.ff-country { position: relative; }
.ff-country-btn {
  width: 100%; height: 47px; border: 1px solid var(--ff-line-strong); border-radius: var(--ff-radius-sm);
  background: var(--ff-surface); display: flex; align-items: center; gap: 9px; padding: 0 12px;
  cursor: pointer; font-family: inherit; font-size: 14px; color: var(--ff-ink); text-align: left;
}
.ff-country-btn:focus { outline: none; border-color: var(--ff-blue); box-shadow: 0 0 0 3px rgba(11,92,255,.14); }
.ff-country-btn .ff-flag { font-size: 17px; line-height: 1; }
.ff-country-btn .ff-cname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.ff-country-btn .ff-cdial { color: var(--ff-muted); font-size: 13px; }
.ff-country-btn .ff-caret { width: 16px; height: 16px; color: var(--ff-muted); flex: none; }
.ff-country-pop {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--ff-line-strong); border-radius: var(--ff-radius-sm);
  box-shadow: 0 16px 40px rgba(16,24,40,.14); padding: 8px; display: none;
}
.ff-country-pop.is-open { display: block; }
.ff-country-search { width: 100%; height: 38px; border: 1px solid var(--ff-line); border-radius: 9px; padding: 0 11px; font-size: 13.5px; font-family: inherit; outline: none; margin-bottom: 6px; }
.ff-country-list { max-height: 264px; overflow-y: auto; }
.ff-country-opt {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 10px;
  border: 0; background: none; border-radius: 9px; cursor: pointer; font-family: inherit;
  font-size: 13.5px; color: var(--ff-ink); text-align: left;
}
.ff-country-opt:hover, .ff-country-opt.is-active { background: #f4f6fa; }
.ff-country-opt .ff-cdial { margin-left: auto; color: var(--ff-muted); font-size: 12.5px; }

/* Contact suggestions */
.ff-suggest {
  position: absolute; z-index: 25; top: calc(100% + 6px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--ff-line-strong); border-radius: var(--ff-radius-sm);
  box-shadow: 0 16px 40px rgba(16,24,40,.14); padding: 6px; display: none; max-height: 240px; overflow-y: auto;
}
.ff-suggest.is-open { display: block; }
.ff-suggest-opt {
  display: block; width: 100%; padding: 9px 11px; border: 0; background: none; border-radius: 9px;
  cursor: pointer; font-family: inherit; text-align: left;
}
.ff-suggest-opt:hover { background: #f4f6fa; }
.ff-suggest-opt .ff-sg-name { font-size: 13.5px; font-weight: 700; color: var(--ff-ink); }
.ff-suggest-opt .ff-sg-num { font-family: var(--ff-mono); font-size: 12px; color: var(--ff-muted); margin-top: 2px; }

/* ── Dropzone & files ──────────────────────────────────────────────── */
.ff-drop {
  border: 1.5px dashed var(--ff-line-strong); border-radius: 15px; background: #fbfcfd;
  padding: 40px 20px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.ff-drop:hover, .ff-drop.is-over { border-color: var(--ff-blue); background: var(--ff-blue-soft); }
.ff-drop-icon {
  width: 44px; height: 44px; border-radius: 999px; background: #fff; border: 1px solid var(--ff-line);
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(16,24,40,.06);
}
.ff-drop-icon svg { width: 20px; height: 20px; color: var(--ff-blue); }
.ff-drop-title { font-size: 14px; font-weight: 700; color: var(--ff-ink); }
.ff-drop-title u { text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
.ff-drop-hint { font-size: 12px; color: var(--ff-muted-2); margin-top: 6px; }

.ff-files { margin-top: 16px; border: 1px solid var(--ff-line); border-radius: 14px; overflow: hidden; }
.ff-file { display: flex; align-items: center; gap: 12px; padding: 13px 15px; background: #fff; }
.ff-file + .ff-file { border-top: 1px solid var(--ff-line); }
.ff-file.is-dragging { opacity: .45; }
.ff-file-grip { color: #c3c8d0; cursor: grab; flex: none; display: flex; }
.ff-file-grip:active { cursor: grabbing; }
.ff-file-grip svg { width: 14px; height: 14px; }
.ff-file-ic { width: 32px; height: 32px; border-radius: 9px; background: var(--ff-blue-soft); color: var(--ff-blue); display: flex; align-items: center; justify-content: center; flex: none; }
.ff-file-ic svg { width: 16px; height: 16px; }
.ff-file-meta { flex: 1; min-width: 0; }
.ff-file-name { font-size: 13.5px; font-weight: 700; color: var(--ff-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ff-file-sub { font-size: 11.5px; color: var(--ff-muted-2); margin-top: 2px; }
.ff-file-acts { display: flex; align-items: center; gap: 4px; flex: none; }
.ff-icon-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 0; background: none; cursor: pointer;
  color: var(--ff-muted-2); display: flex; align-items: center; justify-content: center;
}
.ff-icon-btn:hover { background: #f3f4f7; color: var(--ff-ink); }
.ff-icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.ff-icon-btn.is-danger:hover { background: var(--ff-red-soft); color: var(--ff-red); }
.ff-icon-btn svg { width: 16px; height: 16px; }
.ff-add-file {
  width: 100%; border: 0; border-top: 1px solid var(--ff-line); background: #fafbfc;
  padding: 13px; font-family: inherit; font-size: 13.5px; font-weight: 600; color: var(--ff-blue);
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px;
}
.ff-add-file:hover { background: var(--ff-blue-soft); }
.ff-add-file svg { width: 15px; height: 15px; }

/* ── Toggles ───────────────────────────────────────────────────────── */
.ff-toggle-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 4px 0; }
.ff-toggle-row .ff-tr-title { font-size: 13.5px; font-weight: 700; color: var(--ff-ink); }
.ff-toggle-row .ff-tr-hint { font-size: 12px; color: var(--ff-muted); margin-top: 3px; }
.ff-switch { position: relative; width: 44px; height: 24px; flex: none; }
.ff-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.ff-switch i { position: absolute; inset: 0; border-radius: 999px; background: #d3d7dd; transition: background .18s; }
.ff-switch i::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 999px; background: #fff; transition: transform .18s; box-shadow: 0 1px 3px rgba(16,24,40,.2);
}
.ff-switch input:checked + i { background: var(--ff-blue); }
.ff-switch input:checked + i::after { transform: translateX(20px); }

/* ── Buttons ───────────────────────────────────────────────────────── */
.ff-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 46px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font-family: inherit; font-size: 14.5px; font-weight: 700; cursor: pointer;
  text-decoration: none; transition: background .15s, border-color .15s, color .15s, opacity .15s;
  white-space: nowrap;
}
.ff-btn svg { width: 17px; height: 17px; flex: none; }
.ff-btn-primary { background: var(--ff-blue); color: #fff; box-shadow: 0 6px 16px rgba(11,92,255,.24); }
.ff-btn-primary:hover { background: var(--ff-blue-hover); }
.ff-btn-ghost { background: var(--ff-surface); color: var(--ff-ink); border-color: var(--ff-line-strong); }
.ff-btn-ghost:hover { background: #f7f8fa; }
.ff-btn-dark { background: var(--ff-dark); color: #fff; }
.ff-btn-dark:hover { background: #24272e; }
.ff-btn-danger { background: var(--ff-red-soft); color: var(--ff-red); border-color: #f7d3d0; }
.ff-btn-danger:hover { background: #fbdedb; }
.ff-btn-sm { height: 38px; padding: 0 16px; font-size: 13px; }
.ff-btn-lg { height: 52px; padding: 0 28px; font-size: 15.5px; }
.ff-btn-block { width: 100%; }
.ff-btn:disabled, .ff-btn.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* ── Badges ────────────────────────────────────────────────────────── */
.ff-badge {
  display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .01em;
}
.ff-badge-green { background: var(--ff-green-soft); color: var(--ff-green); }
.ff-badge-amber { background: var(--ff-amber-soft); color: var(--ff-amber); }
.ff-badge-red   { background: var(--ff-red-soft);   color: var(--ff-red); }
.ff-badge-blue  { background: var(--ff-blue-soft);  color: var(--ff-blue); }
.ff-badge-gray  { background: #f1f2f4; color: var(--ff-muted); }

/* ── Tabs ──────────────────────────────────────────────────────────── */
.ff-tabbar { display: flex; align-items: center; gap: 22px; padding: 18px 22px; border-bottom: 1px solid var(--ff-line); }
.ff-tabs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ff-tab {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 15px;
  border: 0; border-radius: 10px; background: none; font-family: inherit;
  font-size: 13.5px; font-weight: 700; color: var(--ff-muted); cursor: pointer;
}
.ff-tab:hover { background: #f5f6f8; color: var(--ff-ink); }
.ff-tab.is-active { background: var(--ff-dark); color: #fff; }
.ff-tab-count {
  min-width: 19px; height: 19px; padding: 0 6px; border-radius: 999px;
  background: var(--ff-blue); color: #fff; font-size: 11px; font-weight: 700;
  display: none; align-items: center; justify-content: center;
}
.ff-tab-count.is-on { display: inline-flex; }
.ff-tab.is-active .ff-tab-count { background: #fff; color: var(--ff-dark); }

.ff-search { position: relative; margin-left: auto; min-width: 240px; }
.ff-search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--ff-muted-2); }
.ff-search input {
  width: 100%; height: 38px; border: 1px solid var(--ff-line-strong); border-radius: 999px;
  padding: 0 15px 0 36px; font-size: 13px; font-family: inherit; outline: none; color: var(--ff-ink);
}
.ff-search input:focus { border-color: var(--ff-blue); box-shadow: 0 0 0 3px rgba(11,92,255,.13); }
.ff-search.is-plain input { border-radius: var(--ff-radius-sm); }

/* ── Activity list ─────────────────────────────────────────────────── */
.ff-list { display: flex; flex-direction: column; }
.ff-row {
  display: flex; align-items: center; gap: 15px; padding: 17px 22px;
  border-bottom: 1px solid var(--ff-line); text-decoration: none; color: inherit;
  transition: background .12s; background: none; border-left: 0; border-right: 0; border-top: 0;
  font-family: inherit; text-align: left; width: 100%; cursor: pointer;
}
.ff-row:hover { background: #fafbfc; }
.ff-row-ic { width: 38px; height: 38px; border-radius: 11px; flex: none; display: flex; align-items: center; justify-content: center; }
.ff-row-ic svg { width: 17px; height: 17px; }
.ff-row-ic.is-out { background: var(--ff-green-soft); color: var(--ff-green); }
.ff-row-ic.is-in  { background: #e1ebff; color: var(--ff-blue); }
.ff-row-ic.is-draft { background: #f1f2f4; color: var(--ff-muted); }
.ff-row-ic.is-fail { background: var(--ff-red-soft); color: var(--ff-red); }
.ff-row-main { flex: 1; min-width: 0; }
.ff-num { font-family: var(--ff-mono); font-size: 14.5px; font-weight: 600; color: var(--ff-ink); letter-spacing: .01em; }
.ff-row-sub { font-size: 12px; color: var(--ff-muted-2); margin-top: 3px; }
.ff-row-meta { display: flex; align-items: center; gap: 15px; flex: none; }
.ff-row-time { font-size: 12px; color: var(--ff-muted-2); white-space: nowrap; }
.ff-row-chevron { color: #c3c8d0; display: flex; flex: none; }
.ff-row-chevron svg { width: 16px; height: 16px; }
.ff-row.is-unread .ff-num::after {
  content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 999px;
  background: var(--ff-blue); margin-left: 9px; vertical-align: middle;
}

.ff-card-foot {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px; background: #fafbfc; border-top: 1px solid var(--ff-line);
  font-size: 11.5px; color: var(--ff-muted-2); border-radius: 0 0 var(--ff-radius) var(--ff-radius);
}
.ff-card-foot svg { width: 14px; height: 14px; color: var(--ff-green); }

/* ── Pagination ────────────────────────────────────────────────────── */
.ff-pager {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 22px; border-top: 1px solid var(--ff-line); flex-wrap: wrap;
}
.ff-pager-count { font-size: 12px; color: var(--ff-muted-2); }
.ff-pager-pages { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.ff-pager-btn {
  min-width: 34px; height: 34px; padding: 0 10px; border-radius: 9px;
  border: 1px solid var(--ff-line-strong); background: #fff; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 600; color: var(--ff-ink-2);
  display: inline-flex; align-items: center; justify-content: center;
}
.ff-pager-btn:hover:not(:disabled):not(.is-current) { background: #f5f6f8; }
.ff-pager-btn.is-current { background: var(--ff-dark); border-color: var(--ff-dark); color: #fff; cursor: default; }
.ff-pager-btn:disabled { opacity: .4; cursor: not-allowed; }
.ff-pager-btn svg { width: 15px; height: 15px; }
.ff-pager-gap { color: var(--ff-muted-2); font-size: 13px; padding: 0 2px; }

/* ── Empty / loading states ────────────────────────────────────────── */
.ff-empty { padding: 74px 24px; text-align: center; }
.ff-empty-ic { color: #c9ced7; margin-bottom: 18px; }
.ff-empty-ic svg { width: 42px; height: 42px; }
.ff-empty-title { font-size: 26px; font-weight: 400; color: var(--ff-ink); letter-spacing: -.01em; }
.ff-empty-hint { font-size: 13.5px; color: var(--ff-muted-2); margin: 8px 0 22px; }
.ff-spinner {
  width: 26px; height: 26px; border: 3px solid var(--ff-line); border-top-color: var(--ff-blue);
  border-radius: 999px; animation: ff-spin .65s linear infinite; margin: 54px auto;
}
.ff-spinner.is-inline { width: 15px; height: 15px; border-width: 2px; margin: 0; display: inline-block; vertical-align: middle; }
@keyframes ff-spin { to { transform: rotate(360deg); } }
.ff-hidden { display: none !important; }

/* ── Detail rows ───────────────────────────────────────────────────── */
.ff-dl { display: flex; flex-direction: column; }
.ff-dl-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--ff-line); }
.ff-dl-row:last-child { border-bottom: 0; }
.ff-dl-k { font-size: 13px; color: var(--ff-muted); }
.ff-dl-v { font-size: 13px; font-weight: 700; color: var(--ff-ink); text-align: right; word-break: break-all; }
.ff-dl-v.is-num { font-family: var(--ff-mono); }

.ff-info {
  display: flex; gap: 11px; padding: 14px 16px; border-radius: 13px;
  background: var(--ff-blue-soft); font-size: 12px; line-height: 1.55; color: var(--ff-ink-2);
}
.ff-info svg { width: 16px; height: 16px; color: var(--ff-blue); flex: none; margin-top: 1px; }
.ff-info b { display: block; color: var(--ff-ink); font-size: 12.5px; margin-bottom: 3px; }
.ff-info.is-green { background: #e9f8ef; }
.ff-info.is-green svg { color: var(--ff-green); }
.ff-info.is-red { background: var(--ff-red-soft); color: var(--ff-red); align-items: center; }
.ff-info.is-red svg { color: var(--ff-red); margin-top: 0; }

.ff-doc-title { font-size: 27px; font-weight: 400; color: var(--ff-ink); letter-spacing: -.01em; }
.ff-doc-hint { font-size: 13px; color: var(--ff-muted-2); margin: 10px auto 0; max-width: 380px; line-height: 1.6; }

/* ── Detail head ───────────────────────────────────────────────────── */
.ff-detail-head { display: flex; align-items: center; gap: 15px; margin-bottom: 26px; }
.ff-detail-ic { width: 40px; height: 40px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center; }
.ff-detail-ic svg { width: 20px; height: 20px; }
.ff-detail-num { font-family: var(--ff-mono); font-size: 30px; font-weight: 500; color: var(--ff-ink); letter-spacing: .01em; line-height: 1.15; }
.ff-detail-time { font-size: 12.5px; color: var(--ff-muted-2); margin-top: 5px; }

.ff-viewer { border-radius: var(--ff-radius); overflow: hidden; background: #2b2c30; border: 1px solid var(--ff-line); }
.ff-viewer iframe { display: block; width: 100%; height: 660px; border: 0; }
.ff-viewer-empty { background: #eceef1; min-height: 640px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 30px; border-radius: var(--ff-radius); }
/* Document removed by the 30-day retention job. */
.ff-deleted-mark {
  width: 46px; height: 46px; border-radius: 999px; margin: 54px auto 22px;
  border: 1.8px solid var(--ff-amber); color: var(--ff-amber);
  display: flex; align-items: center; justify-content: center;
}
.ff-deleted-mark svg { width: 24px; height: 24px; }
.ff-deleted-text {
  max-width: 420px; margin: 0 auto; text-align: center;
  font-size: 14.5px; line-height: 1.6; color: var(--ff-ink-2);
}

.ff-viewer-empty .ff-ve-ic { width: 40px; height: 40px; border-radius: 999px; border: 1.5px solid #c9ced7; color: #9aa1ab; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; }

/* ── Live preview rail ─────────────────────────────────────────────── */
.ff-preview { background: #eef0f3; border-radius: var(--ff-radius); padding: 16px; position: sticky; top: 30px; }
.ff-preview-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.ff-preview-head .ff-eyebrow { color: var(--ff-muted); margin-bottom: 4px; }
.ff-preview-page { font-size: 15px; font-weight: 500; color: var(--ff-ink); }
.ff-preview-tag { font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--ff-muted-2); text-transform: uppercase; }
.ff-preview-sheet {
  background: #fff; border: 1px solid #e2e5e9; border-radius: 4px; aspect-ratio: 1 / 1.414;
  display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative;
  box-shadow: 0 1px 4px rgba(16,24,40,.07);
}
.ff-preview-sheet canvas, .ff-preview-sheet img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.ff-preview-blank { text-align: center; padding: 20px; }
.ff-preview-blank svg { width: 24px; height: 24px; color: var(--ff-muted-2); margin-bottom: 12px; }
.ff-preview-blank .ff-pb-title { font-size: 13px; font-weight: 700; color: var(--ff-ink-2); }
.ff-preview-blank .ff-pb-hint { font-size: 11.5px; color: var(--ff-muted-2); margin-top: 5px; }
.ff-preview-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; font-size: 11.5px; color: var(--ff-muted); }
.ff-preview-foot span { display: inline-flex; align-items: center; gap: 5px; }
.ff-preview-foot svg { width: 12px; height: 12px; color: var(--ff-green); }
.ff-preview-nav { display: flex; align-items: center; gap: 4px; }
.ff-preview-nav .ff-icon-btn { width: 24px; height: 24px; }
.ff-preview-nav .ff-icon-btn svg { width: 13px; height: 13px; }

/* ── Fax number card ───────────────────────────────────────────────── */
.ff-number-card {
  background: var(--ff-surface); border: 1px solid var(--ff-line); border-radius: 14px;
  padding: 14px 20px; min-width: 254px; box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.ff-number-card .ff-nc-label { font-size: 11.5px; color: var(--ff-muted); }
.ff-number-card .ff-nc-num { font-family: var(--ff-mono); font-size: 19px; font-weight: 600; color: var(--ff-ink); margin-top: 4px; }
.ff-number-card .ff-nc-unread { font-size: 11.5px; color: var(--ff-green); margin-top: 5px; font-weight: 600; }

/* ── Settings cards ────────────────────────────────────────────────── */
.ff-set-head { display: flex; align-items: flex-start; gap: 13px; padding-bottom: 18px; border-bottom: 1px solid var(--ff-line); margin-bottom: 20px; }
.ff-set-ic { width: 36px; height: 36px; border-radius: 10px; background: #f4f5f7; color: var(--ff-ink-2); display: flex; align-items: center; justify-content: center; flex: none; }
.ff-set-ic svg { width: 18px; height: 18px; }
.ff-set-title { font-size: 16px; font-weight: 500; color: var(--ff-ink); }
.ff-set-hint { font-size: 12px; color: var(--ff-muted); margin-top: 3px; }
.ff-meta-label { font-size: 12px; color: var(--ff-muted); }
.ff-meta-value { font-size: 14px; font-weight: 700; color: var(--ff-ink); margin-top: 3px; word-break: break-all; }
.ff-set-lead { font-size: 20px; font-weight: 400; color: var(--ff-ink); letter-spacing: -.01em; margin-top: 14px; }
.ff-set-lead-hint { font-size: 12.5px; color: var(--ff-muted); margin-top: 7px; line-height: 1.55; }

/* ── Plan picker ───────────────────────────────────────────────────── */
.ff-optcards { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.ff-optcard {
  position: relative; display: flex; align-items: center; gap: 13px; padding: 17px 18px;
  border: 1.5px solid var(--ff-line-strong); border-radius: 14px; background: #fff;
  cursor: pointer; text-align: left; font-family: inherit; transition: border-color .15s, background .15s;
}
.ff-optcard:hover { border-color: #a9c6ff; }
.ff-optcard.is-on { border-color: var(--ff-blue); background: #f0f5ff; }
.ff-optcard svg.ff-oc-ic { width: 20px; height: 20px; color: var(--ff-blue); flex: none; }
.ff-optcard .ff-oc-title { font-size: 13.5px; font-weight: 700; color: var(--ff-ink); }
.ff-optcard .ff-oc-hint { font-size: 12px; color: var(--ff-muted); margin-top: 3px; }
.ff-optcard .ff-oc-check { margin-left: auto; color: var(--ff-blue); opacity: 0; flex: none; display: flex; }
.ff-optcard .ff-oc-check svg { width: 17px; height: 17px; }
.ff-optcard.is-on .ff-oc-check { opacity: 1; }

.ff-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.ff-plan {
  position: relative; border: 1.5px solid var(--ff-line-strong); border-radius: 14px;
  padding: 20px 18px 22px; background: #fff; cursor: pointer; text-align: left; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.ff-plan:hover { border-color: #a9c6ff; }
.ff-plan.is-on { border-color: var(--ff-blue); box-shadow: 0 0 0 1px var(--ff-blue); }
.ff-plan-radio {
  width: 19px; height: 19px; border-radius: 999px; border: 1.5px solid #cfd4dc;
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.ff-plan.is-on .ff-plan-radio { background: var(--ff-blue); border-color: var(--ff-blue); }
.ff-plan-radio svg { width: 11px; height: 11px; color: #fff; opacity: 0; }
.ff-plan.is-on .ff-plan-radio svg { opacity: 1; }
.ff-plan-name { font-size: 14px; font-weight: 700; color: var(--ff-ink); }
.ff-plan-price { font-size: 25px; font-weight: 500; color: var(--ff-ink); margin-top: 8px; letter-spacing: -.01em; }
.ff-plan-price span { font-size: 12.5px; font-weight: 400; color: var(--ff-muted); }
.ff-plan-hint { font-size: 11.5px; color: var(--ff-muted-2); margin-top: 10px; }
.ff-plan-tag {
  position: absolute; top: -10px; right: 12px; background: var(--ff-blue); color: #fff;
  font-size: 9.5px; font-weight: 700; letter-spacing: .07em; padding: 4px 10px; border-radius: 999px;
}

.ff-feat { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; color: var(--ff-ink-2); padding: 5px 0; }
.ff-feat svg { width: 14px; height: 14px; color: var(--ff-green); flex: none; margin-top: 2px; }
.ff-due { display: flex; align-items: baseline; justify-content: space-between; margin: 18px 0; }
.ff-due-label { font-size: 12.5px; color: var(--ff-muted); }
.ff-due-value { font-size: 30px; font-weight: 500; color: var(--ff-ink); letter-spacing: -.01em; }
.ff-terms { font-size: 11px; color: var(--ff-muted-2); text-align: center; line-height: 1.6; margin-top: 12px; }
.ff-terms a { color: var(--ff-muted); }
.ff-numchip {
  display: flex; align-items: center; gap: 11px; padding: 13px 15px; border-radius: 12px;
  border: 1px dashed var(--ff-line-strong); background: #fbfcfd;
}
.ff-numchip svg { width: 17px; height: 17px; color: var(--ff-muted); flex: none; }
.ff-numchip .ff-nch-label { font-size: 11px; color: var(--ff-muted); }
.ff-numchip .ff-nch-value { font-size: 13px; font-weight: 700; color: var(--ff-ink); margin-top: 2px; }
.ff-numsearch { display: grid; grid-template-columns: 1fr 1fr auto; gap: 14px; align-items: end; }
.ff-numlist { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-top: 16px; }
.ff-numopt {
  border: 1.5px solid var(--ff-line-strong); border-radius: 11px; padding: 12px 13px; background: #fff;
  cursor: pointer; font-family: var(--ff-mono); font-size: 13.5px; font-weight: 600; color: var(--ff-ink); text-align: left;
}
.ff-numopt:hover { border-color: #a9c6ff; }
.ff-numopt.is-on { border-color: var(--ff-blue); background: #f0f5ff; }

/* ── Modals ────────────────────────────────────────────────────────── */
.ff-modal {
  position: fixed; inset: 0; z-index: 80; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(20,22,26,.42); backdrop-filter: blur(2px);
}
.ff-modal.is-open { display: flex; }
.ff-modal-box {
  position: relative; background: #fff; border-radius: 20px; width: 100%; max-width: 520px;
  padding: 30px; box-shadow: 0 32px 64px rgba(16,24,40,.24); max-height: 92vh; overflow-y: auto;
}
.ff-modal-box.is-sm { max-width: 440px; }
.ff-modal-close {
  position: absolute; top: 18px; right: 18px; width: 30px; height: 30px; border: 0; background: none;
  border-radius: 8px; color: var(--ff-muted-2); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.ff-modal-close:hover { background: #f3f4f7; color: var(--ff-ink); }
.ff-modal-close svg { width: 17px; height: 17px; }
.ff-modal-icon {
  width: 46px; height: 46px; border-radius: 14px; background: var(--ff-blue-soft); color: var(--ff-blue);
  display: flex; align-items: center; justify-content: center; margin-bottom: 22px;
}
.ff-modal-icon svg { width: 21px; height: 21px; }
.ff-modal-title { font-size: 30px; font-weight: 400; letter-spacing: -.015em; color: var(--ff-ink); margin: 0; line-height: 1.15; }
.ff-modal-text { font-size: 13.5px; color: var(--ff-muted); line-height: 1.6; margin: 12px 0 0; }
.ff-modal-acts { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 24px; }

.ff-oauth-btn {
  display: flex; align-items: center; justify-content: center; gap: 11px; width: 100%; height: 50px;
  border-radius: 999px; border: 1px solid var(--ff-line-strong); background: #fff;
  font-family: inherit; font-size: 14.5px; font-weight: 700; color: var(--ff-ink); cursor: pointer;
}
.ff-oauth-btn:hover { background: #f7f8fa; }
.ff-oauth-btn.is-dark { background: var(--ff-dark); border-color: var(--ff-dark); color: #fff; }
.ff-oauth-btn.is-dark:hover { background: #24272e; }
.ff-oauth-btn svg { width: 19px; height: 19px; flex: none; }

.ff-auth-sep { display: flex; align-items: center; gap: 12px; margin: 20px 0 4px; color: var(--ff-muted-2); font-size: 12px; }
.ff-auth-sep::before, .ff-auth-sep::after { content: ""; flex: 1; height: 1px; background: var(--ff-line); }
.ff-auth-form { display: flex; flex-direction: column; gap: 16px; margin-top: 20px; }
.ff-auth-link {
  border: 0; background: none; padding: 0; font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--ff-blue); cursor: pointer;
}
.ff-auth-link:hover { text-decoration: underline; }
.ff-auth-alt { font-size: 13px; color: var(--ff-muted); text-align: center; margin: 16px 0 0; }
.ff-field-error { font-size: 12px; color: var(--ff-red); margin: 0; }

/* ── Toasts ────────────────────────────────────────────────────────── */
.ff-toasts { position: fixed; right: 22px; bottom: 22px; z-index: 120; display: flex; flex-direction: column; gap: 10px; }
.ff-toast {
  display: flex; align-items: center; gap: 11px;
  min-width: min(268px, 100%); max-width: min(380px, calc(100vw - 44px));
  padding: 13px 15px; border-radius: 13px; background: #fff; border: 1px solid var(--ff-line);
  box-shadow: 0 12px 30px rgba(16,24,40,.14); font-size: 13.5px; color: var(--ff-ink);
  animation: ff-toast-in .22s ease-out; transition: opacity .25s;
}
@keyframes ff-toast-in { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.ff-toast svg { width: 17px; height: 17px; flex: none; }

/* A completed send reads as done at a glance: green mark, green text, green field. */
.ff-toast.is-success {
  background: var(--ff-green-soft); border-color: #b9ead0; color: var(--ff-green);
}
.ff-toast.is-success svg { color: var(--ff-green); }
.ff-toast.is-success button { color: var(--ff-green); opacity: .65; }
.ff-toast.is-error {
  background: var(--ff-red-soft); border-color: #f7d3d0; color: var(--ff-red);
}
.ff-toast.is-error svg { color: var(--ff-red); }
.ff-toast.is-error button { color: var(--ff-red); opacity: .65; }
.ff-toast.is-warning {
  background: var(--ff-amber-soft); border-color: #f2e0bb; color: var(--ff-amber);
}
.ff-toast.is-warning svg { color: var(--ff-amber); }
.ff-toast.is-info svg { color: var(--ff-blue); }
.ff-toast button { margin-left: auto; border: 0; background: none; color: var(--ff-muted-2); cursor: pointer; padding: 0; display: flex; }

/* ── Mobile ────────────────────────────────────────────────────────── */
.ff-topbar { display: none; }
.ff-scrim { display: none; }

@media (max-width: 1180px) {
  .ff-split { grid-template-columns: 1fr; }
  .ff-preview { position: static; }
  .ff-main { padding: 30px 26px 72px; }
}
@media (max-width: 900px) {
  .ff-grid-2, .ff-optcards { grid-template-columns: 1fr; }
  .ff-plans, .ff-numlist { grid-template-columns: 1fr; }
  .ff-numsearch { grid-template-columns: 1fr; }
  .ff-numsearch .ff-btn { width: 100%; }
  .ff-row-3, .ff-row-2 { grid-template-columns: 1fr; }
  .ff-sidebar { transform: translateX(-100%); transition: transform .2s ease-out; box-shadow: 0 0 40px rgba(16,24,40,.16); }
  .ff-sidebar.is-open { transform: none; }
  .ff-main { margin-left: 0; padding: 18px 16px 72px; }
  .ff-topbar {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px;
    background: #fff; border-bottom: 1px solid var(--ff-line);
    position: sticky; top: 0; z-index: 30;
  }
  .ff-topbar .ff-brand { margin: 0; padding: 0; }
  .ff-topbar .ff-brand-name { font-size: 19px; }
  .ff-topbar .ff-brand-mark { width: 32px; height: 32px; border-radius: 8px; }
  .ff-burger { border: 0; background: none; padding: 6px; color: var(--ff-ink); cursor: pointer; display: flex; }
  .ff-burger svg { width: 22px; height: 22px; }
  .ff-scrim { position: fixed; inset: 0; background: rgba(20,22,26,.4); z-index: 35; }
  .ff-scrim.is-open { display: block; }
  .ff-h1 { font-size: 34px; }
  .ff-page-head { flex-direction: column; align-items: stretch; }
  .ff-card-pad { padding: 20px 18px; }
  .ff-tabbar { flex-direction: column; align-items: stretch; gap: 14px; }
  .ff-search { margin-left: 0; min-width: 0; }
  .ff-modal-title { font-size: 25px; }
  .ff-modal-box { padding: 24px 20px; }
  .ff-detail-num { font-size: 22px; }
  .ff-row { padding: 15px 16px; }
  .ff-viewer iframe { height: 460px; }

  /* The number field sits under the country picker; its spacer label
     would otherwise leave an empty line. */
  .ff-row-3 .ff-field:nth-child(2) > .ff-label { display: none; }

  .ff-pager { padding: 14px 16px; justify-content: center; }
  .ff-pager-pages { margin-left: 0; }
  .ff-pager-count { flex-basis: 100%; text-align: center; }
}

@media (max-width: 620px) {
  /* Status and time drop below the number instead of squeezing it. */
  .ff-row { flex-wrap: wrap; row-gap: 9px; }
  .ff-row-main { flex: 1 1 auto; }
  .ff-row-meta { flex-basis: calc(100% - 53px); margin-left: 53px; gap: 12px; }
  .ff-row-chevron { margin-left: auto; }
}
