[hidden] { display: none !important; }
/* ================================================================
   FideO Ledger — additions on top of the FideO v2.2 stylesheet.
   Uses only the variables defined in styles.css, so the look stays
   one system. Nothing here overrides an existing rule.
   ================================================================ */

.test-banner {
    position: fixed; top: 0; left: 0; right: 0; height: 26px; z-index: 1000;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    background: var(--warning); color: #000; text-align: center;
    font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em;
    padding: 0.375rem 1rem;
}
body.has-test-banner { padding-top: 26px; }
body.has-test-banner .navbar { top: 26px; }
body.has-test-banner .view-header { top: 26px; }
@media (max-width: 768px) { body.has-test-banner .navbar { top: auto !important; } }

/* view content padding, same rule the legacy app applies per view */
.dashboard-content .view > :not(.view-header) { margin-left: var(--content-pad); margin-right: var(--content-pad); }
.dashboard-content .view > .view-header + * { margin-top: 1.25rem; }
.dashboard-content .view { padding-bottom: 5rem; }
.view-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.view-header .view-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.round-icon {
    width: 56px; height: 56px; border-radius: 50%; background: var(--primary-light);
    display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem;
}
.code-input { text-align: center; font-size: 1.75rem !important; letter-spacing: 0.5rem; font-weight: 600; padding: 0.75rem !important; }
.dev-note { display: block; text-align: center; margin-top: 6px; color: var(--warning); font-size: 0.75rem; font-weight: 600; }

.nav-count {
    margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
    border-radius: var(--radius-full); background: var(--error); color: #fff;
    font-size: 0.6875rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}

/* notices */
.notice { border-radius: var(--radius-md); padding: 0.875rem 1rem; font-size: 0.8125rem; margin: 0.75rem 0; line-height: 1.55; }
.notice-info { background: var(--info-light); color: var(--primary-dark); }
.notice-success { background: var(--success-light); color: #1d5e3e; }
.notice-warning { background: var(--warning-light); color: #7a3e00; }
.notice-error { background: var(--error-light); color: #8a1c15; }
.notice strong { font-weight: 700; }

/* tables */
.ltable { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.ltable th { text-align: left; font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-tertiary); font-weight: 700; padding: 0.5rem 0.625rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.ltable td { padding: 0.625rem; border-bottom: 1px solid var(--border-light); vertical-align: top; }
.ltable tr:last-child td { border-bottom: none; }
.ltable tr.clickable { cursor: pointer; }
.ltable tr.clickable:hover td { background: var(--bg-hover); }
.table-wrap { overflow-x: auto; }

.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.75rem; word-break: break-all; }
.muted { color: var(--text-secondary); }
.tiny { font-size: 0.75rem; }
.amt { font-family: var(--font-body); font-weight: 700; font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.stack > * + * { margin-top: 0.75rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 768px) { .grid-2 { grid-template-columns: 1fr; } }

.badge-neutral { background: var(--bg-tertiary); color: var(--text-secondary); }

/* the instrument text a member signs */
.instrument-text {
    white-space: pre-wrap; font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.75rem; line-height: 1.6; background: var(--bg-tertiary);
    border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 1rem; max-height: 46vh; overflow-y: auto;
}
.sig-list { list-style: none; display: flex; flex-direction: column; gap: 0.375rem; }
.sig-list li { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; }
.sig-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border-heavy); flex-shrink: 0; }
.sig-dot.signed { background: var(--success); }
.sig-dot.declined { background: var(--error); }
.sig-dot.invalid { background: var(--warning); }

.modal-content.modal-large { max-width: 720px; }
.modal .form-group + .form-group { margin-top: 0.875rem; }
.modal .form-row { margin-top: 0.875rem; }
.field-help { font-size: 0.75rem; color: var(--text-tertiary); }

.kv { display: grid; grid-template-columns: 160px 1fr; gap: 0.375rem 1rem; font-size: 0.8125rem; }
.kv dt { color: var(--text-secondary); }
@media (max-width: 768px) { .kv { grid-template-columns: 1fr; } }

.empty-inline { color: var(--text-tertiary); font-size: 0.8125rem; padding: 0.5rem 0; }
.pill-tabs { margin-top: 1.25rem; }
@media (max-width: 768px) { .dashboard-content .view { padding-bottom: 6rem; } }
#modal .modal-content { z-index: 501; }
.toast-container { bottom: auto; top: 2.25rem; z-index: 10000; }
.modal .form-row .form-group + .form-group { margin-top: 0; }
.modal .form-row > .form-group { min-width: 0; }
.modal .form-group input, .modal .form-group select, .modal .form-group textarea { width: 100%; }
.dashboard-content .view > .stats-grid { margin: 1.25rem var(--content-pad) !important; }

/* ---- social layer ---- */
.dm-layout { display: grid; grid-template-columns: 320px 1fr; height: calc(100vh - 220px); min-height: 440px; }
.dm-list { border-right: 1px solid var(--border); overflow-y: auto; }
.dm-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.dm-thread .chat-messages-area { min-height: 0; }
.dm-back { display: none; }
.message-card.active { background: var(--bg-hover); }
.message-card .nav-count { margin-left: 0.5rem; }
.grp-card .nav-count { margin-left: 0.5rem; }
.grp-detail-tabs a.gd-tab { text-decoration: none; display: inline-block; }
.gd-panel .chat-messages-area { border: 1px solid var(--border-light); border-radius: var(--radius-md); }
.post-card a.post-author-avatar { text-decoration: none; }
.profile-cover { border-radius: 0; }
.feed-container-full .feed-sidebar-right { padding: 1rem; }
@media (max-width: 768px) {
  .dm-layout { grid-template-columns: 1fr; height: calc(100vh - 200px); }
  .dm-layout.has-thread .dm-list { display: none; }
  .dm-layout:not(.has-thread) .dm-thread { display: none; }
  .dm-back { display: flex; }
  .feed-container-full { grid-template-columns: 1fr; }
}
/* links inside social views read as UI, not as underlined text */
#community-view a, #post-view a, #people-view a, #messages-view a,
#groups-view a, #notifications-view a { text-decoration: none; }
#community-view .post-author-name:hover, #post-view .post-author-name:hover,
.post-hashtag:hover, .post-mention:hover { text-decoration: underline; }

/* a zero count stays hidden even where the mobile nav forces spans visible */
.nav-count[hidden] { display: none !important; }
@media (max-width: 768px) {
  .nav-menu { justify-content: flex-start !important; overflow-x: auto !important; }
  .nav-menu > div { display: none; }
  .nav-link { flex: 0 0 auto; min-width: 64px; font-size: 0.5625rem !important; white-space: nowrap; position: relative; }
  .nav-link .nav-count { position: absolute; top: 0; right: 10px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 0.5625rem !important; margin: 0; }
}
.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0.75rem; }
.dir-grid .dir-card { margin-bottom: 0; }
#directory-view a:not(.btn) { text-decoration: none; }

/* ---- member autocomplete ---- */
.mp-drop { position: absolute; z-index: 20000; background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-xl); overflow: hidden; max-height: 320px; overflow-y: auto; }
.mp-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; cursor: pointer; font-size: 0.875rem; }
.mp-item.active, .mp-item:hover { background: var(--bg-hover); }

