* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: '72 Brand', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f4f6f8;
  color: #1a1a2e;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Header ── */
.header {
  background: #00144A;
  color: white;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  border-bottom: 3px solid #5D36FF;
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}
.header-brand-logo {
  height: 26px;
  display: block;
  border-radius: 3px;
}
.header-brand-divider {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.25);
}
.header h1 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: rgba(255,255,255,0.9);
}
.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
input[type="date"] {
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  background: rgba(255,255,255,0.1);
  color: white;
  font-size: 14px;
  cursor: pointer;
}
.day-nav {
  padding: 7px 12px;
  font-size: 15px;
  line-height: 1;
}
.today-btn {
  font-size: 12px;
  padding: 7px 12px;
}
.day-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  white-space: nowrap;
}
.day-label.is-today {
  color: #05ABA5;
  background: rgba(5,171,165,0.15);
  padding: 3px 8px;
  border-radius: 10px;
  border: 1px solid rgba(5,171,165,0.3);
}

/* ── Buttons ── */
.btn {
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, transform 0.1s;
}
.btn:hover { opacity: 0.88; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: #006FF3; color: white; }
.btn-secondary { background: rgba(255,255,255,0.15); color: white; border: 1px solid rgba(255,255,255,0.3); }
.btn-outline { background: white; color: #333; border: 1px solid #d0d4e4; }
.btn-outline:hover { background: #f4f6ff; border-color: #006FF3; color: #006FF3; }
.btn-success { background: #05ABA5; color: white; }
.btn-danger { background: #e05a5a; color: white; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.plaud-status {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 12px;
  font-weight: 600;
}
.plaud-status.connected { background: rgba(5,171,165,0.25); color: #00e6e0; border: 1px solid rgba(5,171,165,0.4); }
.plaud-status.disconnected { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.6); border: 1px solid rgba(255,255,255,0.2); cursor: pointer; }
.plaud-status.expiring { background: rgba(245,166,35,0.2); color: #f5a623; border: 1px solid rgba(245,166,35,0.4); cursor: pointer; }
.plaud-status.expired { background: rgba(224,90,90,0.2); color: #e05a5a; border: 1px solid rgba(224,90,90,0.4); cursor: pointer; }

/* ── Side preview panel ── */
.side-preview-panel {
  width: 480px;
  min-width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #e0e4ef;
  background: white;
  overflow: hidden;
}
.side-preview-header {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  border-bottom: 1px solid #e0e4ef;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}


.template-card {
  border: 2px solid #e0e4ef;
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.15s;
  background: white;
}
.template-card:hover { border-color: #006FF3; background: #f8f9ff; }
.template-card.active { border-color: #5D36FF; background: #f0eeff; }
.template-icon { font-size: 20px; margin-bottom: 6px; }
.template-name { font-size: 13px; font-weight: 700; color: #00144A; margin-bottom: 3px; }
.template-desc { font-size: 11px; color: #888; }

.meeting-type-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.meeting-type-badge.internal { background: #eef2ff; color: #3020a0; }
.meeting-type-badge.external { background: #e0faf9; color: #075753; }

.calendar-body-preview {
  border: 1px solid #d8dbe8;
  border-radius: 6px;
  padding: 12px 14px;
  max-height: 300px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.5;
  background: white;
}
.calendar-body-preview * { max-width: 100%; }
.calendar-body-preview img { display: none; } /* hide tracking pixels */
.calendar-body-preview a { color: #006FF3; }

.draft-count {
  display: inline-block;
  background: #006FF3;
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 6px;
  margin-left: 4px;
  vertical-align: middle;
}
.draft-item {
  padding: 12px 16px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.12s;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.draft-item:hover { background: #f8f9ff; }
.draft-item.active { background: #eef2ff; border-left-color: #006FF3; }
.draft-subject {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a2e;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.draft-meta { font-size: 11px; color: #aaa; display: flex; gap: 8px; }

.tab-bar {
  background: white;
  border-bottom: 1px solid #e0e4ef;
  display: flex;
  gap: 0;
  flex-shrink: 0;
  padding: 0 16px;
}
.tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: #888;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}
.tab:hover { color: #444; }
.tab.active { color: #006FF3; border-bottom-color: #006FF3; }

/* ── Tab content ── */
.tab-content {
  display: none;
  flex: 1;
  overflow: hidden;
  flex-direction: row;
}
.tab-content.active { display: flex; }

/* ── Recording list ── */
.recording-item {
  padding: 12px 16px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.12s;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.recording-item:hover { background: #f8f9ff; }
.recording-item.active { background: #eef2ff; border-left-color: #5D36FF; }
.recording-time {
  font-size: 11px;
  color: #5D36FF;
  font-weight: 600;
}
.recording-name {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a2e;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.recording-dur {
  font-size: 11px;
  color: #aaa;
}

/* ── Recording detail ── */
.rec-header { margin-bottom: 4px; }
.rec-header h2 { font-size: 17px; font-weight: 700; color: #00144A; }
.rec-meta { display: flex; gap: 14px; margin-top: 6px; font-size: 12px; color: #666; }

.audio-player {
  width: 100%;
  margin: 4px 0;
  border-radius: 8px;
  accent-color: #5D36FF;
}

.transcript-block {
  margin-bottom: 16px;
}
.transcript-speaker-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.transcript-lines {
  padding-left: 0;
}
.transcript-line {
  font-size: 13px;
  line-height: 1.6;
  color: #1a1a2e;
  margin-bottom: 2px;
}
.transcript-ts {
  font-size: 10px;
  font-weight: 600;
  color: #aaa;
  font-family: monospace;
  margin-right: 6px;
}

.transcript-box {
  background: #f8f9ff;
  border: 1px solid #e0e4ef;
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.7;
  color: #333;
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  font-family: inherit;
}
.transcript-segment {
  margin-bottom: 10px;
}
.transcript-ts {
  font-size: 10px;
  font-weight: 700;
  color: #5D36FF;
  margin-right: 6px;
  font-family: monospace;
}
.transcript-speaker {
  font-weight: 600;
  color: #00144A;
  margin-right: 4px;
}

.summary-display {
  background: #f8f9ff;
  border: 1px solid #e0e4ef;
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.7;
  color: #333;
  max-height: 280px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.toggle-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.btn-toggle {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  border: 1px solid #d8dbe8;
  background: white;
  color: #666;
  cursor: pointer;
  transition: all 0.12s;
}
.btn-toggle.active { background: #5D36FF; color: white; border-color: #5D36FF; }
.btn-toggle:hover:not(.active) { background: #f0f0ff; border-color: #5D36FF; color: #5D36FF; }

/* ── Collapsed meetings panel ── */
.panel-meetings.collapsed {
  width: 36px !important;
  min-width: 36px;
  overflow: hidden;
}
.panel-meetings.collapsed .meeting-list,
.panel-meetings.collapsed .panel-title span {
  display: none;
}
.panel-meetings.collapsed #hideMeetingsBtn {
  transform: rotate(180deg);
  margin: 0 auto;
  display: block;
}
.panel-meetings.collapsed .panel-title {
  justify-content: center;
  padding: 14px 0;
}

/* ── Main ── */
.main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.resize-handle {
  width: 5px;
  flex-shrink: 0;
  background: #e0e4ef;
  cursor: col-resize;
  transition: background 0.15s;
  position: relative;
}
.resize-handle:hover,
.resize-handle.dragging {
  background: #006FF3;
}
.resize-handle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 1px;
  height: 32px;
  background: rgba(255,255,255,0.5);
  border-radius: 1px;
}

/* ── Meeting list panel ── */
.panel-meetings {
  width: 420px;
  min-width: 180px;
  max-width: 600px;
  flex-shrink: 0;
  background: white;
  border-right: 1px solid #e0e4ef;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.panel-title {
  padding: 14px 16px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  border-bottom: 1px solid #f0f2f7;
  flex-shrink: 0;
}
.meeting-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.meeting-item {
  padding: 12px 16px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.12s;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.meeting-item:hover { background: #f8f9ff; }
.meeting-item.active { background: #eef2ff; border-left-color: #006FF3; }
.meeting-time {
  font-size: 11px;
  color: #006FF3;
  font-weight: 600;
}
.meeting-title {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a2e;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.meeting-meta {
  font-size: 11px;
  color: #888;
  display: flex;
  gap: 8px;
}
.match-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.match-exact { background: #d4edda; color: #155724; }
.match-close { background: #d4edda; color: #155724; }
.match-loose { background: #fff3cd; color: #7a5000; }
.match-none { background: #f0f0f0; color: #888; }

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: #aaa;
  font-size: 13px;
  line-height: 1.6;
}

/* ── Editor panel ── */
.panel-editor {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f8f9ff;
}
.editor-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.editor-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  color: #bbb;
}
.editor-placeholder svg { opacity: 0.3; }

.editor-section {
  background: white;
  border-radius: 10px;
  border: 1px solid #e8eaf2;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #006FF3;
  margin-bottom: 10px;
}
.meeting-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.meeting-header-info h2 {
  font-size: 17px;
  font-weight: 700;
  color: #00144A;
}
.meeting-header-info .meta-row {
  display: flex;
  gap: 14px;
  margin-top: 6px;
  font-size: 12px;
  color: #666;
}
.meta-chip {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Plaud match row */
.plaud-match-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.plaud-select {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #d8dbe8;
  border-radius: 6px;
  font-size: 13px;
  color: #1a1a2e;
  background: white;
  cursor: pointer;
}
.plaud-select:focus { outline: none; border-color: #006FF3; box-shadow: 0 0 0 3px rgba(0,111,243,0.12); }

/* Subtitle input */
input.subtitle-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d8dbe8;
  border-radius: 6px;
  font-size: 13px;
  color: #1a1a2e;
}
input.subtitle-input:focus { outline: none; border-color: #006FF3; box-shadow: 0 0 0 3px rgba(0,111,243,0.12); }

/* Summary textarea */
textarea.summary-textarea {
  width: 100%;
  min-height: 160px;
  padding: 10px 12px;
  border: 1px solid #d8dbe8;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.6;
  color: #1a1a2e;
  resize: vertical;
  font-family: inherit;
}
textarea.summary-textarea:focus { outline: none; border-color: #006FF3; box-shadow: 0 0 0 3px rgba(0,111,243,0.12); }

/* Personal note */
textarea.note-textarea {
  width: 100%;
  min-height: 100px;
  padding: 10px 12px;
  border: 1px solid #d8dbe8;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.6;
  color: #1a1a2e;
  resize: vertical;
  font-family: inherit;
}
textarea.note-textarea:focus { outline: none; border-color: #006FF3; box-shadow: 0 0 0 3px rgba(0,111,243,0.12); }

/* Action items */
.action-list { display: flex; flex-direction: column; gap: 8px; }
.action-row {
  display: grid;
  grid-template-columns: 1fr 140px 120px 100px 32px;
  gap: 8px;
  align-items: center;
}
.action-row input, .action-row select {
  padding: 7px 10px;
  border: 1px solid #d8dbe8;
  border-radius: 6px;
  font-size: 12px;
  color: #1a1a2e;
  font-family: inherit;
}
.action-row input:focus, .action-row select:focus { outline: none; border-color: #006FF3; }
.action-header {
  display: grid;
  grid-template-columns: 1fr 140px 120px 100px 32px;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #aaa;
  margin-bottom: 2px;
  padding: 0 2px;
}
.btn-remove {
  width: 28px; height: 28px;
  background: none;
  border: 1px solid #e0e4ef;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
  font-size: 16px;
  line-height: 1;
  transition: all 0.12s;
}
.btn-remove:hover { background: #fde8e8; border-color: #e05a5a; color: #e05a5a; }

/* Recipients */
.recipient-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 12px;
  background: #eef2ff;
  border-radius: 20px;
  font-size: 12px;
  color: #3020a0;
  font-weight: 500;
}
.chip-remove {
  cursor: pointer;
  color: #aab;
  font-size: 14px;
  line-height: 1;
  transition: color 0.1s;
}
.chip-remove:hover { color: #e05a5a; }
.add-recipient {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.add-recipient input {
  flex: 1;
  padding: 7px 12px;
  border: 1px solid #d8dbe8;
  border-radius: 6px;
  font-size: 12px;
}
.add-recipient input:focus { outline: none; border-color: #006FF3; }

/* Footer bar */
.editor-footer {
  background: white;
  border-top: 1px solid #e0e4ef;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.footer-subject {
  flex: 1;
  padding: 8px 14px;
  border: 1px solid #d8dbe8;
  border-radius: 6px;
  font-size: 13px;
  color: #1a1a2e;
}
.footer-subject:focus { outline: none; border-color: #006FF3; box-shadow: 0 0 0 3px rgba(0,111,243,0.12); }

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(0,111,243,0.2);
  border-top-color: #006FF3;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Preview modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal {
  background: white;
  border-radius: 12px;
  width: 90vw;
  max-width: 760px;
  height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e0e4ef;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 15px; font-weight: 700; }
.modal-close {
  cursor: pointer; font-size: 20px; color: #aaa; line-height: 1;
  background: none; border: none;
}
.modal-close:hover { color: #333; }
.modal-body {
  flex: 1;
  overflow: hidden;
}
.modal-body iframe {
  width: 100%; height: 100%; border: none;
}
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid #e0e4ef;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: white;
  z-index: 2000;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  animation: slideIn 0.2s ease;
}
.toast.success { background: #05ABA5; }
.toast.error { background: #e05a5a; }
@keyframes slideIn { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
