/*
 * Beacon Customer Reference Dashboard
 *
 * Design intent: read like a Bloomberg/Affinity/Linear product. Dense
 * table. Restrained color. Monospace for numbers and dates. One accent
 * color for actions. No marketing UX.
 */

:root {
  --bg: #fafaf9;
  --bg-elevated: #ffffff;
  --bg-sidebar: #f5f5f4;
  --bg-row-hover: #f5f5f4;
  --bg-row-selected: #eef2ff;

  --border: #e7e5e4;
  --border-strong: #d6d3d1;

  --text: #1c1917;
  --text-muted: #57534e;
  --text-dim: #a8a29e;

  --accent: #1f2937;
  --accent-hover: #111827;

  --pill-grey-bg: #f3f4f6;
  --pill-grey-fg: #4b5563;
  --pill-blue-bg: #dbeafe;
  --pill-blue-fg: #1e40af;
  --pill-amber-bg: #fef3c7;
  --pill-amber-fg: #92400e;
  --pill-green-bg: #d1fae5;
  --pill-green-fg: #065f46;
  --pill-red-bg: #fee2e2;
  --pill-red-fg: #991b1b;

  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI",
               system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Menlo", "Cascadia Mono",
               "Roboto Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; }

/* --- Top bar --- */

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 44px;
  padding: 0 18px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.brand-mark {
  color: var(--accent);
  font-size: 12px;
}

.brand-name {
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.topbar-spacer { flex: 1; }

.topbar-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

/* --- Layout --- */

.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 44px);
}

.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 14px 0;
  overflow-y: auto;
}

.sidebar-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 18px 8px;
}

.company-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.company-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 18px;
  border-left: 2px solid transparent;
  cursor: pointer;
  user-select: none;
}

.company-item:hover {
  background: var(--bg-row-hover);
}

.company-item.is-selected {
  background: var(--bg-row-selected);
  border-left-color: var(--accent);
}

.company-item-name {
  font-weight: 500;
  color: var(--text);
}

.company-item-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.company-empty {
  padding: 12px 18px;
  color: var(--text-dim);
  font-style: italic;
}

/* --- Content --- */

