:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --sidebar: #0f172a;
  --text: #111827;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --border: #e5e7eb;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --success: #16a34a;
  --warning-bg: #fff7ed;
  --warning-border: #fed7aa;
  --warning-text: #9a3412;
  --shadow: 0 16px 42px rgba(15, 23, 42, 0.075);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 13px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.10), transparent 34%),
    var(--bg);
  color: var(--text);
}

button,
input {
  font-family: inherit;
}

.app-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 14px;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(59, 130, 246, 0.16), transparent 28%),
    var(--sidebar);
  color: #ffffff;
}

.brand {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 4px 6px 20px;
}

.brand-logo {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 15px;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.32);
  font-size: 22px;
  font-weight: 900;
}

.brand-title {
  margin-top: 1px;
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
}

.brand-line {
  margin-top: 7px;
  color: #dbeafe;
  font-size: 12px;
  line-height: 1.25;
}

.brand-line-muted {
  margin-top: 2px;
  color: var(--muted-2);
}

.search-box {
  position: relative;
  margin: 0 4px 18px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 14px;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 34px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 13px;
  outline: none;
  background: rgba(255, 255, 255, 0.075);
  color: #ffffff;
  font-size: 13px;
}

.search-box input::placeholder {
  color: #94a3b8;
}

.search-box input:focus {
  border-color: rgba(147, 197, 253, 0.62);
  background: rgba(255, 255, 255, 0.105);
}

.sidebar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 6px 9px;
}

.sidebar-section-title {
  color: #dbeafe;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.records-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.record-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 58px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.052);
  color: #ffffff;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.record-link:hover,
.record-link.is-active {
  border-color: rgba(147, 197, 253, 0.34);
  background: rgba(255, 255, 255, 0.10);
}

.record-link:hover {
  transform: translateY(-1px);
}

.record-open {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
  padding: 9px 2px 9px 9px;
  color: inherit;
  text-decoration: none;
}

.record-main {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.record-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(147, 197, 253, 0.13);
  color: #bfdbfe;
  font-size: 14px;
}

.record-info {
  min-width: 0;
}

.record-link-title {
  overflow: hidden;
  margin-bottom: 4px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-link-meta {
  display: flex;
  gap: 8px;
  color: #94a3b8;
  font-size: 11px;
}

.record-delete-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 58px;
  margin-right: 4px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
}

.record-delete-button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.record-delete-button:hover {
  background: rgba(220, 38, 38, 0.12);
  color: #fca5a5;
}

.records-empty {
  margin: 6px;
  padding: 15px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.45;
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.upload-card,
.status-card,
.record-card,
.transcript-card,
.empty-workspace {
  max-width: 1240px;
  margin-right: auto;
  margin-left: auto;
}

.upload-card {
  display: grid;
  grid-template-columns: 38% 1fr;
  gap: 12px;
  align-items: center;
  padding: 18px 22px;
  margin-bottom: 16px;
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 96% 18%, rgba(59, 130, 246, 0.16), transparent 26%),
    linear-gradient(115deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.98) 38%, rgba(239, 246, 255, 0.92) 100%);
  box-shadow: var(--shadow);
}

.section-label {
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.upload-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100%;
  padding: 0 34px;
  text-align: center;
}

.upload-copy h1 {
  margin: 0 0 6px;
  font-size: 30px;
  line-height: 1.16;
  letter-spacing: -0.045em;
  color: #1e3a8a;
  font-weight: 800;
}

