/* Shared contrast and alignment rules for every screen. */
:root {
  --muted: #55515f;
  --line: #d5d0de;
  --control-border: #91899c;
}

.ui-button,
.new-project,
.sidebar-nav button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.4;
}
.new-project,
.sidebar-nav button { justify-content: flex-start; }
.ui-button .button-icon,
button > span[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin: 0;
}
.button-icon svg { width: 18px; height: 18px; }
.ui-button.icon-button { gap: 0; }
.icon-button svg { width: 20px; height: 20px; }
.icon-button {
  background: #fff;
  color: #37313f;
  border: 1px solid #b5adbf;
}
.icon-button:hover {
  background: #e6def9;
  border-color: #796397;
}
.sidebar-user .icon-button { border-color: transparent; }
.sidebar-user .icon-button:hover { background: #383141; color: #fff; }
.sidebar-nav button,
.project-list button { color: #ede9f4; }
.sidebar-search,
.sidebar-search input::placeholder,
.project-list button small,
.project-list .empty,
.sidebar-user small { color: #cac3d5; }
.sidebar-search { border: 1px solid #6e657c; }
.sidebar-search input { border: 0; }
.sidebar-search input:focus-visible { outline-offset: -3px; }

input, textarea, select {
  min-width: 0;
  border-color: var(--control-border);
  background: #f8f7fa;
}
input::placeholder, textarea::placeholder { opacity: 1; }
input:focus, textarea:focus, select:focus { border-color: #624787; }
input:disabled, select:disabled, textarea:disabled,
input[readonly] { color: #55515f; opacity: 1; background: #efedf3; }
.check input { flex: 0 0 20px; height: 20px; margin: 0; }
button:disabled {
  opacity: 1;
  color: #5b5566;
  background: #e7e3ed;
  border-color: #b5adbf;
  cursor: not-allowed;
}
button.primary:disabled,
.send:disabled,
.ui-button.primary:disabled {
  background: #e7e3ed;
  color: #5b5566;
}
button.send:not(:disabled):hover { background: #433373; color: #fff; }
.send:not(:disabled) { border: 1px solid #171719; }

/* Foreground and background must switch together, without a low-contrast tween. */
.tabs button { transition: none; color: #ede8f5; }
.tabs button:not(.active):hover { background: #393240; color: #fff; }
.tabs button.active { color: #30244e; }
.option-cards button {
  border-color: var(--control-border);
  min-height: 42px;
}
.option-cards button:hover { background: #f0eafa; }
.option-cards button[aria-pressed="true"] {
  border-color: #70538f;
  background: #ddd5ff;
  color: #30244e;
}
:focus-visible { outline: 3px solid #70538f; outline-offset: 3px; }
.tabs button:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
.tabs button.active:focus-visible { outline-color: #433373; }
.sidebar :focus-visible { outline-color: #ddd5ff; }
.dropzone { border-color: #82758f; }
.dropzone:hover { background: #eeebf4; }

.transcript-search { border: 1px solid var(--control-border); }
.transcript-tools { display: flex; align-items: center; gap: 8px; }
.transcript-search input,
.transcript-search input:focus { border: 0; }
.transcript-search:focus-within { outline: 2px solid #70538f; outline-offset: 2px; }
.composer form { border: 1px solid var(--control-border); }
.composer textarea:focus-visible { outline: 0; }
.composer form:focus-within { outline: 2px solid #70538f; outline-offset: 2px; }
.speaker-chip > svg { width: 16px; height: 16px; color: #55515f; }
.speaker-chip:hover { background: #e9e3f4; }
.speaker-chip { min-height: 48px; }
.timestamp { color: #514b5b; }
.timestamp:hover { background: transparent; color: #30244e; text-decoration: underline; }
.bubble-actions { opacity: 1; align-items: center; flex-wrap: wrap; gap: 6px; }
.bubble-actions button {
  min-height: 36px;
  font-size: 12px;
  gap: 6px;
  padding: 5px 8px;
}
.bubble-actions .button-icon svg { width: 16px; height: 16px; }
.bubble-actions .icon-button { width: 36px; min-width: 36px; padding: 0; border: 0; }
.bubble-actions button:hover { background: #ffffffb3; }
.result-actions { flex-wrap: wrap; }
.result-actions .ui-button { min-height: 40px; }
.preset-row .ui-button { min-height: 40px; }
.result-header .avatar svg { width: 20px; height: 20px; }
.voice-actions .ui-button { min-height: 40px; }
.voice-actions .icon-button { width: 40px; min-width: 40px; padding: 0; }
.export-format { min-width: 112px; justify-content: flex-start; padding: 12px 16px; }
.option-cards .export-format { font-size: 14px; }
.export-format svg { width: 20px; height: 20px; }
.pill.success { border: 1px solid #498467; color: #1c5d43; }
.pill.warning { border: 1px solid #9f792c; color: #6a4b11; }
.pill.error { border: 1px solid #b15d5d; color: #8c2828; }
.progress-bar i { background: #70538f; }
.recording-dot { background: #9e2828; }
.voice-step { font-size: 14px; }

@media (max-width: 760px) {
  .content-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }
  .content-toolbar .tabs { grid-column: 1 / -1; }
  .content-toolbar .transcript-search { min-width: 0; width: auto; }
  .transcript-tools { gap: 6px; }
  .transcript-tools .icon-button { width: 40px; min-width: 40px; min-height: 42px; }
  .bubble-actions .ui-button { min-height: 40px; }
  .bubble-actions .icon-button { width: 40px; min-width: 40px; }
  .speaker-chip { padding: 9px 12px; }
  .result-actions { gap: 8px; }
  .result-actions .ui-button { flex: 1 0 auto; }
  .export-format { flex: 1; min-width: 88px; justify-content: center; }
  .voice-actions { gap: 8px; }
  .admin-row > .row { padding-left: 0; gap: 8px; }
}
