/* v1.1 surfaces: Needs you, reviews, saved replies, inbox, calendar, notes to Kai, settings. Same tokens as app.css. */
.block { display: block; }
.mini-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--soft); color: var(--black); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; transition: transform 150ms var(--ease), background-color 150ms var(--ease); }
.mini-btn:active { transform: scale(.97); }
.mini-btn:hover { background: #E4E4DE; }
.mini-btn[disabled] { opacity: .45; pointer-events: none; }
.seg-sm .seg-btn { height: 34px; font-size: 14px; padding: 0 12px; }
.seg-n { font: 600 12px var(--body); color: var(--gray); margin-left: 6px; font-variant-numeric: tabular-nums; }
.form-error.dark { color: var(--black); font-weight: 700; }

/* Tabs: 5 on the phone bar, icons + short labels */
.tabbar { grid-template-columns: repeat(5, 1fr); }
.tab { font-size: 12px; gap: 3px; }
.tab-ic { position: relative; display: inline-grid; }
.tab-badge { position: absolute; top: -5px; right: -10px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--black); color: var(--off); font: 600 12px/17px var(--body); text-align: center; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px var(--card); }
.tab-top .tab-badge { position: static; display: inline-block; margin-left: 7px; background: var(--off); color: var(--black); box-shadow: none; vertical-align: 1px; }
@media (min-width: 900px) and (max-width: 1180px) { .tab-top { padding: 0 11px; font-size: 14px; } .wordmark { display: none; } }

/* Needs you (top of Leads, on the dark band) */
.needs { margin-bottom: 18px; }
.needs-head { display: flex; align-items: baseline; justify-content: space-between; margin: 6px 0 12px; }
.needs-head h2 { font-size: 20px; color: var(--off); }
.needs-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
@media (min-width: 900px) { .needs-list { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); } }
.need { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 12px 12px 12px 16px; background: var(--graphite); border-radius: 14px; cursor: pointer; transition: opacity 150ms var(--ease-io), transform 150ms var(--ease); }
.need:active { transform: scale(.985); }
.need.leaving { opacity: 0; transform: translateX(8px); }
.need-text { flex: 1; min-width: 0; display: grid; gap: 3px; }
.need-meta { font: 500 12px/1.3 var(--body); color: var(--gray-d); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.need-name { font-weight: 700; font-size: 16px; color: var(--off); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.need-job { font-weight: 500; color: var(--gray-d); }
.need-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--off); color: var(--black); font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap; transition: transform 150ms var(--ease), background-color 150ms var(--ease); }
.need-btn:active { transform: scale(.97); }
.need-btn.done { background: var(--off); }
.need-btn.done .ic { color: var(--deep); }
.need-btn[disabled]:not(.done) { opacity: .6; }
.skel-need { height: 68px; background: var(--graphite); }
.caught-up { display: flex; align-items: center; gap: 8px; color: var(--gray-d); padding: 4px 0 6px; }
.caught-up .ic { color: var(--green); }