.content {
  padding: 24px 28px;
  overflow-x: auto;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.target-name {
  font-size: 19px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}

.target-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.content-header-actions {
  display: flex;
  gap: 8px;
}

.empty-state {
  margin-top: 60px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state-title {
  font-size: 14px;
  color: var(--text);
}

.empty-state-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* --- Buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  transition: background 80ms ease, border-color 80ms ease;
}

.btn:hover:not(:disabled) {
  background: var(--bg-row-hover);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-small {
  padding: 3px 9px;
  font-size: 11px;
}

/* --- Q&A drawer items (reuses .drawer + .drawer-body containers) --- */

.qa-section-header {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 18px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.qa-section-header:first-child {
  margin-top: 0;
}

.qa-item {
  padding: 10px 0 12px;
  border-bottom: 1px solid var(--border);
}
.qa-item:last-child {
  border-bottom: 0;
}

.qa-question {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.4;
}

.qa-answer {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.55;
  white-space: pre-wrap;
}

.qa-answer-empty {
  font-style: italic;
  opacity: 0.6;
}

.qa-item-freeform .qa-answer {
  color: var(--text);
  font-style: italic;
}

/* --- Customer table --- */

.customer-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.customer-table thead {
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
}

.customer-table th {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
  padding: 9px 12px;
  white-space: nowrap;
}

.customer-table th.col-revenue { text-align: right; }
.customer-table th.col-actions { width: 1%; }

.customer-table td {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}

.customer-table tbody tr:hover {
  background: var(--bg-row-hover);
}

.col-customer { font-weight: 500; }
.col-revenue {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
}
.col-revenue .revenue-unit {
  color: var(--text-muted);
  font-size: 10px;
  margin-left: 4px;
}
.col-products {
  color: var(--text-muted);
  font-size: 12px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.col-actions { white-space: nowrap; text-align: right; }

/* Editable cells */
.editable {
  position: relative;
  min-width: 110px;
}

.editable[data-empty="true"] .editable-value {
  color: var(--text-dim);
  font-style: italic;
}

.editable-value {
  display: inline-block;
  width: 100%;
  padding: 2px 0;
  cursor: text;
}

.editable-input {
  width: 100%;
  font: inherit;
  color: inherit;
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  border-radius: 3px;
  padding: 2px 6px;
  margin: -3px -7px;
  outline: none;
}

/* --- Status pills --- */

.pill {
  display: inline-block;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 99px;
  white-space: nowrap;
}

.pill-grey  { background: var(--pill-grey-bg);  color: var(--pill-grey-fg); }
.pill-blue  { background: var(--pill-blue-bg);  color: var(--pill-blue-fg); }
.pill-amber { background: var(--pill-amber-bg); color: var(--pill-amber-fg); }
.pill-green { background: var(--pill-green-bg); color: var(--pill-green-fg); }
.pill-red   { background: var(--pill-red-bg);   color: var(--pill-red-fg); }

/* Reference-status dropdown looks like a pill, edits inline. */
.ref-status-select {
  appearance: none;
  -webkit-appearance: none;
  display: inline-block;
  padding: 2px 22px 2px 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: none;
  border-radius: 99px;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'><path d='M0 0l4 5 4-5z' fill='%23999'/></svg>");
  background-repeat: no-repeat;
  background-position: right 6px center;
}

/* --- Drawer (outreach preview) --- */

/* The browser's UA stylesheet [hidden] { display: none } has the same
 * specificity as our .drawer { display: flex } below, and the .drawer
 * rule wins because it loads later — which means [hidden] alone would
 * NOT actually hide the drawer. Force it. */
[hidden] { display: none !important; }

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.32);
  z-index: 20;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 460px;
  max-width: 92vw;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  z-index: 21;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.08);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  position: sticky;
  top: 0;
  z-index: 1;
}

.drawer-title {
  font-weight: 600;
  font-size: 13px;
}

.drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  width: 28px;
  height: 28px;
  color: var(--text);
  cursor: pointer;
  padding: 0;
}

.drawer-close:hover {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

.drawer-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.drawer-footer {
  border-top: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--bg-sidebar);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.draft-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 14px;
  background: var(--bg-elevated);
}

.draft-card-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-sidebar);
}

.draft-recipient {
  font-weight: 500;
  font-family: var(--font-mono);
  font-size: 12px;
}

.draft-subject {
  font-size: 12px;
  margin-top: 3px;
  color: var(--text-muted);
}

.draft-body {
  padding: 14px;
  white-space: pre-wrap;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text);
  line-height: 1.55;
}

.draft-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg-sidebar);
}

.draft-card-actions .btn {
  text-decoration: none;
}

.draft-saved-path {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dim);
  cursor: default;
}

/* Subtle inline note shown at the top of the drawer body. */
.drawer-note {
  font-size: 11px;
  color: var(--text-muted);
  padding: 0 0 12px;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 14px;
}

.drawer-note code {
  font-family: var(--font-mono);
  background: var(--bg-sidebar);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10.5px;
}

/* --- Customer side card: tabs --- */
.drawer-titles { display: flex; flex-direction: column; gap: 2px; }
.drawer-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.drawer-tabs {
  display: flex;
  gap: 2px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}
.drawer-tab {
  appearance: none;
  border: none;
  background: none;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.drawer-tab:hover { color: var(--text); }
.drawer-tab.is-active {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.tab-badge {
  display: inline-block;
  min-width: 16px;
  padding: 0 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  border-radius: 99px;
  background: var(--pill-green-bg);
  color: var(--pill-green-fg);
}

/* --- Details tab --- */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 22px;
}
.detail-field.detail-wide { grid-column: 1 / -1; }
.detail-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 3px;
}
.detail-value { font-size: 13px; color: var(--text); }
.detail-value.detail-editable { cursor: text; border-bottom: 1px dashed var(--border-strong); padding-bottom: 2px; }
.detail-value.detail-editable[data-empty="true"] { color: var(--text-dim); font-style: italic; }
.detail-footer {
  grid-column: 1 / -1;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* --- AI Call tab --- */
.ai-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 12px;
}
.ai-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 12px;
  overflow: hidden;
}
.ai-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: var(--bg-sidebar);
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  font-size: 12px;
}
.ai-card-head .ai-card-meta { font-weight: 400; color: var(--text-muted); font-size: 11px; }
.ai-card-body { padding: 12px; }
.ai-card.is-collapsed .ai-card-body { display: none; }

