:root {
  color-scheme: dark;
  --bg: #07100d;
  --surface: #0d1915;
  --surface-2: #13221d;
  --text: #f7f3e8;
  --muted: #9da9a1;
  --line: rgba(247, 243, 232, 0.10);
  --accent: #f2c45b;
  --accent-2: #2ac17e;
  --accent-text: #10140f;
  --danger: #ff7a52;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  overflow-x: hidden;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(242, 196, 91, 0.10), transparent 260px),
    var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

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

button {
  -webkit-tap-highlight-color: transparent;
}

svg {
  display: block;
  fill: currentColor;
  height: 20px;
  width: 20px;
}

.svg-sprite {
  display: none;
}

.shell {
  min-height: 100vh;
  max-width: none;
  margin: 0 14px;
  overflow: hidden;
  padding: max(16px, env(safe-area-inset-top)) 0 calc(94px + env(safe-area-inset-bottom));
  width: min(362px, calc(100dvw - 28px));
}

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

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

.brand img {
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  height: 44px;
  width: 44px;
}

.brand p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0;
  margin: 0 0 2px;
}

.brand strong {
  display: block;
  font-size: 19px;
  line-height: 1.1;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(31px, 7vw, 44px);
  letter-spacing: 0;
  line-height: 0.96;
  max-width: 9ch;
}

h2 {
  font-size: 18px;
  line-height: 1.15;
}

p,
.empty,
.session {
  color: var(--muted);
}

.session {
  background: rgba(247, 243, 232, 0.06);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 13px;
  margin: 0 0 14px;
  padding: 11px 12px;
}

.icon-btn,
.link-btn {
  align-items: center;
  background: rgba(247, 243, 232, 0.08);
  border: 1px solid var(--line);
  color: var(--text);
  display: inline-flex;
  justify-content: center;
}

.icon-btn {
  border-radius: 16px;
  height: 44px;
  width: 44px;
}

.link-btn {
  border-radius: 999px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 850;
  min-height: 34px;
  padding: 0 12px;
}

.screen {
  display: none;
}

.screen.is-active {
  display: block;
}

.hero-card {
  border-radius: 28px;
  box-shadow: var(--shadow);
  isolation: isolate;
  margin-bottom: 14px;
  min-height: 390px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.hero-media,
.hero-shade {
  inset: 0;
  position: absolute;
}

.hero-media {
  height: 100%;
  object-fit: cover;
  width: 100%;
  z-index: -2;
}

.hero-shade {
  background:
    linear-gradient(180deg, rgba(7, 16, 13, 0.18), rgba(7, 16, 13, 0.20) 30%, rgba(7, 16, 13, 0.88) 86%),
    linear-gradient(90deg, rgba(7, 16, 13, 0.28), transparent 58%);
  z-index: -1;
}

.hero-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
  min-height: 390px;
  padding: 20px;
  width: 100%;
}

.hero-content p {
  font-size: 15px;
  line-height: 1.35;
  margin-top: 10px;
  max-width: 25ch;
}

.pill {
  align-self: flex-start;
  background: rgba(242, 196, 91, 0.16);
  border: 1px solid rgba(242, 196, 91, 0.38);
  border-radius: 999px;
  color: var(--accent);
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 12px;
  padding: 7px 11px;
}

.hero-stats {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 22px;
  max-width: 100%;
  width: 100%;
}

.hero-stats div,
.stat,
.panel,
.result,
.profile-card,
.quick-action {
  background: rgba(247, 243, 232, 0.075);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.hero-stats div {
  border-radius: 18px;
  min-width: 0;
  padding: 12px;
}

.hero-stats strong,
.stat strong {
  display: block;
  font-size: 25px;
}

.hero-stats span,
.stat span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 750;
  margin-top: 2px;
}

.quick-grid,
.stats-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
  width: 100%;
}

.quick-action {
  align-items: flex-start;
  border-radius: 20px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 96px;
  min-width: 0;
  padding: 15px;
  text-align: left;
}