/* ---- contract composer ---- */
.composer-grid { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 1rem; align-items: start; }
.composer-main .section-card { margin-bottom: 0.75rem; }
.composer-main .form-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.composer-main .form-row > .form-group { flex: 1 1 180px; min-width: 0; }
.composer-main .form-row > .form-group.narrow { flex: 0 1 120px; }
.composer-main .form-group { margin-bottom: 0.625rem; }
.composer-main .form-group input, .composer-main .form-group select, .composer-main .form-group textarea { width: 100%; }
.leg-card { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.75rem 0.875rem; margin-bottom: 0.75rem; background: var(--bg-secondary); }
.ms-row { border-left: 3px solid var(--primary-light); padding-left: 0.625rem; margin-bottom: 0.5rem; }
.ck { gap: 0.375rem; cursor: pointer; }
.ck input { width: auto; }
.wrap-gap { gap: 0.5rem 1.25rem; }
.grid-2-wide { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 0.75rem; }
@media (max-width: 1100px) { .composer-grid, .grid-2-wide { grid-template-columns: 1fr; } }

/* ---- contract board and contract cards in chat ---- */
#board-view a.board-card { display: block; color: inherit; text-decoration: none; margin-bottom: 0; }
#board-view a.board-card:hover { box-shadow: var(--shadow-md); }
#board-view .pill-tabs { display: flex; gap: 0.25rem; }
.cc-holder { margin-top: 0.375rem; }
.cc-card { display: block; background: var(--bg-primary); color: var(--text-primary); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 0.5rem 0.625rem; text-decoration: none; min-width: 220px; }
.cc-card ul { margin: 0.25rem 0 0.25rem 1rem; padding: 0; }
.message-bubble.own .cc-card { color: var(--text-primary); }
.chat-input-container #dm-attach, .chat-input-container #gc-attach { flex: 0 0 auto; }
#bd-q { padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-md); font: inherit; }

