/* Budding Social OS: builds on the portal app shell */
.os-brand { display: flex; align-items: center; gap: 10px; }
.os-brand span { height: 20px; padding: 0 6px; border-radius: 4px; background: var(--yellow); color: var(--deep); font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; }
.side-row .mark { flex: none; width: 20px; height: 20px; border-radius: 5px; background: rgba(255, 243, 230, 0.12); color: var(--on-green); display: grid; place-items: center; font-size: 9px; font-weight: 600; letter-spacing: -0.02em; }
.side-row.is-active .mark { background: var(--yellow); color: var(--deep); }
.side-add { color: var(--on-green-3); }

.save-state { font-size: 12px; color: var(--ink-3); min-width: 48px; text-align: right; }

/* Client header */
.client-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.client-head .big-mark { flex: none; width: 48px; height: 48px; border-radius: 12px; background: var(--yellow); color: var(--deep); display: grid; place-items: center; font-weight: 600; font-size: 15px; }
.client-head h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 32px; line-height: 1.1; }
.client-head p { margin: 2px 0 0; color: var(--ink-3); font-size: 13px; }
.client-head p code { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.client-head .actions { margin-left: auto; display: flex; gap: 8px; }

/* Section tabs */
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; scrollbar-width: none; }
.subtabs a { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; font-size: 13px; font-weight: 500; color: var(--ink-3); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease); }
.subtabs a:hover { color: var(--ink); }
.subtabs a.is-active { color: var(--ink); border-bottom-color: var(--ink); }
.subtabs .count { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }

/* Forms */
.form-panel { padding: 20px; display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.section-note { margin: 0 0 16px; color: var(--ink-2); font-size: 13px; max-width: 640px; }
.os .input, .os .textarea { background: #fff; font-size: 13px; }
.os .input { height: 36px; }
.os .field > span { font-size: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); height: 36px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--green); }

/* Repeater rows */
.rows { display: grid; gap: 8px; }
.rowcard { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 16px; border-radius: var(--r-card); background: var(--panel); box-shadow: 0 0 0 1px var(--line); }
.rowcard .idx { width: 24px; height: 24px; margin-top: 22px; border-radius: 6px; background: var(--bg); color: var(--ink-3); font-size: 12px; font-weight: 600; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.rowcard .fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.rowcard .fields .wide { grid-column: 1 / -1; }
.rowcard .fields .w2 { grid-column: span 2; }
.rowcard .ctrl { display: flex; flex-direction: column; gap: 2px; margin-top: 18px; }
.rowcard .ctrl button { width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-3); display: grid; place-items: center; transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease); }
.rowcard .ctrl button:hover { background: rgba(24, 36, 26, 0.06); color: var(--ink); }
.rowcard .ctrl .icon { width: 14px; height: 14px; }
.rowcard .ctrl .up .icon { transform: rotate(-90deg); }
.rowcard .ctrl .down .icon { transform: rotate(90deg); }
.add-row { justify-self: start; }
.empty-rows { padding: 24px; border-radius: var(--r-card); border: 1px dashed var(--line-strong); color: var(--ink-3); text-align: center; font-size: 13px; }

