:root {
  --page: #f5f6f3;
  --surface: #ffffff;
  --surface-soft: #f8f9f7;
  --text: #17201c;
  --muted: #68736e;
  --subtle: #919a96;
  --line: #dfe4e0;
  --line-strong: #ccd4cf;
  --accent: #365f52;
  --accent-hover: #294b40;
  --accent-soft: #e6eeea;
  --success: #2d7a55;
  --danger: #b84444;
  --warning: #b17a24;
  --shadow: 0 18px 50px rgba(39, 56, 49, .08);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background: var(--page);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px clamp(18px, 4vw, 54px);
  border-bottom: 1px solid rgba(204, 212, 207, .8);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 13px;
  color: white;
  background: var(--accent);
  box-shadow: 0 8px 20px rgba(54, 95, 82, .18);
}
.brand-mark span { width: 3px; border-radius: 4px; background: currentColor; }
.brand-mark span:nth-child(1) { height: 10px; }
.brand-mark span:nth-child(2) { height: 20px; }
.brand-mark span:nth-child(3) { height: 15px; }
.brand-mark span:nth-child(4) { height: 7px; }
.brand-copy strong, .brand-copy small { display: block; }
.brand-copy strong { font-size: 16px; letter-spacing: -.01em; }
.brand-copy small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.connection-card {
  min-width: 170px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}
.connection-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(177, 122, 36, .11);
}
.connection-dot.ready { background: var(--success); box-shadow: 0 0 0 4px rgba(45, 122, 85, .11); }
.connection-dot.error { background: var(--danger); box-shadow: 0 0 0 4px rgba(184, 68, 68, .11); }
.connection-card[data-state="ready"] { border-color: rgba(45, 122, 85, .3); background: rgba(45, 122, 85, .06); }
.connection-card[data-state="error"] { border-color: rgba(184, 68, 68, .3); background: rgba(184, 68, 68, .06); }
.connection-card[data-state="ready"] strong { color: var(--success); }
.connection-card[data-state="error"] strong { color: var(--danger); }
.connection-card strong, .connection-card small { display: block; white-space: nowrap; }
.connection-card strong { font-size: 12px; }
.connection-card small { margin-top: 1px; color: var(--muted); font-size: 10px; }

.profile-button,
.header-actions button,
.primary-button,
.secondary-button,
.danger-button,
.add-profile-button,
.close-button {
  border: 0;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.profile-button {
  min-width: 196px;
  height: 52px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-align: left;
}
.profile-button:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  font-weight: 800;
  letter-spacing: .02em;
}
.user-avatar { width: 34px; height: 34px; background: #4f6f64; font-size: 11px; }
.profile-button-copy { min-width: 0; }
.profile-button-copy strong, .profile-button-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-button-copy strong { font-size: 12px; }
.profile-button-copy small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.profile-chevron { color: var(--subtle); font-size: 22px; line-height: 1; }

.workspace {
  width: min(1040px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(30px, 5vw, 52px) 0 72px;
}
.intro { max-width: 720px; }
.eyebrow {
  display: inline-block;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
}
.intro h1 {
  margin: 12px 0 12px;
  font-size: clamp(38px, 6vw, 64px);
  line-height: .98;
  letter-spacing: -.055em;
  font-weight: 750;
}
.intro p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.6;
}

.upload-card {
  margin-top: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.drop-zone {
  min-height: 122px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 28px;
  transition: background .16s ease, box-shadow .16s ease;
}
.drop-zone.dragging { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.upload-symbol {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 27px;
  font-weight: 400;
}
.composer-copy { min-width: 0; flex: 1; }
.composer-copy strong, .composer-copy span { display: block; }
.composer-copy strong { font-size: 17px; letter-spacing: -.01em; }
.composer-copy span { margin-top: 5px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.upload-button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  color: white;
  background: var(--accent);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background .16s ease, transform .16s ease;
}
.upload-button:hover { background: var(--accent-hover); transform: translateY(-1px); }
#audioInput { display: none; }
.spinner {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: 3px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .85s linear infinite;
}
.progress-track { height: 3px; overflow: hidden; background: var(--accent-soft); }
.progress-bar { width: 34%; height: 100%; background: var(--accent); animation: loading 1.2s ease-in-out infinite; }
.context-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 18px 28px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}
.context-row label { color: var(--muted); font-size: 12px; font-weight: 750; }
.context-row input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  padding: 10px 12px;
  color: var(--text);
  background: var(--surface);
}
.context-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(54, 95, 82, .11); }

