:root {
  --bg: #f1f2f4;
  --panel: #ffffff;
  --line: #d3d6de;
  --ink: #18346d;
  --muted: #7a8395;
  --soft: #edf0f6;
  --green: #cdeec4;
  --brand-deep: #07162d;
  --brand-deep-alt: #0b2146;
  --brand-blue: #1eb3ff;
  --brand-blue-strong: #1486ff;
  --brand-red: #ff3d46;
  --brand-white: #f8fbff;
  --shadow: 0 10px 22px rgba(34, 40, 56, 0.08);
  --radius-card: 28px;
  --radius-nav: 26px;
  --radius-btn: 20px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: Inter, Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(30, 179, 255, 0.08), transparent 20%),
    radial-gradient(circle at top right, rgba(255, 61, 70, 0.05), transparent 18%),
    linear-gradient(180deg, #eef3fa 0%, var(--bg) 28%, #f7f9fc 100%);
  color: var(--ink);
  min-height: 100vh;
  padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px));
}

a {
  color: inherit;
}

.app-shell {
  width: min(100%, 860px);
  margin: 0 auto;
  min-height: 100vh;
}

.screen-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 16px 18px 10px;
  background:
    radial-gradient(circle at left top, rgba(30, 179, 255, 0.2), transparent 24%),
    radial-gradient(circle at right top, rgba(255, 61, 70, 0.16), transparent 20%),
    linear-gradient(135deg, rgba(7, 22, 45, 0.98), rgba(11, 33, 70, 0.95));
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(90, 131, 203, 0.22);
  box-shadow: 0 14px 28px rgba(7, 22, 45, 0.2);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.app-logo {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: rgba(8, 22, 47, 0.92);
  border: 1px solid rgba(30, 179, 255, 0.36);
  box-shadow:
    0 14px 28px rgba(7, 22, 45, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
}

.app-logo img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.headings {
  min-width: 0;
}

.eyebrow {
  color: var(--brand-blue);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
}

.screen-title {
  margin-top: 4px;
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--brand-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.screen-subtitle {
  margin-top: 4px;
  color: rgba(224, 233, 247, 0.78);
  font-size: 0.86rem;
  line-height: 1.35;
}

.icon-btn {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  text-decoration: none;
  border: 1px solid rgba(96, 136, 207, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: var(--brand-white);
  box-shadow: 0 12px 28px rgba(7, 22, 45, 0.18);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  font-weight: 900;
}

.icon-btn:hover,
.icon-btn:focus-visible {
  border-color: rgba(30, 179, 255, 0.4);
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

.screen-body {
  padding: 6px 18px 0;
}

.mobile-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  transform: none;
  bottom: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(14px);
  border-top: 1px solid #d9dce4;
  box-shadow: 0 -8px 24px rgba(38, 44, 58, 0.08);
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 30;
}

.nav-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  width: min(100%, 860px);
  margin: 0 auto;
}

.nav-link {
  text-decoration: none;
  color: #5d6575;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 8px 2px 6px;
  font-size: 0.78rem;
  font-weight: 700;
}

.nav-link svg {
  width: 23px;
  height: 23px;
}

.nav-link.active,
.nav-link[aria-current="page"] {
  color: var(--brand-blue-strong);
}

.nav-indicator {
  display: none !important;
}

.trinity-favoritable {
  position: relative;
}

.trinity-favorite-toggle {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  color: #8a93a6;
  box-shadow: 0 8px 20px rgba(34, 40, 56, 0.08);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.18s ease, color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  z-index: 2;
}

.trinity-favorite-toggle:hover {
  transform: translateY(-1px);
  color: var(--ink);
  border-color: #bfc8d8;
}

.trinity-favorite-toggle svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.trinity-favorite-toggle.is-active {
  color: #d19a09;
  background: #fff8df;
  border-color: #efd48a;
}

.trinity-favoritable.is-favorite {
  border-color: #efd48a;
  box-shadow: 0 14px 28px rgba(209, 154, 9, 0.12);
}

@media (max-width: 420px) {
  .trinity-favorite-toggle {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
  }
}

.auth-card,
.placeholder-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}

.placeholder-card {
  padding: 22px 20px;
}

.app-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: var(--soft);
  display: grid;
  place-items: center;
  color: var(--ink);
  margin-bottom: 16px;
}

.app-card-icon svg {
  width: 28px;
  height: 28px;
}

.placeholder-card h1,
.placeholder-card h2 {
  margin: 0 0 10px;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.placeholder-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--green);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
}

.btn-row {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.btn-app {
  min-height: 54px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 800;
}

.btn-app.primary {
  background: #18346d;
  color: #fff;
  border-color: #18346d;
}

@media (max-width: 420px) {
  .screen-header,
  .screen-body {
    padding-left: 14px;
    padding-right: 14px;
  }

  .screen-title {
    font-size: 1.08rem;
  }
}