/* File field */
.filefield { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.filefield .fthumb { flex: none; width: 56px; height: 36px; border-radius: 4px; overflow: hidden; background: var(--bg); box-shadow: 0 0 0 1px var(--line); }
.filefield .fthumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.filefield .fname { flex: 1; min-width: 0; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filefield label.btn { height: 32px; padding: 0 12px; font-size: 12px; cursor: pointer; }
.filefield.busy { opacity: 0.6; pointer-events: none; }

.slug-field { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r-control); background: #fff; }
.slug-field span { padding: 0 2px 0 12px; color: var(--ink-3); font-family: var(--mono); font-size: 12px; }
.slug-field .input { border: 0; padding-left: 2px; font-family: var(--mono); font-size: 12px; }
.slug-field:focus-within { border-color: var(--ink); }
.secret { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-radius: var(--r-control); background: var(--bg); }
.secret code { flex: 1; font-family: var(--mono); font-size: 16px; font-weight: 600; letter-spacing: 0.02em; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Inbox */
.filter { margin-bottom: 16px; }
.inbox { display: grid; gap: 8px; }
.msg { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 16px 20px; }
.msg .who { width: 32px; height: 32px; border-radius: 50%; background: var(--yellow); color: var(--deep); display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.msg.is-done .who { background: var(--bg); color: var(--ink-3); }
.msg-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.msg-top strong { color: var(--ink); font-weight: 600; font-size: 13px; }
.msg-body { font-size: 14px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 12px; }
.msg .textarea { min-height: 64px; }
.msg-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.msg-actions .links { display: flex; gap: 4px; margin-left: -8px; }
.msg-actions .btn-quiet { height: 28px; padding: 0 8px; font-size: 12px; gap: 6px; text-decoration: none; }

.audit-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.audit-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); opacity: 0.5; }
.audit-pill.on::before { background: #4F9A45; opacity: 1; }

@media (max-width: 900px) {
  .form-grid { grid-template-columns: 1fr; }
  .client-head { flex-wrap: wrap; }
  .client-head .actions { margin-left: 0; width: 100%; }
  .rowcard { grid-template-columns: minmax(0, 1fr) auto; }
  .rowcard .idx { display: none; }
}
.sub-h { margin: 32px 0 6px; font-size: 14px; font-weight: 600; }
.sub-h + .section-note { margin-bottom: 12px; }
.section-actions { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.os .page-head + .seg { display: inline-flex; }

/* ---------- Today ---------- */
.page-head .stale { color: var(--fix); }
.mail-summary { margin: 0; padding: 16px 20px; font-size: 14px; line-height: 1.6; color: var(--ink); border-bottom: 1px solid var(--line); background: #FDFCF9; }
.mail-section { padding: 4px 0 0; }
.mail-section h3 { display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px 20px 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.mail-section h3 .tnum { font-family: var(--mono); font-weight: 500; color: var(--ink-3); }
.mails { list-style: none; margin: 0; padding: 0 8px 8px; }
.mail { display: grid; grid-template-columns: 20px minmax(0, 1fr) 32px; gap: 12px; align-items: start; padding: 12px; border-radius: 8px; transition: background-color var(--fast) var(--ease); }
.mail:hover { background: #FBFAF7; }
.mail .tick { margin-top: 1px; }
.mail .dot { width: 6px; height: 6px; margin: 7px 0 0 7px; border-radius: 50%; background: var(--ink-3); opacity: 0.5; }
.mail-top { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.mail-top strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-top .when { margin-left: auto; flex: none; font-size: 12px; color: var(--ink-3); }
.chip { flex: none; height: 20px; padding: 0 6px; border-radius: 4px; background: var(--bg); color: var(--ink-2); font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; }
.mail-subject { font-size: 13px; color: var(--ink); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-gist { font-size: 13px; color: var(--ink-2); line-height: 1.5; margin-top: 2px; }
.mail .icon-btn { margin-top: -4px; }
.mail.is-done { opacity: 0.5; }
.mail.is-done .mail-subject { text-decoration: line-through; text-decoration-color: var(--ink-3); }
.mail.urgent .mail-top strong { color: var(--ink); }
.fyi summary { list-style: none; display: flex; align-items: center; justify-content: space-between; padding-right: 20px; cursor: pointer; border-top: 1px solid var(--line); }
.fyi summary::-webkit-details-marker { display: none; }
.fyi summary .icon { width: 14px; height: 14px; color: var(--ink-3); transition: transform var(--fast) var(--ease); }
.fyi[open] summary .icon { transform: rotate(90deg); }
.mail-foot { margin: 0; padding: 10px 20px 14px; font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--line); }

.tick { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center; background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-strong); color: #3A6B33; cursor: pointer; transition: background-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease); }
.tick.on { background: #E7F0E3; box-shadow: none; }
.tick:hover { box-shadow: inset 0 0 0 1.5px #3A6B33; }
.tick .icon { width: 12px; height: 12px; stroke-width: 2; }

.tl.cal li.past { opacity: 0.45; }
.tl .join { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--ink); text-decoration: none; }
.tl .join .icon { width: 12px; height: 12px; }
.cal-label { margin: 4px 20px 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--ink-3); }

.setup { padding: 24px 20px; font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.setup strong { display: block; color: var(--ink); font-size: 14px; margin-bottom: 4px; }
.setup p { margin: 0 0 12px; max-width: 520px; }
.setup ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.setup code { font-family: var(--mono); font-size: 12px; background: var(--bg); padding: 1px 5px; border-radius: 4px; color: var(--ink); }

/* Client page */
.link-code { font-size: 12px !important; font-weight: 500 !important; }
.pw-state { flex: 1; font-size: 13px; color: var(--ink-2); }
.plain { margin: 0; font-size: 13px; color: var(--ink); }
.counts { list-style: none; margin: 0; padding: 4px 20px 8px; }
.counts li { display: flex; align-items: center; gap: 10px; padding: 10px 0; font-size: 13px; color: var(--ink-2); }
.counts li + li { border-top: 1px solid var(--line); }
.counts li .icon { color: var(--ink-3); }
.counts li span { flex: 1; min-width: 0; }
.counts li strong { font-weight: 600; color: var(--ink); }
.counts a { color: var(--ink); font-weight: 600; text-decoration: none; }
.counts a:hover { text-decoration: underline; }
.os .add-ghost { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 13px; font-weight: 500; text-decoration: none; transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease); }
.os .add-ghost:hover { background: #FFF6DC; color: var(--ink); }
.os .add-ghost .icon { width: 14px; height: 14px; }

/* Client badges with a logo */
.client-badge { background: var(--yellow); color: var(--deep); font-size: 11px; font-weight: 600; }
.has-img { background: #FFF6E9 !important; overflow: hidden; }
.has-img img { width: 100%; height: 100%; object-fit: contain; padding: 12%; display: block; }
.side-row .mark.has-img img { padding: 8%; }

/* People who can sign in */
.people { list-style: none; margin: 0 0 8px; padding: 0; border-radius: var(--r-control); box-shadow: 0 0 0 1px var(--line); }
.people li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.people li + li { border-top: 1px solid var(--line); }
.people .who { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--yellow); color: var(--deep); display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.people .pinfo { flex: 1; min-width: 0; display: grid; }
.people .pinfo strong { font-size: 13px; font-weight: 600; }
.people .pinfo small { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.add-person { justify-self: start; }
.pw-row { display: flex; gap: 8px; align-items: center; }
.pw-row .input { flex: 1; font-family: var(--mono); }
.btn.danger { color: var(--fix); }
.btn.danger:hover { background: rgba(180, 67, 46, 0.08); color: var(--fix); }