.transcript-section {
  margin-top: 44px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 12px 40px rgba(39, 56, 49, .05);
}
.section-header {
  min-height: 94px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.section-title { flex: 0 0 auto; }
.section-header h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.section-header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.transcript-tools {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.search-field {
  width: min(360px, 100%);
  min-height: 40px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: var(--surface-soft);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.search-field:focus-within {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(54, 95, 82, .1);
}
.search-icon { font-size: 19px; line-height: 1; transform: rotate(-12deg); }
.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 9px 0;
  color: var(--text);
  background: transparent;
  font-size: 13px;
}
.search-field input::-webkit-search-cancel-button { display: none; }
.search-field button {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.search-field button:hover { color: var(--text); background: var(--line); }
.header-actions { display: flex; gap: 7px; flex: 0 0 auto; }
.header-actions button {
  min-width: 50px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  background: var(--surface);
  font-size: 11px;
  font-weight: 800;
}
.header-actions button:hover:not(:disabled) { border-color: var(--line-strong); background: var(--surface-soft); }
.header-actions button:disabled { opacity: .35; cursor: default; }

.messages { overflow-x: hidden; padding: 8px 0; }
.channel-welcome {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 22px;
  text-align: center;
}
.empty-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  color: var(--accent);
  background: var(--accent-soft);
  font-family: Georgia, serif;
  font-weight: 700;
}
.channel-welcome h3 { margin: 14px 0 5px; font-size: 16px; }
.channel-welcome p { margin: 0; color: var(--muted); font-size: 13px; }
.message {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 13px;
  margin: 0 20px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.message:last-child { border-bottom: 0; }
.message .avatar { width: 44px; height: 44px; font-size: 12px; }
.message-user-avatar { color: white; }
.system-avatar { color: var(--accent); background: var(--accent-soft); }
.error-avatar { color: white; background: var(--danger); }
.message-body { min-width: 0; }
.message-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; min-height: 22px; }
.message-head strong { font-size: 14px; }
.message-head time { color: var(--subtle); font-size: 11px; }
.bot-tag { display: none; }
.message p {
  max-width: 100%;
  margin: 7px 0 0;
  color: #34413b;
  font-size: 15px;
  line-height: 1.68;
  overflow-wrap: anywhere;
}
.transcript-line {
  display: block;
  max-width: 100%;
  margin-top: 10px !important;
  color: #26332d !important;
  font-size: clamp(18px, 2vw, 21px) !important;
  line-height: 1.72 !important;
  letter-spacing: -.012em;
  white-space: normal;
  overflow: visible;
  word-break: normal;
  overflow-wrap: anywhere;
}
.transcript-line mark {
  border-radius: 4px;
  padding: 0 .08em;
  color: inherit;
  background: #f5df88;
  box-shadow: 0 0 0 1px rgba(153, 118, 14, .08);
}
.search-empty-state {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 22px;
  text-align: center;
}
.search-empty-state h3 { margin: 14px 0 5px; font-size: 16px; }
.search-empty-state p { margin: 0; color: var(--muted); font-size: 13px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes loading { 0% { transform: translateX(-110%); } 100% { transform: translateX(300%); } }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 120;
  padding: 11px 15px;
  border-radius: 11px;
  color: white;
  background: #17201c;
  box-shadow: 0 12px 35px rgba(23, 32, 28, .2);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: .2s ease;
  font-size: 13px;
}
.toast.show { opacity: 1; transform: translateY(0); }

body.modal-open { overflow: hidden; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(21, 29, 25, .48);
  backdrop-filter: blur(5px);
}
.settings-modal {
  width: min(800px, 100%);
  max-height: min(650px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 30px 90px rgba(21, 29, 25, .24);
}
.settings-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px 20px;
  border-bottom: 1px solid var(--line);
}
.settings-header h2 { margin: 7px 0 0; font-size: 25px; letter-spacing: -.03em; }
.settings-header p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.close-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 25px;
  line-height: 1;
}
.close-button:hover { color: var(--text); background: var(--accent-soft); }
.settings-content { min-height: 420px; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.profile-list-panel { min-height: 0; padding: 20px 12px; border-right: 1px solid var(--line); background: var(--surface-soft); }
.settings-label { padding: 0 9px 9px; color: var(--subtle); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.profile-list { max-height: 340px; overflow-y: auto; }
.profile-list-item {
  width: 100%;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 9px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.profile-list-item:hover { background: var(--surface); }
.profile-list-item.selected { border-color: var(--line); background: var(--surface); box-shadow: 0 5px 16px rgba(39, 56, 49, .05); }
.mini-profile-avatar { width: 36px; height: 36px; font-size: 11px; }
.profile-list-copy { min-width: 0; }
.profile-list-copy strong, .profile-list-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-list-copy strong { font-size: 13px; }
.profile-list-copy small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.active-check { color: var(--success); font-weight: 800; }
.add-profile-button {
  width: calc(100% - 8px);
  margin: 14px 4px 0;
  padding: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}
.add-profile-button:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.profile-editor { min-width: 0; padding: 28px; overflow-y: auto; }
.profile-preview { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.profile-preview-avatar { width: 56px; height: 56px; font-size: 16px; }
.profile-preview strong, .profile-preview small { display: block; }
.profile-preview strong { font-size: 18px; }
.profile-preview small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.profile-editor > label { display: block; margin: 16px 0 7px; color: var(--muted); font-size: 11px; font-weight: 800; }
.profile-editor > input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  padding: 11px 12px;
  color: var(--text);
  background: var(--surface);
}
.profile-editor > input[type="text"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(54, 95, 82, .11); }
.color-field { display: flex; align-items: center; gap: 11px; }
.color-field input[type="color"] { width: 54px; height: 40px; border: 0; padding: 0; background: transparent; cursor: pointer; }
.color-field span { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.profile-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 32px; }
.profile-actions button { border-radius: 10px; padding: 10px 13px; font-size: 12px; font-weight: 800; }
.profile-actions button:disabled { opacity: .45; cursor: default; }
.primary-button { color: white; background: var(--accent); }
.primary-button:hover { background: var(--accent-hover); }
.secondary-button { color: var(--text); background: var(--surface-soft); border: 1px solid var(--line); }
.secondary-button:hover:not(:disabled) { background: var(--accent-soft); }
.danger-button { margin-right: auto; color: var(--danger); background: transparent; }
.danger-button:hover:not(:disabled) { background: rgba(184, 68, 68, .08); }

@media (max-width: 820px) {
  .connection-card { display: none; }
  .topbar { padding-inline: 18px; }
  .workspace { width: min(100% - 28px, 1040px); }
}

@media (max-width: 650px) {
  .brand-copy small, .profile-button-copy small, .profile-chevron { display: none; }
  .brand-copy strong { font-size: 14px; }
  .profile-button { min-width: 0; width: 46px; grid-template-columns: 1fr; padding: 5px; }
  .profile-button-copy { display: none; }
  .user-avatar { width: 34px; height: 34px; }
  .workspace { padding-top: 42px; }
  .drop-zone { flex-wrap: wrap; padding: 22px; }
  .composer-copy { flex-basis: calc(100% - 70px); }
  .upload-button { width: 100%; }
  .context-row { grid-template-columns: 1fr; gap: 8px; padding: 16px 20px; }
  .section-header { align-items: stretch; flex-direction: column; }
  .transcript-tools { width: 100%; align-items: stretch; flex-direction: column; }
  .search-field { width: 100%; }
  .header-actions { width: 100%; }
  .header-actions button { flex: 1; }
  .message { margin-inline: 16px; grid-template-columns: 38px minmax(0, 1fr); }
  .message .avatar { width: 38px; height: 38px; }
  .modal-backdrop { padding: 10px; }
  .settings-modal { max-height: calc(100vh - 20px); }
  .settings-content { grid-template-columns: 1fr; overflow-y: auto; }
  .profile-list-panel { max-height: 220px; border-right: 0; border-bottom: 1px solid var(--line); }
  .profile-list { max-height: 125px; }
  .profile-actions { flex-wrap: wrap; }
  .danger-button { margin-right: 0; }
}

/* Channel workspace */
.channel-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.channel-panel-top {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 20px;
}
.active-channel-copy { min-width: 0; }
.active-channel-copy h1 {
  margin: 5px 0 0;
  font-size: clamp(20px, 3vw, 27px);
  line-height: 1.08;
  letter-spacing: -.035em;
}
.compact-upload {
  min-width: 310px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.compact-upload.dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(54, 95, 82, .1);
}
.compact-upload.busy .small-upload-button {
  opacity: .65;
  pointer-events: none;
}
.small-upload-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 12px;
  border-radius: 9px;
  color: white;
  background: var(--accent);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: background .16s ease, transform .16s ease;
}
.small-upload-button:hover { background: var(--accent-hover); transform: translateY(-1px); }
.small-upload-button span:first-child { font-size: 15px; font-weight: 500; }
.compact-upload .spinner {
  width: 18px;
  height: 18px;
  border-width: 2px;
}
.upload-status {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-tabs {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 0 14px 13px;
  scrollbar-width: thin;
}
.channel-tab {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}
.channel-tab:hover { color: var(--text); background: var(--surface-soft); }
.channel-tab.active {
  color: var(--accent);
  border-color: #d8e4de;
  background: var(--accent-soft);
}
.compact-context {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}
.compact-context label { color: var(--muted); font-size: 11px; font-weight: 750; }
.compact-context input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  padding: 8px 10px;
  color: var(--text);
  background: var(--surface);
  font-size: 12px;
}
.compact-context input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(54, 95, 82, .1); }
.channel-panel .progress-track { border-top: 1px solid rgba(54, 95, 82, .08); }
.transcript-section { margin-top: 22px; }
.header-actions button:first-child { min-width: 82px; }

@media (max-width: 720px) {
  .channel-panel-top { align-items: flex-start; flex-direction: column; }
  .compact-upload { width: 100%; min-width: 0; justify-content: flex-start; }
  .upload-status { flex: 1; }
  .compact-context { grid-template-columns: 1fr; gap: 7px; }
}

@media (max-width: 480px) {
  .channel-panel-top { padding: 15px; }
  .channel-tabs { padding-inline: 10px; }
  .compact-context { padding: 12px 15px; }
  .compact-upload { flex-wrap: wrap; }
  .upload-status { flex-basis: calc(100% - 115px); }
}

/* Notebook theme */
:root {
  --page: #e9e4d7;
  --surface: #fffdf3;
  --surface-soft: #f8f3e5;
  --text: #28261f;
  --muted: #716c5f;
  --subtle: #9a9383;
  --line: #d8d1bf;
  --line-strong: #bdb4a0;
  --accent: #315f87;
  --accent-hover: #244b6d;
  --accent-soft: #e7eff6;
  --paper-line: rgba(92, 147, 190, .22);
  --paper-margin: rgba(203, 83, 83, .42);
  --shadow: 0 22px 60px rgba(62, 53, 35, .14);
}

body {
  background:
    radial-gradient(circle at 15% 0%, rgba(255,255,255,.7), transparent 30%),
    linear-gradient(135deg, #ece7db 0%, #ddd6c7 100%);
  font-family: "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.topbar {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(300px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 10px clamp(16px, 3vw, 42px);
  border-bottom: 1px solid #cfc6b3;
  background: rgba(250, 246, 235, .96);
  box-shadow: 0 4px 18px rgba(73, 63, 43, .08);
}

.brand-mark {
  width: 38px;
  height: 46px;
  gap: 0;
  align-items: stretch;
  justify-content: stretch;
  border: 1px solid #c7bda9;
  border-radius: 5px 10px 10px 5px;
  color: transparent;
  background:
    linear-gradient(90deg, #d7685f 0 4px, transparent 4px),
    repeating-linear-gradient(to bottom, #fffdf3 0 9px, #b9d3e6 10px 11px);
  box-shadow: 4px 5px 0 rgba(88, 77, 55, .1);
  position: relative;
}
.brand-mark::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 4px;
  bottom: 4px;
  width: 7px;
  background: repeating-linear-gradient(to bottom, #58564e 0 3px, transparent 3px 7px);
  border-radius: 4px;
}
.brand-mark span { display: none; }
.brand-copy strong { font-family: Georgia, "Times New Roman", serif; font-size: 17px; }
.brand-copy small { color: #7a7365; }

.topbar-upload {
  position: relative;
  min-width: 260px;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 5px;
  border: 1px solid #cfc5b0;
  border-radius: 9px;
  background: #fffdf6;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.topbar-upload.dragging {
  border-color: var(--accent);
  background: #f1f7fb;
  box-shadow: 0 0 0 3px rgba(49, 95, 135, .12);
}
.topbar-upload.busy .topbar-upload-button { opacity: .62; pointer-events: none; }
.topbar-upload-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border-radius: 7px;
  color: white;
  background: var(--accent);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  transition: background .16s ease, transform .16s ease;
}
.topbar-upload-button:hover { background: var(--accent-hover); transform: translateY(-1px); }
.paperclip { font-size: 16px; font-weight: 500; line-height: 1; }
.topbar-upload-status {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-upload .spinner { width: 18px; height: 18px; border-width: 2px; }
.topbar-progress {
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 1px;
  height: 2px;
  border-radius: 2px;
}

.topbar-actions { justify-content: flex-end; }
.connection-card, .profile-button {
  border-color: #d1c7b3;
  background: rgba(255,253,246,.82);
}

.workspace {
  width: min(1120px, calc(100% - 36px));
  padding: clamp(24px, 4vw, 42px) 0 70px;
}

.channel-panel {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.channel-panel-top {
  min-height: 74px;
  padding: 8px 12px 16px;
  border-bottom: 0;
}
.active-channel-copy h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 500;
  letter-spacing: -.035em;
}
.eyebrow { color: #8f4c47; letter-spacing: .12em; }
.notebook-date {
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-style: italic;
}

.channel-tabs {
  gap: 7px;
  overflow: visible;
  padding: 0 12px;
  border-bottom: 0;
}
.channel-tab {
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid #cfc4ad;
  border-bottom-color: #a99e88;
  border-radius: 9px 9px 3px 3px;
  color: #655f53;
  background: #e8dfc8;
  box-shadow: 0 2px 0 rgba(72, 62, 43, .08);
}
.channel-tab:nth-child(2) { background: #dfe8d7; }
.channel-tab:nth-child(3) { background: #e3e6ee; }
.channel-tab:nth-child(4) { background: #eaded5; }
.channel-tab:hover { color: var(--text); background: #f4edda; }
.channel-tab.active {
  z-index: 2;
  color: #302d27;
  border-color: #bfb49f;
  border-bottom-color: #fffdf3;
  background: #fffdf3;
  box-shadow: 0 -2px 0 rgba(255,255,255,.7), 0 4px 10px rgba(80,67,43,.08);
}

.compact-context {
  margin: 0 12px;
  padding: 12px 18px;
  border: 1px solid #d2c8b4;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: rgba(255,253,243,.84);
}
.compact-context input {
  border-color: #d3cab7;
  border-radius: 5px;
  background: rgba(255,255,255,.55);
}

.transcript-section {
  position: relative;
  margin-top: 0;
  overflow: hidden;
  border: 1px solid #c9bea8;
  border-radius: 4px 12px 12px 4px;
  background:
    linear-gradient(90deg, transparent 0 72px, var(--paper-margin) 72px 74px, transparent 74px),
    repeating-linear-gradient(to bottom, transparent 0 37px, var(--paper-line) 37px 38px),
    #fffdf3;
  box-shadow: var(--shadow), -7px 0 0 #d8cfbd, -11px 0 0 #a69b85;
}
.transcript-section::before {
  content: "";
  position: absolute;
  z-index: 4;
  left: -6px;
  top: 24px;
  bottom: 24px;
  width: 12px;
  background: repeating-linear-gradient(to bottom, #5e5b53 0 5px, transparent 5px 16px);
  border-radius: 7px;
  pointer-events: none;
}

.section-header {
  min-height: 92px;
  padding: 17px 22px 17px 92px;
  border-bottom: 1px solid rgba(168, 156, 133, .55);
  background: rgba(255,253,243,.82);
  backdrop-filter: blur(4px);
}
.section-header h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 500;
}
.section-header p { color: #7e7769; }
.search-field {
  border-color: #d0c6b2;
  border-radius: 6px;
  background: rgba(255,255,255,.55);
}
.header-actions button {
  border-color: #cfc5b2;
  border-radius: 5px;
  background: rgba(255,253,246,.82);
}

.messages { padding: 0 0 20px; }
.message {
  min-height: 114px;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  margin: 0;
  padding: 19px 28px 18px 88px;
  border-bottom: 1px dashed rgba(137, 126, 103, .28);
}
.message:last-child { border-bottom: 0; }
.message .avatar {
  width: 36px;
  height: 36px;
  margin-top: 1px;
  border: 2px solid rgba(255,253,243,.9);
  box-shadow: 0 0 0 1px rgba(101, 89, 68, .16);
  font-size: 10px;
}
.message-head strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 600;
}
.message-head time { color: #8d8576; font-style: italic; }
.message p { color: #343129; }
.transcript-line {
  margin-top: 8px !important;
  color: #29271f !important;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(20px, 2vw, 23px) !important;
  line-height: 1.67 !important;
  letter-spacing: .003em;
}
.transcript-line mark { background: #f5de79; }

.channel-welcome, .search-empty-state {
  min-height: 320px;
  padding-left: 92px;
}
.empty-icon {
  border: 1px solid #d4c9b4;
  border-radius: 6px;
  background: rgba(255,255,255,.55);
  font-family: Georgia, "Times New Roman", serif;
}
.channel-welcome h3, .search-empty-state h3 { font-family: Georgia, "Times New Roman", serif; font-size: 19px; font-weight: 500; }

.settings-modal {
  border-color: #c8bda8;
  background: #fffdf3;
}
.settings-header, .profile-list-panel { background: #f5efdf; }
.profile-editor input, .profile-editor select { border-radius: 5px; }

@media (max-width: 1000px) {
  .topbar { grid-template-columns: minmax(180px, 1fr) minmax(230px, 1fr) auto; }
  .connection-card { display: none; }
}

@media (max-width: 760px) {
  .topbar {
    position: sticky;
    grid-template-columns: 1fr auto;
    gap: 9px;
    padding: 9px 14px;
  }
  .topbar-upload {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    min-width: 0;
  }
  .topbar-actions { grid-column: 2; grid-row: 1; }
  .workspace { width: min(100% - 24px, 1120px); padding-top: 24px; }
  .channel-panel-top { align-items: flex-end; flex-direction: row; padding-inline: 4px; }
  .channel-tabs { padding-inline: 0; }
  .channel-tab { padding-inline: 13px; font-size: 11px; }
  .compact-context { margin-inline: 0; }
  .section-header { padding-left: 64px; }
  .message { padding-left: 62px; padding-right: 18px; }
  .transcript-section {
    background:
      linear-gradient(90deg, transparent 0 49px, var(--paper-margin) 49px 51px, transparent 51px),
      repeating-linear-gradient(to bottom, transparent 0 37px, var(--paper-line) 37px 38px),
      #fffdf3;
  }
  .channel-welcome, .search-empty-state { padding-left: 62px; }
}

@media (max-width: 520px) {
  .brand-copy small, .topbar-upload-status { display: none; }
  .brand-copy strong { font-size: 14px; }
  .brand-mark { width: 32px; height: 39px; }
  .topbar-upload { justify-content: space-between; }
  .topbar-upload-button { flex: 1; justify-content: center; }
  .channel-panel-top { align-items: flex-start; flex-direction: column; gap: 6px; }
  .notebook-date { font-size: 11px; }
  .channel-tabs { gap: 4px; }
  .channel-tab { min-height: 38px; padding-inline: 9px; font-size: 10px; }
  .compact-context { grid-template-columns: 1fr; gap: 7px; padding: 11px 13px; }
  .section-header { padding-left: 58px; }
  .message {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 9px;
    padding-left: 56px;
    padding-right: 12px;
  }
  .message .avatar { width: 30px; height: 30px; font-size: 9px; }
  .transcript-line { font-size: 19px !important; line-height: 1.72 !important; }
}


/* Full-screen notebook layout */
html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

.app-shell {
  width: 100%;
  height: 100vh;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  flex: 0 0 auto;
}

.workspace {
  width: 100%;
  max-width: none;
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
}

.channel-panel {
  flex: 0 0 auto;
  padding: 12px 22px 0;
  border-bottom: 1px solid #c9bea8;
  background: #e9e1cf;
}

.channel-panel-top {
  min-height: 66px;
  padding: 4px 8px 12px;
}

.channel-tabs {
  padding-inline: 8px;
}

.transcript-section {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.transcript-section::before {
  left: 0;
}

.section-header {
  flex: 0 0 auto;
}

.transcript-tools {
  margin-left: auto;
}

.messages {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.search-empty-state {
  min-height: 0;
  flex: 1 1 auto;
}

@media (max-width: 760px) {
  .workspace {
    width: 100%;
    padding: 0;
  }

  .channel-panel {
    padding: 10px 12px 0;
  }
}

@media (max-width: 520px) {
  .channel-panel {
    padding-inline: 8px;
  }

  .section-header {
    gap: 12px;
  }
}


/* Transcription Tree refinements */
.brand-copy { display: flex; align-items: center; }
.brand-copy strong { font-size: 19px; }
.active-channel-copy h1 { margin-top: 0; }


/* Channel clearing and retention controls */
.clear-channel-button {
  min-height: 40px;
  flex: 0 0 auto;
  border: 1px solid rgba(184, 68, 68, .28);
  border-radius: 11px;
  padding: 0 14px;
  color: #9e3d3d;
  background: rgba(255, 250, 247, .88);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.clear-channel-button:hover:not(:disabled) {
  border-color: rgba(184, 68, 68, .52);
  background: rgba(184, 68, 68, .08);
  transform: translateY(-1px);
}
.clear-channel-button:focus-visible {
  outline: 3px solid rgba(184, 68, 68, .16);
  outline-offset: 2px;
}
.clear-channel-button:disabled {
  opacity: .45;
  cursor: not-allowed;
}
@media (max-width: 760px) {
  .clear-channel-button { width: 100%; }
}

/* Per-user transcript language preference */
.profile-editor > select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 5px;
  outline: none;
  padding: 11px 38px 11px 12px;
  color: var(--text);
  background-color: var(--surface);
  cursor: pointer;
}
.profile-editor > select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(54, 95, 82, .11);
}
.language-help {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.transcript-line.translation-pending {
  color: #8d8576;
  font-style: italic;
}

/* The transcript toolbar stands alone; category title is shown in the channel header. */
.section-header { justify-content: flex-end; min-height: 68px; }


/* Day filter */
.day-field {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  padding: 0 10px 0 12px;
  border: 1px solid #c9bea8;
  border-radius: 8px;
  color: #60594c;
  background: rgba(255, 253, 246, .92);
}
.day-field-label {
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.day-field input[type="date"] {
  min-width: 136px;
  border: 0;
  outline: 0;
  padding: 5px 2px;
  color: var(--text);
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}
.day-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(54, 95, 82, .10);
}
@media (max-width: 760px) {
  .day-field { width: 100%; justify-content: space-between; }
  .day-field input[type="date"] { flex: 1 1 auto; min-width: 0; text-align: right; }
}

/* Login and administrator accounts */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 20% 0%, rgba(255,255,255,.72), transparent 34%),
    linear-gradient(135deg, #ece7db 0%, #d8d0bf 100%);
}
.login-card {
  width: min(420px, 100%);
  padding: 34px;
  border: 1px solid #c9bea8;
  border-radius: 16px;
  background: #fffdf3;
  box-shadow: 0 28px 80px rgba(62, 53, 35, .18);
}
.login-brand-mark {
  width: 50px;
  height: 58px;
  margin: 0 auto 18px;
  border: 1px solid #c7bda9;
  border-radius: 6px 12px 12px 6px;
  background:
    linear-gradient(90deg, #d7685f 0 5px, transparent 5px),
    repeating-linear-gradient(to bottom, #fffdf3 0 11px, #b9d3e6 12px 13px);
  box-shadow: 5px 6px 0 rgba(88, 77, 55, .1);
  position: relative;
}
.login-brand-mark::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 5px;
  bottom: 5px;
  width: 8px;
  border-radius: 4px;
  background: repeating-linear-gradient(to bottom, #58564e 0 3px, transparent 3px 8px);
}
.login-brand-mark span { display: none; }
.login-card h1 {
  margin: 0;
  text-align: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -.035em;
}
.login-card > p {
  margin: 8px 0 26px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}
.login-card label {
  display: block;
  margin: 15px 0 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.login-card input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  padding: 0 13px;
  color: var(--text);
  background: #fffef9;
}
.login-card input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(49, 95, 135, .12);
}
.login-button {
  width: 100%;
  min-height: 46px;
  margin-top: 22px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
}
.login-button:hover:not(:disabled) { background: var(--accent-hover); }
.login-button:disabled { opacity: .6; cursor: wait; }
.login-error,
.form-error {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(184, 68, 68, .28);
  border-radius: 7px;
  color: #963b3b;
  background: rgba(184, 68, 68, .07);
  font-size: 12px;
  line-height: 1.4;
}

.profile-button {
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
}
.profile-button:disabled,
.profile-button.non-admin {
  cursor: default;
  opacity: 1;
}
.profile-button:disabled:hover { border-color: #d1c7b3; background: rgba(255,253,246,.82); }
.admin-chip {
  padding: 3px 6px;
  border-radius: 999px;
  color: #285341;
  background: #dfece5;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.logout-button {
  min-height: 40px;
  border: 1px solid #d1c7b3;
  border-radius: 9px;
  padding: 0 12px;
  color: #5d574d;
  background: rgba(255,253,246,.82);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.logout-button:hover { border-color: #a99e88; background: #fffdf6; }

.profile-editor > input[type="password"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 5px;
  outline: none;
  padding: 11px 12px;
  color: var(--text);
  background: var(--surface);
}
.profile-editor > input[type="password"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(54, 95, 82, .11);
}
.field-help {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.admin-checkbox {
  display: flex !important;
  align-items: center;
  gap: 9px;
  margin-top: 18px !important;
  color: var(--text) !important;
  cursor: pointer;
}
.admin-checkbox input { width: 17px; height: 17px; accent-color: var(--accent); }
.admin-settings-modal { width: min(920px, calc(100vw - 28px)); }

@media (max-width: 1000px) {
  .topbar-actions { gap: 7px; }
  .profile-button { min-width: 180px; }
}
@media (max-width: 650px) {
  .admin-chip { display: none; }
  .logout-button { min-width: 44px; padding: 0 8px; font-size: 0; }
  .logout-button::before { content: "↪"; font-size: 18px; }
  .profile-button { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  .login-card { padding: 26px 22px; }
}

/* Keep every administrator user setting accessible on shorter screens. */
.admin-settings-modal {
  display: flex;
  flex-direction: column;
  height: min(760px, calc(100vh - 48px));
  max-height: calc(100vh - 48px);
}
.admin-settings-modal .settings-header {
  flex: 0 0 auto;
}
.admin-settings-modal .settings-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.admin-settings-modal .profile-list-panel,
.admin-settings-modal .profile-editor {
  min-height: 0;
}
.admin-settings-modal .profile-list-panel {
  overflow-y: auto;
}
.admin-settings-modal .profile-editor {
  position: relative;
  overflow-y: auto;
  padding-bottom: 0;
}
.language-setting-card {
  margin-top: 18px;
  padding: 15px;
  border: 1px solid #d5ccba;
  border-radius: 10px;
  background: rgba(248, 243, 229, .72);
}
.language-setting-card > label {
  display: block;
  margin: 0 0 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}
.language-setting-card > select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: none;
  padding: 10px 38px 10px 12px;
  color: var(--text);
  background-color: var(--surface);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}
.language-setting-card > select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(54, 95, 82, .11);
}
.admin-settings-modal .profile-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 28px -28px 0;
  padding: 16px 28px;
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 243, .97);
  box-shadow: 0 -10px 24px rgba(62, 53, 35, .08);
  backdrop-filter: blur(8px);
}
.admin-settings-modal #saveProfileButton {
  min-width: 130px;
  min-height: 42px;
  font-size: 13px;
}
@media (max-width: 650px) {
  .admin-settings-modal {
    height: calc(100vh - 20px);
    max-height: calc(100vh - 20px);
  }
  .admin-settings-modal .settings-content {
    overflow-y: auto;
  }
  .admin-settings-modal .profile-list-panel {
    flex: 0 0 auto;
    overflow: visible;
  }
  .admin-settings-modal .profile-editor {
    overflow: visible;
  }
  .admin-settings-modal .profile-actions {
    margin-inline: -28px;
  }
}

/* Administrator channel permissions and channel maintenance */
.channel-access-card {
  margin: 18px 0 0;
  padding: 15px;
  border: 1px solid #d5ccba;
  border-radius: 10px;
  background: rgba(248, 243, 229, .72);
}
.channel-access-card legend {
  padding: 0 5px;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}
.channel-access-card > p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.channel-access-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.channel-access-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.channel-access-actions span {
  flex: 1;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}
.channel-access-actions button { flex: 0 0 auto; }
.channel-access-toggle {
  display: grid !important;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  column-gap: 9px;
  min-height: 43px;
  margin: 0 !important;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text) !important;
  background: var(--surface);
  cursor: pointer;
  font-size: 12px !important;
  font-weight: 750 !important;
}
.channel-access-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.toggle-control {
  position: relative;
  grid-row: 1;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: #d8d3c7;
  transition: background .16s ease;
}
.toggle-control::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  transition: transform .16s ease;
}
.channel-access-toggle input:checked + .toggle-control { background: var(--accent); }
.channel-access-toggle input:checked + .toggle-control::after { transform: translateX(14px); }
.channel-access-toggle input:focus-visible + .toggle-control { box-shadow: 0 0 0 3px rgba(54, 95, 82, .16); }
.toggle-label {
  grid-column: 2;
  min-width: 0;
  line-height: 1.25;
}

.channel-maintenance-panel {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.channel-maintenance-panel > p {
  margin: 7px 0 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.admin-channel-clear-list {
  display: grid;
  gap: 7px;
}
.admin-channel-clear-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}
.admin-channel-clear-row > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.admin-channel-clear-row strong {
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-channel-clear-row small {
  color: var(--muted);
  font-size: 10px;
}
.admin-clear-channel-button {
  min-height: 31px;
  padding: 0 10px;
  border: 1px solid #e2bdb5;
  border-radius: 8px;
  color: #9e3e30;
  background: #fff5f2;
  cursor: pointer;
  font-size: 10px;
  font-weight: 850;
}
.admin-clear-channel-button:hover:not(:disabled) { background: #fde9e4; }
.admin-clear-channel-button:disabled { opacity: .42; cursor: not-allowed; }

@media (max-width: 650px) {
  .channel-access-grid { grid-template-columns: 1fr; }
}


/* Administrator metrics */
.metrics-button,
.metrics-refresh-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.metrics-button:hover,
.metrics-refresh-button:hover { background: var(--surface-soft); border-color: var(--line-strong); }
.metrics-modal {
  width: min(1180px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.metrics-header { flex: 0 0 auto; }
.metrics-content {
  min-height: 0;
  overflow-y: auto;
  padding: 22px;
}
.metrics-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.metrics-filter-group { display: flex; flex-wrap: wrap; gap: 12px; }
.metrics-toolbar label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 750; }
.metrics-toolbar select,
.metrics-toolbar input {
  min-width: 190px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0 12px;
  color: var(--text);
  background: var(--surface);
}
.metrics-toolbar input { min-width: 250px; }
.metrics-toolbar input::placeholder { color: var(--muted); }
.metrics-status {
  padding: 26px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}
.metrics-status.error { color: var(--danger); border-color: rgba(184, 68, 68, .4); background: rgba(184, 68, 68, .04); }
.metrics-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.metric-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-soft);
}
.metric-card span,
.metric-card small { display: block; color: var(--muted); }
.metric-card span { font-size: 11px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.metric-card strong {
  display: block;
  margin-top: 9px;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.05;
  letter-spacing: -.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.metric-card small { min-height: 16px; margin-top: 6px; font-size: 11px; }
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.metric-chart-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
}
.daily-chart-card { grid-column: 1 / -1; }
.metric-chart-heading h3 { margin: 0; font-size: 15px; }
.metric-chart-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.metric-chart {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 14px;
  overflow: visible;
}
.metric-chart .chart-grid { stroke: var(--line); stroke-width: 1; }
.metric-chart .chart-axis { stroke: var(--line-strong); stroke-width: 1; }
.metric-chart .chart-label { fill: var(--muted); font-size: 11px; font-family: inherit; }
.metric-chart .chart-value { fill: var(--text); font-size: 11px; font-weight: 750; font-family: inherit; }
.metric-chart .chart-line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.metric-chart .chart-area { fill: var(--accent-soft); opacity: .72; }
.metric-chart .chart-point { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.metric-chart .chart-bar { fill: var(--accent); }
.metric-chart .chart-bar-secondary { fill: var(--accent-hover); }
.metric-chart .chart-empty { fill: var(--muted); font-size: 15px; font-family: inherit; }

.metrics-time-table-wrap { margin-top: 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; }
.metrics-time-table { width: 100%; border-collapse: collapse; min-width: 620px; font-size: 12px; }
.metrics-time-table th, .metrics-time-table td { padding: 11px 13px; border-bottom: 1px solid var(--line); text-align: left; }
.metrics-time-table th { color: var(--muted); background: var(--surface-soft); font-size: 10px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.metrics-time-table tbody tr:last-child td { border-bottom: 0; }
.metrics-time-table td { color: var(--text); }
.metric-chart .chart-time-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.metric-chart .chart-time-point { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; }

@media (max-width: 980px) {
  .metrics-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .metrics-button { grid-column: auto; }
  .metrics-content { padding: 16px; }
  .metrics-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics-grid { grid-template-columns: 1fr; }
  .daily-chart-card { grid-column: auto; }
}
@media (max-width: 520px) {
  .metrics-modal { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .metrics-toolbar { align-items: stretch; flex-direction: column; }
  .metrics-filter-group, .metrics-toolbar label, .metrics-toolbar select, .metrics-toolbar input, .metrics-refresh-button { width: 100%; }
  .metrics-summary { grid-template-columns: 1fr 1fr; }
  .metric-card { padding: 13px; }
}

/* Multi-property login and private owner console */
.multi-login-card {
  width: min(440px, calc(100vw - 32px));
}

.login-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  margin: 18px 0 20px;
  border: 1px solid #d9ddd8;
  border-radius: 12px;
  background: #f4f6f3;
}

.login-mode-tab {
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  background: transparent;
  color: #667069;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.login-mode-tab.active {
  background: #ffffff;
  color: #21473d;
  box-shadow: 0 1px 4px rgba(32, 56, 48, 0.12);
}

.brand-copy small {
  display: block;
  margin-top: 2px;
  color: #758078;
  font-size: 0.75rem;
  font-weight: 600;
}

.owner-shell {
  min-height: 100vh;
  background: #f4f6f2;
  color: #20312b;
}

.owner-topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 28px;
  border-bottom: 1px solid #dce2dc;
  background: rgba(255, 255, 255, 0.96);
  position: sticky;
  top: 0;
  z-index: 20;
}

.owner-topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.owner-security-badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: #e7f1ec;
  color: #285d4d;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.owner-workspace {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 34px 34px 60px;
}

.owner-dashboard-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.owner-dashboard-header h1 {
  margin: 4px 0 6px;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  letter-spacing: -0.035em;
}

.owner-dashboard-header p,
.owner-editor-heading p,
.owner-admin-section p {
  margin: 0;
  color: #69756e;
}

.owner-add-property {
  white-space: nowrap;
}

.owner-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.owner-summary-grid article {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  border: 1px solid #dce2dc;
  border-radius: 16px;
  background: #ffffff;
}

.owner-summary-grid span {
  color: #68736c;
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.045em;
}

.owner-summary-grid strong {
  font-size: 2rem;
  line-height: 1;
  color: #21473d;
}

.owner-management-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  min-height: 650px;
  overflow: hidden;
  border: 1px solid #d9dfd9;
  border-radius: 18px;
  background: #ffffff;
}

.owner-property-list-panel {
  padding: 18px;
  border-right: 1px solid #dfe4df;
  background: #f8faf7;
}

.owner-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.owner-list-heading span {
  min-width: 30px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e6eee9;
  color: #315f51;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
}

.owner-property-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 0 12px;
  border: 1px solid #d7ddd7;
  border-radius: 11px;
  background: #ffffff;
}

.owner-property-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  padding: 11px 0;
  background: transparent;
  font: inherit;
}

.owner-property-list {
  display: grid;
  gap: 8px;
}

.owner-property-list-item {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.owner-property-list-item:hover {
  background: #eef3ef;
}

.owner-property-list-item.selected {
  border-color: #9ab8ad;
  background: #e5efea;
}

.owner-property-list-code {
  min-width: 64px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #203f36;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.035em;
}

.owner-property-list-copy {
  min-width: 0;
}

.owner-property-list-copy strong,
.owner-property-list-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-property-list-copy small {
  margin-top: 3px;
  color: #69756e;
  font-size: 0.75rem;
}

.owner-property-message-count {
  min-width: 28px;
  color: #3d6256;
  text-align: right;
  font-size: 0.82rem;
  font-weight: 800;
}

.owner-property-empty {
  padding: 30px 14px;
  color: #79837d;
  text-align: center;
}

.owner-property-editor {
  padding: 30px;
  overflow: auto;
}

.owner-editor-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 22px;
  border-bottom: 1px solid #e1e5e1;
}

.owner-editor-heading h2 {
  margin: 4px 0 6px;
  font-size: 1.65rem;
}

.owner-property-code-chip {
  padding: 8px 11px;
  border-radius: 9px;
  background: #233f37;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.owner-form-grid {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.owner-form-grid.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.owner-form-grid.three-columns {
  grid-template-columns: minmax(160px, 0.8fr) minmax(140px, 0.7fr) minmax(240px, 1.25fr);
}

.owner-property-editor label,
.owner-language-fieldset > span {
  display: block;
  color: #394a43;
  font-size: 0.84rem;
  font-weight: 800;
}

.owner-property-editor input,
.owner-property-editor select {
  width: 100%;
  margin-top: 7px;
  padding: 11px 12px;
  border: 1px solid #cfd7d1;
  border-radius: 10px;
  background: #ffffff;
  color: #20312b;
  font: inherit;
}

.owner-property-editor input:focus,
.owner-property-editor select:focus {
  border-color: #5f8d7d;
  outline: 3px solid rgba(64, 115, 96, 0.13);
}

.owner-property-editor label small {
  display: block;
  margin-top: 6px;
  color: #7a847e;
  font-size: 0.75rem;
  font-weight: 500;
}

.owner-language-fieldset {
  padding: 13px 14px;
  border: 1px solid #d3dad4;
  border-radius: 11px;
  background: #f8faf8;
}

.owner-language-fieldset label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  margin-right: 18px;
  font-weight: 650;
}

.owner-language-fieldset input {
  width: auto;
  margin: 0;
}

.owner-radio-section {
  margin-top: 26px;
  padding: 20px;
  border: 1px solid #d7ded8;
  border-radius: 14px;
  background: #fbfcfb;
}
.owner-radio-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.owner-radio-heading h3 { margin: 4px 0 5px; }
.owner-radio-heading p { margin: 0; color: #69756e; }
.owner-radio-count {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e7f1ec;
  color: #285d4d;
  font-size: .76rem;
  font-weight: 800;
}
.owner-radio-grid {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
.owner-radio-row {
  display: grid;
  grid-template-columns: 100px minmax(160px, 1fr) minmax(180px, .8fr) minmax(145px, auto);
  align-items: center;
  gap: 16px;
  padding: 13px 14px;
  border: 1px solid #dce3dd;
  border-radius: 11px;
  background: #f7faf8;
}
.owner-radio-row > div strong,
.owner-radio-row > div small { display: block; }
.owner-radio-row > div small { margin-top: 3px; color: #758078; }
.owner-radio-toggle {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
}
.owner-radio-toggle input { width: auto; margin: 0; }
.owner-radio-row label input { margin-top: 5px; }
.owner-radio-mode-toggle {
  display: inline-grid !important;
  grid-template-columns: auto 42px auto;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: .76rem;
  font-weight: 800;
  color: #5d6a62;
}
.owner-radio-mode-toggle input {
  appearance: none;
  width: 42px !important;
  height: 23px;
  margin: 0 !important;
  border: 1px solid #aebbb2;
  border-radius: 999px;
  background: #dfe8e2;
  cursor: pointer;
  position: relative;
  transition: background .18s ease, border-color .18s ease;
}
.owner-radio-mode-toggle input::after {
  content: "";
  position: absolute;
  width: 17px;
  height: 17px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .18s ease;
}
.owner-radio-mode-toggle input:checked {
  background: #365f52;
  border-color: #365f52;
}
.owner-radio-mode-toggle input:checked::after { transform: translateX(19px); }
.owner-receiver-token-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
  padding: 15px;
  border: 1px solid #d2dbd4;
  border-radius: 11px;
  background: #eef4f0;
}
.owner-receiver-token-card p { margin: 4px 0 0; color: #66736b; font-size: .79rem; }
.owner-receiver-token-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.owner-receiver-token-actions input {
  width: min(360px, 100%);
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
}
@media (max-width: 760px) {
  .owner-radio-row { grid-template-columns: 1fr; gap: 8px; }
  .owner-radio-heading, .owner-receiver-token-card { align-items: stretch; flex-direction: column; }
  .owner-receiver-token-actions { justify-content: flex-start; }
}

.owner-admin-section {
  margin-top: 26px;
  padding: 20px;
  border: 1px solid #d7ded8;
  border-radius: 14px;
  background: #f7faf8;
}

.owner-admin-section h3 {
  margin: 4px 0 5px;
}

.owner-admin-section > label {
  margin-top: 18px;
}

.owner-property-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.owner-property-stats span {
  padding: 7px 11px;
  border-radius: 999px;
  background: #edf2ee;
  color: #54635b;
  font-size: 0.78rem;
}

.owner-editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid #e0e5e1;
}

@media (max-width: 980px) {
  .owner-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .owner-management-grid {
    grid-template-columns: 1fr;
  }

  .owner-property-list-panel {
    border-right: 0;
    border-bottom: 1px solid #dfe4df;
  }

  .owner-property-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .owner-form-grid.three-columns {
    grid-template-columns: 1fr 1fr;
  }

  .owner-language-fieldset {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .owner-topbar,
  .owner-dashboard-header,
  .owner-topbar-actions {
    align-items: flex-start;
  }

  .owner-topbar,
  .owner-dashboard-header {
    flex-direction: column;
  }

  .owner-workspace {
    padding: 22px 14px 40px;
  }

  .owner-summary-grid,
  .owner-property-list,
  .owner-form-grid.two-columns,
  .owner-form-grid.three-columns {
    grid-template-columns: 1fr;
  }

  .owner-language-fieldset {
    grid-column: auto;
  }

  .owner-property-editor {
    padding: 20px 16px;
  }

  .owner-editor-heading,
  .owner-editor-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .owner-editor-actions button {
    width: 100%;
  }
}

.owner-shell {
  height: 100vh;
  overflow-y: auto;
}

.owner-topbar .brand-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.owner-users-panel {
  margin-top: 22px;
  border: 1px solid #d9dfd9;
  border-radius: 18px;
  background: #ffffff;
  overflow: hidden;
}

.owner-users-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 26px;
  border-bottom: 1px solid #dfe4df;
}

.owner-users-heading h2 {
  margin: 4px 0 5px;
  font-size: 1.45rem;
}

.owner-users-heading p,
.owner-user-editor-heading p,
.owner-user-channel-card p {
  margin: 0;
  color: #69756e;
}

.owner-users-heading-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}

.owner-users-heading-actions > span {
  color: #647169;
  font-size: 0.82rem;
}

.owner-users-grid {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  min-height: 560px;
}

.owner-user-list-panel {
  padding: 16px;
  border-right: 1px solid #dfe4df;
  background: #f8faf7;
}

.owner-user-list {
  display: grid;
  gap: 8px;
}

.owner-user-list-item {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.owner-user-list-item:hover {
  background: #eef3ef;
}

.owner-user-list-item.selected {
  border-color: #9ab8ad;
  background: #e5efea;
}

.owner-user-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--owner-user-color, #365f52);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 850;
}

.owner-user-list-copy {
  min-width: 0;
}

.owner-user-list-copy strong,
.owner-user-list-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-user-list-copy small {
  margin-top: 3px;
  color: #69756e;
  font-size: 0.72rem;
}

.owner-user-admin-badge {
  padding: 4px 7px;
  border-radius: 999px;
  background: #dfece6;
  color: #285d4d;
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.owner-user-editor {
  padding: 26px;
}

.owner-user-editor-heading {
  padding-bottom: 18px;
  border-bottom: 1px solid #e1e5e1;
}

.owner-user-editor-heading h3 {
  margin: 4px 0 5px;
  font-size: 1.35rem;
}

.owner-user-editor label,
.owner-user-channel-card legend {
  display: block;
  color: #394a43;
  font-size: 0.84rem;
  font-weight: 800;
}

.owner-user-editor input[type="text"],
.owner-user-editor input[type="password"],
.owner-user-editor select {
  width: 100%;
  margin-top: 7px;
  padding: 11px 12px;
  border: 1px solid #cfd7d1;
  border-radius: 10px;
  background: #ffffff;
  color: #20312b;
  font: inherit;
}

.owner-user-editor input:focus,
.owner-user-editor select:focus {
  border-color: #5f8d7d;
  outline: 3px solid rgba(64, 115, 96, 0.13);
}

.owner-user-editor label small {
  display: block;
  margin-top: 6px;
  color: #7a847e;
  font-size: 0.75rem;
  font-weight: 500;
}

.owner-user-color-field {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 7px;
  padding: 7px 11px;
  border: 1px solid #cfd7d1;
  border-radius: 10px;
  background: #ffffff;
}

.owner-user-color-field input {
  width: 38px;
  height: 30px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.owner-user-color-field strong {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.owner-user-channel-card {
  margin: 22px 0 0;
  padding: 16px;
  border: 1px solid #d5ddd6;
  border-radius: 12px;
  background: #f8faf8;
}

.owner-user-channel-card p {
  margin-top: 4px;
  font-size: 0.78rem;
}

.owner-user-channel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 13px;
}

.owner-user-channel-option {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid #d9e0da;
  border-radius: 10px;
  background: #ffffff;
  font-weight: 650 !important;
}

.owner-user-channel-option input,
.owner-user-admin-toggle input {
  width: auto;
  margin: 0;
}

.owner-user-admin-toggle {
  display: flex !important;
  align-items: center;
  gap: 9px;
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid #d5ddd6;
  border-radius: 11px;
  background: #f8faf8;
}

@media (max-width: 980px) {
  .owner-users-grid {
    grid-template-columns: 1fr;
  }

  .owner-user-list-panel {
    border-right: 0;
    border-bottom: 1px solid #dfe4df;
  }

  .owner-user-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .owner-users-heading,
  .owner-users-heading-actions,
  .owner-user-editor .owner-editor-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .owner-users-heading-actions .primary-button,
  .owner-user-editor .owner-editor-actions button {
    width: 100%;
  }

  .owner-user-list,
  .owner-user-channel-grid {
    grid-template-columns: 1fr;
  }

  .owner-user-editor {
    padding: 20px 16px;
  }
}

/* Owner-enabled debugging microphone capture */
.topbar-record-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid #c8bda8;
  border-radius: 7px;
  color: #4d473d;
  background: #fffdf6;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.topbar-record-button:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}
.topbar-record-button:disabled { opacity: .5; cursor: not-allowed; }
.topbar-record-button.recording {
  border-color: #a93636;
  color: #8d2525;
  background: #fff0ed;
}
.microphone-icon {
  width: 9px;
  height: 9px;
  display: inline-block;
  overflow: hidden;
  border-radius: 50%;
  color: transparent;
  background: currentColor;
}
.topbar-record-button.recording .microphone-icon { animation: record-pulse 1s ease-in-out infinite; }
.message-source { min-width: 0; display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.transcript-line { white-space: pre-wrap; }

@keyframes record-pulse {
  0%, 100% { transform: scale(.8); opacity: .55; }
  50% { transform: scale(1.15); opacity: 1; }
}

@media (max-width: 820px) {
  .topbar-upload { flex-wrap: wrap; height: auto; min-width: 0; }
  .topbar-upload-status { flex: 1 1 100%; padding: 0 6px 3px; }
}

.profile-summary {
  cursor: pointer;
}
.profile-summary:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}
.profile-list-item:disabled {
  cursor: not-allowed;
  opacity: .62;
}


/* Personal language preferences */
.owner-user-list-item:disabled {
  cursor: not-allowed;
  opacity: .62;
}
.user-preferences-modal {
  width: min(520px, calc(100vw - 28px));
}
.user-preferences-content {
  padding: 24px;
}
.user-preferences-content > label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}
.user-preferences-content select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  color: var(--text);
  background: var(--surface);
  font: inherit;
}
.user-preferences-content select:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(54, 95, 82, .11);
}
.user-preferences-content .profile-actions {
  margin-top: 22px;
}


.owner-radio-heading-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.owner-radio-language {
  display: grid;
  gap: 4px;
  min-width: 170px;
  font-size: 0.78rem;
  color: var(--muted-text, #5f665f);
}

.owner-radio-language select {
  min-height: 38px;
}


.transcript-line.radio-processing {
  color: #6f675b;
  font-style: italic;
}

.transcript-line.radio-processing::after {
  content: "";
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-left: 0.45em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -0.12em;
  animation: radio-processing-spin 0.9s linear infinite;
}

.transcript-line.radio-processing-error {
  color: #8a4f45;
  font-style: italic;
}

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


/* Version 7.9: processing entries and their completed replacements are
   automatically brought into view for the currently open radio channel. */


.owner-channel-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-top: 18px; padding: 12px 14px; border: 1px solid #dce3dd;
  border-radius: 11px; background: #f1f6f3;
}
.owner-channel-toolbar strong, .owner-channel-toolbar small { display: block; }
.owner-channel-toolbar small { margin-top: 3px; color: #6d7971; }
.owner-radio-row.owner-radio-row-dynamic {
  grid-template-columns: 92px minmax(115px,.55fr) minmax(180px,1fr) minmax(165px,.8fr) minmax(135px,auto) auto;
  align-items: end;
}
.owner-radio-row-dynamic > label { min-width: 0; font-size: .75rem; font-weight: 750; color: #5f6d64; }
.owner-radio-row-dynamic > label > input:not([type="checkbox"]) { width: 100%; min-width: 0; }
.owner-radio-row-dynamic .owner-radio-toggle, .owner-radio-row-dynamic .owner-radio-mode-toggle { align-self: center; margin-bottom: 8px; }
.owner-delete-channel-button {
  min-height: 38px; margin-bottom: 1px; padding: 8px 11px;
  border: 1px solid #d7b7b1; border-radius: 8px; background: #fff7f5;
  color: #8a4036; font-weight: 800; cursor: pointer;
}
.owner-delete-channel-button:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 1050px) {
  .owner-radio-row.owner-radio-row-dynamic { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 650px) {
  .owner-channel-toolbar { align-items: stretch; flex-direction: column; }
  .owner-radio-row.owner-radio-row-dynamic { grid-template-columns: 1fr; }
}


/* Version 8.2: channel feeds are ordered newest first. */
#messages {
  scroll-padding-top: 12px;
}


/* Transcription Tree shared desktop/website icon — Online 8.5 */
/* Transcription Tree shared desktop/website icon — Online 8.5 */
.brand-mark.site-icon-frame,
.login-brand-mark.site-icon-frame {
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 13px;
  color: inherit;
  background: transparent;
  box-shadow: 0 8px 20px rgba(41, 82, 64, .18);
}

.brand-mark.site-icon-frame {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
}

.login-brand-mark.site-icon-frame {
  width: 78px;
  height: 78px;
  margin: 0 auto 18px;
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(41, 82, 64, .21);
}

.brand-mark.site-icon-frame::before,
.login-brand-mark.site-icon-frame::before {
  display: none;
  content: none;
}

.site-brand-icon {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

@media (max-width: 760px) {
  .brand-mark.site-icon-frame {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }
}


/* Mandatory authenticator-app 2FA — Online 8.9 */
.mfa-panel {
  margin-top: 4px;
}

.mfa-step-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: rgba(41, 82, 64, .10);
  color: #295240;
  font-size: .77rem;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.mfa-panel h2 {
  margin: 0 0 7px;
  color: #25251f;
  font-size: 1.25rem;
}

.mfa-description {
  margin: 0 0 15px;
  color: #6e685c;
  line-height: 1.45;
}

.mfa-setup {
  margin: 0 0 16px;
}

.mfa-qr-shell {
  width: min(260px, 78vw);
  aspect-ratio: 1;
  margin: 8px auto 12px;
  padding: 12px;
  border: 1px solid #ddd3bf;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 25px rgba(41, 82, 64, .09);
}

.mfa-qr-shell img {
  display: block;
  width: 100%;
  height: 100%;
}

.mfa-setup-note {
  margin: 0 0 10px;
  color: #6e685c;
  font-size: .88rem;
  line-height: 1.45;
}

.mfa-secret-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid #ddd3bf;
  border-radius: 10px;
  background: rgba(255, 255, 255, .65);
}

.mfa-secret-row > span {
  font-size: .76rem;
  font-weight: 800;
  color: #756e60;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.mfa-secret-row code {
  overflow-wrap: anywhere;
  color: #295240;
  font-size: .91rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.mfa-back-button {
  width: 100%;
  margin-top: 8px;
}

.mfa-recovery-panel {
  margin-top: 10px;
}

.mfa-recovery-panel > p {
  color: #6e685c;
  line-height: 1.5;
}

.mfa-recovery-codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.mfa-recovery-codes code {
  display: block;
  padding: 9px 8px;
  border: 1px solid #ddd3bf;
  border-radius: 8px;
  background: #fff;
  color: #295240;
  text-align: center;
  font-size: .9rem;
  font-weight: 850;
  letter-spacing: .05em;
}

.mfa-recovery-actions {
  display: grid;
  gap: 8px;
}

@media (max-width: 560px) {
  .mfa-secret-row {
    grid-template-columns: 1fr;
  }

  .mfa-recovery-codes {
    grid-template-columns: 1fr;
  }
}


/* 2FA QR reliability — Online 8.10 */
.mfa-qr-error {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  padding: 18px;
  color: #9a453e;
  background: #fff7f4;
  border: 1px dashed #d9a39b;
  border-radius: 10px;
  text-align: center;
  font-weight: 800;
  line-height: 1.45;
}

.mfa-qr-error[hidden] {
  display: none !important;
}


/* Owner Security Center — Online 8.11 */
.owner-emergency-login-button {
  width: 100%;
  margin-top: 8px;
}

.owner-emergency-login h2 {
  margin: 8px 0 7px;
  font-size: 1.3rem;
}

.owner-emergency-login > p {
  margin: 0 0 15px;
  color: #6e685c;
  line-height: 1.45;
}

.owner-emergency-login .secondary-button {
  width: 100%;
  margin-top: 8px;
}

.owner-security-button {
  min-height: 36px;
  padding: 7px 12px;
}

.owner-security-modal {
  width: min(880px, calc(100vw - 32px));
  max-height: calc(100vh - 44px);
  overflow: hidden;
  border: 1px solid #c8bda8;
  border-radius: 20px;
  background: #fffdf3;
  box-shadow: 0 30px 90px rgba(21, 29, 25, .28);
}

.owner-security-content {
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  padding: 20px 24px 28px;
}

.owner-security-status-card {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.owner-security-status-card > div {
  min-height: 82px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 13px;
  border: 1px solid #ddd3bf;
  border-radius: 12px;
  background: #f8f4e9;
}

.owner-security-status-card span {
  color: #756e60;
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.owner-security-status-card strong {
  color: #295240;
  overflow-wrap: anywhere;
}

.owner-security-section {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid #ddd3bf;
  border-radius: 14px;
  background: rgba(255, 255, 255, .66);
}

.owner-security-section.emergency {
  border-color: #d6b89a;
  background: #fff9ef;
}

.owner-step-up-section {
  border-color: #aac9bb;
  background: #f2f8f5;
}

.owner-security-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.owner-security-heading h3 {
  margin: 4px 0 4px;
  font-size: 1.1rem;
}

.owner-security-heading p {
  margin: 0;
  color: #6e685c;
  font-size: .88rem;
  line-height: 1.45;
}

.owner-security-grid {
  display: grid;
  gap: 11px;
  margin-bottom: 12px;
}

.owner-security-grid.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.owner-security-grid label,
.owner-auth-replacement label {
  display: grid;
  gap: 6px;
  color: #4e504a;
  font-size: .82rem;
  font-weight: 750;
}

.owner-security-grid input,
.owner-auth-replacement input {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid #cec6b7;
  border-radius: 8px;
  background: #fff;
  color: #242821;
  font: inherit;
}

.owner-auth-replacement {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e1d8c8;
}

.owner-security-qr-shell {
  width: min(250px, 75vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: 0 auto;
  padding: 11px;
  border: 1px solid #ddd3bf;
  border-radius: 14px;
  background: #fff;
}

.owner-security-qr-shell img {
  width: 100%;
  height: 100%;
  display: block;
}

.owner-security-qr-shell > div {
  padding: 18px;
  color: #9a453e;
  text-align: center;
  font-weight: 800;
}

.owner-security-key-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid #ddd3bf;
  border-radius: 9px;
  background: #fff;
}

.owner-security-key-row span,
.owner-emergency-output > span {
  color: #756e60;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.owner-security-key-row code,
.owner-emergency-output code {
  color: #295240;
  overflow-wrap: anywhere;
  font-weight: 850;
  letter-spacing: .05em;
}

.owner-security-output,
.owner-emergency-output {
  margin-top: 14px;
  padding: 13px;
  border: 1px solid #ddd3bf;
  border-radius: 11px;
  background: #fff;
}

.owner-emergency-output {
  display: grid;
  gap: 10px;
}

.owner-emergency-output code {
  padding: 11px;
  border-radius: 8px;
  background: #f2f8f5;
  text-align: center;
  font-size: .95rem;
}

.owner-security-success {
  margin-top: 14px;
  padding: 11px 13px;
  border: 1px solid #a7cabb;
  border-radius: 9px;
  background: #eef7f2;
  color: #295240;
  font-weight: 750;
}

.mfa-emergency-heading {
  grid-column: 1 / -1;
  margin-top: 8px;
  color: #6a5b44;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.mfa-recovery-codes .mfa-emergency-code {
  grid-column: 1 / -1;
  border-color: #c7a87e;
  background: #fff8e9;
}

@media (max-width: 760px) {
  .owner-topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .owner-security-status-card,
  .owner-security-grid.two-columns {
    grid-template-columns: 1fr 1fr;
  }

  .owner-security-key-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .owner-security-status-card,
  .owner-security-grid.two-columns {
    grid-template-columns: 1fr;
  }
}


/* Property account recovery — Online 8.12 */
.account-recovery-card {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #c8d6cf;
  border-radius: 13px;
  background: #f5faf7;
}

.account-recovery-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 13px;
}

.account-recovery-heading h3 {
  margin: 3px 0 4px;
  font-size: 1.03rem;
}

.account-recovery-heading p {
  margin: 0;
  color: #686d67;
  font-size: .86rem;
  line-height: 1.45;
}

.account-security-chip {
  flex: 0 0 auto;
  max-width: 230px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(41, 82, 64, .10);
  color: #295240;
  font-size: .73rem;
  font-weight: 850;
  text-align: center;
}

.account-recovery-grid {
  display: grid;
  gap: 10px;
  margin: 10px 0;
}

.account-recovery-grid.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-recovery-grid label {
  display: grid;
  gap: 6px;
  font-size: .79rem;
  font-weight: 750;
  color: #50544e;
}

.account-recovery-grid input {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #c9d1cc;
  border-radius: 8px;
  background: #fff;
  color: inherit;
  font: inherit;
}

.account-recovery-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 11px;
}

.account-recovery-note {
  padding: 11px 12px;
  border: 1px solid #d7c59f;
  border-radius: 9px;
  background: #fff8e8;
  color: #685a3d;
  line-height: 1.45;
  font-size: .86rem;
}

.account-recovery-audit {
  margin: 11px 0 0;
  padding-top: 10px;
  border-top: 1px solid #dce5df;
  color: #777a75;
  font-size: .76rem;
  line-height: 1.4;
}

@media (max-width: 720px) {
  .account-recovery-grid.two-columns,
  .account-recovery-actions {
    grid-template-columns: 1fr;
  }
  .account-recovery-heading {
    flex-direction: column;
  }
}


/* Compliance authorization and Owner Audit Log — 8.13 */
.owner-debug-audio-toggle{display:flex;gap:8px;align-items:center;font-size:13px;font-weight:700}.owner-authorization-help{margin:10px 0 0;font-size:12px;color:#68736f}.owner-radio-authorization{min-width:210px;display:flex;flex-direction:column;gap:7px;padding:9px 10px;border:1px solid rgba(64,85,77,.18);border-radius:10px;background:rgba(255,255,255,.55)}.owner-radio-authorization strong{font-size:12px;line-height:1.3}.authorization-valid{color:#285f46}.authorization-required{color:#8b3d34}.owner-radio-authorization-actions{display:flex;gap:6px;flex-wrap:wrap}.owner-auth-upload-button,.owner-auth-view-button{padding:6px 9px;font-size:11px}.owner-audit-modal{z-index:1200}.owner-audit-dialog{width:min(1180px,calc(100vw - 32px));max-height:88vh}.owner-audit-toolbar{display:grid;grid-template-columns:minmax(190px,1fr) minmax(190px,1fr) auto;gap:12px;align-items:end;margin:16px 0 10px}.owner-audit-toolbar label{display:flex;flex-direction:column;gap:5px;font-size:12px;font-weight:700}.owner-audit-status{min-height:22px;font-size:12px;color:#68736f}.owner-audit-table-wrap{overflow:auto;max-height:58vh;border:1px solid rgba(64,85,77,.16);border-radius:12px}.owner-audit-table{width:100%;border-collapse:collapse;font-size:12px}.owner-audit-table th,.owner-audit-table td{text-align:left;vertical-align:top;padding:10px;border-bottom:1px solid rgba(64,85,77,.12)}.owner-audit-table th{position:sticky;top:0;background:#f6f8f5;z-index:1}@media(max-width:820px){.owner-audit-toolbar{grid-template-columns:1fr}.owner-radio-authorization{min-width:0}}

/* ======================================================================
   Transcription Tree Admin Console dashboard layout — 8.13.28 UI patch
   Structural companion to templates/index.html + static/app.js.
   ====================================================================== */
.admin-console-backdrop {
  padding: 18px;
  background: rgba(18, 27, 36, .46);
  backdrop-filter: blur(7px);
}
.admin-settings-modal.admin-console {
  width: min(1240px, calc(100vw - 36px)) !important;
  height: min(840px, calc(100vh - 36px)) !important;
  max-height: calc(100vh - 36px) !important;
  display: grid !important;
  grid-template-columns: 224px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #dbe2e8;
  border-radius: 13px;
  background: #f5f7f9;
  box-shadow: 0 30px 90px rgba(10, 22, 34, .28);
}
.admin-console-sidebar {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  color: #eef4f8;
  background: linear-gradient(180deg, #243b50 0%, #1b3043 100%);
  border-right: 1px solid rgba(255,255,255,.06);
}
.admin-console-brand {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 4px 7px 20px;
}
.admin-console-brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255,255,255,.11);
  border: 1px solid rgba(255,255,255,.12);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
}
.admin-console-brand strong,
.admin-console-brand span { display: block; }
.admin-console-brand strong { font-size: 14px; line-height: 1.2; }
.admin-console-brand span { margin-top: 3px; color: #b9c8d4; font-size: 11px; }
.admin-console-nav { display: grid; gap: 5px; }
.admin-console-nav-button {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  color: #d9e4ec;
  background: transparent;
  text-align: left;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.admin-console-nav-button:hover { background: rgba(255,255,255,.07); color: #fff; }
.admin-console-nav-button.active {
  color: #fff;
  background: #315a80;
  box-shadow: inset 3px 0 0 #73a8d7;
}
.admin-console-nav-icon { color: #b9c9d6; font-size: 15px; text-align: center; }
.admin-console-sidebar-note {
  margin-top: auto;
  padding: 15px 9px 5px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.admin-console-sidebar-note span,
.admin-console-sidebar-note strong,
.admin-console-sidebar-note small { display: block; }
.admin-console-sidebar-note span { color: #95aabc; font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.admin-console-sidebar-note strong { margin-top: 7px; font-size: 12px; }
.admin-console-sidebar-note small { margin-top: 5px; color: #aebdca; font-size: 10px; line-height: 1.45; }
.admin-console-workspace { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #f6f8fa; }
.admin-console-topbar {
  flex: 0 0 auto;
  min-height: 92px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 20px 26px 16px;
  border-bottom: 1px solid #dfe5ea;
  background: #fff;
}
.admin-console-topbar .eyebrow { color: #6b7c8c; }
.admin-console-topbar h2 { margin: 5px 0 0; color: #172535; font-size: 24px; letter-spacing: -.03em; }
.admin-console-topbar p { margin: 4px 0 0; color: #70808f; font-size: 12px; }
.admin-console-close { background: #f2f5f7; }
.admin-console-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 22px 28px;
}
.admin-console-view { display: grid; gap: 16px; }
.admin-console-view[hidden] { display: none !important; }
.admin-view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.admin-view-toolbar .settings-label { padding: 0; color: #71808e; }
.admin-view-toolbar p { margin: 5px 0 0; color: #71808e; font-size: 12px; line-height: 1.4; }
.admin-add-user-button {
  min-width: 112px;
  min-height: 36px;
  border: 0;
  border-radius: 5px;
  padding: 8px 14px;
  color: #fff;
  background: #1fa45b;
  box-shadow: 0 2px 5px rgba(31,164,91,.2);
  font-size: 12px;
  font-weight: 800;
}
.admin-add-user-button:hover { background: #178b4c; }
.admin-users-table-card {
  overflow: hidden;
  border: 1px solid #dce3e8;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(30, 50, 68, .045);
}
.admin-users-table-head,
.profile-list-item.admin-user-row {
  display: grid !important;
  grid-template-columns: minmax(220px, 1.8fr) minmax(110px, .8fr) minmax(85px, .55fr) 32px !important;
  align-items: center;
  gap: 12px;
}
.admin-users-table-head {
  min-height: 40px;
  padding: 0 15px;
  border-bottom: 1px solid #e2e7eb;
  color: #657482;
  background: #f8fafb;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.profile-list.admin-users-table-body { max-height: 255px; overflow-y: auto; }
.profile-list-item.admin-user-row {
  width: 100%;
  min-height: 58px;
  padding: 9px 15px !important;
  border: 0 !important;
  border-bottom: 1px solid #edf0f2 !important;
  border-radius: 0 !important;
  background: #fff !important;
  color: #23313f;
  text-align: left;
  box-shadow: none !important;
}
.profile-list-item.admin-user-row:last-child { border-bottom: 0 !important; }
.profile-list-item.admin-user-row:hover { background: #f7fbff !important; }
.profile-list-item.admin-user-row.selected { background: #edf6ff !important; box-shadow: inset 3px 0 0 #2e72ad !important; }
.admin-user-cell { min-width: 0; font-size: 12px; }
.admin-user-identity { display: grid; grid-template-columns: 34px minmax(0,1fr); align-items: center; gap: 10px; }
.admin-user-identity .mini-profile-avatar { width: 34px; height: 34px; font-size: 10px; }
.admin-user-identity-copy strong,
.admin-user-identity-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-identity-copy strong { color: #1c2c3b; font-size: 12px; }
.admin-user-identity-copy small { margin-top: 2px; color: #7d8a96; font-size: 10px; }
.admin-role-chip,
.admin-channel-count-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid #dbe2e7;
  border-radius: 999px;
  padding: 3px 8px;
  color: #586875;
  background: #f5f7f8;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}
.admin-role-chip.admin { color: #246aa0; border-color: #b9d7ed; background: #eef7fd; }
.admin-user-row-action { color: #56748b; text-align: center; font-size: 17px; font-weight: 800; }
.admin-editor-shell {
  overflow: hidden;
  border: 1px solid #dce3e8;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(30, 50, 68, .045);
}
.admin-editor-shell-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  border-bottom: 1px solid #e4e8eb;
  background: #fbfcfd;
}
.admin-editor-shell-heading .settings-label { padding: 0; color: #71808e; }
.admin-editor-shell-heading h3 { margin: 3px 0 0; color: #223242; font-size: 15px; }
.admin-editor-hint { color: #7b8994; font-size: 10px; }
.admin-settings-modal .profile-editor {
  overflow: visible !important;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
  padding: 20px !important;
  background: #fff;
}
.admin-settings-modal .profile-preview { grid-column: 1 / -1; margin-bottom: 10px; padding-bottom: 15px; border-bottom: 1px solid #edf0f2; }
.admin-settings-modal .profile-editor > label,
.admin-settings-modal .profile-editor > input,
.admin-settings-modal .profile-editor > .field-help,
.admin-settings-modal .profile-editor > .color-field { min-width: 0; }
.admin-settings-modal .profile-editor > label { margin-top: 13px; color: #5f6e7a; }
.admin-settings-modal .profile-editor input[type="text"],
.admin-settings-modal .profile-editor input[type="password"],
.admin-settings-modal .profile-editor select,
.admin-settings-modal .profile-editor textarea {
  border-color: #d7dee4;
  border-radius: 6px;
  background: #fff;
  box-shadow: none;
}
.admin-settings-modal .profile-editor input:focus,
.admin-settings-modal .profile-editor select:focus,
.admin-settings-modal .profile-editor textarea:focus {
  border-color: #5a91bd;
  box-shadow: 0 0 0 3px rgba(50, 116, 171, .10);
}
.admin-settings-modal .field-help { color: #82909b; }
.admin-settings-modal .language-setting-card,
.admin-settings-modal .channel-access-card,
.admin-settings-modal .admin-checkbox,
.admin-settings-modal .account-recovery-card,
.admin-settings-modal .form-error,
.admin-settings-modal .profile-actions { grid-column: 1 / -1; }
.admin-settings-modal .language-setting-card,
.admin-settings-modal .channel-access-card,
.admin-settings-modal .account-recovery-card {
  border-color: #dfe5e9;
  border-radius: 7px;
  background: #f9fbfc;
}
.admin-settings-modal .profile-actions {
  position: static !important;
  margin: 20px -20px -20px !important;
  padding: 14px 20px !important;
  border-top: 1px solid #e3e7ea;
  background: #fbfcfd !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
.admin-settings-modal #saveProfileButton { min-width: 120px; background: #326b98; }
.admin-channel-dashboard {
  display: grid;
  gap: 10px;
  padding: 0;
}
.admin-channel-dashboard > div:first-child {
  margin: 0 !important;
  padding: 10px 13px;
  border: 1px solid #dce4e9;
  border-radius: 7px;
  color: #667785 !important;
  background: #fff;
}
.admin-channel-dashboard .admin-channel-clear-row {
  grid-template-columns: 38px minmax(180px, .9fr) auto minmax(360px, 2fr) !important;
  align-items: start !important;
  gap: 12px !important;
  padding: 14px !important;
  border: 1px solid #dce3e8 !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: 0 2px 7px rgba(30,50,68,.035);
}
.admin-channel-dashboard [data-channel-name-input] {
  min-height: 40px;
  border: 1px solid #d5dee4;
  border-radius: 7px;
  outline: none;
  padding: 8px 10px;
  color: #223242;
  background: #fff;
}
.admin-channel-dashboard [data-channel-name-input]:focus {
  border-color: #5a91bd;
  box-shadow: 0 0 0 3px rgba(50, 116, 171, .10);
}
.admin-channel-dashboard .admin-channel-clear-row > div:nth-child(4) {
  grid-column: 4 !important;
  margin: 0 !important;
}
.admin-channel-dashboard textarea { min-height: 62px !important; border: 1px solid #d8e0e5; border-radius: 6px; padding: 9px; background: #fff; }
.admin-channel-dashboard .admin-clear-channel-button { border-radius: 5px; }

@media (max-width: 900px) {
  .admin-settings-modal.admin-console { grid-template-columns: 176px minmax(0, 1fr); }
  .admin-users-table-head,
  .profile-list-item.admin-user-row { grid-template-columns: minmax(180px, 1.6fr) minmax(90px,.7fr) 75px 28px !important; }
  .admin-channel-dashboard .admin-channel-clear-row { grid-template-columns: 38px minmax(0,1fr) auto !important; }
  .admin-channel-dashboard .admin-channel-clear-row > div:nth-child(4) { grid-column: 2 / -1 !important; }
}
@media (max-width: 680px) {
  .admin-console-backdrop { padding: 0; }
  .admin-settings-modal.admin-console {
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    grid-template-columns: 1fr;
    border-radius: 0;
  }
  .admin-console-sidebar { flex-direction: row; align-items: center; gap: 8px; padding: 8px 10px; }
  .admin-console-brand { display: none; }
  .admin-console-nav { display: flex; }
  .admin-console-nav-button { min-width: 100px; grid-template-columns: auto 1fr; }
  .admin-console-sidebar-note { display: none; }
  .admin-console-topbar { min-height: 82px; padding: 16px; }
  .admin-console-content { padding: 14px; }
  .admin-users-table-head { display: none !important; }
  .profile-list-item.admin-user-row { grid-template-columns: minmax(0,1fr) auto !important; gap: 7px !important; }
  .profile-list-item.admin-user-row .admin-user-cell:nth-child(2),
  .profile-list-item.admin-user-row .admin-user-cell:nth-child(3) { display: none; }
  .admin-settings-modal .profile-editor { grid-template-columns: 1fr; }
  .admin-settings-modal .profile-editor > * { grid-column: 1 !important; }
  .admin-editor-hint { display: none; }
}

/* Admin Console dark-green theme — visual only. */
.admin-console-sidebar {
  background: linear-gradient(180deg, #173f2b 0%, #0d2f1f 100%);
}
.admin-console-brand span { color: #b8d3c3; }
.admin-console-nav-button { color: #d9e9df; }
.admin-console-nav-button.active {
  background: #245d40;
  box-shadow: inset 3px 0 0 #75b98e;
}
.admin-console-nav-icon { color: #b8d3c3; }
.admin-console-sidebar-note span { color: #91b6a0; }
.admin-console-sidebar-note small { color: #aec8b7; }
.profile-list-item.admin-user-row:hover { background: #f4faf6 !important; }
.profile-list-item.admin-user-row.selected {
  background: #eaf5ed !important;
  box-shadow: inset 3px 0 0 #2f744d !important;
}
.admin-role-chip.admin {
  color: #24613f;
  border-color: #bad9c5;
  background: #edf7f0;
}
.admin-user-row-action { color: #527763; }
.admin-settings-modal .profile-editor input:focus,
.admin-settings-modal .profile-editor select:focus,
.admin-settings-modal .profile-editor textarea:focus {
  border-color: #4d8a65;
  box-shadow: 0 0 0 3px rgba(36, 102, 65, .12);
}
.admin-settings-modal #saveProfileButton {
  background: #245d40;
}
.admin-settings-modal #saveProfileButton:hover:not(:disabled) {
  background: #194b31;
}

/* Friendly Admin property header and channel cards — 8.15 */
.admin-console-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-property-badge {
  min-width: 170px;
  max-width: 300px;
  display: grid;
  gap: 3px;
  padding: 9px 13px;
  border: 1px solid #d5e3da;
  border-radius: 10px;
  background: #f2f8f4;
}
.admin-property-badge span {
  color: #6b8374;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .13em;
}
.admin-property-badge strong {
  overflow: hidden;
  color: #173f2b;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-channel-view-toolbar {
  padding: 14px 16px;
  border: 1px solid #d8e3dc;
  border-radius: 10px;
  background: #fff;
}
.admin-channel-dashboard > div:first-child {
  padding: 12px 15px !important;
  border-color: #d5e3da !important;
  color: #52685a !important;
  background: #f3f8f5 !important;
}
.admin-channel-dashboard .admin-channel-clear-row {
  grid-template-columns: 44px minmax(0, 1fr) auto !important;
  gap: 12px 14px !important;
  padding: 16px !important;
  border-color: #d8e3dc !important;
  border-radius: 11px !important;
  box-shadow: 0 3px 10px rgba(22, 63, 43, .055) !important;
}
.admin-channel-dashboard .admin-channel-clear-row:hover {
  border-color: #b8d2c2 !important;
  box-shadow: 0 5px 16px rgba(22, 63, 43, .08) !important;
}
.admin-channel-dashboard [data-channel-drag-handle] {
  width: 40px;
  height: 40px;
  margin: 0 !important;
  border-color: #c9dbcf !important;
  border-radius: 10px !important;
  color: #35654a !important;
  background: #f1f7f3 !important;
  font-size: 16px;
}
.admin-channel-dashboard .admin-channel-clear-row > div:nth-child(2) {
  align-self: center;
}
.admin-channel-dashboard .admin-channel-clear-row > div:nth-child(2) strong {
  display: block;
  color: #172b20;
  font-size: 14px;
}
.admin-channel-dashboard .admin-channel-clear-row > div:nth-child(2) small {
  display: block;
  margin-top: 4px;
  color: #728078;
  font-size: 11px;
}
.admin-channel-dashboard .admin-clear-channel-button {
  align-self: center;
  min-height: 36px;
  padding: 8px 13px;
}
.admin-channel-dashboard .admin-channel-clear-row > div:nth-child(4) {
  grid-column: 1 / -1 !important;
  display: grid !important;
  gap: 12px !important;
  margin: 2px 0 0 !important;
  padding: 14px 0 0 58px;
  border-top: 1px solid #e5ece7;
}
.admin-channel-dashboard .admin-channel-clear-row > div:nth-child(4) label > span {
  color: #263b2e;
  font-size: 12px;
}
.admin-channel-dashboard textarea {
  min-height: 88px !important;
  padding: 11px 12px;
  border-color: #cedbd2;
  border-radius: 8px;
  line-height: 1.45;
}
.admin-channel-dashboard textarea:focus {
  outline: none;
  border-color: #4d8a65;
  box-shadow: 0 0 0 3px rgba(36, 102, 65, .1);
}
.admin-channel-dashboard [data-channel-move-up],
.admin-channel-dashboard [data-channel-move-down] {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 7px;
  background: #f4f7f5;
}
.admin-channel-dashboard [data-channel-settings-footer] {
  position: sticky;
  bottom: -28px;
  z-index: 2;
  margin: 2px -22px -28px;
  padding: 14px 22px !important;
  border-top: 1px solid #d8e3dc;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px);
}
.admin-channel-dashboard [data-save-channel-settings] {
  min-height: 40px;
  padding: 9px 16px;
  border-radius: 8px;
}
@media (max-width: 760px) {
  .admin-console-topbar-actions { gap: 7px; }
  .admin-property-badge { min-width: 0; max-width: 160px; padding: 8px 10px; }
  .admin-channel-dashboard .admin-channel-clear-row > div:nth-child(4) { padding-left: 0; }
}

/* Corrected Admin user form layout — 8.15 */
.admin-settings-modal .profile-editor {
  display: block !important;
  padding: 20px !important;
}
.admin-settings-modal .profile-preview {
  margin: 0 0 20px;
  padding: 0 0 18px;
}
.admin-basic-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
  margin-bottom: 20px;
}
.admin-form-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.admin-form-field label {
  margin: 0;
  color: #4f6256;
  font-size: 11px;
  font-weight: 800;
}
.admin-form-field input[type="text"],
.admin-form-field input[type="password"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d2ddd5;
  border-radius: 8px;
  outline: none;
  padding: 10px 12px;
  color: #17251d;
  background: #fff;
}
.admin-form-field input[type="text"]:focus,
.admin-form-field input[type="password"]:focus {
  border-color: #4d8a65;
  box-shadow: 0 0 0 3px rgba(36, 102, 65, .11);
}
.admin-form-field .field-help {
  min-height: 16px;
  margin: 0;
  color: #78877d;
  font-size: 10px;
  line-height: 1.45;
}
.admin-avatar-color-field {
  justify-content: flex-start;
}
.admin-avatar-color-field .color-field {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 10px;
  border: 1px solid #d2ddd5;
  border-radius: 8px;
  background: #fff;
}
.admin-avatar-color-field input[type="color"] {
  width: 42px;
  height: 32px;
}
.admin-settings-modal .language-setting-card,
.admin-settings-modal .channel-access-card,
.admin-settings-modal .admin-checkbox,
.admin-settings-modal .account-recovery-card {
  margin-top: 16px;
}
.admin-settings-modal .profile-actions {
  margin: 20px -20px -20px !important;
}
@media (max-width: 760px) {
  .admin-basic-fields { grid-template-columns: 1fr; }
}

/* Scrolling lined-paper transcript rhythm — 8.15 */
.transcript-section {
  background: #fffdf3;
}
.messages {
  background:
    linear-gradient(90deg, transparent 0 72px, var(--paper-margin) 72px 74px, transparent 74px),
    repeating-linear-gradient(to bottom, transparent 0 37px, var(--paper-line) 37px 38px),
    #fffdf3;
  background-attachment: local;
  background-origin: border-box;
}
.transcript-line {
  line-height: 38px !important;
}
@media (max-width: 760px) {
  .messages {
    background:
      linear-gradient(90deg, transparent 0 49px, var(--paper-margin) 49px 51px, transparent 51px),
      repeating-linear-gradient(to bottom, transparent 0 37px, var(--paper-line) 37px 38px),
      #fffdf3;
    background-attachment: local;
  }
}

.release-channel-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid #d49b2c;
  border-radius: 999px;
  background: #fff5d7;
  color: #744f08;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.release-channel-badge[hidden] { display: none; }

.login-card > .release-channel-badge {
  margin: 0 auto 14px;
}

.owner-release-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 320px);
  gap: 24px;
  align-items: center;
  margin: 22px 0;
  padding: 20px;
  border: 1px solid #d9e3dd;
  border-radius: 16px;
  background: #f7faf8;
}

.owner-release-section h3,
.owner-release-section p { margin: 4px 0 0; }
.owner-release-section p { color: #66756d; line-height: 1.5; }
.owner-release-section label { font-weight: 700; }
.owner-release-section select { width: 100%; margin-top: 7px; }
.owner-release-section small {
  display: block;
  margin-top: 7px;
  color: #6d7b74;
  font-weight: 500;
  line-height: 1.4;
}

.owner-property-release-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 66px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #e9f0ec;
  color: #496257;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.owner-property-release-badge.test {
  background: #fff0c8;
  color: #765008;
}

@media (max-width: 760px) {
  .owner-release-section { grid-template-columns: 1fr; }
}


/* Dedicated mobile application layout — Test rebuild 8.17 */
.mobile-layout,
.mobile-layout body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

.mobile-layout body {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior: none;
}

.mobile-layout button,
.mobile-layout input,
.mobile-layout select,
.mobile-layout textarea,
.mobile-layout label[for] {
  touch-action: manipulation;
}

.mobile-layout input,
.mobile-layout select,
.mobile-layout textarea {
  font-size: 16px;
}

.mobile-layout .app-shell {
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
}

.mobile-layout .topbar {
  position: relative !important;
  inset: auto !important;
  z-index: 20 !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  flex: 0 0 auto !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: auto auto auto !important;
  align-items: stretch !important;
  gap: 8px !important;
  padding: max(8px, env(safe-area-inset-top)) 10px 8px !important;
  overflow: hidden !important;
  border-bottom: 1px solid #cfc6b3 !important;
  background: rgba(250, 246, 235, .98) !important;
  box-shadow: 0 3px 12px rgba(73, 63, 43, .08) !important;
}

.mobile-layout .topbar > .brand,
.mobile-layout .topbar > .topbar-actions,
.mobile-layout .topbar > .topbar-upload {
  position: static !important;
  inset: auto !important;
  transform: none !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
}

.mobile-layout .topbar > .brand {
  grid-column: 1 !important;
  grid-row: 1 !important;
  min-height: 38px !important;
  display: grid !important;
  grid-template-columns: 34px minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 9px !important;
}

.mobile-layout .topbar .brand-mark {
  position: relative !important;
  width: 32px !important;
  min-width: 32px !important;
  height: 36px !important;
  margin: 0 !important;
}

.mobile-layout .topbar .brand-copy {
  min-width: 0 !important;
  display: block !important;
  overflow: hidden !important;
}

.mobile-layout .topbar .brand-copy strong {
  display: block !important;
  overflow: hidden !important;
  font-size: 15px !important;
  line-height: 1.15 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.mobile-layout .topbar .brand-copy small {
  display: none !important;
}

.mobile-layout .topbar .release-channel-badge {
  min-height: 24px !important;
  padding: 3px 8px !important;
  font-size: 9px !important;
}

.mobile-layout .topbar > .topbar-actions {
  grid-column: 1 !important;
  grid-row: 2 !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-auto-flow: row !important;
  align-items: stretch !important;
  gap: 7px !important;
  overflow: visible !important;
}

.mobile-layout .topbar-actions > .connection-card {
  display: none !important;
}

.mobile-layout .topbar-actions > button {
  position: static !important;
  inset: auto !important;
  transform: none !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-height: 44px !important;
  height: 44px !important;
  margin: 0 !important;
  padding: 5px 10px !important;
  overflow: hidden !important;
  border-radius: 9px !important;
  font-size: 12px !important;
  line-height: 1.15 !important;
  white-space: normal !important;
  text-overflow: ellipsis !important;
}

.mobile-layout .topbar-actions .profile-button {
  display: grid !important;
  grid-template-columns: 32px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 8px !important;
  text-align: left !important;
}

.mobile-layout .topbar-actions .user-avatar {
  width: 32px !important;
  height: 32px !important;
  margin: 0 !important;
}

.mobile-layout .topbar-actions .profile-button-copy {
  min-width: 0 !important;
  display: block !important;
  overflow: hidden !important;
}

.mobile-layout .topbar-actions .profile-button-copy strong {
  display: block !important;
  overflow: hidden !important;
  font-size: 12px !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.mobile-layout .topbar-actions .profile-button-copy small,
.mobile-layout .topbar-actions .profile-chevron,
.mobile-layout .topbar-actions .admin-chip {
  display: none !important;
}

.mobile-layout .topbar > .topbar-upload {
  grid-column: 1 !important;
  grid-row: 3 !important;
  min-height: 48px !important;
  height: auto !important;
  gap: 7px !important;
  padding: 5px !important;
}

.mobile-layout .topbar-upload-button,
.mobile-layout .topbar-record-button {
  min-width: 0 !important;
  min-height: 42px !important;
  flex: 1 1 0 !important;
  justify-content: center !important;
  padding-inline: 8px !important;
}

.mobile-layout .workspace {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
  flex: 1 1 auto !important;
  padding: 0 !important;
}

.mobile-layout .channel-panel {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  flex: 0 0 auto !important;
  padding: 8px 10px 9px !important;
  overflow: hidden !important;
}

.mobile-layout .channel-panel-top {
  min-height: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  padding: 0 2px 7px !important;
}

.mobile-layout .active-channel-copy {
  min-width: 0 !important;
}

.mobile-layout .active-channel-copy h1 {
  max-width: 100% !important;
  margin: 0 !important;
  overflow: hidden !important;
  font-size: clamp(21px, 6.4vw, 27px) !important;
  line-height: 1.14 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.mobile-layout .notebook-date {
  display: none !important;
}

.mobile-layout .channel-tabs {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  justify-content: flex-start !important;
  gap: 7px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding: 0 2px 7px !important;
  scroll-padding-inline: 2px !important;
  scroll-snap-type: x proximity !important;
  scrollbar-width: none !important;
  touch-action: pan-x !important;
  overscroll-behavior-x: contain !important;
  -webkit-overflow-scrolling: touch !important;
}

.mobile-layout .channel-tabs::-webkit-scrollbar {
  display: none !important;
}

.mobile-layout .channel-tab {
  width: auto !important;
  min-width: max-content !important;
  min-height: 42px !important;
  flex: 0 0 auto !important;
  padding: 0 14px !important;
  scroll-snap-align: start !important;
  touch-action: manipulation !important;
  font-size: 12px !important;
}

.mobile-layout .channel-scroll-control[hidden] {
  display: none !important;
}

.mobile-layout .channel-scroll-control:not([hidden]) {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  display: grid !important;
  grid-template-columns: 44px minmax(0, 1fr) 44px !important;
  align-items: center !important;
  gap: 9px !important;
  padding: 1px 2px 0 !important;
}

.mobile-layout .channel-scroll-control > button {
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid #bcae92 !important;
  border-radius: 9px !important;
  color: #315f87 !important;
  background: #fffdf3 !important;
  font-size: 25px !important;
  line-height: 1 !important;
}

.mobile-layout .channel-scroll-control > button:disabled {
  opacity: .35 !important;
}

.mobile-layout .channel-slider {
  min-width: 0 !important;
  display: grid !important;
  grid-template-rows: auto 28px !important;
  align-items: center !important;
  gap: 1px !important;
}

.mobile-layout .channel-slider > span {
  display: block !important;
  min-width: 0 !important;
  overflow: hidden !important;
  color: #655f53 !important;
  font-size: 10px !important;
  font-weight: 750 !important;
  line-height: 1.1 !important;
  text-align: center !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.mobile-layout .channel-slider input[type="range"] {
  width: 100% !important;
  height: 28px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  accent-color: #315f87 !important;
  touch-action: pan-x !important;
}

.mobile-layout .channel-slider input[type="range"]::-webkit-slider-runnable-track {
  height: 7px !important;
  border: 1px solid #c7bda9 !important;
  border-radius: 999px !important;
  background: #eee5d1 !important;
}

.mobile-layout .channel-slider input[type="range"]::-webkit-slider-thumb {
  width: 26px !important;
  height: 26px !important;
  margin-top: -10px !important;
  border: 2px solid #fffdf3 !important;
  border-radius: 50% !important;
  background: #315f87 !important;
  box-shadow: 0 1px 4px rgba(30, 45, 54, .28) !important;
  -webkit-appearance: none !important;
}

.mobile-layout .transcript-section {
  min-width: 0 !important;
  min-height: 0 !important;
  flex: 1 1 auto !important;
}

.mobile-layout .section-header {
  min-height: 0 !important;
  flex: 0 0 auto !important;
  display: block !important;
  padding: 10px 12px 10px 56px !important;
}

.mobile-layout .transcript-tools {
  width: 100% !important;
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 8px !important;
  margin: 0 !important;
}

.mobile-layout .search-field,
.mobile-layout .day-field {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 44px !important;
}

.mobile-layout .day-field {
  padding-inline: 10px !important;
}

.mobile-layout .day-field input[type="date"] {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 42px !important;
  padding: 4px 0 !important;
  text-align: left !important;
}

.mobile-layout .messages {
  min-width: 0 !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  padding-bottom: max(18px, env(safe-area-inset-bottom)) !important;
  scrollbar-gutter: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

.mobile-layout .message {
  min-width: 0 !important;
  min-height: 0 !important;
  grid-template-columns: 30px minmax(0, 1fr) !important;
  gap: 9px !important;
  padding: 14px 12px 15px 56px !important;
}

.mobile-layout .message .avatar {
  width: 30px !important;
  height: 30px !important;
}

.mobile-layout .message-head {
  gap: 5px 8px !important;
}

.mobile-layout .message-head strong {
  font-size: 14px !important;
}

.mobile-layout .message-head time {
  font-size: 12px !important;
}

.mobile-layout .transcript-line {
  margin-top: 5px !important;
  overflow-wrap: anywhere !important;
  font-size: 18px !important;
  line-height: 1.65 !important;
}

.mobile-layout .channel-welcome,
.mobile-layout .search-empty-state {
  min-height: 220px !important;
  padding: 38px 18px 38px 56px !important;
}

@media (max-width: 380px) {
  .mobile-layout .topbar-actions > button {
    font-size: 11px !important;
  }

  .mobile-layout .topbar .brand-copy strong {
    font-size: 14px !important;
  }

  .mobile-layout .section-header {
    padding-right: 10px !important;
  }

  .mobile-layout .message {
    padding-right: 10px !important;
    padding-left: 53px !important;
  }

  .mobile-layout .transcript-line {
    font-size: 17px !important;
  }
}


/* Compact mobile navigation and tools — Test 8.18 */
.mobile-menu-button,
.mobile-search-button,
.day-icon {
  display: none;
}

.mobile-layout .topbar {
  grid-template-columns: minmax(0, 1fr) 44px !important;
  grid-template-rows: auto auto auto !important;
  align-items: center !important;
  gap: 7px 8px !important;
}

.mobile-layout .topbar > .brand {
  grid-column: 1 !important;
  grid-row: 1 !important;
  min-height: 40px !important;
}

.mobile-layout .topbar > .topbar-upload {
  grid-column: 1 / -1 !important;
  grid-row: 3 !important;
}

.mobile-layout .mobile-menu-button {
  grid-column: 2 !important;
  grid-row: 1 !important;
  align-self: center !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  display: grid !important;
  place-content: center !important;
  gap: 4px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid #c9bea8 !important;
  border-radius: 9px !important;
  color: #302d27 !important;
  background: #fffdf3 !important;
  box-shadow: none !important;
  cursor: pointer !important;
}

.mobile-layout .mobile-menu-button span {
  width: 20px !important;
  height: 2px !important;
  display: block !important;
  border-radius: 999px !important;
  background: currentColor !important;
  transition: transform .16s ease, opacity .16s ease !important;
}

.mobile-layout .topbar.mobile-menu-open .mobile-menu-button span:nth-child(1) {
  transform: translateY(6px) rotate(45deg) !important;
}

.mobile-layout .topbar.mobile-menu-open .mobile-menu-button span:nth-child(2) {
  opacity: 0 !important;
}

.mobile-layout .topbar.mobile-menu-open .mobile-menu-button span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg) !important;
}

.mobile-layout .topbar > .topbar-actions {
  grid-column: 1 / -1 !important;
  grid-row: 2 !important;
  display: none !important;
  padding-top: 1px !important;
}

.mobile-layout .topbar.mobile-menu-open > .topbar-actions {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.mobile-layout .topbar-actions > button {
  min-height: 40px !important;
  height: 40px !important;
  padding: 4px 9px !important;
  font-size: 11px !important;
}

.mobile-layout .topbar-actions .profile-button {
  grid-template-columns: 28px minmax(0, 1fr) !important;
  gap: 7px !important;
}

.mobile-layout .topbar-actions .user-avatar {
  width: 28px !important;
  height: 28px !important;
}

.mobile-layout .channel-scroll-control {
  display: none !important;
}

.mobile-layout .section-header {
  min-height: 60px !important;
  display: flex !important;
  align-items: center !important;
  padding: 8px 12px 8px 56px !important;
}

.mobile-layout .transcript-tools {
  width: 100% !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
}

.mobile-layout .mobile-search-button,
.mobile-layout .day-field {
  position: relative !important;
  box-sizing: border-box !important;
  width: 44px !important;
  max-width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  flex: 0 0 44px !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 1px solid #cfc5b2 !important;
  border-radius: 9px !important;
  color: #315f87 !important;
  background: rgba(255, 253, 246, .94) !important;
  cursor: pointer !important;
}

.mobile-layout .mobile-search-button {
  display: grid !important;
}

.mobile-layout .mobile-search-button svg,
.mobile-layout .search-icon svg,
.mobile-layout .day-icon svg {
  width: 21px !important;
  height: 21px !important;
  display: block !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

.mobile-layout .search-field {
  display: none !important;
}

.mobile-layout .section-header.mobile-search-open .mobile-search-button {
  display: none !important;
}

.mobile-layout .section-header.mobile-search-open .search-field {
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  min-height: 44px !important;
  flex: 1 1 auto !important;
  display: flex !important;
}

.mobile-layout .section-header.mobile-search-open .search-field input {
  width: 100% !important;
  min-width: 0 !important;
}

.mobile-layout .search-icon {
  color: #315f87 !important;
}

.mobile-layout .day-icon {
  display: grid !important;
  place-items: center !important;
  pointer-events: none !important;
}

.mobile-layout .day-field-label {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

.mobile-layout .day-field input[type="date"] {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: .01 !important;
  border: 0 !important;
  cursor: pointer !important;
  -webkit-appearance: none !important;
}

.mobile-layout .mobile-menu-button:focus-visible,
.mobile-layout .mobile-search-button:focus-visible,
.mobile-layout .day-field:focus-within {
  outline: 3px solid rgba(49, 95, 135, .22) !important;
  outline-offset: 2px !important;
}

@media (max-width: 380px) {
  .mobile-layout .topbar {
    grid-template-columns: minmax(0, 1fr) 42px !important;
  }

  .mobile-layout .mobile-menu-button {
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
  }

  .mobile-layout .section-header {
    padding-left: 53px !important;
    padding-right: 10px !important;
  }
}


/* Right-aligned mobile tools and Safari-safe Admin scrolling — Test 8.19 */
.mobile-layout .section-header {
  min-height: 50px !important;
  justify-content: flex-end !important;
  padding: 6px 12px 6px 56px !important;
}

.mobile-layout .transcript-tools {
  width: auto !important;
  min-width: 0 !important;
  flex: 0 0 auto !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 6px !important;
  margin: 0 0 0 auto !important;
}

.mobile-layout .mobile-search-button,
.mobile-layout .day-field {
  width: 36px !important;
  max-width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  flex: 0 0 36px !important;
  border-radius: 8px !important;
}

.mobile-layout .mobile-search-button svg,
.mobile-layout .day-icon svg {
  width: 18px !important;
  height: 18px !important;
}

.mobile-layout .section-header.mobile-search-open .transcript-tools {
  width: 100% !important;
  flex: 1 1 auto !important;
}

.mobile-layout .section-header.mobile-search-open .search-field {
  min-height: 38px !important;
  height: 38px !important;
}

@media (max-width: 680px) {
  .admin-console-backdrop {
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 0 !important;
    align-items: stretch !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  .admin-settings-modal.admin-console {
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    min-height: 0 !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    overflow: hidden !important;
  }

  .admin-console-workspace {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .admin-console-topbar {
    min-height: 0 !important;
    padding: 14px 16px 12px !important;
  }

  .admin-console-content {
    height: 100% !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain !important;
    touch-action: pan-y !important;
    padding: 14px 14px max(150px, calc(env(safe-area-inset-bottom) + 116px)) !important;
    scroll-padding-bottom: max(170px, calc(env(safe-area-inset-bottom) + 136px)) !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .admin-settings-modal .profile-actions {
    position: sticky !important;
    bottom: max(10px, env(safe-area-inset-bottom)) !important;
    z-index: 8 !important;
    margin: 20px -6px 0 !important;
    padding: 11px 12px !important;
    border: 1px solid #d8e3dc !important;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, .97) !important;
    box-shadow: 0 -5px 18px rgba(22, 63, 43, .12) !important;
    backdrop-filter: blur(8px) !important;
  }

  .admin-settings-modal .profile-actions > button {
    min-height: 44px !important;
  }
}

@media (max-width: 380px) {
  .mobile-layout .section-header {
    padding-left: 53px !important;
    padding-right: 10px !important;
  }
}


/* Baseline-aligned lined-paper transcript — Test 8.20 */
.messages {
  --paper-row-height: 38px;
  --paper-baseline: 27px;
  background:
    linear-gradient(90deg, transparent 0 72px, var(--paper-margin) 72px 74px, transparent 74px),
    repeating-linear-gradient(
      to bottom,
      transparent 0 var(--paper-baseline),
      var(--paper-line) var(--paper-baseline) calc(var(--paper-baseline) + 1px),
      transparent calc(var(--paper-baseline) + 1px) var(--paper-row-height)
    ),
    #fffdf3 !important;
  background-attachment: local !important;
  background-origin: border-box !important;
}

.message {
  position: relative !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-bottom: 0 !important;
}

.message:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 28px;
  right: 0;
  bottom: 0;
  border-bottom: 1px dashed rgba(137, 126, 103, .28);
  pointer-events: none;
}

.message-body {
  min-width: 0;
  min-height: calc(var(--paper-row-height) * 3);
}

.message-head {
  min-height: var(--paper-row-height) !important;
  height: var(--paper-row-height);
  align-items: baseline !important;
}

.message-head strong,
.message-head time {
  line-height: var(--paper-row-height) !important;
}

.transcript-line {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  line-height: var(--paper-row-height) !important;
}

.translation-status {
  min-height: var(--paper-row-height);
  display: flex;
  align-items: center;
  margin: 0;
}

.transcript-confidence-row {
  min-height: var(--paper-row-height) !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  align-items: center !important;
}

.temporary-message .message-body > p {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  line-height: var(--paper-row-height) !important;
}

.mobile-layout .messages {
  background:
    linear-gradient(90deg, transparent 0 49px, var(--paper-margin) 49px 51px, transparent 51px),
    repeating-linear-gradient(
      to bottom,
      transparent 0 var(--paper-baseline),
      var(--paper-line) var(--paper-baseline) calc(var(--paper-baseline) + 1px),
      transparent calc(var(--paper-baseline) + 1px) var(--paper-row-height)
    ),
    #fffdf3 !important;
}

.mobile-layout .message {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.mobile-layout .transcript-line {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  line-height: var(--paper-row-height) !important;
}

.mobile-layout .message:not(:last-child)::after {
  left: 28px;
}


/* Scroll-coupled paper rules — Test 8.21 */
.message,
.channel-welcome {
  background:
    linear-gradient(90deg, transparent 0 72px, var(--paper-margin) 72px 74px, transparent 74px),
    repeating-linear-gradient(
      to bottom,
      transparent 0 var(--paper-baseline),
      var(--paper-line) var(--paper-baseline) calc(var(--paper-baseline) + 1px),
      transparent calc(var(--paper-baseline) + 1px) var(--paper-row-height)
    ),
    #fffdf3 !important;
  background-attachment: scroll !important;
  background-origin: border-box !important;
}

.channel-welcome {
  min-height: 100% !important;
}

.mobile-layout .message,
.mobile-layout .channel-welcome {
  background:
    linear-gradient(90deg, transparent 0 49px, var(--paper-margin) 49px 51px, transparent 51px),
    repeating-linear-gradient(
      to bottom,
      transparent 0 var(--paper-baseline),
      var(--paper-line) var(--paper-baseline) calc(var(--paper-baseline) + 1px),
      transparent calc(var(--paper-baseline) + 1px) var(--paper-row-height)
    ),
    #fffdf3 !important;
  background-attachment: scroll !important;
}


/* Per-user translation with preserved source text — Test 8.22 */
.transcript-original {
  color: #766f62;
  font-size: .8em;
  font-style: italic;
  letter-spacing: 0;
}

.mobile-layout .transcript-original {
  color: #746d61;
  font-size: .78em;
}
/* Recorder controls share the existing Admin and Owner form styles. */
.recorder-control-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  margin-bottom: 20px;
  border: 1px solid #d5dfd8;
  border-radius: 16px;
  background: #fff;
  color: #254635;
  min-width: 0;
}
.recorder-control-card[hidden], .recorder-verification[hidden] { display: none; }
.recorder-control-card h3, .recorder-control-card p { margin: 0; }
.recorder-control-card h3 { margin: 5px 0 8px; }
.recorder-control-status { font-weight: 700; font-size: 1.1rem; }
.recorder-control-detail, .recorder-control-note { color: #56695d; font-size: .9rem; line-height: 1.5; }
.recorder-control-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.recorder-control-actions button { min-height: 44px; padding: 10px 18px; }
.recorder-verification { max-width: 580px; }
.recorder-verification input { width: 100%; min-width: 0; min-height: 44px; box-sizing: border-box; }
@media (max-width: 600px) {
  .recorder-control-card { padding: 16px; }
  .recorder-control-actions button { flex: 1 1 150px; }
}
/* Pending calls stay visible in their original channel and recording order. */
.radio-pending-status {
  display: inline-block;
  margin: 0 1rem .5rem;
  padding: .25rem .65rem;
  border-radius: 1rem;
  background: #ece6d6;
  color: #4f493d;
  font-size: .85rem;
}
.radio-pending-status[hidden] { display: none; }


/* On-demand per-message translation */
.message-translation-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.message-translation-controls[hidden],
.message-on-demand-translation[hidden] { display: none !important; }
.message-translation-language {
  min-height: 34px;
  padding: 6px 30px 6px 10px;
  border: 1px solid #d9cfbb;
  border-radius: 9px;
  background: #fff;
  font: inherit;
}
.message-translate-button { min-height: 34px; }
.message-on-demand-translation {
  margin-top: 8px;
  padding: 8px 10px;
  border-left: 3px solid currentColor;
  border-radius: 4px;
  line-height: 1.45;
}
