/* mobile-sheets.css - Spreadsheets Files page (Pass 4 P4-4). --m-* tokens only. */
.m-sheets { padding: 12px max(16px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); color: var(--m-text); font-family: var(--m-font); }
.m-sheets-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.m-sheets-chips::-webkit-scrollbar { display: none; }
.m-sheets-chip { flex: 0 0 auto; min-height: 44px; padding: 0 16px; border-radius: var(--m-radius-full); border: 1px solid var(--m-border); background: var(--m-surface); color: var(--m-text); font: inherit; font-size: 14px; }
.m-sheets-chip.is-active { background: var(--m-gold); border-color: var(--m-gold); color: var(--m-surface); }
.m-sheets-search { box-sizing: border-box; width: 100%; min-height: 44px; margin: 4px 0 8px; padding: 0 14px; border-radius: var(--m-radius); border: 1px solid var(--m-border); background: var(--m-elevated); color: var(--m-text); font: inherit; font-size: 16px; }
.m-sheets-status { min-height: 20px; padding: 4px 2px; font-size: 13px; color: var(--m-muted); }
.m-sheets-list { display: flex; flex-direction: column; border-top: 1px solid var(--m-border-subtle); }
.m-sheets-row { display: flex; align-items: center; gap: 12px; box-sizing: border-box; width: 100%; min-height: 56px; padding: 8px 4px; border: 0; border-bottom: 1px solid var(--m-border-subtle); background: transparent; color: inherit; font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.m-sheets-row:active { background: var(--m-elevated); }
.m-sheets-ico { flex: 0 0 auto; display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: var(--m-radius-sm); background: var(--m-accent-dim); color: var(--m-accent); }
.m-sheets-row-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.m-sheets-row-title { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-sheets-row-sub { font-size: 12px; color: var(--m-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-sheets-fav { flex: 0 0 auto; font-size: 11px; color: var(--m-warning); }
.m-sheets-empty { padding: 32px 8px; text-align: center; font-size: 14px; color: var(--m-muted); }
.m-sheets-back { min-height: 44px; padding: 0 4px; border: 0; background: transparent; color: var(--m-accent); font: inherit; font-size: 15px; }
.m-sheets-detail-title { margin-top: 8px; font-family: var(--m-font-display); font-size: 20px; font-weight: 700; }
.m-sheets-detail-sub { margin-top: 4px; font-size: 13px; color: var(--m-muted); }
.m-sheets-action { display: block; box-sizing: border-box; width: 100%; min-height: 48px; margin-top: 12px; border-radius: var(--m-radius); border: 1px solid var(--m-border-strong); background: var(--m-surface); color: var(--m-text); font: inherit; font-size: 16px; }
.m-sheets-action-primary { background: var(--m-gold); border-color: var(--m-gold); color: var(--m-surface); }
.m-sheets-files[hidden], .m-sheets-detail[hidden] { display: none; }

/* Spreadsheets grid (Pass 4 P4-5). --m-* tokens only. */
.m-sg { display: flex; flex-direction: column; height: calc(100vh - var(--m-nav-height) - var(--m-topbar) - env(safe-area-inset-top) - env(safe-area-inset-bottom)); color: var(--m-text); font-family: var(--m-font); }
.m-sg-note { flex: 0 0 auto; padding: 6px 16px; font-size: 12px; color: var(--m-muted); border-bottom: 1px solid var(--m-border-subtle); }
.m-sg-empty { padding: 48px 24px; text-align: center; color: var(--m-muted); font-size: 14px; }
.m-sg-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; background: var(--m-surface); position: relative; }
.m-sg-inner { position: relative; }
.m-sg-hdr { position: sticky; top: 0; z-index: 4; background: var(--m-elevated); }
.m-sg-hrow, .m-sg-row { display: flex; position: relative; }
.m-sg-frozen { position: sticky; z-index: 3; background: var(--m-surface); border-bottom: 2px solid var(--m-border-strong); }
.m-sg-frozen .m-sg-row, .m-sg-body .m-sg-row { position: absolute; left: 0; }
.m-sg-body { position: relative; }
.m-sg-corner, .m-sg-rn, .m-sg-ch { box-sizing: border-box; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--m-muted); background: var(--m-elevated); border-right: 1px solid var(--m-border); border-bottom: 1px solid var(--m-border); }
.m-sg-corner, .m-sg-rn { position: sticky; left: 0; z-index: 5; }
.m-sg-rn { height: 100%; }
.m-sg-c { box-sizing: border-box; flex: 0 0 auto; display: flex; align-items: center; gap: 4px; padding: 0 6px; font-size: 13px; overflow: hidden; white-space: nowrap; border-right: 1px solid var(--m-border-subtle); border-bottom: 1px solid var(--m-border-subtle); background: var(--m-surface); }
.m-sg-fc { position: sticky; z-index: 2; }
.m-sg-cover { padding: 0; }
.m-sg-sp { flex: 0 0 auto; }
.m-sg-t { overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; }
.m-sg-from { flex: 0 0 auto; font-size: 9px; line-height: 1; padding: 2px 4px; border-radius: var(--m-radius-sm); background: var(--m-accent-dim); color: var(--m-accent); }
.m-sg-c.is-sel { outline: 2px solid var(--m-accent); outline-offset: -2px; z-index: 1; }
.m-sg-detail { flex: 0 0 auto; min-height: 44px; padding: 8px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left)); border-top: 1px solid var(--m-border); background: var(--m-elevated); font-size: 13px; }
.m-sg-hint { color: var(--m-muted); }
.m-sg-d-head { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.m-sg-d-row { display: flex; gap: 8px; margin-top: 4px; }
.m-sg-d-k { flex: 0 0 56px; color: var(--m-muted); }
.m-sg-d-v { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.m-sg-d-f { font-family: var(--m-font-mono); }
.m-sg-d-why { margin-top: 6px; font-size: 12px; color: var(--m-muted); }
.m-sg-tabs { flex: 0 0 auto; display: flex; overflow-x: auto; border-top: 1px solid var(--m-border); background: var(--m-surface); padding-bottom: env(safe-area-inset-bottom); -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.m-sg-tabs::-webkit-scrollbar { display: none; }
.m-sg-tab { flex: 0 0 auto; min-height: 44px; padding: 0 16px; border: 0; background: transparent; color: var(--m-muted); font: inherit; font-size: 13px; border-top: 2px solid transparent; }
.m-sg-tab.is-active { color: var(--m-accent); border-top-color: var(--m-accent); font-weight: 600; }
/* P4-6: long-press editor for Input cells (bottom sheet). */
.m-sg-c { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.m-sg-c:focus { outline: 2px solid var(--m-accent); outline-offset: -2px; }
.m-sg-edit-back { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; justify-content: flex-end; background: color-mix(in srgb, var(--m-bg) 55%, transparent); }
.m-sg-edit { box-sizing: border-box; width: 100%; max-height: 80vh; overflow-y: auto; padding: 16px max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); background: var(--m-elevated); color: var(--m-text); border-top: 1px solid var(--m-border-strong); border-radius: var(--m-radius-lg, 16px) var(--m-radius-lg, 16px) 0 0; box-shadow: var(--m-shadow-lg); font-size: 14px; }
.m-sg-edit-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.m-sg-edit-title { min-width: 0; overflow-wrap: anywhere; }
.m-sg-edit-ico { display: inline-flex; flex: 0 0 auto; width: 20px; height: 20px; color: var(--m-accent); }
.m-sg-edit .m-sg-d-k { flex-basis: 104px; }
.m-sg-edit-in { box-sizing: border-box; width: 100%; min-height: 44px; margin-top: 12px; padding: 0 12px; border: 1px solid var(--m-border-strong); border-radius: var(--m-radius-sm); background: var(--m-surface); color: var(--m-text); font: inherit; font-size: 16px; }
.m-sg-edit-in:focus { outline: 2px solid var(--m-accent); outline-offset: 1px; }
.m-sg-edit-err { margin-top: 8px; font-size: 13px; color: var(--m-danger); }
.m-sg-edit-btns { display: flex; gap: 8px; margin-top: 16px; }
.m-sg-edit-btn { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border: 1px solid var(--m-border-strong); border-radius: var(--m-radius-sm); background: var(--m-surface); color: var(--m-text); font: inherit; font-weight: 600; }
.m-sg-edit-btn .m-sg-edit-ico { color: inherit; }
.m-sg-edit-btn.is-primary { background: var(--m-accent); border-color: var(--m-accent); color: var(--m-bg); }
.m-sg-edit-btn:disabled { opacity: 0.6; }

/* S25 P4 T48: phone owner sheet and contact sheet (graphOwnerChain, graphContact360) */
.m-op-host { padding: 6px 0 10px; font-size: 14px; }
.m-op-host ul { list-style: none; margin: 0; padding: 0; }
.m-op-host li { padding: 6px 0; }
.m-op-host .op-h { font-size: 12px; font-weight: 700; letter-spacing: .03em; margin: 10px 0 4px; }
.m-op-host .op-meta, .m-op-host .op-note { font-size: 12px; color: var(--m-muted); }
.m-op-host .op-depth-2 { padding-left: 14px; }
.m-op-host .op-depth-3 { padding-left: 28px; }
.m-op-host .op-tag { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 8px; background: rgba(127,127,127,.15); margin-left: 4px; }
.m-op-host .op-chips, .m-op-host .op-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0; }
.m-op-host .op-chip { min-height: 36px; padding: 0 12px; }
.m-op-host .op-chip.active { font-weight: 700; }