.quick-action svg {
  color: var(--accent);
  height: 24px;
  width: 24px;
}

.quick-action span {
  font-size: 15px;
  font-weight: 850;
}

.panel,
.result,
.profile-card,
.stat {
  border-radius: 22px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

.panel,
.result {
  margin-bottom: 14px;
  padding: 16px;
}

.profile-card {
  margin-bottom: 12px;
  padding: 18px;
}

.section-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-head.compact {
  margin-bottom: 8px;
}

.section-head span {
  color: var(--accent);
  display: block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.segment {
  background: rgba(247, 243, 232, 0.07);
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 12px;
  padding: 5px;
}

.segment button {
  background: transparent;
  border: 0;
  border-radius: 14px;
  color: var(--muted);
  font-weight: 850;
  min-height: 43px;
}

.segment button.is-active {
  background: var(--text);
  color: var(--accent-text);
}

.predict-mode {
  display: none;
}

.predict-mode.is-active {
  display: block;
}

label {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin: 13px 0 7px;
}

select,
input,
textarea {
  background: rgba(7, 16, 13, 0.68);
  border: 1px solid rgba(247, 243, 232, 0.14);
  border-radius: 15px;
  color: var(--text);
  min-height: 50px;
  outline: none;
  padding: 0 13px;
  width: 100%;
}

textarea {
  line-height: 1.35;
  padding: 12px;
  resize: vertical;
}

button:not(.icon-btn):not(.link-btn):not(.quick-action):not(.tabbar button):not(.segment button) {
  background: var(--accent);
  border: 0;
  border-radius: 15px;
  color: var(--accent-text);
  font-weight: 950;
  margin-top: 14px;
  min-height: 50px;
  padding: 0 16px;
  width: 100%;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

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

.list-item {
  background: rgba(7, 16, 13, 0.48);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 13px;
}

.list-item strong {
  display: block;
  margin-bottom: 5px;
}

.list-item p {
  font-size: 13px;
  line-height: 1.35;
}

.grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 10px;
}

.metric {
  background: rgba(7, 16, 13, 0.54);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 11px;
}

.metric span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  min-height: 32px;
}

.metric strong {
  display: block;
  font-size: 20px;
}

.stat {
  min-height: 84px;
  padding: 15px;
}

.faq {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

details {
  background: rgba(7, 16, 13, 0.48);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px;
}

summary {
  cursor: pointer;
  font-weight: 850;
}

details p {
  font-size: 13px;
  line-height: 1.4;
  margin-top: 8px;
}

.tabbar {
  background: rgba(13, 25, 21, 0.97);
  border: 1px solid var(--line);
  border-radius: 24px;
  bottom: max(12px, env(safe-area-inset-bottom));
  box-shadow: var(--shadow);
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  left: 14px;
  max-width: none;
  padding: 5px;
  position: fixed;
  transform: none;
  width: min(362px, calc(100dvw - 18px));
  z-index: 20;
}

.tabbar button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 18px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  font-size: 11px;
  font-weight: 850;
  gap: 3px;
  min-height: 52px;
  min-width: 0;
  justify-content: center;
}

.tabbar svg {
  height: 19px;
  width: 19px;
}

.tabbar span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.tabbar button.is-active {
  background: rgba(242, 196, 91, 0.14);
  color: var(--accent);
}

.empty {
  background: rgba(7, 16, 13, 0.42);
  border: 1px dashed rgba(247, 243, 232, 0.16);
  border-radius: 18px;
  font-size: 13px;
  padding: 14px;
}

.danger {
  color: var(--danger);
}

@media (min-width: 640px) {
  .shell {
    margin: 0 auto;
    width: min(720px, calc(100dvw - 48px));
  }

  .tabbar {
    left: 50%;
    transform: translateX(-50%);
    width: min(688px, calc(100dvw - 48px));
  }

  .quick-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