/* ---- composer: field errors, autofill, guaranty suggestions, schedules ---- */
.composer-main .has-error input, .composer-main .has-error select, .composer-main .has-error textarea,
.composer-main input.has-error, .composer-main select.has-error {
  border-color: var(--error, #d64545) !important; background: #fff6f6; box-shadow: 0 0 0 2px rgba(214,69,69,.15); }
.composer-main .leg-card.has-error, .composer-main .ms-row.has-error, .composer-main .c-sec.has-error,
.composer-main .sched-card.has-error, .composer-main .wrap-gap.has-error, .composer-main .form-row.has-error {
  outline: 2px solid var(--error, #d64545); outline-offset: 2px; border-radius: var(--radius-md); }
.err-msg { color: var(--error, #d64545); font-size: .75rem; font-weight: 600; margin-top: .25rem; }
.leg-card > .err-msg, .c-sec > .err-msg, .wrap-gap > .err-msg { width: 100%; margin: 0 0 .375rem; }
.err-count { font-family: inherit; font-size: .6875rem; font-weight: 700; color: #fff; background: var(--error, #d64545);
  border-radius: 9999px; padding: .1rem .5rem; margin-left: .375rem; vertical-align: middle; }
.err-list { margin: .375rem 0 0 1.1rem; } .err-list li { margin: .125rem 0; } .err-list a { color: inherit; text-decoration: underline; }
.composer-main .autofilled { background: #f1f7ff; border-color: #9cc3f5 !important; }
.autofilled-pill { display: inline-block; font-size: .625rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: #0b5cad; background: #e3f0ff; border-radius: 4px; padding: 0 .3rem; }
.g-opts { margin: .375rem 0 .75rem; } .g-opt { display: flex; justify-content: space-between; align-items: center; gap: .75rem;
  padding: .375rem .5rem; border: 1px dashed var(--border); border-radius: var(--radius-md); margin-bottom: .375rem; font-size: .8125rem; }
.sched-card { background: #fbfcfe; } .sched-table td, .sched-table th { padding: .25rem .5rem; font-size: .75rem; }

/* ---- balance sheets ---- */
.bs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: .75rem; }
@media (max-width: 900px) { .bs-grid { grid-template-columns: 1fr; } }
.bs-side { border: 1px solid var(--border); border-radius: var(--radius-md); padding: .75rem .875rem; background: var(--bg-primary); margin-bottom: .75rem; }
.bs-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid var(--border); padding-bottom: .375rem; margin-bottom: .25rem; }
.bs-head h4 { margin: 0; font-family: 'Instrument Serif', Georgia, serif; font-size: 1.125rem; font-weight: 600; }
.bs-group { font-size: .6875rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-secondary, #5A6A7E); margin: .5rem 0 .125rem; }
.bs-line { display: flex; justify-content: space-between; gap: 1rem; padding: .25rem 0; font-size: .875rem; border-bottom: 1px dashed var(--border-light, #eef1f5); }
.bs-line span, .bs-line strong:last-child { white-space: nowrap; }
.neg { color: var(--error, #d64545); }

/* balance-sheet lines: the entries each is summed from */
.bs-src { margin: 0 0 .25rem .75rem; }
.bs-src summary { cursor: pointer; color: var(--text-secondary, #5A6A7E); }
.bs-src table { margin-top: .25rem; }

/* credit applications */
.cr-line { display: grid; grid-template-columns: 1fr 8rem auto; gap: .375rem; align-items: center; margin-bottom: .375rem; }
.cr-line a[data-rm] { color: var(--text-secondary, #5A6A7E); text-decoration: none; padding: 0 .25rem; }
.cr-bar { height: 6px; border-radius: 3px; background: var(--border, #dde3ea); margin: .5rem 0 .25rem; overflow: hidden; }
.cr-bar > div { height: 100%; background: var(--success, #2e7d4f); }
@media (max-width: 600px) { .cr-line { grid-template-columns: 1fr 6rem auto; } }

/* v16 navigation: hub tabs, club sections, account menu */
.hub-tabs { display: flex; gap: .25rem; flex-wrap: wrap; border-bottom: 1px solid var(--border, #dde3ea); margin: 0 0 1rem; padding-top: .75rem; }
.hub-tab { padding: .5rem .875rem; font-size: .875rem; font-weight: 600; color: var(--text-secondary, #5A6A7E); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.hub-tab:hover { color: var(--text-primary, #1a2433); }
.hub-tab.active { color: var(--primary, #1f5fbf); border-bottom-color: var(--primary, #1f5fbf); }
.gd-sections { display: flex; gap: .375rem; flex-wrap: wrap; padding: .5rem .875rem; border-bottom: 1px solid var(--border-light, #eef1f5); }
.gd-sec { font-size: .8125rem; padding: .25rem .625rem; border-radius: 999px; color: var(--text-secondary, #5A6A7E); text-decoration: none; border: 1px solid var(--border, #dde3ea); }
.gd-sec.active { background: var(--primary, #1f5fbf); border-color: var(--primary, #1f5fbf); color: #fff; }
.nav-account { margin-top: auto; }
.nav-account > summary { list-style: none; cursor: pointer; }
.nav-account > summary::-webkit-details-marker { display: none; }
.nav-account-menu { display: flex; flex-direction: column; gap: 2px; padding-left: 1.75rem; }
.nav-link.nav-sub { font-size: .8125rem; padding-top: .375rem; padding-bottom: .375rem; }
.nav-count-soft { background: rgba(255,255,255,.18) !important; }
@media (max-width: 768px) {
  .hub-tabs { flex-wrap: nowrap; overflow-x: auto; }
  .nav-account { margin-top: 0; position: relative; }
  .nav-account-menu { position: fixed; bottom: 64px; right: 8px; padding: .5rem; background: var(--bg-sidebar, #0b2a5b); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.3); z-index: 50; }
  .nav-link.nav-sub { font-size: .8125rem !important; min-width: 0; }
}
