/* Line Item — calm, high-contrast, large type */
:root {
  --bg: #f6f4f0;
  --card: #ffffff;
  --text: #2c2c2c;
  --muted: #5a5a5a;
  --primary: #2f6fbf;
  --primary-hover: #255a9c;
  --success: #2d7a46;
  --warn-bg: #faf3d1;
  --warn-border: #e6d48a;
  --err: #b33333;
  --border: #d8d5cf;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  font-size: 18px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.top-bar {
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 1rem 1.5rem 1.25rem;
  margin-bottom: 1.5rem;
}

.page-back {
  margin: 0 0 1rem;
}

.page-back a {
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.page-back a:hover {
  text-decoration: underline;
}

.top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card);
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  background: var(--text);
}

.brand {
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  color: var(--primary);
}

.licensed-tag {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e8e4dc;
}

.subnav a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.subnav a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .nav-toggle {
    display: flex;
  }

  .subnav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
  }

  .subnav.open {
    display: flex;
  }

  .subnav a {
    padding: 0.65rem 0.25rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

.container {
  max-width: 52rem;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

.layout-wide .container {
  max-width: 64rem;
}

h1 {
  font-size: 1.85rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}

h2 {
  font-size: 1.25rem;
  font-weight: 650;
  margin: 0 0 0.75rem;
}

p.lead {
  font-size: 1.15rem;
  color: var(--muted);
  margin: 0 0 1.25rem;
}

p.next-hint {
  font-weight: 600;
  color: var(--text);
  margin: 0 0 1rem;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.25rem;
}

.stack-gap {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.grid-2 {
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="date"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="url"],
textarea,
select {
  width: 100%;
  max-width: 100%;
  padding: 0.55rem 0.65rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: inherit;
}

textarea.mono {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.95rem;
  line-height: 1.4;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.75rem;
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.15rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 9px;
  border: 1px solid #c9c9c9;
  background: #f3f3f3;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  text-align: center;
}

.btn:hover {
  background: #e8e8e8;
}

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

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

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

.btn.large {
  font-size: 1.12rem;
  padding: 0.9rem 1.35rem;
}

.btn.small {
  font-size: 0.92rem;
  padding: 0.4rem 0.75rem;
}

.btn.row {
  width: 100%;
  padding: 1rem 1.25rem;
}

.btn.ghost {
  background: transparent;
}

.btn.danger {
  border-color: var(--err);
  color: var(--err);
  background: #fff5f5;
}

.status-msg {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.status-msg.ok {
  background: #e8f5eb;
  border: 1px solid #a8d4b4;
  color: #1e4627;
}

.status-msg.err {
  background: #fceaea;
  border: 1px solid #e8a0a0;
  color: var(--err);
}

.status-msg.info {
  background: #eef5fc;
  border: 1px solid #a8c4e8;
  color: #1a3d66;
}

.status-msg.warn {
  background: #fff8e6;
  border: 1px solid #e6c878;
  color: #7a5a00;
}

.status-pill {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-pill.ok {
  background: #e8f5eb;
  color: #1e4627;
}

.status-pill.err {
  background: #fceaea;
  color: var(--err);
}

.status-pill.info {
  background: #eef5fc;
  color: #1a3d66;
}

.status-pill.warn {
  background: #fff8e6;
  color: #7a5a00;
}

.status-pill.neutral {
  background: #ececec;
  color: #4a4a4a;
}

.flash-wrap .flash {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin: 0 0 1rem;
}

.flash-info {
  background: #eef5fc;
  border: 1px solid #a8c4e8;
}

.flash-error {
  background: #fceaea;
  border: 1px solid #e8a0a0;
}

.flash-success {
  background: #e8f5eb;
  border: 1px solid #a8d4b4;
}

.landing-hero {
  text-align: center;
  padding: 2rem 0 1rem;
}

.landing-hero h1 {
  font-size: 2.1rem;
}

.landing-demo-hint {
  max-width: 32rem;
  margin: 0.5rem auto 0;
  text-align: center;
}

.landing-section {
  margin-bottom: 2rem;
}

.landing-section h2 {
  font-size: 1.45rem;
}

.fine-print {
  font-size: 0.95rem;
  color: var(--muted);
}

details.advanced {
  margin-top: 1.25rem;
  font-size: 0.95rem;
  color: var(--muted);
}

details.advanced summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--primary);
}

.welcome-actions {
  margin-top: 2rem;
}

.copy-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.computer-id-box {
  font-family: ui-monospace, monospace;
  font-size: 1rem;
  padding: 0.6rem 0.75rem;
  background: #f0eeea;
  border-radius: 8px;
  word-break: break-all;
  flex: 1;
  min-width: 12rem;
}

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

.check-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.check-icon {
  font-size: 1.5rem;
  line-height: 1;
  min-width: 2rem;
  text-align: center;
}

.check-body h3 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}

.check-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.check-item.ready .check-icon {
  color: var(--success);
}

.check-item.needs .check-icon {
  color: #c77b00;
}

.check-item.optional .check-icon {
  color: #8a7d4a;
}

.home-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 2rem 0;
}

.home-foot {
  margin-top: 2.5rem;
  text-align: center;
}

.steps {
  margin: 1.5rem 0;
}

.step {
  display: none;
}

.step.active {
  display: block;
}

.step-badge {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.template-preview {
  max-height: 14rem;
  overflow: auto;
  padding: 0.75rem;
  background: #f8f8f8;
  border-radius: 8px;
  white-space: pre-wrap;
  font-size: 0.98rem;
}

.combo-wrap {
  position: relative;
}

.combo-wrap > input[type="text"] {
  padding: 0.85rem 0.95rem;
  font-size: 1.05rem;
  line-height: 1.35;
  min-height: 3.05rem;
  border: 1px solid #c5c5c5;
  border-radius: 10px;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.combo-wrap > input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 191, 0.22);
}

.combo-wrap > input[type="text"]::placeholder {
  color: #888;
}

.combo-list {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  max-height: 14rem;
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--card);
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.combo-list li {
  padding: 0.45rem 0.65rem;
  cursor: pointer;
}

.combo-list li:hover,
.combo-list li.active {
  background: #eef5fc;
}

/* Call Templates — filter bar (matches Start New Call template picker polish) */
.templates-filter-card {
  border: 1px solid #e8e4dc;
  padding: 1.5rem 1.65rem;
  margin-bottom: 1.25rem;
}

.tpl-filter-row {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: stretch;
}

@media (min-width: 720px) {
  .tpl-filter-row {
    flex-direction: row;
    align-items: flex-end;
    gap: 1.25rem;
  }

  .tpl-filter-search-field {
    flex: 1;
    min-width: 0;
  }

  .tpl-filter-show-field {
    flex: 0 0 auto;
    width: 100%;
    max-width: 16rem;
  }
}

.tpl-filter-search-field .field,
.tpl-filter-show-field .field {
  margin-bottom: 0;
}

.tpl-filter-search-wrap {
  position: relative;
  display: block;
}

.tpl-search-input {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.85rem 2.75rem 0.85rem 2.65rem;
  font-size: 1.05rem;
  line-height: 1.35;
  min-height: 3.05rem;
  border: 1px solid #c5c5c5;
  border-radius: 10px;
  background: var(--card);
  font-family: inherit;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.tpl-search-input::placeholder {
  color: #888;
}

.tpl-search-input::-webkit-search-cancel-button,
.tpl-search-input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.tpl-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 191, 0.22);
}

