/* LinqCRM — styles for the working app (adds to styles.css, same look) */
[hidden] { display: none !important; }
code { font-family: var(--mono); font-size: 12px; background: var(--bg3); padding: 1px 5px; border-radius: 4px; }
kbd { background: var(--bg4); border: 1px solid var(--border2); border-radius: 3px; padding: 1px 4px; font-family: var(--mono); font-size: 10px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--linq-blue); outline-offset: 2px; }

/* ─── Sign-in / setup ─── */
.auth-wrap { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: radial-gradient(1200px 600px at 50% -10%, #23304d 0%, #1a1f2e 55%, #12161f 100%); overflow-y: auto; z-index: 5; }
.auth-card { width: 100%; max-width: 420px; background: var(--bg2); border-radius: 16px; padding: 30px 30px 24px; box-shadow: 0 20px 60px rgba(0,0,0,0.45); display: flex; flex-direction: column; }
.auth-card .form-label { margin-top: 12px; }
.auth-logo { width: 54px; height: 54px; border-radius: 12px; margin: 0 auto 12px; display: block; }
.auth-title { font-size: 20px; font-weight: 700; text-align: center; color: var(--text); letter-spacing: -0.3px; }
.auth-sub { font-size: 13px; color: var(--text3); text-align: center; margin: 4px 0 8px; line-height: 1.55; }
.auth-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-error { margin-top: 12px; padding: 8px 12px; border-radius: 8px; background: var(--red-lt); color: var(--red); font-size: 12px; font-weight: 500; }
.auth-btn { margin-top: 18px; padding: 11px; font-size: 14px; justify-content: center; }
.auth-foot { margin-top: 14px; font-size: 11px; color: var(--text3); text-align: center; }

/* ─── Global search ─── */
.search-results { position: absolute; top: calc(100% + 6px); right: 0; width: 380px; max-height: 420px; overflow-y: auto; background: var(--bg2); border: 1px solid var(--border2); border-radius: 12px; box-shadow: var(--shadow-md); z-index: 200; padding: 6px; }
.sr-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.sr-item:hover, .sr-item.on { background: var(--bg3); }
.sr-empty { padding: 14px; font-size: 12px; color: var(--text3); text-align: center; }

/* ─── Dashboard ─── */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; height: 100%; overflow: hidden; }
.dash-q { display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.dash-head { padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; gap: 8px; }
.dash-head-title { font-size: 12px; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 7px; }
.dash-count { background: rgba(255,255,255,0.2); color: #fff; font-size: 10px; padding: 1px 7px; border-radius: 10px; font-family: var(--mono); }
.dash-search { display: flex; align-items: center; gap: 5px; background: rgba(255,255,255,0.15); border-radius: 6px; padding: 4px 8px; }
.dash-search input { background: none; border: none; outline: none; font-size: 11px; color: #fff; font-family: var(--font); width: 90px; }
.dash-search input::placeholder { color: rgba(255,255,255,0.7); }
.dash-btn { background: rgba(255,255,255,0.18); border: none; color: #fff; font-size: 10px; font-weight: 700; padding: 4px 9px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.dash-btn:hover { filter: brightness(1.1); }
.dash-sq { background: rgba(255,255,255,0.2); border: none; color: #fff; font-size: 13px; font-weight: 700; width: 24px; height: 24px; border-radius: 5px; cursor: pointer; }
.dash-select { background: rgba(255,255,255,0.2); border: none; color: #fff; font-size: 10px; font-weight: 700; padding: 4px 8px; border-radius: 6px; cursor: pointer; outline: none; }
.dash-select option { color: var(--text); }
.tabs4 { display: flex; background: var(--bg2); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.t4 { flex: 1; padding: 6px; text-align: center; font-size: 10px; font-weight: 700; cursor: pointer; color: var(--text3); border-bottom: 2px solid transparent; user-select: none; }
.tabs4.big .t4 { padding: 7px; font-size: 11px; }
.t4.on { color: var(--linq-blue); border-bottom-color: var(--linq-blue); }
.tabs4.green .t4.on { color: var(--linq-green); border-bottom-color: var(--linq-green); }
.metric-tile { border-radius: 10px; padding: 12px 14px; }
.metric-tile .k { font-size: 10px; font-family: var(--mono); font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 4px; }
.metric-tile .v { font-size: 28px; font-weight: 700; font-family: var(--mono); line-height: 1; }
.metric-tile .s { font-size: 10px; margin-top: 3px; opacity: 0.75; }
.sec-label { font-size: 10px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 0.8px; font-family: var(--mono); margin: 4px 0 6px; }
.row-tile { display: flex; align-items: center; gap: 10px; padding: 7px 10px; background: var(--bg3); border-radius: 8px; margin-bottom: 4px; }
.cal-day { text-align: center; padding: 3px 2px; border-radius: 5px; cursor: pointer; font-size: 11px; font-weight: 500; color: var(--text); background: transparent; border: none; font-family: var(--font); }
.cal-day:hover { background: var(--bg3); }
.cal-day.today { background: var(--linq-blue); color: #fff; font-weight: 700; }
.cal-day.sel { box-shadow: inset 0 0 0 2px var(--linq-orange); }
.cal-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--linq-orange); margin: 1px auto 0; }
.cal-day.today .cal-dot { background: #fff; }
.appt-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: var(--linq-green-lt); border-radius: 8px; margin-bottom: 5px; border-left: 3px solid var(--linq-green); cursor: pointer; }
.empty-note { padding: 14px; text-align: center; font-size: 12px; color: var(--text3); }

/* ─── Lead / client lists ─── */
.list-col { width: 290px; min-width: 290px; border-right: 1px solid var(--border); display: flex; flex-direction: column; background: var(--bg2); }
.list-head { padding: 10px 12px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.list-head-title { font-size: 13px; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 7px; }
.list-filters { padding: 8px 10px; border-bottom: 1px solid var(--border); display: flex; gap: 6px; align-items: center; }
.list-search { flex: 1; display: flex; align-items: center; gap: 6px; background: var(--bg3); border: 1px solid var(--border); border-radius: 7px; padding: 6px 9px; }
.list-search input { background: none; border: none; outline: none; font-size: 12px; color: var(--text); font-family: var(--font); width: 100%; }
.list-select { background: var(--bg3); border: 1px solid var(--border); border-radius: 7px; padding: 6px 8px; font-size: 11px; color: var(--text2); font-family: var(--font); outline: none; cursor: pointer; }
.lrow { padding: 11px 14px; display: flex; align-items: center; gap: 10px; cursor: pointer; border-bottom: 1px solid var(--border); background: var(--bg2); transition: background 0.1s; }
.lrow:hover { background: var(--bg3); }
.lrow.on { background: #eef4ff; }
.lrow.client.on { background: #f0fdf4; }
.lrow .view-btn { opacity: 0; flex-shrink: 0; padding: 4px 9px; border-radius: 6px; border: 1px solid var(--linq-blue); background: var(--linq-blue-lt); color: var(--linq-blue); font-size: 10px; font-weight: 600; cursor: pointer; transition: opacity 0.15s; }
.lrow:hover .view-btn, .lrow .view-btn:focus { opacity: 1; }
.av { border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.st-badge { font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 8px; font-family: var(--mono); white-space: nowrap; }
.load-more { display: block; width: calc(100% - 20px); margin: 10px; padding: 8px; border-radius: 8px; border: 1px dashed var(--border2); background: transparent; color: var(--text2); font-size: 11px; font-weight: 600; cursor: pointer; }
.load-more:hover { background: var(--bg3); }
.empty-panel { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: var(--bg); z-index: 2; padding: 20px; }

/* ─── Conversation panel ─── */
.convo-header { background: var(--bg2); border-bottom: 1px solid var(--border); padding: 12px 20px; display: flex; align-items: center; gap: 14px; }
.convo-avatar { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex-shrink: 0; cursor: pointer; background: var(--linq-blue-lt); color: var(--linq-blue); }
.convo-name { font-size: 15px; font-weight: 700; color: var(--text); cursor: pointer; text-decoration: underline dotted var(--text3); }
.convo-meta { font-size: 11px; color: var(--text3); font-family: var(--mono); margin-top: 2px; }
.followup-line { font-size: 11px; color: var(--linq-orange); font-weight: 600; margin-top: 3px; }
.followup-line.overdue { color: var(--red); }
.convo-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 340px; }
.convo-actions .btn { font-size: 11px; padding: 6px 10px; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.btn-callgreen { background: var(--linq-green-lt); color: var(--linq-green); border-color: rgba(46,125,50,0.3); font-weight: 600; }
.btn-convert { background: var(--linq-orange-lt); color: var(--linq-orange); border-color: rgba(245,124,0,0.3); font-weight: 600; }
.btn-danger { background: var(--red-lt); color: var(--red); border-color: rgba(198,40,40,0.25); font-weight: 600; }
.btn-danger:hover { background: #ffd9de; }
.pill-select { appearance: none; border: none; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px; font-family: var(--mono); cursor: pointer; outline: none; background: var(--amber-lt); color: var(--linq-orange); }
.pill-select.hot { background: var(--red-lt); color: var(--red); }
.pill-select.warm { background: var(--amber-lt); color: var(--linq-orange); }
.pill-select.cold, .pill-select.blue { background: var(--linq-blue-lt); color: var(--linq-blue); }
.pill-select.green, .pill-select.active { background: var(--linq-green-lt); color: var(--linq-green); }
.pill-select.renewal { background: var(--amber-lt); color: var(--linq-orange); }
.pill-select.lapsed { background: var(--red-lt); color: var(--red); }
.mini-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px; font-family: var(--mono); background: var(--linq-blue-lt); color: var(--linq-blue); white-space: nowrap; }
.mini-badge.red { background: var(--red-lt); color: var(--red); }
.mini-badge.orange { background: var(--amber-lt); color: var(--linq-orange); }
.mini-badge.gray { background: var(--bg3); color: var(--text2); }
.info-strip { background: var(--linq-blue-lt); border-bottom: 1px solid rgba(21,101,192,0.15); padding: 7px 20px; display: flex; overflow-x: auto; flex-wrap: nowrap; align-items: center; min-height: 40px; }
.chipcol { display: flex; flex-direction: column; padding: 0 14px; border-right: 1px solid rgba(21,101,192,0.2); white-space: nowrap; }
.chipcol:first-child { padding-left: 0; }
.chipcol .k { font-size: 9px; color: rgba(21,101,192,0.6); text-transform: uppercase; letter-spacing: 0.8px; font-family: var(--mono); font-weight: 600; }
.chipcol .v { font-size: 11px; font-weight: 700; color: #1d4ed8; font-family: var(--mono); }
.flagp { font-size: 9px; font-weight: 700; padding: 1px 7px; border-radius: 8px; font-family: var(--mono); white-space: nowrap; }
.flagp.aca { background: #dbeafe; color: #1d4ed8; }
.flagp.dia { background: #fef2f2; color: #991b1b; }
.legend-row { padding: 6px 20px; background: var(--bg2); border-bottom: 1px solid var(--border); display: flex; gap: 14px; align-items: center; flex-shrink: 0; flex-wrap: wrap; }
.lg { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--text3); }
.lg i { width: 9px; height: 9px; border-radius: 2px; border: 1px solid; display: inline-block; }
.chip { font-size: 10px; font-weight: 600; padding: 3px 9px; border-radius: 10px; border: 1px solid var(--border2); background: transparent; color: var(--text2); cursor: pointer; font-family: var(--font); }
.chip.on { background: var(--linq-blue); color: #fff; border-color: var(--linq-blue); }
.convo-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; flex-direction: column; }
.msg.right { align-items: flex-end; }
.msg-top { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.msg.right .msg-top { flex-direction: row-reverse; }
.msg-tag { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px; font-family: var(--mono); border: 1px solid; }
.msg-time { font-size: 10px; color: var(--text3); font-family: var(--mono); }
.msg-bubble { max-width: 70%; border: 1px solid; padding: 10px 14px; font-size: 13px; color: #1e293b; line-height: 1.6; white-space: pre-wrap; word-wrap: break-word; border-radius: 4px 14px 14px 14px; }
.msg.right .msg-bubble { border-radius: 14px 4px 14px 14px; }
.msg-status { font-size: 10px; color: var(--text3); margin-top: 3px; font-style: italic; }
.composer { background: var(--bg2); border-top: 1px solid var(--border); padding: 12px 16px; }
.mode-btn { padding: 5px 13px; border-radius: 20px; border: 1.5px solid var(--border2); background: transparent; color: var(--text2); font-size: 11px; font-weight: 700; cursor: pointer; font-family: var(--font); }
.mode-btn.on[data-mode="note"] { background: #ca8a04; border-color: #ca8a04; color: #fff; }
.mode-btn.on[data-mode="sms"] { background: var(--linq-green); border-color: var(--linq-green); color: #fff; }
.mode-btn.on[data-mode="email"] { background: var(--linq-blue); border-color: var(--linq-blue); color: #fff; }
.mode-label { font-size: 10px; color: var(--text3); margin-left: 6px; }
.subject-input { width: 100%; background: var(--bg3); border: 1px solid var(--border2); border-radius: 7px; padding: 7px 11px; color: var(--text); font-size: 12px; font-family: var(--font); outline: none; margin-bottom: 7px; }
.reply-input { flex: 1; background: var(--bg3); border: 1px solid var(--border2); border-radius: 10px; padding: 10px 12px; color: var(--text); font-size: 13px; font-family: var(--font); outline: none; resize: none; line-height: 1.5; }
.reply-input:focus, .subject-input:focus { border-color: var(--linq-blue); }
.send-btn { width: 38px; height: 38px; border-radius: 50%; background: #ca8a04; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.send-btn:disabled { opacity: 0.5; cursor: default; }

/* ─── Clients ─── */
.cl-col1 { width: 240px; min-width: 240px; border-right: 1px solid var(--border); display: flex; flex-direction: column; background: var(--bg2); overflow-y: auto; }
.cl-col2 { width: 400px; min-width: 320px; border-right: 1px solid var(--border); display: flex; flex-direction: column; background: var(--bg2); overflow: hidden; }
.cl-col3 { flex: 1; min-width: 260px; display: flex; flex-direction: column; overflow: hidden; }
.cl-colhead { padding: 10px 14px; font-size: 11px; font-weight: 700; color: #fff; text-transform: uppercase; letter-spacing: 0.8px; font-family: var(--mono); flex-shrink: 0; }
.info-k { font-size: 9px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.7px; font-family: var(--mono); font-weight: 600; margin-bottom: 2px; }
.info-v { font-size: 12px; color: var(--text); font-weight: 500; margin-bottom: 9px; word-wrap: break-word; }
.pol-card { background: var(--bg3); border: 1px solid var(--border2); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.side-btn { width: 100%; padding: 7px; border-radius: 8px; font-size: 11px; font-weight: 700; cursor: pointer; text-align: center; text-decoration: none; display: block; font-family: var(--font); }

/* ─── Pipeline ─── */
.pipe-col { display: flex; flex-direction: column; min-height: 0; width: 230px; min-width: 230px; }
.pipe-drop { flex: 1; overflow-y: auto; border-radius: 0 0 var(--radius) var(--radius); padding: 2px; min-height: 80px; transition: background 0.15s; }
.pipe-drop.over { background: var(--linq-blue-lt); outline: 2px dashed var(--linq-blue); }
.pipe-card[draggable="true"] { cursor: grab; }
.pipe-card.dragging { opacity: 0.4; }
.pipe-more { font-size: 11px; color: var(--text3); text-align: center; padding: 8px; }

/* ─── Follow-ups ─── */
.fu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.fu-list { padding: 6px; max-height: 420px; overflow-y: auto; }
.fu-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.fu-item:hover { background: var(--bg3); }
.fu-when { font-size: 10px; font-family: var(--mono); font-weight: 700; white-space: nowrap; }

/* ─── Dialer ─── */
.dialer-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: start; }
.dialer-note { font-size: 11px; color: var(--text3); margin-top: 10px; line-height: 1.5; }
.outcomes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.outcomes .btn { justify-content: center; font-weight: 600; padding: 9px 6px; }
.dial-big { display: block; text-align: center; margin: 14px auto 4px; padding: 12px 24px; border-radius: 30px; background: var(--linq-green); color: #fff; font-size: 16px; font-weight: 700; font-family: var(--mono); text-decoration: none; width: fit-content; }
.dial-big:hover { background: var(--linq-green2); }
.plain-list { padding-left: 18px; font-size: 13px; color: var(--text2); line-height: 1.9; }

/* ─── Intake form ─── */
.modal.intake { width: 900px; max-width: calc(100vw - 24px); margin-bottom: 40px; }
.intake .irow { flex-wrap: wrap; }
.sep-row { background: var(--linq-blue-lt); border-radius: 8px; padding: 8px 12px 0; }
.fam-head { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.7px; font-family: var(--mono); font-weight: 600; margin-bottom: 4px; }
.intake textarea.iinput { resize: vertical; }

/* ─── Dialogs ─── */
.dlg-overlay { position: fixed; inset: 0; background: rgba(15,25,35,0.5); z-index: 1000; display: flex; align-items: flex-start; justify-content: center; padding: 50px 12px 40px; overflow-y: auto; }
.dlg { background: var(--bg2); border: 1px solid var(--border2); border-radius: 14px; width: 520px; max-width: 100%; padding: 24px; box-shadow: 0 12px 40px rgba(0,0,0,0.25); }
.dlg.wide { width: 880px; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.dlg-title { font-size: 16px; font-weight: 700; color: var(--linq-blue); }
.dlg-foot { display: flex; gap: 8px; margin-top: 18px; }
.dlg-foot .btn-primary { flex: 1; padding: 10px; justify-content: center; }
.dlg .form-group { margin-bottom: 10px; }
.utable { width: 100%; border-collapse: collapse; }
.utable th { padding: 8px 12px; text-align: left; font-size: 10px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 0.7px; background: var(--bg3); border-bottom: 2px solid var(--border2); }
.utable td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 12px; }
.ubtn { padding: 3px 9px; border-radius: 5px; font-size: 10px; font-weight: 600; cursor: pointer; border: 1px solid; font-family: var(--font); }

/* ─── Toast ─── */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #1a1f2e; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13px; font-weight: 500; opacity: 0; pointer-events: none; transition: all 0.2s; z-index: 2000; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--red); }

/* ─── Smaller screens ─── */
@media (max-width: 1100px) {
  .agents-grid { grid-template-columns: repeat(2, 1fr); }
  .fu-grid { grid-template-columns: 1fr; }
  .dialer-grid { grid-template-columns: 1fr; }
  .cl-col2 { width: 320px; }
}
@media (max-width: 760px) {
  .dash-grid { grid-template-columns: 1fr; grid-template-rows: none; overflow-y: auto; }
  .dash-q { min-height: 360px; }
  .settings-grid, .agents-grid { grid-template-columns: 1fr; }
  .topbar .search-box { display: none; }
}

/* ─── Sidebar: Ringy-style logo, toggle and account menu ─── */
.sidebar { transition: width 0.28s cubic-bezier(0.4,0,0.2,1), min-width 0.28s cubic-bezier(0.4,0,0.2,1); }
.logo-area { height: 76px; padding: 0 6px; gap: 10px; justify-content: flex-start; padding-left: 7px; }
.logo-img { width: 42px; min-width: 42px; height: auto; border-radius: 0; filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4)); }
.logo-text { display: none; }
.logo-word { font-size: 27px; font-weight: 800; letter-spacing: -0.5px; color: #fff; white-space: nowrap; opacity: 0; transform: translateX(-8px); transition: opacity 0.2s, transform 0.2s; line-height: 1; }
.logo-word span { color: var(--linq-orange); }
.sidebar-inner:hover .logo-word, .sb-pinned .logo-word { opacity: 1; transform: translateX(0); }
.sidebar-inner:hover .logo-img, .sb-pinned .logo-img { width: 46px; min-width: 46px; }

/* top-bar toggle (keeps the sidebar open) */
.sb-toggle { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border2); background: var(--bg3); color: var(--text2); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; transition: background 0.15s, color 0.15s; }
.sb-toggle:hover { background: var(--bg4); color: var(--text); }
.sb-toggle .ic-close { display: none; }
.sb-pinned .sb-toggle .ic-open { display: none; }
.sb-pinned .sb-toggle .ic-close { display: block; }
.sb-pinned .sb-toggle { background: var(--linq-blue-lt); color: var(--linq-blue); border-color: rgba(21,101,192,0.25); }

/* pinned open: page makes room */
.sb-pinned .sidebar { width: 240px; min-width: 240px; }
.sb-pinned .sidebar-inner, .sb-pinned .sidebar-inner:hover { width: 240px; box-shadow: none; }
.sb-pinned .nav-label { opacity: 1; transform: translateX(0); }
.sb-pinned .nav-badge { opacity: 1; }
.sb-pinned .nav-item[data-tip]::after { display: none; }

/* account button at the bottom of the sidebar */
.sidebar-footer { padding: 10px 0; }
.user-card { width: 100%; display: flex; align-items: center; gap: 10px; padding: 6px 12px; background: none; border: none; cursor: pointer; color: inherit; font-family: var(--font); text-align: left; }
.user-card:hover .user-av, .user-card[aria-expanded="true"] .user-av { box-shadow: 0 0 0 2px rgba(245,124,0,0.6); }
.user-av { width: 32px; height: 32px; min-width: 32px; border-radius: 50%; background: rgba(245,124,0,0.25); color: #f57c00; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; transition: box-shadow 0.15s; }
.user-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.user-name { font-size: 12px; font-weight: 600; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10px; color: rgba(255,255,255,0.45); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-caret { color: rgba(255,255,255,0.45); flex-shrink: 0; }

/* account menu */
.user-menu { position: fixed; z-index: 300; width: 250px; background: var(--bg2); border: 1px solid var(--border2); border-radius: 12px; box-shadow: 0 12px 36px rgba(0,0,0,0.25); padding: 6px; }
.um-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.um-av { width: 38px; height: 38px; min-width: 38px; border-radius: 50%; background: var(--linq-orange-lt); color: var(--linq-orange); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.um-name { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.um-sub { font-size: 11px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.um-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: none; background: none; border-radius: 8px; font-size: 13px; color: var(--text2); cursor: pointer; font-family: var(--font); text-align: left; }
.um-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.um-item:hover, .um-item:focus-visible { background: var(--bg3); color: var(--text); outline: none; }
.um-item.danger { color: var(--red); }
.um-item.danger:hover { background: var(--red-lt); }
@media (prefers-reduced-motion: reduce) { .logo-word, .sidebar { transition: none; } }
.logo-area { padding-left: 5px; }
.logo-img { width: 46px; min-width: 46px; }
.sidebar-inner:hover .logo-img, .sb-pinned .logo-img { width: 54px; min-width: 54px; }

/* ─── Claude AI ─── */
.ai-wrap { max-width: 880px; display: flex; flex-direction: column; gap: 12px; height: 100%; }
.ai-quick { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-chat-card { display: flex; flex-direction: column; flex: 1; min-height: 360px; }
.ai-chat-card .ai-messages { flex: 1; overflow-y: auto; padding: 16px; max-height: none; }
.ai-foot { font-size: 11px; color: var(--text3); line-height: 1.5; }
.ai-bubble { line-height: 1.6; }
.ai-bubble.ai-err { background: var(--red-lt); color: var(--red); }
.ai-typing { display: flex; gap: 4px; align-items: center; min-height: 20px; }
.ai-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--linq-orange); animation: aiDot 1s infinite ease-in-out; }
.ai-typing span:nth-child(2) { animation-delay: 0.15s; } .ai-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes aiDot { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.ai-draft-btn { padding: 5px 12px; border-radius: 20px; border: 1.5px solid rgba(245,124,0,0.4); background: var(--linq-orange-lt); color: var(--linq-orange); font-size: 11px; font-weight: 700; cursor: pointer; font-family: var(--font); white-space: nowrap; }
.ai-draft-btn:hover { background: #ffe6c7; }
.ai-draft-btn:disabled { opacity: 0.6; cursor: default; }
.ai-setup { border-color: rgba(245,124,0,0.35); background: var(--linq-orange-lt); }
@media (prefers-reduced-motion: reduce) { .ai-typing span { animation: none; opacity: 0.7; } }
.msg-status-bad { color: var(--red); font-style: normal; font-weight: 600; }
/* wave 1: tags, block, templates, inbox */
.tag-row { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.tag-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px; border: 1px solid; white-space: nowrap; font-family: var(--font); }
.tag-chip.sm { font-size: 9px; padding: 1px 6px; }
.tag-chip.big { font-size: 12px; padding: 6px 12px; cursor: pointer; background: #fff; color: var(--tc); border: 1.5px solid var(--tc); }
.tag-chip.big.on { background: var(--tc); color: #fff; }
.tag-chip.big small { font-size: 9px; opacity: .8; }
.tag-add, .tpl-btn { font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 8px; border: 1px dashed var(--border2); background: transparent; color: var(--text2); cursor: pointer; font-family: var(--font); white-space: nowrap; }
.tag-add:hover, .tpl-btn:hover { border-color: var(--linq-blue); color: var(--linq-blue); }
.tpl-btn { border-style: solid; }
.blocked-badge { font-size: 9px; font-weight: 800; padding: 2px 7px; border-radius: 6px; background: #0f1923; color: #fff; letter-spacing: .4px; }
.tpl-pick { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; border: 1px solid var(--border2); border-radius: 10px; padding: 9px 11px; background: #fff; cursor: pointer; font-family: var(--font); font-size: 12px; color: var(--text); }
.tpl-pick span { font-size: 11px; color: var(--text3); }
.tpl-pick:hover { border-color: var(--linq-blue); background: var(--linq-blue-lt); }
.tpl-row { display: flex; gap: 8px; align-items: center; border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; font-size: 12px; }
#page-inbox .composer { border-top: 1px solid var(--border); background: #fff; padding: 12px 16px; }
code { font-family: var(--mono); font-size: 10px; background: var(--bg3); padding: 1px 4px; border-radius: 4px; }
/* wave 2 */
.notice { background: var(--linq-orange-lt); border: 1px solid #ffe0b2; color: #8a4b00; border-radius: 10px; padding: 10px 12px; font-size: 12px; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.mini-table th { text-align: left; font-size: 10px; color: var(--text3); font-weight: 700; text-transform: uppercase; letter-spacing: .6px; padding: 6px 8px; border-bottom: 1px solid var(--border); font-family: var(--mono); }
.mini-table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.bar { height: 7px; border-radius: 4px; background: var(--bg3); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--linq-green); }
.script-body { background: var(--bg3); border-radius: 10px; padding: 14px 16px; font-size: 14px; line-height: 1.7; color: var(--text); max-height: 55vh; overflow: auto; }
.sc-cue { background: var(--linq-orange-lt); color: #8a4b00; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 5px; }
.sec-label { font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--text3); margin: 4px 0 8px; font-family: var(--mono); }
/* wave 3 */
.accept-toggle { font-size: 11px; font-weight: 800; padding: 6px 12px; border-radius: 20px; border: 1.5px solid #a5d6a7; background: var(--linq-green-lt); color: var(--linq-green); cursor: pointer; white-space: nowrap; font-family: var(--font); margin-right: 8px; }
.accept-toggle.off { border-color: var(--border2); background: var(--bg3); color: var(--text3); }
.code-box { background: #0f1923; color: #d6e2f0; border-radius: 10px; padding: 12px 14px; font-family: var(--mono); font-size: 11px; line-height: 1.6; overflow: auto; white-space: pre; max-height: 260px; }
@media (max-width: 760px) { .accept-toggle { display: none; } }

/* ═════ Phone app layout ═════ */
#m-tabs, .m-back { display: none; }
.m-more { display: flex; flex-direction: column; gap: 4px; }
.m-more-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 12px; border: 0; border-radius: 10px; background: var(--bg3); font: 600 14px var(--font); color: var(--text); text-align: left; cursor: pointer; }
.m-more-item .m-ic { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; color: var(--linq-blue); }
.m-more-item .m-ic svg { width: 20px; height: 20px; }
.m-more-item.danger { color: var(--red); }
.m-steps { font-size: 13px; color: var(--text2); line-height: 1.8; padding-left: 20px; margin-bottom: 6px; }
@media (max-width: 760px) {
  html, body { overscroll-behavior-y: none; }
  .sidebar { display: none !important; }
  .main { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  #m-tabs { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; background: #0f1923; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 18px rgba(0,0,0,.18); }
  .m-tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; color: rgba(255,255,255,.55); font: 600 10px var(--font); padding: 6px 0; position: relative; cursor: pointer; }
  .m-tab .m-ic { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
  .m-tab .m-ic svg { width: 21px; height: 21px; }
  .m-tab.on { color: #fff; }
  .m-tab.on .m-ic { color: #ffb74d; }
  .m-badge { position: absolute; top: 2px; left: 54%; min-width: 17px; height: 17px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10px; line-height: 17px; padding: 0 4px; }
  .topbar { padding: calc(8px + env(safe-area-inset-top)) 12px 8px; gap: 8px; min-height: 0; }
  .topbar .sb-toggle, .breadcrumb, .accept-toggle { display: none !important; }
  .page-title { font-size: 18px; }
  .topbar-right { gap: 6px; }
  .topbar-right .search-box { display: none; }
  .m-back { display: inline-flex; align-items: center; border: 0; background: var(--linq-blue-lt); color: var(--linq-blue); font: 700 13px var(--font); padding: 6px 12px; border-radius: 18px; margin-right: 8px; cursor: pointer; }
  .m-back[hidden] { display: none; }
  /* lists and record screens: one at a time */
  .list-col { width: 100% !important; min-width: 0 !important; border-right: 0 !important; }
  .page .list-col ~ * { display: none !important; }
  .page.m-detail .list-col { display: none !important; }
  .page.m-detail .list-col ~ * { display: flex !important; flex: 1; min-width: 0; }
  .list-filters { flex-wrap: wrap; }
  .convo-header { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .convo-actions { width: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
  .convo-actions .btn { flex: 1 1 auto; justify-content: center; padding: 9px 10px; }
  .composer { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
  .reply-input { font-size: 16px; }              /* stops iPhone from zooming in on tap */
  input, select, textarea { font-size: 16px !important; }
  .dash-q { min-height: 70vh; border-right: 0 !important; }
  .settings-grid, .auth-two { grid-template-columns: 1fr !important; }
  .page-content { padding: 12px; }
  .dlg-overlay { padding: 0; align-items: stretch; }
  .dlg { width: 100% !important; max-width: 100% !important; min-height: 100%; border-radius: 0; padding: calc(18px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)); }
  .mini-table { font-size: 11px; }
  .lrow { padding-top: 12px; padding-bottom: 12px; }
  .hover-card { display: none !important; }
}
@media (max-width: 760px) {
  .page.m-detail .list-col ~ * { flex-direction: column; overflow-y: auto !important; -webkit-overflow-scrolling: touch; }
  .page.m-detail .list-col ~ * > * { flex-shrink: 0; }
  .page.m-detail .convo-messages { min-height: 46vh; max-height: none; flex: 0 0 auto; overflow: visible; }
  .composer > div:first-child { flex-wrap: wrap; row-gap: 6px; }
  .composer .mode-label { flex-basis: 100%; margin-left: 0; order: 10; }
  .composer .char-count, .composer kbd, .composer kbd + * { display: none; }
  .convo-header .tag-row { flex-wrap: wrap; }
}
