:root {
  --bg-hue: 215;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-secondary: #ffffff;
  --text: #1a1f2b;
  --muted: #6f7687;
  --line: #e4e8f0;
  --accent: #0f62fe;
  --accent-soft: #eef4ff;
  --success-soft: #f0fdf4;
  --danger-soft: #fff5f5;
  --shadow: 0 6px 22px rgba(10, 20, 40, 0.04);
  --radius-xl: 14px;
  --radius-lg: 10px;
  --radius-md: 10px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "SF Pro Display", "Helvetica Neue", sans-serif;
  color: var(--text);
  background-color: hsl(var(--bg-hue) 48% 96%);
  background-image: radial-gradient(circle at top right, hsl(var(--bg-hue) 78% 88%), hsl(var(--bg-hue) 48% 96%) 42%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  max-width: 860px;
  margin: 0 auto;
  padding: 14px 14px 64px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 8px;
}

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

h1 {
  margin: 4px 0 12px;
  font-size: 20px;
}

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

.muted,
.profile-label {
  color: var(--muted);
}

.nav-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.screen {
  display: none;
  margin-top: 0;
}

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

.panel-stack {
  display: grid;
  gap: 10px;
}

.panel {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.compact-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

input,
select,
.filter-check,
.primary,
.ghost {
  min-height: 42px;
  border-radius: 10px;
}

input,
select {
  width: 100%;
  padding: 10px;
  color: var(--text);
  border: 1px solid var(--line);
  background: #fff;
  outline: none;
}

input:focus,
select:focus {
  border-color: rgba(15, 98, 254, 0.35);
  box-shadow: 0 0 0 3px rgba(15, 98, 254, 0.08);
}

.filter-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.filter-check input {
  width: 18px;
  height: 18px;
  min-height: auto;
  margin: 0;
}

.wide-button {
  grid-column: 1 / -1;
}

.primary,
.ghost {
  padding: 8px 10px;
}

.primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  font-weight: 600;
}

.ghost {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

.cards {
  display: grid;
  gap: 10px;
}

.card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 6px;
  font-size: 17px;
  line-height: 1.2;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.card-grid,
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.card-grid {
  margin-top: 12px;
}

.card-grid > div,
.profile-item {
  padding: 12px;
  border-radius: 10px;
  background: #f8fafc;
  line-height: 1.35;
}

.card-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.card-actions > * {
  flex: 1 1 180px;
}

.profile-panel {
  background: var(--surface);
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  transform: none;
  width: 100%;
  max-width: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 0 8px env(safe-area-inset-bottom);
  border-top: 1px solid var(--line);
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  align-items: center;
  min-height: 44px;
  overflow: visible;
  z-index: 15;
}

.nav-item {
  min-height: 30px;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 6px;
  line-height: 1;
}

.nav-item.is-active {
  color: var(--accent);
  font-weight: 600;
}

.nav-label {
  font-size: 10px;
  line-height: 1;
}

.platform-android .app-shell {
  padding-bottom: 96px;
}

.platform-android .bottom-nav {
  padding-bottom: 0;
  min-height: 56px;
}

.platform-ios .app-shell {
  padding-bottom: 104px;
}

.platform-ios .bottom-nav {
  padding-bottom: calc(env(safe-area-inset-bottom) + 8px);
  min-height: 52px;
}

@media (max-width: 720px) {
  .app-shell {
    padding: 12px 12px 64px;
  }

  .user-strip,
  .panel,
  .card {
    border-radius: 14px;
  }

  .card-head {
    flex-direction: column;
  }

  .bottom-nav {
    padding: 0 8px env(safe-area-inset-bottom);
  }
}
