:root {
  --bg-deep: #04070d;
  --bg-panel: rgba(13, 22, 36, 0.78);
  --bg-panel-strong: rgba(9, 17, 31, 0.92);
  --line-soft: rgba(118, 166, 216, 0.18);
  --line-strong: rgba(118, 166, 216, 0.38);
  --text-main: #edf6ff;
  --text-soft: #9db7d4;
  --accent-cyan: #39e6da;
  --accent-blue: #55a8ff;
  --accent-gold: #ffba65;
  --danger: #ff6e86;
  --ok: #74e59b;
  --radius-xl: 26px;
  --radius-lg: 18px;
  --radius-md: 13px;
  --shadow-main: 0 24px 60px rgba(0, 0, 0, 0.42);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text-main);
  background: radial-gradient(circle at 8% -18%, #183256 0%, #0b1524 40%, var(--bg-deep) 78%);
}

body {
  position: relative;
  overflow-x: hidden;
}

.grid-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(95, 140, 196, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(95, 140, 196, 0.08) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.22;
}

.aurora {
  position: fixed;
  border-radius: 999px;
  filter: blur(12px);
  pointer-events: none;
  z-index: 0;
}

.aurora-one {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(57, 230, 218, 0.36), rgba(57, 230, 218, 0));
  top: -120px;
  left: -100px;
  animation: float 12s ease-in-out infinite;
}

.aurora-two {
  width: 390px;
  height: 390px;
  background: radial-gradient(circle, rgba(255, 186, 101, 0.3), rgba(255, 186, 101, 0));
  right: -120px;
  top: 320px;
  animation: float 14s ease-in-out infinite reverse;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1200px, calc(100% - 26px));
  margin: 0 auto;
  padding: calc(14px + var(--safe-top)) 0 calc(26px + var(--safe-bottom));
  display: grid;
  gap: 14px;
}

.panel {
  border-radius: var(--radius-xl);
  border: 1px solid var(--line-soft);
  background: linear-gradient(130deg, var(--bg-panel), var(--bg-panel-strong));
  box-shadow: var(--shadow-main);
  backdrop-filter: blur(14px);
  padding: 18px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(57, 230, 218, 0.36), rgba(85, 168, 255, 0.3));
  border: 1px solid rgba(120, 212, 255, 0.42);
  display: grid;
  place-items: center;
  font-family: "Sora", sans-serif;
  font-weight: 800;
}

.eyebrow {
  margin: 0;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 700;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: "Sora", sans-serif;
}

h1 {
  margin-top: 4px;
  font-size: clamp(26px, 4.1vw, 34px);
  line-height: 1.02;
}

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

.badge {
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border: 1px solid var(--line-soft);
}

.badge-free {
  background: rgba(128, 159, 194, 0.18);
  color: #d4e3f3;
}

.badge-pro {
  background: linear-gradient(135deg, rgba(255, 186, 101, 0.34), rgba(85, 168, 255, 0.38));
  color: #fff1df;
  border-color: rgba(255, 198, 130, 0.48);
}

.badge-ai {
  background: rgba(57, 230, 218, 0.17);
  color: #a9fff8;
  border-color: rgba(57, 230, 218, 0.38);
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 14px;
}

.hero-kicker {
  margin: 0;
  color: var(--accent-blue);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 12px;
  font-weight: 700;
}

.hero h2 {
  margin-top: 10px;
  font-size: clamp(25px, 3.7vw, 38px);
  line-height: 1.06;
}

.hero-subtitle {
  margin: 12px 0 0;
  color: var(--text-soft);
  max-width: 650px;
}

.hero-cta {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.metric-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
  background: rgba(13, 24, 40, 0.66);
  padding: 12px;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-card span {
  font-size: 12px;
  color: var(--text-soft);
}

.metric-card strong {
  font-family: "Sora", sans-serif;
  font-size: clamp(21px, 3vw, 29px);
}

.workspace-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 14px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.section-head p {
  margin: 6px 0 0;
  color: var(--text-soft);
}

.row {
  align-items: center;
}

.trial-line {
  margin: 10px 0 0;
  color: #b7cbe2;
  font-size: 13px;
}

.ai-messages {
  margin-top: 12px;
  min-height: 260px;
  max-height: 460px;
  overflow: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
  padding: 10px;
  display: grid;
  gap: 8px;
  background: rgba(5, 11, 21, 0.7);
}

.ai-empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  padding: 14px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.45;
}

.msg {
  max-width: 88%;
  border-radius: 14px;
  padding: 9px 11px;
  font-size: 14px;
  line-height: 1.44;
  white-space: pre-wrap;
}

.msg.user {
  justify-self: end;
  background: linear-gradient(145deg, rgba(85, 168, 255, 0.34), rgba(85, 168, 255, 0.18));
  border: 1px solid rgba(130, 194, 255, 0.34);
}

.msg.assistant {
  justify-self: start;
  background: linear-gradient(145deg, rgba(57, 230, 218, 0.24), rgba(57, 230, 218, 0.1));
  border: 1px solid rgba(95, 236, 226, 0.28);
}

.msg-meta {
  margin-top: 6px;
  color: rgba(184, 205, 228, 0.82);
  font-size: 11px;
}