.upload-copy p {
  margin: 0;
  color: #1e3a8a;
  font-size: 26px;
  line-height: 1.16;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.upload-form {
  display: grid;
  gap: 8px;
}

.dropzone {
  display: grid;
  place-items: center;
  min-height: 108px;
  padding: 12px;
  border: 1.5px dashed #bfdbfe;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at top, rgba(37, 99, 235, 0.07), transparent 45%),
    #ffffff;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-1px);
}

.dropzone.has-file {
  border-color: rgba(22, 163, 74, 0.58);
  background:
    radial-gradient(circle at top, rgba(22, 163, 74, 0.08), transparent 45%),
    #ffffff;
}

.dropzone.is-processing {
  pointer-events: none;
  cursor: wait;
  opacity: 0.68;
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.dropzone-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 6px;
  border-radius: 16px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 22px;
  font-weight: 900;
}

.dropzone-title {
  max-width: 310px;
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.32;
}

.dropzone-subtitle {
  max-width: 310px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.selected-file {
  width: 100%;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 13px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  text-align: left;
  transition: background 0.16s ease, color 0.16s ease;
}

.selected-file.is-ready {
  background: #f0fdf4;
  color: #166534;
}

.selected-file-status {
  font-weight: 900;
}

.selected-file-name {
  margin-top: 3px;
  overflow: hidden;
  color: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-button,
.secondary-button,
.save-title-button,
.modal-cancel-button,
.modal-delete-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 13px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.primary-button {
  width: 100%;
  min-height: 36px;
  border: 0;
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.22);
}

.primary-button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: wait;
  background: #93a9d1;
  box-shadow: none;
  transform: none;
}

.secondary-button,
.save-title-button,
.modal-cancel-button {
  border: 1px solid #c7d2fe;
  background: #ffffff;
  color: #1e3a8a;
}

.secondary-button:hover,
.save-title-button:hover,
.modal-cancel-button:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.modal-delete-button {
  border: 1px solid var(--danger);
  background: var(--danger);
  color: #ffffff;
}

.modal-delete-button:hover {
  background: #b91c1c;
}

.status-card {
  padding: 13px 15px;
  margin-bottom: 16px;
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-lg);
  background: var(--warning-bg);
  color: var(--warning-text);
  font-size: 13px;
  line-height: 1.45;
}

.record-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.rename-form {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
}

.record-title-input {
  width: min(520px, 100%);
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 13px;
  outline: none;
  background: #ffffff;
  color: var(--text);
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.035em;
}

.record-title-input:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.25);
}

.record-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.record-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  min-width: 285px;
}

.record-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-soft);
  color: #374151;
  font-size: 12px;
  font-weight: 850;
}

.transcript-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

.transcript-header h2 {
  margin: 0;
  font-size: 23px;
  letter-spacing: -0.035em;
}

.text-block-title {
  margin-bottom: 9px;
  color: #374151;
  font-size: 14px;
  font-weight: 900;
}

pre {
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #f8fafc;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14.5px;
  line-height: 1.66;
}

.full-text-details {
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

.full-text-details summary {
  cursor: pointer;
  font-weight: 900;
}

.full-text-details pre {
  margin-top: 8px;
}

.export-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.export-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  column-gap: 12px;
  row-gap: 8px;
  margin-bottom: 10px;
}

.export-row:last-child {
  margin-bottom: 0;
}

.export-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.export-label {
  font-size: 12px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: 0.04em;
}

.export-title {
  font-size: 13px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 10px;
}

.export-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  color: #1e40af;
  text-decoration: none;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.export-link:hover {
  border-color: #93c5fd;
  background: #dbeafe;
}

.empty-workspace {
  display: grid;
  place-items: center;
  min-height: 285px;
  padding: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow);
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
  border-radius: 20px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 28px;
  font-weight: 900;
}

.empty-workspace h2 {
  margin: 0 0 8px;
  font-size: 21px;
  letter-spacing: -0.03em;
}

.empty-workspace p {
  margin: 0;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1000;
  transform: translateY(12px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 14px;
  border: 1px solid #bbf7d0;
  border-radius: 14px;
  background: #f0fdf4;
  color: #166534;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
  font-size: 13px;
  font-weight: 900;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.48);
}

.modal-overlay.is-visible {
  display: grid;
}

.modal-dialog {
  width: min(420px, 100%);
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.modal-dialog h2 {
  margin: 0;
  color: var(--text);
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.035em;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
}

@media (max-width: 1080px) {
  .upload-card {
    grid-template-columns: 1fr;
  }

  .record-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .record-summary {
    justify-content: flex-start;
    min-width: 0;
  }
}

@media (max-width: 860px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    max-height: 350px;
  }

  .workspace {
    padding: 14px;
  }
}

@media (max-width: 560px) {
  .workspace {
    padding: 12px;
  }

  .upload-card,
  .record-card,
  .transcript-card,
  .empty-workspace {
    padding: 16px;
    border-radius: 18px;
  }

  .upload-copy h1 {
    font-size: 25px;
  }

  .dropzone {
    min-height: 160px;
  }

  .transcript-header,
  .rename-form {
    flex-direction: column;
    align-items: stretch;
  }

  .secondary-button,
  .save-title-button {
    width: 100%;
  }
}