.tpl-search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.35rem;
  height: 1.35rem;
  color: var(--muted);
  pointer-events: none;
}

.tpl-search-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.tpl-search-clear {
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

.tpl-search-clear:hover {
  background: #f0ece6;
  color: var(--text);
}

.tpl-search-clear:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(47, 111, 191, 0.35);
}

.tpl-search-clear.visible {
  display: flex;
}

.tpl-show-select {
  width: 100%;
  margin: 0;
  padding: 0.85rem 2.35rem 0.85rem 0.95rem;
  font-size: 1.05rem;
  line-height: 1.35;
  min-height: 3.05rem;
  border: 1px solid #c5c5c5;
  border-radius: 10px;
  background-color: var(--card);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235a5a5a' d='M3 4.5 6 7.5 9 4.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tpl-show-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 191, 0.22);
}

.table-wrap {
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
}

table.data th,
table.data td {
  text-align: left;
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid #e4e4e4;
  vertical-align: top;
}

table.data th {
  font-weight: 650;
  color: var(--muted);
}

.note-preview {
  max-width: 14rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.global-busy {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.82);
  font-weight: 600;
  color: var(--text);
}

.global-busy[hidden] {
  display: none !important;
}

.global-busy-spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 3px solid #ddd;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

body.has-global-busy {
  cursor: wait;
}