.suggestions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.suggestion-btn {
  border: 1px solid rgba(85, 168, 255, 0.34);
  border-radius: 999px;
  background: rgba(21, 41, 67, 0.7);
  color: #cce8ff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  cursor: pointer;
}

.suggestion-btn:hover {
  background: rgba(32, 56, 86, 0.84);
}

.ai-form {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.ai-form textarea {
  min-height: 106px;
  resize: vertical;
}

.ai-form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.context-hint {
  font-size: 12px;
  color: #9fc8f4;
}

.reminder-form {
  margin-top: 12px;
  display: grid;
  gap: 11px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #d4e6f9;
}

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

input,
select,
textarea {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: rgba(7, 13, 24, 0.82);
  color: var(--text-main);
  padding: 10px 12px;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(85, 168, 255, 0.78);
  box-shadow: 0 0 0 3px rgba(85, 168, 255, 0.16);
}

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

.money-row {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 8px;
}

.btn {
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  padding: 9px 12px;
  font-weight: 700;
  transition: transform 140ms ease, filter 140ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.btn.primary {
  background: linear-gradient(135deg, #39e6da 0%, #55a8ff 100%);
  color: #042030;
  font-weight: 800;
}

.btn.ghost {
  border: 1px solid var(--line-soft);
  background: rgba(18, 31, 49, 0.86);
  color: #d6e9ff;
}

.btn.small {
  padding: 7px 10px;
  font-size: 12px;
}

.btn.wide {
  width: 100%;
}

.cockpit-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: 12px;
}

.timeline-block h4,
.cockpit-grid h4 {
  margin: 0;
  color: #d4e8ff;
  font-size: 14px;
  font-weight: 700;
}

.timeline-list {
  margin-top: 10px;
  display: grid;
  gap: 7px;
}

.timeline-item {
  border: 1px solid var(--line-soft);
  background: rgba(9, 17, 30, 0.78);
  border-radius: 12px;
  padding: 9px;
  display: grid;
  gap: 5px;
}

.timeline-item strong {
  font-size: 13px;
}

.timeline-item p {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
}

.reminders-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.reminder-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
  background: rgba(8, 15, 27, 0.75);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.reminder-title {
  margin: 0;
  font-size: 16px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: rgba(27, 43, 64, 0.62);
  color: #d7e8fa;
  padding: 4px 10px;
  font-size: 12px;
}

.chip.alert {
  border-color: rgba(255, 186, 101, 0.55);
  background: rgba(255, 186, 101, 0.17);
  color: #ffe3bf;
}

.chip.done {
  border-color: rgba(116, 229, 155, 0.46);
  background: rgba(116, 229, 155, 0.14);
  color: #caf9dd;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mini-btn,
.danger-btn,
.ask-btn {
  border: 0;
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.mini-btn {
  border: 1px solid rgba(57, 230, 218, 0.43);
  background: rgba(57, 230, 218, 0.16);
  color: #9efff6;
}

.ask-btn {
  border: 1px solid rgba(85, 168, 255, 0.4);
  background: rgba(85, 168, 255, 0.16);
  color: #cbe7ff;
}

.danger-btn {
  border: 1px solid rgba(255, 110, 134, 0.38);
  background: rgba(255, 110, 134, 0.17);
  color: #ffd4dd;
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 16px;
  color: var(--text-soft);
  text-align: center;
  font-size: 13px;
}

.plans-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.plan-card {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(123, 173, 229, 0.25);
  background: radial-gradient(circle at top right, rgba(57, 230, 218, 0.14), rgba(8, 15, 28, 0.85));
  padding: 13px;
  display: grid;
  gap: 9px;
}

.plan-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.price {
  font-family: "Sora", sans-serif;
  font-size: 25px;
  font-weight: 700;
}

.plan-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-soft);
  display: grid;
  gap: 4px;
  font-size: 13px;
}

.plan-btn {
  border: 0;
  border-radius: 11px;
  padding: 9px 11px;
  font-weight: 800;
  background: linear-gradient(135deg, #ffba65, #ff9462);
  color: #2a1100;
  cursor: pointer;
}

.plan-btn.disabled {
  pointer-events: none;
  background: rgba(136, 168, 198, 0.22);
  color: #d9e9fa;
}

.footer-note {
  text-align: center;
  color: rgba(158, 183, 209, 0.7);
  font-size: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + var(--safe-bottom));
  transform: translate(-50%, 14px);
  background: rgba(8, 17, 31, 0.96);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: #f2f8ff;
  padding: 10px 14px;
  box-shadow: var(--shadow-main);
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease;
  max-width: min(560px, calc(100% - 26px));
  z-index: 50;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-14px) scale(1.04);
  }
}

@media (max-width: 1080px) {
  .hero,
  .workspace-grid,
  .cockpit-grid,
  .plans-grid,
  .form-grid-2 {
    grid-template-columns: 1fr;
  }

  .hero-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 740px) {
  .shell {
    width: calc(100% - 16px);
    padding-top: calc(10px + var(--safe-top));
  }

  .panel {
    padding: 14px;
  }

  .topbar,
  .section-head,
  .ai-form-footer,
  .top-actions,
  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .top-actions {
    gap: 6px;
  }

  .msg {
    max-width: 100%;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }
}
