.company-dialog{width:min(94vw,640px);max-height:calc(var(--field-viewport-height,100dvh) - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 24px);overflow:auto;box-sizing:border-box;overscroll-behavior:contain;padding:20px max(16px,env(safe-area-inset-right,0px)) 24px max(16px,env(safe-area-inset-left,0px))}
.company-dialog header{display:flex;align-items:start;justify-content:space-between;gap:12px}.company-dialog h2{margin:0 0 16px}.company-dialog input,.company-dialog select{width:100%;box-sizing:border-box;min-height:44px;font-size:16px}.company-dialog input[type=checkbox]{width:24px;min-width:24px;height:24px;min-height:24px}.company-dialog button{min-height:44px;white-space:normal;overflow-wrap:anywhere}.company-actions{display:flex;gap:8px;flex-wrap:wrap}.company-person{display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding:12px 0;border-bottom:1px solid #ddd}.company-person[hidden]{display:none}.company-person span{flex:1;min-width:120px;overflow-wrap:anywhere}.company-person small{display:block}.company-dialog fieldset{min-width:0}.company-dialog :focus-visible{outline:3px solid #C41E3A;outline-offset:3px}.company-dialog .field{display:block;margin:12px 0}.company-dialog .crew-check{margin:16px 0;align-items:start}

.company-profile{padding:16px 0;border-block:1px solid var(--line,#ddd);border-radius:0;margin:16px 0;background:transparent}.company-profile h3{margin:0}.company-private-label{font-size:13px;color:#555}.company-person [data-company-action=message]{font-weight:650;min-width:100px}.company-dialog .company-person [data-company-action=message]:disabled{opacity:.6}

.company-dialog #company-close{flex:0 0 auto;white-space:nowrap;overflow-wrap:normal}

/* The existing Business destination is now the single account/settings area. */
.account-card{border-top:1px solid var(--line,#ddd)}
.account-card h2{margin-top:0}.account-card .account-status{font-weight:700}
.account-facts{display:grid;grid-template-columns:minmax(90px,.4fr) minmax(0,1fr);gap:10px 16px;margin:20px 0}
.account-facts dt{color:var(--ink-dim,#555)}.account-facts dd{margin:0;overflow-wrap:anywhere}
.account-card .company-actions button{min-height:44px;white-space:normal;overflow-wrap:anywhere}
.account-card select{width:100%;min-height:44px;font-size:16px}
.account-card [role=status]{min-height:1.5em}
body .tab-bar button[data-view=you]{white-space:normal;line-height:1.1}
body .tab-bar button[data-view=you] span:last-child{max-width:105px}

/* Main company entry only; room/member picker layout remains independent. */
.company-dialog .company-start{display:grid;grid-template-columns:1fr;gap:12px;margin:20px 0}
.company-dialog .company-start button,.company-dialog .company-option-actions button{min-height:48px!important;width:100%;margin:0}
.company-dialog .company-options{margin-top:24px;border-top:1px solid var(--line,#ddd);padding-top:8px}
.company-dialog .company-options summary{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:56px;font-weight:650;cursor:pointer;list-style:none;overflow-wrap:anywhere}
.company-dialog .company-options summary::after{content:'+';flex:none}
.company-dialog .company-options details[open]>summary::after,.company-dialog .company-options[open]>summary::after{content:'−'}
.company-dialog .company-option-actions{display:grid;gap:12px;margin:12px 0 20px}
.company-dialog .company-account-options{border-top:1px solid var(--line,#ddd);margin-top:16px;padding-top:8px}

.company-dialog header{flex-wrap:wrap}
.company-dialog header h2{flex:1 1 10rem;overflow-wrap:normal}
/* Crew directory only; company administration keeps its existing layout. */
.company-room-picker h3{margin:0 0 12px}.company-room-picker p{overflow-wrap:anywhere}
.company-room-picker .company-person{min-height:56px;flex-wrap:nowrap;box-sizing:border-box;gap:12px}
.company-room-picker .company-person small{font-size:14px;line-height:1.45}
.company-room-picker .company-person span{min-width:0}
.company-room-picker .company-picker-selection{margin:16px 0;padding:12px;background:var(--surface-2);border-radius:14px}
.company-room-picker #company-add-submit{width:100%;min-height:56px!important;margin:8px 0}
.company-room-picker #company-picker-refresh{margin-top:8px}
.company-room-picker button:disabled{opacity:.45}

/* Account is one identity row, followed by the existing settings rows. */
#view-you #account-card{padding:16px;margin-bottom:12px;border-radius:0;border-width:0 0 1px;box-shadow:none}
#account-card .account-overview{display:flex;align-items:center;gap:12px;justify-content:space-between}
#account-card .account-summary{min-width:0;flex:1}
#account-card .account-summary h2{margin:0 0 4px;font-size:17px;line-height:1.35;overflow-wrap:anywhere}
#account-card .account-access-title{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
#account-card .account-status{margin:0;font-size:14px;line-height:1.4;min-height:0}
#account-card .account-company{margin:2px 0 0;font-size:14px;line-height:1.4;font-weight:650;overflow-wrap:anywhere}
#account-card .account-main-actions{flex:0 1 44%;margin:0}
#account-card .account-main-actions button{margin:0;min-height:44px;padding:10px 12px;font-size:14px;line-height:1.3}
#account-card .account-build{margin:8px 0 0;font-size:14px;line-height:1.4}
#account-card .account-local-summary{margin:10px 0 0;font-size:14px;line-height:1.4}
#account-card .account-technical{margin:10px 0 0;padding:0;border-top:1px solid var(--line,#ddd)}
#account-card>.account-technical>summary{margin:0;min-height:44px;display:flex;align-items:center;line-height:1.35;font-size:14px}
#account-card .account-technical[open]>summary{margin-bottom:12px}
#account-card .account-identity-email{overflow-wrap:anywhere}
#account-card .account-notice{margin:0 0 12px;padding:12px;border-left:3px solid var(--red,#C41E3A);background:var(--surface-2,#fafafa)}
.company-dialog{background:var(--surface,#fff);border-radius:12px}
.company-dialog #company-body>h3{margin-top:24px;padding-top:16px;border-top:1px solid var(--line,#ddd)}
.company-dialog #company-body>[data-company-action=new-room].primary{background:var(--red,#C41E3A);border-color:var(--red,#C41E3A);color:#fff;font-weight:750}
.company-dialog .company-profile p{margin:8px 0;font-size:14px;line-height:1.5}
.company-dialog .company-profile p:empty{display:none}
.company-dialog .company-options,.company-dialog .company-account-options{border-radius:0;background:transparent}
.company-dialog .company-profile{margin-top:0;padding-top:0;border-top:0}
.company-dialog .company-member-actions{flex:1 1 100%;border:0;padding:0;background:transparent}
.company-dialog .company-member-actions>summary{min-height:44px;display:flex;align-items:center;cursor:pointer;font-size:14px}
.company-dialog .company-member-actions .company-option-actions{margin:0 0 8px}
.company-dialog .company-membership,.company-dialog .company-information{margin-top:16px}
@media(max-width:360px){#view-you #account-card{padding:12px}#account-card .account-overview{gap:8px}#account-card .account-main-actions button{padding-inline:10px}}
#account-push .account-push{margin:0 0 12px;padding:16px;border-bottom:1px solid var(--line,#ddd);background:var(--surface)}
#account-push .account-push h3{margin:0 0 8px;font-size:18px;line-height:1.2;letter-spacing:-0.02em}
#account-push .account-push p{margin:0 0 12px;font-size:16px;line-height:1.45}
#account-push .account-push .company-actions{margin:0 0 8px}
#account-push .account-push-cats{margin:8px 0 0;padding:0;border:0}
#account-push .account-push-cats legend{padding:0;margin:0 0 8px;font-size:12px;font-weight:700;letter-spacing:0.08em;text-transform:uppercase}
#account-push .account-push-cat{display:flex;align-items:center;gap:12px;min-height:56px;margin:0;padding:8px 0;border-top:1px solid var(--line,#ddd);font-size:16px}
#account-push .account-push-cat input{width:24px;height:24px;flex:none}
#account-push .account-push-install{border:1px solid var(--line,#ddd);border-radius:18px;padding:16px;background:var(--surface,#fff);color:var(--ink,#111)}
#account-push .account-push-install h3{color:var(--ink,#111)}
#account-push .account-push-install p{color:var(--ink,#111);opacity:1}
#account-push .account-push-steps,#push-optin .account-push-steps{margin:12px 0 0;padding:0 0 0 24px;color:var(--ink,#111);font-size:16px;line-height:1.45}
#account-push .account-push-steps li,#push-optin .account-push-steps li{margin:8px 0;color:var(--ink,#111)}
#push-optin{flex-wrap:wrap}
#push-optin button{min-height:44px}
#push-optin.push-optin-install{display:flex;flex-direction:column;align-items:stretch;gap:12px}
#push-optin.push-optin-install #push-optin-copy{color:var(--ink,#111);font-size:16px;line-height:1.45}
#push-optin.push-optin-install #push-optin-copy p{margin:0 0 8px;font-size:16px;color:var(--ink,#111)}

/* v161: Company never covers the tab bar. */
.company-dialog{max-height:calc(var(--field-viewport-height,100dvh) - var(--field-nav-height,52px) - env(safe-area-inset-top,0px) - 16px)!important;margin-bottom:calc(var(--field-nav-height,52px) + 8px)}
/* v163: one compact company card, one short line, one button. Home renders the
   main area edge to edge, so the card carries its own inset there. */
#company-enrollment{display:grid;gap:12px;margin:0 0 20px;padding:16px;border:1px solid var(--line);border-radius:var(--radius,16px);background:var(--surface)}
#company-enrollment #company-enrollment-line{margin:0;font-size:15px;line-height:1.45;color:var(--ink)}
#company-enrollment #company-enrollment-open{width:100%;min-height:48px;margin:0}
body.field-home-screen #company-enrollment{margin:16px max(16px,env(safe-area-inset-right,0px)) 0 max(16px,env(safe-area-inset-left,0px))}
/* Job room: the card is a Home/Account banner. Hiding it here is the
   layout contract; Field Chat owns the remaining column above the tab bar. */
body.field-job-room #company-enrollment,body.job-centered #company-enrollment{display:none!important}

/* v165: Ask Nico inside a company stacks like every other company screen, and
   its job picker leads straight to that job or its invoice. */
.company-nico form{display:grid;gap:12px;margin:0 0 16px}
.company-nico>label,.company-nico form label{display:grid;gap:4px}
.company-nico label>span{font-weight:650}
.company-nico>label{margin:16px 0 0}
.company-nico textarea{width:100%;box-sizing:border-box;min-height:5rem;font-size:16px}
.company-nico h3{margin:20px 0 8px}
.company-nico section>button{width:100%;margin:0 0 8px}
.company-nico #company-nico-job{margin-bottom:8px}

/* 6-character company codes: large, glove-friendly, one obvious field. */
.company-dialog .company-code-field{margin:16px 0 8px}
.company-dialog .company-code-input{min-height:56px;font-size:1.5rem;font-weight:700;letter-spacing:.24em;text-align:center;text-transform:uppercase;border-radius:14px}
.company-dialog [data-company-action=request-join]{width:100%;min-height:56px}
.company-dialog #company-code-hint{margin:0 0 16px}
.company-dialog .company-share-code{display:grid;gap:8px}
.company-dialog .company-share-code-value{margin:8px 0 0;padding:16px;text-align:center;font-size:1.75rem;font-weight:700;letter-spacing:.28em;line-height:1.2;background:var(--surface-2,#fafafa);border-radius:14px;overflow-wrap:anywhere}
.company-dialog .company-share-code .field{margin:8px 0}
.company-dialog .company-share-code>button{width:100%;margin:4px 0 0}
.company-dialog .company-share-code>button.primary{min-height:56px}

.open-invoices{padding:16px 0;border-bottom:1px solid var(--line)}.open-invoices h2{font-size:1.1rem;margin:0 0 8px}.open-invoices-list{list-style:none;margin:0;padding:0}.open-invoice-row{width:100%;display:grid;grid-template-columns:1fr auto;gap:2px 12px;text-align:left;background:transparent!important;border:0!important;border-bottom:1px solid var(--line)!important;border-radius:0!important;padding:12px 0!important;color:var(--ink)!important}.open-invoice-who{font-weight:650;overflow-wrap:anywhere}.open-invoice-amount{grid-row:span 2;align-self:center}.open-invoice-due{font-size:13px;color:var(--ink-dim)}.open-invoice-due.overdue{color:#9a231a}
.account-reset{border-color:#ac534c}
.account-reset h2{margin:0 0 8px}
.account-reset p{margin:0 0 12px}
.account-reset button{min-height:var(--tap-secondary,48px);font-weight:650}
.account-reset-dialog .account-reset-step{font-weight:650;margin:20px 0 8px}
.account-reset-dialog .account-reset-warning{color:#9a231a;font-weight:650}
.account-reset-dialog .account-reset-download{display:inline-flex;align-items:center;min-height:var(--tap-secondary,48px);margin:8px 0;font-weight:650}
.account-reset-dialog .field{display:flex;flex-direction:column;gap:6px}
.account-reset-dialog input[type=text]{min-height:var(--tap-secondary,48px);padding:10px 12px;font:inherit;letter-spacing:.08em;text-transform:uppercase;border:1px solid var(--control-line,#7D8691);border-radius:var(--radius-control,12px)}
.account-reset-actions{display:flex;flex-wrap:wrap;gap:8px;margin:20px 0 0}
.account-reset-actions button{min-height:var(--tap-secondary,48px)}
.account-reset-status:empty{display:none}