button.is-busy,
a.is-busy-link {
  opacity: 0.85;
}

/* Landing page — distinct from legacy app */
body.page-landing {
  background: #f3f1ec;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 0.75rem;
}

.landing-hero-card {
  text-align: center;
  padding: 2rem 1.5rem 1.75rem;
  border-top: 4px solid var(--primary);
  margin-bottom: 1.75rem;
}

.landing-hero-card h1 {
  font-size: 2.05rem;
  line-height: 1.2;
  margin-top: 0;
  color: #1f1f1f;
}

.landing-hero-card .lead {
  font-size: 1.2rem;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.landing-after-download {
  text-align: left;
  max-width: 28rem;
  margin: 1.5rem auto 0;
  padding: 1rem 1.25rem;
  background: #f8f9fb;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.landing-after-download ol {
  margin: 0.5rem 0;
  padding-left: 1.25rem;
}

.landing-after-download p {
  margin: 0.5rem 0 0;
}

/* Marketing header (public pages) */
.top-bar-marketing .subnav {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.marketing-header-row {
  justify-content: space-between;
  align-items: center;
}

.marketing-subnav {
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.row-actions.wrap {
  flex-wrap: wrap;
}

/* Data tables — scan-friendly */
.sticky-head-wrap {
  max-height: min(70vh, 32rem);
  overflow: auto;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
}

table.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #faf8f5;
  box-shadow: 0 1px 0 #e4e4e4;
}

table.data-table th,
table.data-table td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #e8e4dc;
  vertical-align: top;
}

table.data-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.55);
}

table.data-table tbody tr:hover {
  background: #eef5fc;
}

table.data-table th {
  font-weight: 650;
  color: var(--muted);
}

@media (max-width: 640px) {
  .table-wrap table.data-table thead {
    display: none;
  }

  .table-wrap table.data-table,
  .table-wrap table.data-table tbody,
  .table-wrap table.data-table tr,
  .table-wrap table.data-table td {
    display: block;
    width: 100%;
  }

  .table-wrap table.data-table tbody tr {
    margin-bottom: 1rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
  }

  .table-wrap table.data-table tbody tr:nth-child(even) {
    background: var(--card);
  }

  .table-wrap table.data-table td {
    padding: 0.45rem 0;
    border-bottom: 1px solid #ece9e3;
  }

  .table-wrap table.data-table td:last-child {
    border-bottom: none;
  }

  .table-wrap table.data-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.78rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--muted);
    margin-bottom: 0.15rem;
  }
}

.th-sort {
  font: inherit;
  font-weight: 650;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  text-align: left;
}

.th-sort:hover {
  color: var(--primary);
}

.sort-ind {
  font-size: 0.85em;
  opacity: 0.75;
}

.table-card {
  margin-top: 1rem;
}

.empty-state {
  margin: 1.25rem 0 0;
  padding: 1rem 1.25rem;
  background: #f8f8f8;
  border-radius: var(--radius);
  color: var(--muted);
}

