:root {
  --bg: #f7f6fb;
  --surface: #ffffff;
  --surface-alt: #f0eef8;
  --border: #e4e1ee;
  --text: #211d2c;
  --text-muted: #6b6480;
  --accent: #7c5cf0;
  --accent-hover: #6b48e8;
  --accent-muted: #ece7fc;
  --danger: #e0334a;
  --danger-hover: #c92a3f;
  --danger-muted: #fbe4e7;
  --success: #1f9d63;
  --success-muted: #dff5ea;
  --warning: #b3660a;
  --warning-muted: #fdf0dd;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  justify-content: center;
  padding: 3rem 1.25rem;
}

.app {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.app__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.app__header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.6rem;
}

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

.notice {
  background: var(--warning-muted);
  border: 1px solid var(--warning);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.notice__heading {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: var(--warning);
}

.notice__list {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text);
}

.notice__list strong {
  color: var(--warning);
}

.offline-banner {
  margin: 0;
  padding: 0.7rem 1rem;
  background: var(--warning-muted);
  border: 1px solid var(--warning);
  border-radius: 8px;
  color: var(--warning);
  font-size: 0.85rem;
  text-align: center;
}

.recorder {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.recorder__source {
  align-self: center;
}

.recorder__source-hint {
  margin: -0.75rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

.recorder__status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-dot.is-recording {
  background: var(--danger);
  animation: pulse 1.4s ease-in-out infinite;
}

.status-dot.is-paused {
  background: #e5b73b;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224, 51, 74, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(224, 51, 74, 0); }
}

.recorder__timer {
  font-variant-numeric: tabular-nums;
  font-size: 2.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.recorder__controls {
  display: flex;
  gap: 0.75rem;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
  color: var(--text);
  background: var(--surface-alt);
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

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

.btn--record {
  background: var(--danger);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn--record:hover:not(:disabled) {
  background: var(--danger-hover);
}

.btn--record.is-recording {
  background: var(--surface-alt);
  color: var(--text);
}

.btn__icon {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.btn--record.is-recording .btn__icon {
  border-radius: 2px;
  background: var(--danger);
}

.error-msg {
  color: var(--danger);
  font-size: 0.85rem;
  text-align: center;
  margin: 0;
}

.recordings__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.recordings__header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.view-toggle {
  display: flex;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
}

.view-toggle__btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
}

.view-toggle__btn.is-active {
  background: var(--accent);
  color: #fff;
}

.recordings__table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.recordings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.recordings-table th,
.recordings-table td {
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.recordings-table th {
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.recordings-table tbody tr:last-child td {
  border-bottom: none;
}

.recordings-table tbody tr:hover {
  background: var(--surface-alt);
}

.recordings-table__transcript {
  max-width: 420px;
  max-height: 120px;
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.4;
  color: var(--text-muted);
}

.recordings__empty-table {
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.app__footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  padding-top: 0.5rem;
}

.login-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.login-card h1 {
  margin: 0;
  font-size: 1.4rem;
}

.login-card__button {
  margin-top: 0.5rem;
}

.app__account {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.recordings h2 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.toggle input {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.recordings__search {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  color: var(--text);
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

.recordings__search:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.recordings__search::placeholder {
  color: var(--text-muted);
}

.transcript-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--success);
  margin-bottom: 0.4rem;
}

.recordings__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.recordings__empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 1rem 0;
}

.recording-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.recording-item__info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.recording-item__name {
  font-weight: 600;
  font-size: 0.95rem;
  cursor: text;
  border-radius: 4px;
  padding: 0.1rem 0.3rem;
  margin: -0.1rem -0.3rem;
}

.recording-item__name:hover {
  background: var(--surface-alt);
}

.recording-item__name:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  background: var(--surface-alt);
}

.recording-item__meta {
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.recording-item__audio {
  width: 100%;
}

.recording-item__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.retention-select {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-right: auto;
}

.retention-select select {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.6rem;
  color: var(--text);
  font-size: 0.78rem;
  cursor: pointer;
}

.retention-select select:disabled,
.recording-item__actions .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.upload-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.documents-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.documents-panel__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.documents-panel__empty {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.document-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  font-size: 0.82rem;
}

.document-item__badge {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--accent);
  background: var(--accent-muted);
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
}

.document-item__name {
  flex: 1;
  cursor: text;
  border-radius: 4px;
  padding: 0.1rem 0.3rem;
  margin: -0.1rem -0.3rem;
}

.document-item__name:hover {
  background: var(--surface);
}

.document-item__name:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  background: var(--surface);
}

.document-item__date {
  color: var(--text-muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

.btn--small {
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  border-radius: 999px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn--download {
  background: var(--surface-alt);
  color: var(--text);
}

.btn--delete {
  background: var(--danger-muted);
  color: var(--danger);
}

.btn--delete:hover {
  background: var(--danger);
  color: #fff;
}

.btn--transcribe {
  background: var(--surface-alt);
  color: var(--success);
}

.btn--transcribe:hover:not(:disabled) {
  background: #1c3a2e;
}

.recording-item__transcript {
  margin: 0;
  padding: 0.75rem 0.9rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text);
  white-space: pre-wrap;
}

.btn--diarize {
  background: var(--surface-alt);
  color: var(--accent);
}

.btn--diarize:hover:not(:disabled) {
  background: var(--accent-muted);
}

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

.btn--mom:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn--summary {
  background: var(--success);
  color: #10131a;
}

.btn--summary:hover:not(:disabled) {
  background: #5be0a8;
}

.speakers-panel__exports {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.speakers-panel {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.9rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.speakers-panel__heading {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
}

.speakers-panel__names {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.speaker-name-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.speaker-name-row span {
  width: 90px;
  flex-shrink: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.speaker-name-row input {
  flex: 1;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  color: var(--text);
  font-size: 0.85rem;
}

.speaker-name-row input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.speakers-panel__transcript {
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.speakers-panel__transcript p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.4;
}

.speakers-panel__transcript p strong {
  color: var(--accent);
}
