*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

[hidden] {
  display: none !important;
}

:root {
  color-scheme: dark;
  --bg: #070914;
  --surface: #111624;
  --surface-2: #171d2d;
  --surface-hover: #1c2435;
  --border: rgba(226, 232, 240, 0.1);
  --border-strong: rgba(226, 232, 240, 0.18);
  --text: #eef2ff;
  --muted: #9aa6bd;
  --dim: #647085;
  --ok: #34d399;
  --warn: #fbbf24;
  --down: #fb7185;
  --cyan: #67e8f9;
  --radius: 8px;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html {
  min-height: 100%;
  font-size: 16px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(8, 13, 27, 0.98)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 120px);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button,
input,
select,
textarea {
  border: 0;
}

.shell {
  width: min(1160px, calc(100% - 32px));
  margin-inline: auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 32px 0 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand-mark {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  object-fit: cover;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
}

.brand h1 {
  display: inline-block;
  margin-top: 4px;
  background: linear-gradient(135deg, #38bdf8 0%, #c084fc 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: clamp(2rem, 6vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.eyebrow,
.section-kicker {
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.subtitle {
  max-width: 560px;
  margin-top: 10px;
  color: var(--muted);
  font-size: clamp(0.95rem, 2vw, 1.05rem);
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(92px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.metric {
  min-width: 92px;
  padding: 13px 14px;
  background: rgba(17, 22, 36, 0.78);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.metric-value {
  display: block;
  color: #fff;
  font-size: 0.96rem;
  font-weight: 800;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.metric-label {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.control-bar,
.composer,
.review,
.log {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(17, 22, 36, 0.74);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(14px);
}

.control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
}

.composer,
.review {
  padding: 18px;
}

.composer textarea {
  margin-top: 10px;
  resize: vertical;
}

.review {
  margin-top: 16px;
}

.segments {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(7, 9, 20, 0.45);
}

.segment,
button {
  min-height: 38px;
  padding: 0 14px;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
}

.segment {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.segment.is-active,
.segment.active,
.primary {
  color: #062027;
  background: var(--cyan);
  border-color: transparent;
  font-weight: 800;
  box-shadow: 0 10px 28px rgba(103, 232, 249, 0.16);
}

.icon-button,
.ghost,
.small {
  color: var(--text);
  background: rgba(17, 22, 36, 0.82);
  border: 1px solid var(--border);
}

button:hover {
  background: rgba(103, 232, 249, 0.1);
  border-color: rgba(103, 232, 249, 0.32);
}

.voice.listening {
  color: #062027;
  background: var(--cyan);
}

.actions,
.reviewHead,
.panelTitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.actions {
  margin-top: 14px;
}

.input-label,
label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

textarea,
input,
select {
  width: 100%;
  min-height: 42px;
  padding: 11px 12px;
  color: var(--text);
  background: rgba(7, 9, 20, 0.58);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
}

textarea:focus,
input:focus,
select:focus {
  border-color: rgba(103, 232, 249, 0.62);
  box-shadow: 0 0 0 3px rgba(103, 232, 249, 0.1);
}

textarea::placeholder,
input::placeholder {
  color: var(--dim);
}

.grid,
.cards {
  display: grid;
  gap: 12px;
}

.grid {
  grid-template-columns: minmax(0, 1.5fr) minmax(180px, 0.7fr);
  margin: 18px 0 12px;
}

.cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 12px 0;
}

.panel {
  padding: 14px;
  background: rgba(7, 9, 20, 0.28);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.panel > * + * {
  margin-top: 12px;
}

.toggle {
  display: inline-flex;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.toggle input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  accent-color: var(--cyan);
}

.small {
  min-height: 32px;
  padding: 0 10px;
}

.danger {
  color: #fecdd3;
}

.reminder {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 170px auto;
  gap: 10px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.reminder textarea {
  grid-column: 2 / 4;
}

.log {
  margin-top: 16px;
  min-height: 46px;
  padding: 12px 14px;
  color: var(--muted);
}

.log:empty {
  display: none;
}

@media (max-width: 780px) {
  .hero,
  .control-bar,
  .actions,
  .reviewHead {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .hero,
  .control-bar,
  .actions,
  .reviewHead {
    flex-direction: column;
  }

  .brand {
    align-items: flex-start;
  }

  .brand-mark {
    width: 56px;
    height: 56px;
  }

  .hero-meta,
  .grid,
  .cards,
  .reminder {
    grid-template-columns: 1fr;
  }

  .reminder textarea {
    grid-column: auto;
  }

  .segments {
    width: 100%;
  }

  .segment {
    flex: 1;
  }
}

/* Typography: Outfit for headers */
h1, h2, h3, .brand h1, .section-kicker, .eyebrow, .tab-btn {
  font-family: 'Outfit', 'Inter', sans-serif;
  letter-spacing: -0.02em;
}

/* Tabs & Navigation */
.tab-nav {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  margin-bottom: 24px;
  padding: 6px;
  background: rgba(17, 22, 36, 0.65);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-btn i, .tab-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2px;
}

.tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.is-active {
  color: #062027;
  background: linear-gradient(135deg, #67e8f9 0%, #c084fc 100%);
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(103, 232, 249, 0.22);
  border-color: transparent;
}

/* Tab Views Show/Hide */
.tab-view {
  display: none !important;
}

.tab-view.is-active {
  display: block !important;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Contact Details View Styles */
.contact-details-view {
  background: rgba(17, 22, 36, 0.74);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.info-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--dim);
  text-align: center;
}

.placeholder-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  color: var(--dim);
  opacity: 0.6;
}

.contact-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.contact-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8 0%, #c084fc 100%);
  color: #070914;
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(192, 132, 252, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.contact-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.contact-header .eyebrow {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--cyan);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: rgba(7, 9, 20, 0.38);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s ease;
}

.info-item:hover {
  border-color: var(--border-strong);
}

.info-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.info-label i, .info-label svg {
  width: 14px;
  height: 14px;
  color: var(--cyan);
}

.info-value {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text);
  overflow-wrap: break-word;
}

/* New Contact Form Styles */
.new-contact-form {
  margin-top: 0;
}

.new-contact-form form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 24px;
}

.new-contact-form label {
  font-weight: 600;
  color: var(--text);
}

.new-contact-form label input,
.new-contact-form label textarea {
  margin-top: 6px;
}

/* Voice Microphone Pulsing Recording Animation */
.mic-pulse-circle {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  margin-right: 8px;
  transition: all 0.3s ease;
}

.mic-pulse-circle.recording {
  background: var(--down);
  box-shadow: 0 0 0 0 rgba(251, 113, 133, 0.7);
  animation: mic-pulse 1.5s infinite ease-in-out;
}

@keyframes mic-pulse {
  0% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(251, 113, 133, 0.8);
  }
  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 10px rgba(251, 113, 133, 0);
  }
  100% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(251, 113, 133, 0);
  }
}