.ai-checklist { list-style: none; margin: 0; padding: 0; line-height: 1.9; }
.ai-checklist li.ok { color: var(--text); }
.ai-checklist li.missing { color: var(--pill-amber-fg); }
.ai-checklist .ai-shortcut { color: var(--pill-blue-fg); cursor: pointer; text-decoration: underline; }

.ai-timing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.ai-timing-cell { background: var(--bg-sidebar); border-radius: 4px; padding: 6px 8px; }
.ai-timing-cell .detail-label { margin-bottom: 1px; }
.ai-timing-cell .ai-timing-val { font-family: var(--font-mono); font-size: 12px; }

.ai-coverage { background: var(--bg-sidebar); border-radius: 4px; padding: 8px 10px; margin-bottom: 10px; font-size: 12px; }
.ai-artifacts { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; }
.ai-artifacts a { color: var(--pill-blue-fg); cursor: pointer; }

.questions-md h2 { font-size: 13px; margin: 14px 0 6px; }
.questions-md h3 { font-size: 12px; margin: 12px 0 5px; color: var(--text-muted); }
.questions-md h4 { font-size: 11.5px; margin: 10px 0 4px; }
.questions-md .q-list { margin: 4px 0 10px; padding-left: 18px; }
.questions-md p { margin: 6px 0; }

/* --- Selected row --- */
.customer-table tbody tr.is-open { background: var(--bg-row-selected); }
.customer-table tbody tr { cursor: pointer; }

