/* Modurel Home's own layout, on the shared tokens (shared/src/ByteNuts.Modurel.UI/wwwroot/css). The Design project has
   no screens for the home, Project settings or invitations yet (MISS-1): these rules only arrange shared components
   and are replaced when it does. */

/* The home */
.hm-group{display:flex;flex-direction:column;gap:12px}
.hm-owner{display:flex;align-items:center;gap:8px;color:var(--text-muted);font:500 13px var(--font-sans)}
.hm-card{display:flex;flex-direction:column;gap:8px;padding:14px 16px;min-width:0}
.hm-card-top{display:flex;align-items:center;gap:8px;min-width:0}
.hm-card-title{flex:1;min-width:0;font:600 14px var(--font-sans);color:var(--text-primary);text-decoration:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hm-card-title:hover{text-decoration:underline}
.hm-card-title:focus-visible{outline:2px solid var(--border-focus);outline-offset:2px;border-radius:var(--radius-xs)}
.hm-card-products,.hm-badges,.hm-person-access{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.hm-level{font-size:12px;color:var(--text-secondary);background:var(--surface-inset);border-radius:var(--radius-sm);padding:2px 6px;white-space:nowrap}

/* Lists */
.hm-strong{font-weight:600;color:var(--text-primary);text-decoration:none}
a.hm-strong:hover{text-decoration:underline}
.hm-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hm-row-actions{display:flex;align-items:center;gap:6px;flex-shrink:0}
.hm-person-who{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.hm-person-name{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.hm-owner-fact{font-size:12px;color:var(--text-muted)}
.hm-grow{flex:1;min-width:0}
.hm-invitation-text{flex:1;min-width:0}
/* Names may be email addresses (an account without a name): long ones break rather than push the layout wide. */
.hm-invitation-text,.hm-card > .sh-muted,.hm-accept-head > div,.hm-accept dd{min-width:0;overflow-wrap:anywhere}

/* Project settings */
.hm-settings{display:flex;flex-direction:column;gap:16px}
.hm-section-body{padding:16px;display:flex;flex-direction:column;gap:12px}
.hm-inline-form{display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap}
.hm-inline-badge{margin-left:8px}
.hm-fieldset{border:0;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.hm-access{display:flex;flex-direction:column;gap:16px}
.hm-access-admin{display:flex;flex-direction:column;gap:4px}
.hm-outcome{display:flex;flex-direction:column;gap:16px}
.hm-managed-note{display:flex;flex-direction:column;align-items:flex-start;gap:6px}
.hm-link{display:flex;flex-direction:column;align-items:flex-start;gap:8px}
.hm-link .md-field,.hm-link-field{width:100%}
.hm-dialog-alert{margin-top:12px}

/* An invitation */
.hm-accept{display:flex;flex-direction:column}
.hm-accept-head{display:flex;gap:12px;align-items:flex-start;padding:16px 16px 0}
.hm-accept-head .sh-title{font-size:20px}
.hm-accept-foot{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:12px 16px;border-top:1px solid var(--border-subtle)}
.hm-accept > .hm-dialog-alert{margin:0 16px 16px}
.hm-offer{display:flex;flex-direction:column;gap:2px;margin-top:4px}

/* Delete, restore and transfers (Phase 3) */
.hm-card-note{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:13px;min-width:0;overflow-wrap:anywhere}
.hm-card-note a{color:var(--text-primary)}
.hm-history{margin:0;padding:0;list-style:none}
.hm-history-row{gap:12px}
.hm-transfer-banner{overflow-wrap:anywhere}
.hm-twofactor .hm-inline-form{align-items:center}

@media (max-width:639px){
  .hm-person,.hm-pending,.hm-invitation{flex-wrap:wrap}
  .hm-person-access{width:100%;padding-left:36px}
  /* On phones the actions go below the text instead of squeezing it. */
  .hm-pending .hm-person-who,.hm-invitation-text{flex:1 1 calc(100% - 40px)}
  .hm-row-actions{margin-left:auto}
}

/* Outgoing connections (Phase 4) and Keys (Send's normalization) */
.hm-section-note{margin:0;padding:12px 16px 0}
.hm-card-hd-row{display:flex;align-items:center;justify-content:space-between;gap:12px}
.hm-mono,.hm-mono input{font-family:var(--font-mono)}
@media (max-width:639px){
  .hm-connection,.hm-key{flex-wrap:wrap}
  .hm-connection .hm-person-who,.hm-key .hm-person-who{flex:1 1 calc(100% - 40px)}
}
/* Workspaces in Home (plan stage 6): a Workspace's section on the home, headed by its chip and name, and the console's facts. */
.hm-ws-head{display:flex;align-items:center;gap:8px;min-width:0}
.hm-ws-head > .sh-section-title{margin:0;flex:1;min-width:0}
.hm-ws-chip{display:inline-block;flex-shrink:0;width:12px;height:12px;border-radius:3px;background-color:var(--border-strong,var(--text-muted));vertical-align:middle;margin-right:6px}
.hm-ws-head > .hm-ws-chip{margin-right:0}
.hm-ws-empty{margin:0}
.hm-facts{margin:0;padding:0 16px 16px;display:grid;grid-template-columns:minmax(160px,auto) 1fr;gap:10px 16px}
.hm-facts > div{display:contents}
.hm-facts dt{color:var(--text-muted);font-size:13px}
.hm-facts dd{margin:0;min-width:0;overflow-wrap:anywhere}
.hm-ws-project .hm-person-access{flex-direction:column;align-items:flex-end;gap:2px;font-size:12px}
@media (max-width:639px){
  .hm-ws-head{flex-wrap:wrap}
  .hm-ws-head > .hm-row-actions{width:100%;margin-left:0}
  .hm-facts{grid-template-columns:1fr;gap:2px 0}
  .hm-facts dd{margin-bottom:8px}
  .hm-ws-project{flex-wrap:wrap}
  .hm-ws-project .hm-person-access{align-items:flex-start;padding-left:28px}
}
/* A project's Overview (rules §12, 2026-11-22): its products as tiles that open each product. */
.hm-overview{display:flex;flex-direction:column;gap:16px}
.hm-product-tile .hm-card-top{align-items:flex-start}
.hm-product-tile .hm-level{display:inline-block;margin-top:2px}
.hm-product-about{margin:0;font-size:13px;flex:1}
.hm-overview-more{margin:0;font-size:13px}
.hm-overview-more a{color:var(--text-primary)}
/* All projects' note on Workspaces, and Create a Workspace. */
.hm-ws-note{display:flex;align-items:flex-start;gap:12px;padding:14px 16px;margin-top:8px}
.hm-ws-note-text{flex:1;min-width:0}
.hm-ws-note-text p{margin:2px 0 0;font-size:13px}
.hm-ws-lead{margin:0;max-width:640px}
.hm-ws-points .hm-card{gap:6px}
.hm-ws-actions{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap}
.hm-ws-steps{margin:0;padding-left:20px;display:flex;flex-direction:column;gap:16px}
.hm-ws-steps li{display:flex;flex-direction:column;align-items:flex-start;gap:4px}
.hm-ws-steps p{margin:0;font-size:13px}
@media (max-width:639px){
  .hm-ws-note{flex-wrap:wrap}
  .hm-ws-note > .md-btn{margin-left:32px}
}

/* Billing (Phase 5 stage 4; design HB2): the ladders, the card field and the facts. */
.hm-billing { display: flex; flex-direction: column; gap: var(--space-4, 16px); }
.hm-h3 { margin: 0; font-size: var(--text-md, 15px); font-weight: 600; }
.hm-list { margin: 0; padding-left: 1.2em; }
.hm-plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--space-3, 12px); }
.hm-plan { border: 1px solid var(--border, #e5e7eb); border-radius: var(--radius-md, 8px); padding: var(--space-3, 12px);
  display: flex; flex-direction: column; gap: var(--space-2, 8px); }
.hm-plan.is-current { border-color: var(--brand, #4f46e5); }
.hm-card-field { display: flex; flex-direction: column; gap: var(--space-3, 12px); }
.hm-card-input { border: 1px solid var(--border, #e5e7eb); border-radius: var(--radius-md, 8px); padding: 12px;
  background: var(--surface, #fff); min-height: 44px; }

/* Billing → Invoices and Usage statements (Phase 5 stage 5): a row's actions stay together at its end. */
.hm-row-actions { display: flex; gap: var(--space-2, 8px); align-items: center; flex-shrink: 0; }
.hm-invoice .hm-person-access, .hm-statement-line .hm-person-access { text-align: end; }
@media (max-width: 640px) {
  .hm-invoice, .hm-statement-line { flex-wrap: wrap; }
  .hm-row-actions { width: 100%; justify-content: flex-end; }
}

/* Budgets (Phase 5 stage 6): each budget's bar under its limit, and a dialog's Remove at the footer's start. */
.hm-budget{align-items:flex-start}
.hm-budget .hm-budget-bar{margin:4px 0 2px;max-width:360px}
.hm-footer-start{margin-right:auto}
.hm-budget-project .hm-person-access{text-align:end}
@media (max-width:639px){
  .hm-budget,.hm-budget-project{flex-wrap:wrap}
  .hm-budget .hm-person-who,.hm-budget-project .hm-person-who{flex:1 1 calc(100% - 40px)}
}

/* An overdue balance (Phase 5 stage 7): Billing's panel above its tabs, whose facts sit inside the section's padding. */
.hm-overdue .hm-facts{padding:0}

/* A transfer's billing (Phase 5 stage 8): the owner's charge and choices, the recipient's plans, billing, add-ons and budgets */
.hm-transfer-billing{display:flex;flex-direction:column;gap:8px}
.hm-accept-part{border-top:1px solid var(--border-subtle)}
.hm-fit{display:flex;flex-direction:column;gap:4px;min-width:0;overflow-wrap:anywhere}
