:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background: #f3f6fb;
  color: #142033;
  --surface: #ffffff;
  --surface-muted: #f7f9fc;
  --line: #d9e1ec;
  --line-strong: #bdc9d9;
  --text: #142033;
  --muted: #5c6b80;
  --primary: #0f766e;
  --primary-strong: #0b5f59;
  --accent: #2563eb;
  --danger: #c2410c;
  --danger-strong: #b91c1c;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

[hidden] {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

.auth-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, #e8edf5 0, #f6f8fb 360px, #eef3f8 100%),
    #f3f6fb;
}

.auth-panel {
  display: grid;
  gap: 18px;
  width: min(480px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-panel h1 {
  color: var(--text);
  font-size: 36px;
}

.auth-message {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  font-weight: 800;
}

.auth-message[data-tone="error"] {
  color: #b91c1c;
}

.auth-message[data-tone="success"] {
  color: #0f766e;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.app-shell {
  min-height: 100vh;
  padding: 32px;
  background:
    linear-gradient(180deg, #e8edf5 0, #f6f8fb 360px, #eef3f8 100%),
    #f3f6fb;
}

.recording-workspace {
  width: min(1280px, 100%);
  margin: 0 auto;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  padding: 22px 24px;
  border: 1px solid rgba(217, 225, 236, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(135deg, #111827 0%, #183247 58%, #0f766e 100%);
  box-shadow: var(--shadow);
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 10px;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0 0 6px;
  color: #738094;
  font-size: 14px;
  font-weight: 700;
}

.top-bar .eyebrow {
  color: #b7c6d7;
}

h1,
h2 {
  margin: 0;
  color: var(--text);
  letter-spacing: 0;
}

h1 {
  color: #ffffff;
  font-size: 40px;
  font-weight: 900;
}

h2 {
  font-size: 26px;
  font-weight: 900;
}

.status-pill {
  min-width: 190px;
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-weight: 700;
  text-align: center;
  backdrop-filter: blur(8px);
}

#account-status {
  min-width: 150px;
}

.compact-button {
  min-height: 48px;
  padding: 0 16px;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 16px;
  backdrop-filter: blur(8px);
}

.compact-button:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.52);
  background: rgba(255, 255, 255, 0.18);
}

.status-pill[data-state="active"] {
  border-color: rgba(153, 246, 228, 0.68);
  color: #ccfbf1;
}

.status-pill[data-state="done"] {
  border-color: rgba(191, 219, 254, 0.72);
  color: #dbeafe;
}

.status-pill[data-state="paused"] {
  border-color: rgba(253, 230, 138, 0.72);
  color: #fef3c7;
}

.status-pill[data-state="error"] {
  border-color: rgba(254, 202, 202, 0.72);
  color: #fee2e2;
}

.environment-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.toolbar-title {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.toolbar-status {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
}

.toolbar-status[data-state="ok"],
.toolbar-status[data-state="ready"] {
  color: #0f766e;
}

.toolbar-status[data-state="warning"],
.toolbar-status[data-state="checking"],
.toolbar-status[data-state="running"],
.toolbar-status[data-state="stale"] {
  color: #b45309;
}

.toolbar-status[data-state="error"],
.toolbar-status[data-state="failed"] {
  color: #b91c1c;
}

.toolbar-action {
  min-height: 52px;
  font-size: 18px;
}

.environment-details {
  display: grid;
  grid-column: 1 / -1;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.environment-details[hidden] {
  display: none;
}

.environment-details li {
  display: grid;
  grid-template-columns: 72px 120px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: #334155;
  font-size: 15px;
  font-style: normal;
}

.environment-details li[data-state="ok"] {
  border-color: #99f6e4;
  background: #f0fdfa;
}

.environment-details li[data-state="warning"] {
  border-color: #fde68a;
  background: #fffbeb;
}

.environment-details li[data-state="error"] {
  border-color: #fecaca;
  background: #fef2f2;
}

.environment-details span,
.environment-details strong {
  font-weight: 900;
}

.environment-details em {
  min-width: 0;
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.meeting-panel,
.recorder-panel,
.result-panel,
.list-toolbar,
.meetings-list-panel,
.meeting-detail-panel {
  border: 1px solid #d7dee8;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.view-tabs {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 8px;
  margin: 0 0 20px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e7edf5;
}

.tab-button {
  min-height: 48px;
  border-color: transparent;
  background: transparent;
  color: #4b5f75;
  font-size: 17px;
}

.tab-button.active {
  background: #172033;
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.18);
}

.view-panel[hidden] {
  display: none;
}

.meeting-panel {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.admin-summary,
.admin-panel {
  border: 1px solid #d7dee8;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px 180px;
  gap: 16px;
  align-items: center;
  padding: 20px;
}

.admin-layout {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

.admin-panel {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.admin-form {
  display: grid;
  gap: 16px;
}

.admin-list {
  display: grid;
  gap: 10px;
}

.admin-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.admin-list-title {
  display: block;
  color: var(--text);
  font-size: 17px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.admin-list-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.admin-list-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.admin-list-actions button {
  min-height: 42px;
  padding: 0 12px;
  font-size: 15px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
  color: #314257;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-size: 18px;
  line-height: 1.4;
}

input,
select {
  min-height: 58px;
  padding: 0 16px;
}

select[multiple] {
  min-height: 180px;
  padding: 10px 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
  outline: none;
}

textarea {
  min-height: 112px;
  resize: vertical;
  padding: 14px 16px;
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #f1f5f9;
  color: #64748b;
}

.recorder-panel {
  margin-top: 20px;
  padding: 24px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
}

.timer-block {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.timer-label {
  color: var(--muted);
  font-size: 18px;
  font-weight: 800;
}

.timer {
  color: #102033;
  font-size: 72px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  line-height: 1;
}

.waveform {
  display: block;
  width: 100%;
  height: 220px;
  margin: 22px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.controls,
.result-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

button,
.button-link {
  min-height: 64px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: #1c2f44;
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:hover:not(:disabled),
.button-link:hover {
  border-color: #52657a;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  box-shadow: none;
}

.primary-action {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary), #0e8f84);
  color: #ffffff;
}

.primary-action:hover:not(:disabled) {
  border-color: var(--primary-strong);
  background: linear-gradient(135deg, var(--primary-strong), #0f766e);
}

.danger-action {
  border-color: var(--danger);
  background: #fff7ed;
  color: var(--danger-strong);
}

.danger-action:hover:not(:disabled) {
  border-color: var(--danger-strong);
  background: #fee2e2;
  color: var(--danger-strong);
}

.runtime-message {
  min-height: 32px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
  font-weight: 700;
}

.runtime-message[data-tone="success"] {
  color: #0f766e;
}

.runtime-message[data-tone="warning"] {
  color: #b45309;
}

.runtime-message[data-tone="error"] {
  color: #b91c1c;
}

.result-panel {
  display: grid;
  gap: 18px;
  margin-top: 20px;
  padding: 22px;
}

.result-panel[hidden] {
  display: none;
}

audio {
  width: 100%;
}

.upload-panel {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.upload-panel[hidden] {
  display: none;
}

.upload-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: #314257;
  font-size: 18px;
  font-weight: 900;
}

progress {
  width: 100%;
  height: 18px;
  accent-color: var(--primary);
}

.upload-result {
  min-height: 28px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.playback-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.playback-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.playback-header span {
  color: var(--muted);
  font-size: 16px;
  font-weight: 900;
}

.playback-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 160px));
  gap: 10px;
}

.playback-actions button {
  min-height: 48px;
  font-size: 16px;
}

.result-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.list-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 16px;
  align-items: end;
  padding: 20px;
}

.search-field {
  min-width: 0;
}

.meetings-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.4fr);
  gap: 20px;
  margin-top: 20px;
}

.meetings-list-panel,
.meeting-detail-panel {
  min-height: 520px;
  padding: 22px;
}

.section-heading {
  margin-bottom: 16px;
}

.meetings-list {
  display: grid;
  gap: 10px;
}

.meeting-list-item {
  display: grid;
  gap: 6px;
  width: 100%;
  min-height: 78px;
  padding: 14px;
  border-color: var(--line);
  text-align: left;
  background: #ffffff;
}

.meeting-list-item.selected,
.meeting-list-item:hover {
  border-color: var(--primary);
  background: #f0fdfa;
}

.meeting-item-title {
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.meeting-item-meta {
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

.empty-state {
  display: grid;
  min-height: 140px;
  place-items: center;
  color: var(--muted);
  font-size: 18px;
  font-weight: 800;
  text-align: center;
}

.error-text {
  color: #b91c1c;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.detail-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 10px;
}

.detail-actions button {
  min-height: 54px;
  font-size: 17px;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.detail-meta div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.detail-meta dt {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.detail-meta dd {
  margin: 6px 0 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.detail-section {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.detail-section h3,
.analysis-content h4 {
  margin: 0;
  color: var(--text);
  letter-spacing: 0;
}

.detail-section h3 {
  font-size: 22px;
}

.transcript-text,
.analysis-content {
  max-height: 360px;
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 16px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.analysis-content {
  display: grid;
  gap: 16px;
  white-space: normal;
}

.analysis-content p,
.analysis-content ul {
  margin: 8px 0 0;
}

.analysis-content li {
  margin: 8px 0;
}

@media (max-width: 800px) {
  .app-shell {
    padding: 18px;
  }

  .top-bar,
  .timer-block {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    font-size: 34px;
  }

  .field-grid,
  .environment-toolbar,
  .controls,
  .result-actions,
  .list-toolbar,
  .admin-summary,
  .meetings-layout,
  .detail-meta,
  .detail-actions {
    grid-template-columns: 1fr;
  }

  .detail-header {
    flex-direction: column;
  }

  .environment-details li {
    grid-template-columns: 1fr;
  }

  .top-actions {
    justify-content: stretch;
  }

  .top-actions > * {
    flex: 1 1 100%;
  }

  .view-tabs {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .admin-list-item {
    grid-template-columns: 1fr;
  }

  .admin-list-actions {
    justify-content: stretch;
  }

  .playback-header {
    align-items: start;
    flex-direction: column;
  }

  .playback-actions {
    grid-template-columns: 1fr;
  }

  .admin-list-actions button {
    flex: 1;
  }

  .timer {
    font-size: 54px;
  }
}