/* --- Cube call-prep section --- */
.cube-section {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-elevated);
  overflow: hidden;
}
.cube-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 14px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 12px;
}
.cube-section-body { padding: 14px; }
.cube-import-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.cube-import-row input[type="text"] {
  flex: 1;
  font: inherit;
  font-size: 12px;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 5px 10px;
  outline: none;
}
.cube-import-row input[type="text"]:focus { border-color: var(--accent); }
.cube-import-error {
  margin-top: 8px;
  font-size: 11px;
  color: var(--pill-red-fg);
  background: var(--pill-red-bg);
  border-radius: 4px;
  padding: 5px 10px;
}
.cube-summary {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-family: var(--font-mono);
}
.cube-pending-row {
  border: 1px solid var(--border);
  border-radius: 5px;
  margin-bottom: 8px;
  overflow: hidden;
}
.cube-pending-head {
  padding: 7px 12px;
  background: var(--bg-sidebar);
  font-weight: 500;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cube-pending-candidates { padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.cube-candidate-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.cube-candidate-name { flex: 1; color: var(--text); }
.cube-candidate-score {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  min-width: 36px;
  text-align: right;
}
.cube-unmatched-list {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}
.cube-unmatched-list li::before { content: "✗ "; color: var(--pill-red-fg); }

/* --- Cube brief (customer card) --- */
.cube-brief {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.cube-brief-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.cube-brief-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.cube-brief-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.cube-arr-row {
  display: flex;
  gap: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  flex-wrap: wrap;
}
.cube-arr-cell {
  padding: 3px 7px;
  border: 1px solid var(--border);
  margin-right: -1px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  white-space: nowrap;
}
.cube-arr-cell:first-child { border-radius: 3px 0 0 3px; }
.cube-arr-cell:last-child { border-radius: 0 3px 3px 0; margin-right: 0; }
.cube-anomaly { font-size: 11.5px; color: var(--pill-amber-fg); margin: 3px 0; }
.cube-target-row { margin: 6px 0; font-size: 12px; }
.cube-target-question { font-size: 11px; color: var(--text-muted); margin-left: 10px; font-style: italic; }
.pill-purple { background: #ede9fe; color: #5b21b6; }

/* --- Calibration section --- */
.cal-section {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-elevated);
  overflow: hidden;
}
.cal-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 14px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 12px;
}
.cal-section-body { padding: 14px; }

.cal-group {
  border: 1px solid var(--border);
  border-radius: 5px;
  margin-bottom: 10px;
  overflow: hidden;
}
.cal-group:last-child { margin-bottom: 0; }

.cal-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 12px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
}
.cal-group-title {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.cal-group-actions { display: flex; gap: 6px; align-items: center; }

/* Provenance chips — reuse pill base, distinct colors */
.prov-edited   { background: #fef3c7; color: #92400e; font-size: 10px; }
.prov-hand     { background: #dbeafe; color: #1e40af; font-size: 10px; }
.prov-cube     { background: #d1fae5; color: #065f46; font-size: 10px; }
.prov-default  { background: #f3f4f6; color: #4b5563; font-size: 10px; }

.cal-group-body { padding: 10px 12px; }

/* Read mode */
.cal-hyp-list { list-style: none; margin: 0; padding: 0; }
.cal-hyp-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.cal-hyp-item:last-child { border-bottom: none; }
.cal-hyp-stmt { flex: 1; color: var(--text); }
.cal-hyp-dir {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  white-space: nowrap;
}
.cal-hyp-dir-positive { background: var(--pill-green-bg); color: var(--pill-green-fg); }
.cal-hyp-dir-negative { background: var(--pill-red-bg);   color: var(--pill-red-fg); }
.cal-hyp-dir-neutral  { background: var(--pill-grey-bg);  color: var(--pill-grey-fg); }
.cal-hyp-conf {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  min-width: 28px;
  text-align: right;
}

.cal-item-list { list-style: none; margin: 0; padding: 0; }
.cal-item-list li {
  padding: 3px 0;
  font-size: 12px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.cal-item-list li:last-child { border-bottom: none; }
.cal-item-list li::before { content: "– "; color: var(--text-dim); }

.cal-phrase-list { display: flex; flex-wrap: wrap; gap: 5px; }
.cal-phrase-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  border: 1px solid var(--border-strong);
  border-radius: 99px;
  background: var(--bg-sidebar);
  color: var(--text-muted);
}

.cal-voice-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
  white-space: pre-wrap;
}

.cal-empty { font-size: 11px; color: var(--text-dim); font-style: italic; }

/* Proposals strip */
.cal-proposals {
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  padding: 8px 12px;
}
.cal-proposals-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #92400e;
  margin-bottom: 6px;
}
.cal-proposal-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 0;
  font-size: 12px;
}
.cal-proposal-text { flex: 1; color: var(--text); }
.cal-proposal-actions { display: flex; gap: 4px; }

/* Edit mode */
.cal-edit-rows { display: flex; flex-direction: column; gap: 6px; }
.cal-edit-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cal-edit-stmt {
  flex: 1;
  font: inherit;
  font-size: 12px;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 4px 8px;
  outline: none;
}
.cal-edit-stmt:focus { border-color: var(--accent); }
.cal-edit-dir {
  font: inherit;
  font-size: 11px;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 3px 6px;
  outline: none;
}
.cal-edit-conf {
  width: 62px;
  font: inherit;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 3px 6px;
  outline: none;
}
.cal-edit-conf:focus,
.cal-edit-dir:focus { border-color: var(--accent); }

.cal-edit-textarea {
  width: 100%;
  font: inherit;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 6px 8px;
  resize: vertical;
  min-height: 80px;
  outline: none;
}
.cal-edit-textarea:focus { border-color: var(--accent); }

.cal-edit-footer {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  align-items: center;
}
.cal-edit-error {
  margin-top: 6px;
  font-size: 11px;
  color: var(--pill-red-fg);
  background: var(--pill-red-bg);
  border-radius: 4px;
  padding: 5px 10px;
}
.btn-danger {
  color: var(--pill-red-fg);
  border-color: #fca5a5;
}
.btn-danger:hover:not(:disabled) { background: var(--pill-red-bg); }
