/* KeptDesk client portal — task-first product surface.
   This file is intentionally portal-scoped; the operator console keeps its
   existing layout and the shared theme remains unchanged. */

body.portal-body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}
.hidden { display: none !important; }

.portal-header {
  min-height: 64px;
  height: auto;
  padding: 10px 24px;
  background: var(--surface);
}
.portal-header .brand-text { gap: 0; }
.portal-header .eyebrow { text-transform: none; letter-spacing: 0; font-size: 12px; }
.portal-header h1 { font-size: 16px; }
.portal-duty {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: 12px;
  color: var(--text-2);
  font-size: 12px;
}
.portal-auth-summary { display:flex; align-items:center; gap:8px; margin-left:auto; }
.portal-auth-summary form { margin:0; }

.portal-auth-gate {
  display:grid;
  flex:1;
  place-items:center;
  min-height:calc(100vh - 150px);
  padding:32px 18px;
}
.portal-auth-card {
  width:min(100%, 470px);
  padding:28px;
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--surface);
  box-shadow:var(--card-shadow);
}
.portal-auth-card .eyebrow { color:var(--accent); }
.portal-auth-card h2 {
  margin:6px 0 8px;
  color:var(--text);
  font-size:24px;
  letter-spacing:-.02em;
  text-transform:none;
}
.portal-auth-card > p { margin:0 0 18px; color:var(--text-2); }
.portal-sign-in {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  padding:0 18px;
  border:1px solid var(--accent);
  border-radius:8px;
  background:var(--accent);
  color:#fff;
  font-weight:650;
  text-decoration:none;
}
.portal-sign-in:hover { border-color:var(--accent-hover); background:var(--accent-hover); color:#fff; }
.portal-sign-in:focus-visible { outline:3px solid var(--accent-soft); outline-offset:2px; }
.portal-auth-unavailable {
  margin:0 0 14px;
  padding:11px 12px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--surface-2);
  color:var(--text-2);
  font-size:13px;
}

.portal-nav {
  display: flex;
  gap: 2px;
  padding: 0 24px;
  overflow-x: auto;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.portal-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 560;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.portal-nav a:hover { color: var(--text); }
.portal-nav a.active { color: var(--text); border-color: var(--accent); }
.portal-nav .nav-count {
  min-width: 18px;
  height: 18px;
  margin-left: 7px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(180,83,9,.12);
  color: var(--warn);
  font: 700 11px/18px var(--font-mono);
  text-align: center;
}
.portal-nav .nav-count.hidden { display: none; }
.nav-desk-short { display:none; }

.portal-main { min-height: 0; }
.portal-panel { width: 100%; min-height: 0; }
.portal-panel.hidden { display: none !important; }
.portal-page { max-width: 1180px; margin: 0 auto; padding: 24px; }

.portal-context {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.portal-context label { color: var(--text-2); font-size: 12px; }
.portal-context select:only-child { display: none; }

.followup-summary {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--card-shadow);
  color: var(--text-2);
  font-size: 14px;
}
.followup-summary strong { color: var(--text); font-weight: 650; }

.followup-shell {
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  min-height: 620px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--card-shadow);
}
.followup-list { min-width: 0; border-right: 1px solid var(--border); background: var(--surface); }
.followup-detail { min-width: 0; padding: 22px; background: var(--surface-2); }
.followup-section-label {
  padding: 14px 16px 8px;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.followup-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 12px;
  padding: 14px 15px 14px 13px;
  color: inherit;
  text-decoration: none;
  border-top: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--surface);
}
.followup-row:hover { background: var(--surface-2); }
.followup-row.selected {
  background: var(--accent-soft);
  box-shadow: inset -3px 0 0 var(--accent), inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent);
}
.followup-row.selected .followup-name { color: var(--accent-hover); }
.followup-row.urgent { border-left-color: var(--warn); }
.followup-row.closed { border-left-color: var(--border); }
.followup-name { display:block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 650; }
.followup-phone { display:block; margin-top:1px; color:var(--text-2); font-size:12px; font-variant-numeric:tabular-nums; }
.followup-headline { display:block; margin-top: 2px; color: var(--text); font-size: 13px; line-height: 1.4; }
.followup-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 5px; color: var(--text-2); font-size: 12px; }
.followup-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.followup-permissions { grid-column: 1 / -1; overflow-wrap: anywhere; }
.followup-time { white-space: nowrap; font-variant-numeric:tabular-nums; }
.work-tag { display:inline-flex; padding:2px 8px; border-radius:999px; font-size:11px; font-weight:650; white-space:nowrap; }
.work-tag.urgent { background:rgba(180,83,9,.12); color:var(--warn); }
.work-tag.waiting { background:var(--accent-soft); color:var(--accent); }
.work-tag.done { border:1px solid var(--border); color:var(--text-2); }

.closed-work { border-top: 1px solid var(--border); }
.closed-work summary { padding: 13px 16px; cursor: pointer; color: var(--text-2); font-weight: 600; }
.closed-work summary:hover { color: var(--text); }