/* Reviews stat */
.stat-reviews { grid-column: 1 / -1; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rv-line { display: flex; gap: 20px; align-items: baseline; }
.rv-n { color: var(--gray-d); font-size: 14px; background: none; border: 0; padding: 0; }
.rv-n strong { font: 800 20px var(--head); color: var(--off); font-variant-numeric: tabular-nums; margin-right: 4px; }
.rv-edit { cursor: pointer; }
.rv-add { color: var(--off); font-weight: 600; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
@media (min-width: 900px) {
  .score { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .stat-reviews { grid-column: auto; display: block; padding: 24px; }
  .stat-reviews .rv-line { flex-direction: column; gap: 10px; margin-top: 16px; }
  .stat-reviews .rv-n strong { font-size: 28px; }
}

/* Lead sheet additions */
.fact-btn { grid-column: 1 / -1; cursor: pointer; transition: background-color 150ms var(--ease); }
.fact-btn:hover { background: #F7F7F3; }
.fact dd.add { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line-l); }
.rv-steps { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.rv-step { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px; border-radius: 999px; background: var(--soft); font-size: 14px; font-weight: 600; }
.rv-step.good { background: var(--green-bg); color: var(--deep); }
.rv-note { margin-top: 8px; }
.saved { display: flex; gap: 6px; overflow-x: auto; margin: 0 -12px 8px; padding: 0 12px 2px; scrollbar-width: none; }
.saved::-webkit-scrollbar { display: none; }
.saved-chip { flex: none; height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--soft); font-weight: 600; font-size: 14px; white-space: nowrap; transition: transform 150ms var(--ease), background-color 150ms var(--ease); }
.saved-chip:active { transform: scale(.97); }
.conv-phone { margin: 14px 2px 0; }

/* Messages */
.inbox, .kai { padding-top: 24px; padding-bottom: 28px; }
@media (min-width: 900px) { .inbox, .kai { max-width: 760px; } }
.inbox-head .res-head { margin-bottom: 12px; }
.inbox-head .seg { width: auto; }
.search { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 14px; margin-bottom: 14px; background: var(--card); border-radius: 14px; box-shadow: 0 0 0 1px var(--line-l); color: var(--gray); }
.search-input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font-size: 16px; color: var(--black); }
.search-input:focus { outline: none; }
.search:focus-within { box-shadow: 0 0 0 1.5px var(--gray); }
.msgs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.msg { padding: 14px 16px; background: var(--card); border-radius: 14px; box-shadow: 0 0 0 1px var(--line-l); cursor: pointer; transition: transform 150ms var(--ease), box-shadow 150ms var(--ease); }
.msg:active { transform: scale(.985); }
.msg-top { display: flex; align-items: center; gap: 10px; }
.msg-name { flex: 1; min-width: 0; font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-time { font: 500 12px var(--mono); color: var(--gray); font-variant-numeric: tabular-nums; }
.msg-dot { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--black); color: var(--off); font: 600 12px/20px var(--body); text-align: center; }
.msg-preview { margin-top: 3px; color: var(--gray); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg.unread .msg-name { font-weight: 800; }
.msg.unread .msg-preview { color: var(--black); font-weight: 600; }
.msg-new { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }

/* Notes to Kai */
.kai-head h2 { font-size: 28px; }
.kai-head p { margin: 6px 0 16px; }
.kai-thanks { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 12px; }
.kai-thanks .ic { color: var(--deep); }
.kai-form { display: grid; gap: 12px; padding: 16px; background: var(--card); border-radius: 14px; box-shadow: 0 0 0 1px var(--line-l); }
.kai-kinds { display: flex; flex-wrap: wrap; gap: 8px; }
.kai-form textarea, .set-field textarea { width: 100%; resize: vertical; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line-l); background: var(--off); font-size: 16px; line-height: 1.4; }
.kai-form textarea:focus, .set-field textarea:focus { outline: none; border-color: var(--gray); }
.kai-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kai-where { display: flex; align-items: center; gap: 8px; }
.kai-select { height: 36px; padding: 0 10px; border-radius: 8px; border: 1.5px solid var(--line-l); background: var(--off); font-size: 14px; }
.kai-form .btn { justify-self: start; }
.kai-past { margin-top: 28px; }
.kai-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.kn { padding: 14px 16px; background: var(--card); border-radius: 14px; box-shadow: 0 0 0 1px var(--line-l); }
.kn-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.kn-kind { font-weight: 700; }
.kn-status { height: 24px; padding: 0 10px; border-radius: 999px; font: 600 12px/24px var(--body); background: var(--soft); color: var(--gray); }
.kn-status.s-done { background: var(--green-bg); color: var(--deep); }
.kn-status.s-seen { color: var(--black); }
.kn-text { margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.kn-time { display: block; font: 500 12px var(--mono); color: var(--gray); margin-top: 6px; }
.kn-reply { margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: var(--soft); }
.kn-reply p { overflow-wrap: anywhere; }
.kn-from { font: 600 12px var(--body); color: var(--gray); }

/* Settings + number sheet */
.settings-form { display: grid; gap: 8px; }
.set-group { margin-bottom: 18px; display: grid; gap: 10px; }
.set-link { padding: 10px 12px; border-radius: 8px; background: var(--soft); overflow-wrap: anywhere; font-size: 14px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; background: var(--card); border-radius: 14px; box-shadow: 0 0 0 1px var(--line-l); cursor: pointer; }
.switch { appearance: none; -webkit-appearance: none; flex: none; width: 50px; height: 30px; border-radius: 999px; background: #D3D3CD; position: relative; cursor: pointer; transition: background-color 180ms var(--ease); margin: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(11, 11, 12, .25); transition: transform 180ms var(--ease-io); }
.switch:checked { background: var(--black); }
.switch:checked::after { transform: translateX(20px); }
.set-field { display: grid; gap: 6px; }
.set-field > span { font: 500 12px var(--body); color: var(--gray); }
.ask-panel { display: grid; gap: 10px; }
.ask-input { width: 100%; height: 60px; padding: 0 16px; border-radius: 14px; border: 1.5px solid var(--line-l); background: var(--off); font: 800 28px var(--head); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.ask-input:focus { outline: none; border-color: var(--gray); }
@media (min-width: 768px) { .ask-panel { left: 50%; top: 30%; width: 340px; transform: translateX(-50%); padding: 18px; } }
/* Grid lists never grow past the screen (long previews ellipsize instead). */
.msgs, .kai-list, .needs-list, .list { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .needs-list { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); } }
.msg, .kn, .need { min-width: 0; }

.kai-form .form-error:empty, .settings-form .form-error:empty { display: none; }
.need-btn { padding: 0 14px; }

/* v1.3 */
.count { font-size: 12px; font-variant-numeric: tabular-nums; }
.money { font-family: var(--mono); font-variant-numeric: tabular-nums; }
button.stat-main { display: block; width: 100%; border: 0; text-align: left; color: inherit; cursor: pointer; }
button.stat-main .stat-label .ic { opacity: .6; }
.see-all { border: 0; background: none; color: var(--gray-d); font: 700 14px var(--body); padding: 6px 0; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line); }
.done-today, .alerts-card { display: flex; align-items: center; gap: 12px; padding: 14px 12px 14px 16px; margin-top: 8px; background: var(--graphite); border-radius: 14px; color: var(--off); }
.alerts-card { margin: 4px 0 14px; }
.alerts-card > .icon-btn { flex: none; width: 36px; height: 36px; color: var(--gray-d); }
.alerts-ic { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 999px; background: var(--line); }
.dt-preview { font-size: 12px; color: var(--gray-d); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-txt { display: inline-flex; align-items: center; gap: 2px; height: 28px; padding: 0 2px; border: 0; border-radius: 999px; background: none; color: var(--black); font: 700 14px var(--body); }
.stage-txt.booked { color: var(--deep); }
.stage-txt.lost { color: var(--red); }
.stage-txt .ic { opacity: .5; }
.fact.wide { grid-column: 1 / -1; }
.quality { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.q-chip { height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--soft); color: var(--black); font: 600 12px var(--body); transition: background-color 150ms var(--ease), color 150ms var(--ease), transform 150ms var(--ease); }
.q-chip:active { transform: scale(.97); }
.q-chip[aria-pressed="true"] { background: var(--black); color: var(--off); }
.note-add { display: flex; gap: 8px; margin-bottom: 8px; }
.note-input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border-radius: 14px; border: 1.5px solid var(--line-l); background: var(--card); font-size: 16px; }
.note-input:focus { outline: none; border-color: var(--gray); }
.note-add .mini-btn { height: 40px; }
.b-who { font-family: var(--body); font-weight: 700; margin-right: 6px; }
.b-out.b-ai { background: #2A2C2F; }
.mini-btn.more { width: 34px; padding: 0; justify-content: center; }
.mini-btn.quiet { background: none; color: var(--gray); }
.ag-val { margin-left: auto; font-size: 14px; color: var(--deep); align-self: center; }
.ev-unknown, .cs-unknown { color: var(--black); }
.cs-unknown { background: var(--soft); }
.ev-unknown { font-weight: 600; margin: 6px 0 0; }
.d1-head { margin-bottom: 14px; }
.d1 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.d1-cell { min-width: 0; }
.d1 .money-num { font-size: 28px; margin-top: 8px; }
.d1-month { font-size: 12px; color: var(--gray-d); margin-top: 6px; font-variant-numeric: tabular-nums; }
.kai-line { margin-top: 12px; padding: 14px 16px; border-radius: 14px; background: var(--card); box-shadow: 0 0 0 1px var(--line-l); }
.kai-from { font: 700 12px var(--body); color: var(--gray); }
.kai-line p { margin-top: 4px; }
.res-period { margin: 24px 0 12px; }
.work { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 12px; background: var(--line-l); border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 1px var(--line-l); }
.work-cell { background: var(--card); padding: 14px 16px; }
.work-cell .stat-label { color: var(--gray); }
.work-num { font: 800 20px var(--head); margin-top: 6px; font-variant-numeric: tabular-nums; }
.work-num.money { font-family: var(--mono); font-weight: 600; }
@media (min-width: 900px) {
  .results { display: block; max-width: 900px; }
  .d1 .money-num { font-size: 48px; }
  .res-period .seg { width: auto; }
}

.alerts-card .need-name, .alerts-card .need-meta { white-space: normal; }
.stat-foot > :last-child { white-space: nowrap; }
.job-main.wrap span { white-space: normal; }
.mono { font-size: .88em; }
@media (min-width: 900px) { .res-period .seg { display: inline-flex; width: auto; } }