/* Setup / task progress */
.setup-progress-global {
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.setup-progress-label {
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.progress-track {
  height: 0.5rem;
  background: #e4e4e4;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #5a9bd4);
  transition: width 0.2s ease;
}

.progress-bar.indeterminate {
  width: 40%;
  animation: indet-slide 1.2s ease-in-out infinite;
}

@keyframes indet-slide {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(350%);
  }
}

.task-progress {
  margin-top: 0.75rem;
}

.task-progress-label {
  margin-bottom: 0.35rem;
}

/* Modal dialogs (native <dialog>) */
.modal-dialog {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  max-width: min(28rem, 94vw);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
}

.modal-dialog::backdrop {
  background: rgba(40, 40, 40, 0.35);
}

.modal-box {
  padding: 1.5rem;
}

.modal-box h2 {
  margin-top: 0;
}

.past-calls-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.past-calls-header h1 {
  margin-bottom: 0.35rem;
}

/* Landing launch help modal */
.modal[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(40, 40, 40, 0.35);
}

.modal-card {
  max-width: min(32rem, 94vw);
  width: 100%;
  max-height: 90vh;
  overflow: auto;
}

.actions-cell {
  white-space: nowrap;
}

/* Keep legacy table.data usable alongside data-table */
table.data tbody tr:hover {
  background: #eef5fc;
}

/* Template import: full extracted text + long-file notice */
.template-import-intro {
  margin: 0.35rem 0 0.85rem;
}

.template-long-hint {
  padding: 0.65rem 0.85rem;
  margin: 0 0 0.85rem;
  border-radius: var(--radius);
  background: #f5f2eb;
  border: 1px solid rgba(0, 0, 0, 0.06);
  color: var(--text);
}

.template-extracted-preview {
  min-height: 14rem;
  line-height: 1.45;
}

.template-body-field .field-hint {
  margin-top: 0.25rem;
}

/* Markdown rendering */
.markdown-body {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  max-width: 48rem;
}

.markdown-body h1 {
  font-size: 1.55rem;
  margin: 0 0 1rem;
  line-height: 1.25;
}

.markdown-body h2 {
  font-size: 1.25rem;
  margin: 1.5rem 0 0.75rem;
  padding-top: 0.25rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.markdown-body h3 {
  font-size: 1.08rem;
  margin: 1.1rem 0 0.5rem;
}

.markdown-body p {
  margin: 0.5rem 0 0.85rem;
}

.markdown-body ul,
.markdown-body ol {
  margin: 0.35rem 0 1rem 1.35rem;
  padding: 0;
}

.markdown-body li {
  margin-bottom: 0.45rem;
}

.markdown-body li input[type="checkbox"] {
  margin-right: 0.45rem;
}

.markdown-body blockquote {
  margin: 0.75rem 0;
  padding: 0.65rem 1rem;
  border-left: 3px solid var(--primary, #2f6fad);
  background: #f7f9fc;
  border-radius: 0 8px 8px 0;
}

.markdown-body hr {
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  margin: 1.25rem 0;
}

.markdown-body strong {
  font-weight: 650;
}

.script-panel {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  padding: 1.25rem 1.35rem;
  max-height: 420px;
  overflow: auto;
}

.script-panel-sticky {
  /* Template stays its own scrollable reference box (inherits max-height
     + overflow from .script-panel); dropping only position:sticky, which
     combined with that internal scroll to feel like two competing scroll
     areas. Recording controls and live transcript flow normally below it. */
  position: static;
}

.note-editor {
  min-height: 600px;
  font-size: 16px;
  line-height: 1.6;
  padding: 20px;
  border-radius: 14px;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  font-family: inherit;
  resize: vertical;
  white-space: pre-wrap;
}

.note-editor-wrap {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.note-editor-wrap .note-editor {
  border: none;
  border-radius: 0;
  min-height: 600px;
}

@media (max-width: 640px) {
  .note-editor,
  .note-editor-wrap .note-editor {
    min-height: 260px;
  }
}

.live-transcript-panel {
  min-height: 5rem;
  padding: 1rem 1.1rem;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  line-height: 1.6;
  font-size: 15px;
  white-space: pre-wrap;
}

.live-transcript-panel .interim,
.interim {
  color: #888;
  font-style: italic;
}

.live-transcript-placeholder {
  color: #888;
  font-style: italic;
}

.transcript-section-card {
  padding: 0;
  overflow: hidden;
}

.transcript-details {
  margin: 0;
}

.transcript-details summary {
  list-style: none;
  cursor: pointer;
}

.transcript-details summary::-webkit-details-marker {
  display: none;
}

.transcript-summary {
  display: block;
  padding: 1rem 1.25rem;
  background: #f7f9fc;
  border-bottom: 1px solid transparent;
}

.transcript-details[open] .transcript-summary {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.transcript-summary-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.05rem;
  font-weight: 650;
  color: #1a1a1a;
}

.transcript-summary-title::before {
  content: "▸";
  color: #666;
  font-size: 0.95rem;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.transcript-details[open] .transcript-summary-title::before {
  transform: rotate(90deg);
}

.transcript-summary-hint {
  display: block;
  margin-top: 0.35rem;
  margin-left: 1.35rem;
  font-size: 0.88rem;
  color: #666;
}

.transcript-body {
  padding: 1rem 1.25rem 1.25rem;
  background: #fff;
}

.transcript-text {
  width: 100%;
  box-sizing: border-box;
  min-height: 160px;
  max-height: 360px;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  background: #fafbfc;
  line-height: 1.55;
  font-size: 14px;
  resize: vertical;
  white-space: pre-wrap;
}

.save-indicator {
  font-size: 0.9rem;
  color: var(--muted, #666);
  min-height: 1.25rem;
  margin: 0.35rem 0 0.75rem;
}

.save-indicator.saving {
  color: var(--primary, #2f6fad);
}

.save-indicator.saved {
  color: #1a7f37;
}

.save-indicator.error {
  color: #b42318;
}

.save-indicator.unsaved {
  color: #b45309;
}

.export-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

.export-dialog {
  max-width: 28rem;
  width: 100%;
}

.export-dialog h3 {
  margin-top: 0;
}

.export-picker-dialog {
  max-width: 32rem;
}

.radio-line {
  display: block;
  margin: 0.35rem 0;
  font-size: 0.95rem;
}

.radio-line input {
  margin-right: 0.45rem;
}

.version-item {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding: 0.85rem 0;
}

.version-item:first-child {
  border-top: none;
  padding-top: 0;
}

.version-item-current {
  background: rgba(47, 111, 173, 0.06);
  border-radius: 10px;
  padding: 0.85rem;
  margin: 0 -0.5rem;
}

.version-badge {
  font-size: 0.75rem;
  background: #1a7f37;
  color: #fff;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  margin-left: 0.35rem;
}

.version-summary {
  margin: 0.35rem 0;
  font-size: 0.92rem;
}

.version-actions,
.attachment-actions {
  margin-top: 0.5rem;
}

.version-readonly {
  min-height: 320px;
  margin: 0.75rem 0;
}

.attachment-item {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding: 0.75rem 0;
}

.attachment-item:first-child {
  border-top: none;
}

.btn-sm {
  font-size: 0.85rem;
  padding: 0.25rem 0.65rem;
}

.note-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.note-tabs button {
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
}

.note-tabs button.active {
  background: var(--primary, #2f6fad);
  color: #fff;
  border-color: transparent;
}

@media (max-width: 640px) {
  .btn.small,
  .btn-sm,
  .note-tabs button {
    min-height: 44px;
    padding: 0.55rem 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

.note-preview-pane {
  display: none;
}

.note-preview-pane.active {
  display: block;
}

.note-edit-pane.active {
  display: block;
}

.note-edit-pane {
  display: none;
}

.recovery-banner {
  background: #fff8e6;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