.detail-back { display: none; margin-bottom: 14px; color: var(--accent); text-decoration: none; font-weight: 600; }
.detail-title { margin: 0; font-size: 21px; font-weight: 680; letter-spacing: -.02em; text-transform: none; }
.detail-subtitle { margin: 3px 0 18px; color: var(--text-2); }
.portal-card { margin-bottom: 14px; overflow: hidden; border:1px solid var(--border); border-radius:10px; background:var(--surface); box-shadow:var(--card-shadow); }
.portal-card-title { padding: 12px 15px; border-bottom:1px solid var(--border); font-size:13px; font-weight:650; }
.fact-list { margin:0; padding: 4px 15px 10px; }
.fact-list > div { display:grid; grid-template-columns:116px minmax(0,1fr); gap:14px; padding:9px 0; border-bottom:1px solid var(--border); }
.fact-list > div:last-child { border-bottom:0; }
.fact-list dt { color:var(--text-2); font-size:12px; }
.fact-list dd { margin:0; font-size:14px; overflow-wrap:anywhere; }
.fact-list dd, .call-action { font-variant-numeric: tabular-nums; }
.outcome-list { margin: 0; padding: 8px 15px 12px; list-style:none; }
.outcome-list li { display:flex; align-items:flex-start; gap:9px; padding:6px 0; }
.outcome-dot { width:8px; height:8px; margin-top:6px; border-radius:50%; background:var(--border); flex:none; }
.outcome-dot.attention { background:var(--warn); }
.outcome-dot.waiting { background:var(--accent); }
.followup-actions { display:flex; gap:8px; flex-wrap:wrap; padding:0 15px 15px; }
.followup-actions .call-action { background:var(--accent); border-color:var(--accent); color:#fff; text-decoration:none; display:inline-flex; align-items:center; justify-content:center; min-height:34px; padding:0 15px; border-radius:8px; font-weight:650; }
.lifecycle-copy { padding: 0 15px 14px; color:var(--text-2); font-size:12px; }
.excerpt { margin:0; padding: 13px 15px; color:var(--text); font-size:14px; }
.conversation-link { display:inline-flex; margin:0 15px 15px; color:var(--accent); font-weight:600; text-decoration:none; }

.portal-empty { display:grid; place-items:center; min-height:320px; padding:36px; text-align:center; }
.portal-empty h2 { margin:0 0 7px; font-size:20px; text-transform:none; letter-spacing:0; }
.portal-empty p { max-width:430px; margin:0; color:var(--text-2); }
.portal-empty.queue-clear { min-height:170px; border-bottom:1px solid var(--border); }

.conversation-row {
  width:100%;
  height:auto;
  min-height:68px;
  border-radius:0;
  text-align:left;
}
.conversation-row.active {
  background:var(--accent-soft);
  box-shadow:inset -3px 0 0 var(--accent), inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent);
}
.conversation-row.active .v { color:var(--accent-hover); }
.conversation-row > span:last-child { text-align:right; }
.conversation-request + .conversation-request { border-top:1px solid var(--border); }
#convdetail .portal-card { max-width:760px; }
#convdetail .transcript-body { padding:12px 15px 15px; }

.desk-work-grid, .reports-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:20px; }
.portal-subsection { min-width:0; }
.portal-subsection + .portal-subsection { padding-top:20px; border-top:1px solid var(--border); }
.playbook-language { display:inline-flex; align-items:center; gap:7px; color:var(--text-2); font-size:12px; }
.playbook-language select { min-height:34px; }
.transcript-disclosure { padding:0; }
.transcript-disclosure summary { min-height:48px; padding:14px 15px; font-weight:650; cursor:pointer; }
.transcript-body { padding:0 15px 15px; }

@media (max-width: 780px) {
  .portal-header { padding:10px 14px; }
  .portal-duty { display:none; }
  .portal-auth-summary { width:100%; justify-content:flex-end; margin-left:0; }
  .portal-nav { padding:0 6px; }
  .portal-nav a { min-height:44px; padding:0 11px; }
  .nav-desk-wide { display:none; }
  .nav-desk-short { display:inline; }
  .portal-page { padding:16px 12px; }
  .followup-shell { display:block; min-height:0; border-radius:10px; }
  .followup-list { border-right:0; }
  .followup-detail { display:none; padding:16px 13px; }
  .followup-shell.show-detail .followup-list { display:none; }
  .followup-shell.show-detail .followup-detail { display:block; }
  .detail-back { display:inline-flex; min-height:44px; align-items:center; }
  .followup-row { min-height:78px; }
  .fact-list > div { grid-template-columns:100px minmax(0,1fr); gap:10px; }
  .followup-actions { flex-direction:column; }
  .followup-actions > *, .followup-actions .call-action { width:100%; min-height:44px; }
}

@media (max-width: 430px) {
  .portal-auth-gate { align-items:start; min-height:0; padding:18px 12px; }
  .portal-auth-card { padding:21px 18px; }
  .portal-auth-card h2 { font-size:21px; }
  .portal-sign-in { width:100%; }
}

@media print {
  .portal-header, .portal-nav, #noticebar, #panel-followups, #panel-conversations, #panel-desk { display:none !important; }
  .portal-body { background:#fff; color:#000; }
  #panel-reports { display:block !important; }
  .reports-grid > #panel-overview { display:none !important; }
  .portal-page { max-width:none; padding:0; }
}
