/* Customer account (portal). Builds on styles.css for colors, buttons and chips.
   Layout: a fixed rail on the left (companies first, then the menu), work area on the right. */

.portal-page { background: var(--soft); font-size: 15.5px; }
.preview-bar { background: var(--ink); color: #c9ccd3; font-size: 13.5px; text-align: center; padding: 8px 16px; }
.preview-bar a { color: #fff; font-weight: 600; margin-left: 6px; }

.app { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: calc(100vh - 36px); }

/* Rail */
.rail { background: #fff; border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto; }
.rail .brand { padding: 2px 8px 10px; font-size: 17px; }
.rail-label { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 18px 10px 6px; }
.companies { display: flex; flex-direction: column; gap: 2px; }
.co-btn { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; background: transparent; border-radius: 9px; padding: 7px 10px; cursor: pointer; font-weight: 500; font-size: 14.5px; color: var(--ink-2); }
.co-btn:hover { background: var(--soft); }
.co-btn[aria-selected="true"] { background: var(--ink); color: #fff; }
.co-btn .av { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: #fff; }
.co-btn .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-btn .st { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.co-btn[aria-selected="true"] .st { color: #b9bdc6; }
.co-btn .av.all { background: #fff; border: 1.5px solid var(--line-2); color: var(--ink); }
.company-select { display: none; }
.add-co { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; color: var(--blue); font-weight: 600; font-size: 14px; padding: 9px 16px; cursor: pointer; border-radius: 9px; text-align: left; }
.add-co:hover { background: var(--tint); }
.menu { display: flex; flex-direction: column; gap: 2px; }
.menu a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: var(--ink-2); font-weight: 500; font-size: 14.5px; }
.menu a:hover { background: var(--soft); color: var(--ink); }
.menu a[aria-current="page"] { background: var(--tint); color: var(--blue-dark); font-weight: 600; }
.menu a em { margin-left: auto; font-style: normal; font-size: 11.5px; font-weight: 700; background: var(--blue); color: #fff; padding: 1px 7px; border-radius: 999px; }
.rail-foot { margin-top: auto; padding: 16px 10px 4px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who i { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--soft); border: 1px solid var(--line-2); display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: 12px; }
.who b { display: block; font-size: 13.5px; }
.who small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }

/* Stage */
.stage { padding: 36px 40px 80px; min-width: 0; outline: 0; }
.stage-inner { max-width: 1040px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; }
.crumb { font-size: 13.5px; color: var(--muted); font-weight: 500; margin-bottom: 6px; }
.page-head h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 620px; }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
.card-pad { padding: 22px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.card-head span { font-size: 13.5px; color: var(--muted); }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.stat .k { font-size: 13.5px; color: var(--muted); font-weight: 500; }
.stat .v { font-size: 24px; font-weight: 700; letter-spacing: -0.03em; margin: 6px 0 10px; line-height: 1.15; }
.stat .s { font-size: 13.5px; color: var(--ink-2); margin-top: 10px; }
.stat .btn { margin-top: 14px; }

/* Rows and tables */
.rows { display: flex; flex-direction: column; }
.row { display: grid; align-items: center; gap: 14px; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row.click { cursor: pointer; width: 100%; text-align: left; background: transparent; border-left: 0; border-right: 0; border-top: 0; }
.row.click:hover { background: #fafaf8; }
.row b { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .r { text-align: right; white-space: nowrap; color: var(--ink-2); font-size: 14px; }
.row-co { grid-template-columns: 34px minmax(0, 1.3fr) minmax(0, 1.35fr) minmax(0, 1.05fr) auto; }
.row-mail { grid-template-columns: 10px 36px minmax(0, 1fr) auto auto; }
.row-rep { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 190px 180px; }
.row-rep > :nth-child(3), .row-rep > :nth-child(4) { justify-self: end; }
.row-bill { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto; }
.row-inv { grid-template-columns: 96px minmax(0, 1fr) auto auto auto; }
.av { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); }
.dot.read { background: transparent; }
.ic { width: 36px; height: 36px; border-radius: 9px; background: var(--soft); display: grid; place-items: center; color: var(--ink-2); }
.unread b { font-weight: 700; }
.chip.red { background: #fde8e8; color: #a61b1b; }
.chip.gray { background: var(--soft); color: var(--ink-2); }
.empty { padding: 40px 22px; text-align: center; color: var(--muted); }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 500; cursor: pointer; color: var(--ink-2); }
.tabs button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Details list */
.dl { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px 16px; font-size: 14.5px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 500; }

/* Calendar menu */
.cal { position: relative; display: inline-block; }
.cal-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 230px; background: #fff; border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; }
.cal-menu a, .cal-menu button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 12px; border-radius: 8px; font-size: 14.5px; font-weight: 500; color: var(--ink); cursor: pointer; }
.cal-menu a:hover, .cal-menu button:hover { background: var(--soft); color: var(--ink); }
.cal-menu small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.cal-note { font-size: 12.5px; color: var(--muted); padding: 8px 12px 6px; border-top: 1px solid var(--line); margin-top: 4px; }

/* Filings grid */
.fgrid2 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.fcard2 { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.fcard2:hover { border-color: var(--ink); box-shadow: var(--shadow); }
.fcard2 b { font-size: 15.5px; }
.fcard2 span { font-size: 13.5px; color: var(--muted); }
.fcard2 em { font-style: normal; font-weight: 600; font-size: 13.5px; margin-top: auto; padding-top: 6px; }

/* Mail reader */
.paper { background: var(--soft); border: 1px dashed var(--line-2); border-radius: 12px; padding: 28px; margin-top: 18px; color: var(--muted); font-size: 14.5px; text-align: center; }
.notice { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; padding: 14px 16px; border-radius: 12px; background: var(--amber-tint); color: #5c3c00; font-size: 14.5px; margin-top: 16px; }
.notice.blue { background: var(--tint); color: #123a8f; }

.snack { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14.5px; font-weight: 500; box-shadow: var(--shadow-lg); z-index: 60; max-width: calc(100vw - 32px); }

@media (max-width: 980px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 14px 16px 10px; gap: 8px; }
  .rail .brand { padding: 0 0 4px; }
  .rail-label, .companies, .rail-foot, .add-co { display: none; }
  .company-select { display: block; }
  .company-select select { min-height: 46px; padding-left: 14px; font-weight: 600; }
  .menu { flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .menu a { white-space: nowrap; padding: 8px 12px; }
  .stage { padding: 24px 16px 64px; }
  .grid3, .grid2 { grid-template-columns: minmax(0, 1fr); }
  .fgrid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .page-head h1 { font-size: 25px; }
  .row { padding: 14px 16px; gap: 10px; }
  .card-head, .card-pad { padding-left: 16px; padding-right: 16px; }
  .row-co { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .row-co .hide-s, .row-rep .hide-s, .row-bill .hide-s, .row-inv .hide-s, .row-mail .hide-s { display: none; }
  .row-mail { grid-template-columns: 10px minmax(0, 1fr) auto; }
  .row-mail .ic { display: none; }
  .row-rep, .row-bill { grid-template-columns: minmax(0, 1fr); }
  .row-rep .r, .row-bill .r { text-align: left; }
  .row-inv { grid-template-columns: minmax(0, 1fr) auto; }
  .row-inv > :first-child { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
  .row-inv .btn { grid-column: 1 / -1; justify-self: start; }
  .row b, .row small { white-space: normal; }
  .fgrid2 { grid-template-columns: minmax(0, 1fr); }
  .dl { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .dl dd { margin-bottom: 10px; }
  .cal-menu { right: auto; left: 0; }
}

.rail-foot a { white-space: nowrap; }

/* Layout v3: left rail with the menu on top (always all companies) and the company list under it. */
.co-btn[aria-current="true"] { background: var(--ink); color: #fff; }
.co-btn[aria-current="true"] .st { color: #b9bdc6; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.rail .brand + .menu { margin-top: 14px; }

/* Layout v4: one menu, companies are content. Works for 1 company or 50. */
.preview-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 12px; }
.preview-bar a { margin-left: 0; }
.sizes { display: inline-flex; gap: 4px; }
.sizes button { border: 1px solid #3a3e47; background: transparent; color: #c9ccd3; font-size: 12.5px; font-weight: 600; border-radius: 999px; padding: 3px 11px; cursor: pointer; }
.sizes button[aria-pressed="true"] { background: #fff; border-color: #fff; color: var(--ink); }
.rail .brand + .menu, .jump + .menu { margin-top: 14px; }
.jump { margin-top: 12px; padding: 0 2px; }
.jump[hidden] + .menu { margin-top: 14px; }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { width: 100%; min-height: 40px; border: 1px solid var(--line-2); border-radius: 9px; padding: 0 12px 0 36px; font-size: 14.5px; background: #fff; }
.search.inline { flex: 1 1 280px; max-width: 380px; margin: 0; }
.jump-list { margin-top: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 4px; background: #fff; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.jump-none { padding: 10px; font-size: 13.5px; color: var(--muted); }
.menu a em.quiet { background: var(--soft); color: var(--ink-2); border: 1px solid var(--line-2); }
.crumb.back { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--blue); margin-bottom: 10px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.row-att { grid-template-columns: 104px minmax(0, 1fr) auto; }
.row-att .go { color: var(--blue); font-weight: 600; }
.row.more { display: block; width: 100%; text-align: center; border: 0; background: #fafaf8; color: var(--blue); font-weight: 600; cursor: pointer; padding: 14px; }
.row.more:hover { background: var(--tint); }
.card-head .search input { min-height: 42px; }
@media (max-width: 980px) {
  .jump { margin-top: 4px; padding: 0; }
  .jump-list { position: relative; z-index: 5; }
}
@media (max-width: 640px) {
  .row-att { grid-template-columns: minmax(0, 1fr) auto; }
  .row-att > .chip { grid-column: 1 / -1; justify-self: start; }
  .card-head .search.inline { max-width: none; flex-basis: 100%; }
}
@media (min-width: 641px) {
  .row-co { grid-template-columns: 34px minmax(0, 1.3fr) minmax(0, 1.35fr) minmax(0, 1.05fr) 132px; }
  .row-co > .chip { justify-self: end; }
}

/* Layout v5: menu (Mailbox, Billing, Order a filing), then the company list with "All" first. No search. */
#co-block[hidden] { display: none; }
.companies { max-height: none; }
.grid-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.grid-even .card-pad { display: flex; flex-direction: column; height: calc(100% - 55px); }
.grid-even .btn-row { margin-top: auto; padding-top: 16px; }
.rep { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.rep-main .k { font-size: 13.5px; color: var(--muted); font-weight: 500; }
.rep-main .v { font-size: 30px; font-weight: 700; letter-spacing: -0.035em; margin: 4px 0 8px; line-height: 1.1; }
.rep-main .s { color: var(--ink-2); font-size: 14.5px; }
.rep-main .s .chip { margin-left: 4px; vertical-align: 1px; }
.rep-side { background: var(--soft); border-radius: 12px; padding: 18px; font-size: 14.5px; }
.rep-side b { display: block; font-size: 15px; }
.rep-side small { display: block; color: var(--muted); font-size: 13.5px; margin-top: 4px; line-height: 1.45; }
.switch { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; align-items: start; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 44px; height: 26px; border-radius: 999px; background: var(--line-2); position: relative; transition: background 0.15s; margin-top: 1px; }
.switch .track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.25); transition: transform 0.15s; }
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 3px solid var(--blue); outline-offset: 2px; }
.links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.linkcard { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; cursor: pointer; color: var(--ink); display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
.linkcard:hover { border-color: var(--ink); color: var(--ink); box-shadow: var(--shadow); }
.linkcard span { color: var(--muted); font-size: 13.5px; }
.linkish { border: 0; background: transparent; color: var(--blue); font-weight: 600; cursor: pointer; padding: 0 0 0 6px; font-size: inherit; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.mail-co select { min-height: 40px; padding: 0 36px 0 14px; font-size: 14px; font-weight: 500; }
@media (max-width: 980px) {
  #co-block { display: block; }
  .grid-even, .rep, .links { grid-template-columns: minmax(0, 1fr); }
  .grid-even .card-pad { height: auto; }
}
.grid-even .card { display: flex; flex-direction: column; }
.grid-even .card-pad { flex: 1; height: auto; }

/* The Compliance switch is a button (it opens a confirmation), not a checkbox. */
button.switch { border: 0; background: transparent; padding: 0; text-align: left; width: 100%; font: inherit; color: inherit; }
button.switch[aria-checked="true"] .track { background: var(--green); }
button.switch[aria-checked="true"] .track::after { transform: translateX(18px); }
button.switch:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; border-radius: 8px; }

/* Pass-through terms: cancel disclosures, locked mail */
.terms { margin: 20px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; font-size: 14.5px; color: var(--ink-2); }
.terms li { padding: 14px 16px; background: var(--soft); border-radius: 12px; line-height: 1.5; }
.terms b { color: var(--ink); }
.ack { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; margin-top: 18px; font-size: 15px; font-weight: 500; cursor: pointer; }
.ack input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ink); }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.stage-inner > .notice { margin-top: 0; }
.notice .linkish { color: inherit; text-decoration: underline; padding-left: 4px; }

/* Contact person form, links inside notes */
.text-in { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 10px; font: inherit; font-size: 16px; color: var(--ink); background: #fff; }
.text-in:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: transparent; }
.hint a, .notice a { color: inherit; text-decoration: underline; }

/* State forms */
.row-form { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.row-form .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--soft); display: grid; place-items: center; color: var(--ink-2); }
.init-side { display: flex; align-items: center; justify-content: flex-end; }
@media (max-width: 980px) and (min-width: 641px) { .row-rep { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto auto; } }
@media (max-width: 640px) { .row-rep > :nth-child(3), .row-rep > :nth-child(4) { justify-self: start; } }

/* What reminders and Compliance do not cover */
.scope { margin: 0; padding: 14px 22px 18px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); line-height: 1.5; }
/* Resources: state filing office */
.office { overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.office .k { font-size: 13px; color: var(--muted); }
.office .v2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; }
.office .s { color: var(--muted); font-size: 14.5px; margin: 6px 0 16px; }
.office .btn { display: inline-flex; gap: 8px; align-items: center; }
.office-side { background: var(--soft); border-left: 1px solid var(--line); }
.office-side ul { margin: 10px 0 0; padding-left: 18px; font-size: 14.5px; color: var(--ink-2); display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 760px) { .office { grid-template-columns: minmax(0, 1fr); } .office-side { border-left: 0; border-top: 1px solid var(--line); } .scope { padding: 12px 16px 16px; } }
.row-form small { white-space: normal; overflow: visible; text-overflow: clip; }

/* Report details form */
.person { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 10px; margin-top: 8px; }
.person .select-wrap select { min-height: 48px; padding-left: 14px; }
@media (max-width: 640px) { .person { grid-template-columns: minmax(0, 1fr); } }
.form-h { font-size: 17px; letter-spacing: -0.01em; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
