:root {
      --bg: #050816;
      --bg-soft: #0b1020;
      --accent: #6366f1;
      --accent-soft: rgba(99, 102, 241, 0.15);
      --accent-strong: #4f46e5;
      --text: #f9fafb;
      --muted: #9ca3af;
      --danger: #f97373;
      --success: #34d399;
      --border-soft: rgba(148, 163, 184, 0.25);
      --radius-lg: 18px;
      --radius-full: 999px;
      --shadow-soft: 0 18px 60px rgba(15, 23, 42, 0.8);
      --blur-bg: blur(16px);
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    body {
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
        "Segoe UI", sans-serif;
      background: radial-gradient(circle at top, #1f2937 0, #020617 50%, #000 100%);
      color: var(--text);
      min-height: 100vh;
      display: flex;
      justify-content: center;
      padding: 0;
    }

    .app-shell {
      width: 100%;
      max-width: 480px;
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      padding: 16px;
      padding-bottom: 80px; /* room for bottom nav */
      position: relative;
    }

    .glass-card {
      background: linear-gradient(
        135deg,
        rgba(15, 23, 42, 0.9),
        rgba(15, 23, 42, 0.96)
      );
      border-radius: var(--radius-lg);
      border: 1px solid var(--border-soft);
      box-shadow: var(--shadow-soft);
      padding: 20px;
      backdrop-filter: var(--blur-bg);
    }

    .logo {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 24px;
    }

    .logo-icon {
      width: 36px;
      height: 36px;
      border-radius: 12px;
      background: conic-gradient(
        from 160deg,
        #4f46e5,
        #ec4899,
        #22c55e,
        #4f46e5
      );
      display: flex;
      align-items: center;
      justify-content: center;
      color: #f9fafb;
      font-weight: 700;
      font-size: 18px;
      box-shadow: 0 10px 35px rgba(79, 70, 229, 0.7);
    }

    .logo-text-main {
      font-weight: 600;
      letter-spacing: 0.03em;
      font-size: 18px;
    }

    .logo-text-sub {
      font-size: 12px;
      color: var(--muted);
    }

    h1,
    h2,
    h3 {
      font-weight: 600;
      letter-spacing: 0.02em;
    }

    h1 {
      font-size: 24px;
      margin-bottom: 6px;
    }

    p {
      font-size: 14px;
      line-height: 1.5;
      color: var(--muted);
    }

    .mt-16 {
      margin-top: 16px;
    }

    .mt-24 {
      margin-top: 24px;
    }

    .mt-32 {
      margin-top: 32px;
    }

    .field {
      display: flex;
      flex-direction: column;
      gap: 6px;
      margin-top: 14px;
    }

    label {
      font-size: 13px;
      color: var(--muted);
    }

    input,
    textarea {
      border-radius: var(--radius-lg);
      border: 1px solid rgba(148, 163, 184, 0.4);
      background: rgba(15, 23, 42, 0.85);
      color: var(--text);
      font-size: 14px;
      padding: 10px 14px;
      outline: none;
      transition: border 0.15s ease, box-shadow 0.15s ease,
        background 0.15s ease;
    }

    input::placeholder,
    textarea::placeholder {
      color: rgba(148, 163, 184, 0.7);
    }

    input:focus,
    textarea:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.6);
      background: rgba(15, 23, 42, 0.95);
    }

    .btn {
      border: none;
      border-radius: var(--radius-full);
      padding: 10px 16px;
      font-size: 14px;
      font-weight: 500;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      cursor: pointer;
      transition: transform 0.1s ease, box-shadow 0.1s ease,
        background 0.1s ease, opacity 0.15s ease;
      white-space: nowrap;
    }

    .btn-primary {
      background: linear-gradient(135deg, var(--accent), var(--accent-strong));
      color: #e5e7eb;
      box-shadow: 0 10px 35px rgba(79, 70, 229, 0.7);
    }

    .btn-secondary {
      background: rgba(15, 23, 42, 0.9);
      color: var(--text);
      border: 1px solid rgba(148, 163, 184, 0.4);
    }

    .btn-soft {
      background: rgba(15, 23, 42, 0.9);
      color: var(--muted);
      border: 1px dashed rgba(148, 163, 184, 0.4);
    }

    .btn:active {
      transform: translateY(1px) scale(0.99);
      box-shadow: none;
    }

    .btn-full {
      width: 100%;
    }

    .btn-sm {
      padding: 8px 12px;
      font-size: 13px;
    }

    .btn-icon {
      width: 34px;
      height: 34px;
      padding: 0;
    }

    .btn-success {
      background: rgba(22, 163, 74, 0.15);
      border: 1px solid rgba(34, 197, 94, 0.7);
      color: var(--success);
    }

    .btn-danger {
      background: rgba(220, 38, 38, 0.15);
      border: 1px solid rgba(248, 113, 113, 0.8);
      color: var(--danger);
    }

    .flex {
      display: flex;
    }

    .justify-between {
      justify-content: space-between;
    }

    .items-center {
      align-items: center;
    }

    .gap-8 {
      gap: 8px;
    }

    .gap-12 {
      gap: 12px;
    }

    .gap-16 {
      gap: 16px;
    }

    .chips-row {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin-top: 10px;
    }

    .chip {
      border-radius: var(--radius-full);
      padding: 6px 10px;
      font-size: 11px;
      background: rgba(15, 23, 42, 0.9);
      border: 1px solid rgba(148, 163, 184, 0.35);
      color: var(--muted);
    }

    .chip-positive {
      border-color: rgba(34, 197, 94, 0.7);
      color: var(--success);
    }

    .chip-negative {
      border-color: rgba(248, 113, 113, 0.8);
      color: var(--danger);
    }

    .score-main {
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      padding: 16px 14px;
      border-radius: 18px;
      background: radial-gradient(circle at top, #1f2937 0, #020617 70%);
      border: 1px solid rgba(99, 102, 241, 0.4);
      margin-top: 8px;
    }

    .score-label {
      font-size: 13px;
      color: var(--muted);
      margin-bottom: 2px;
    }

    .score-value {
      font-size: 32px;
      font-weight: 700;
      letter-spacing: 0.06em;
    }

    .score-trend {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      font-size: 11px;
      color: var(--success);
      margin-top: 4px;
      padding: 3px 8px;
      border-radius: 999px;
      background: rgba(22, 163, 74, 0.12);
    }

    .score-trend.negative {
      color: var(--danger);
      background: rgba(239, 68, 68, 0.12);
    }

    .stat-row {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
      margin-top: 14px;
    }

    .stat-card {
      border-radius: 14px;
      padding: 10px 10px;
      background: rgba(15, 23, 42, 0.9);
      border: 1px solid rgba(148, 163, 184, 0.4);
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .stat-label {
      font-size: 11px;
      color: var(--muted);
    }

    .stat-value {
      font-size: 16px;
      font-weight: 600;
    }

    .stat-positive {
      color: var(--success);
    }

    .stat-negative {
      color: var(--danger);
    }

    .timeline {
      margin-top: 14px;
      display: flex;
      flex-direction: column;
      gap: 10px;
      max-height: 260px;
      overflow-y: auto;
      padding-right: 4px;
    }

    .timeline-item {
      display: grid;
      grid-template-columns: auto 1fr auto;
      gap: 8px;
      align-items: center;
      font-size: 12px;
      padding: 8px 10px;
      border-radius: 14px;
      background: rgba(15, 23, 42, 0.9);
      border: 1px solid rgba(148, 163, 184, 0.3);
    }

    .timeline-badge {
      width: 26px;
      height: 26px;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
    }

    .timeline-badge.plus {
      background: rgba(22, 163, 74, 0.15);
      color: var(--success);
      border: 1px solid rgba(34, 197, 94, 0.7);
    }

    .timeline-badge.minus {
      background: rgba(220, 38, 38, 0.15);
      color: var(--danger);
      border: 1px solid rgba(248, 113, 113, 0.8);
    }

    .timeline-main {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .timeline-title {
      font-size: 12px;
      color: var(--text);
    }

    .timeline-sub {
      font-size: 11px;
      color: var(--muted);
    }

    .timeline-value {
      font-size: 13px;
      font-weight: 600;
    }

    .empty-state {
      font-size: 12px;
      color: var(--muted);
      padding: 12px 0;
      text-align: center;
    }

    /* Bottom nav */

    .bottom-nav {
      position: fixed;
      bottom: 12px;
      left: 50%;
      transform: translateX(-50%);
      width: 100%;
      max-width: 480px;
      padding: 0 16px;
      pointer-events: none;
    }

    .bottom-nav-inner {
      pointer-events: auto;
      border-radius: 999px;
      background: rgba(15, 23, 42, 0.9);
      backdrop-filter: blur(20px);
      border: 1px solid rgba(148, 163, 184, 0.4);
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 6px 6px;
      box-shadow: 0 12px 40px rgba(15, 23, 42, 0.95);
    }

    .nav-item {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      padding: 6px 6px;
      border-radius: 999px;
      font-size: 12px;
      color: var(--muted);
      cursor: pointer;
      border: none;
      background: transparent;
    }

    .nav-item span.icon {
      font-size: 14px;
    }

    .nav-item-active {
      background: linear-gradient(135deg, var(--accent), var(--accent-strong));
      color: #e5e7eb;
      box-shadow: 0 8px 25px rgba(79, 70, 229, 0.85);
    }

    .nav-item-active span.icon {
      font-size: 14px;
    }

    .nav-item:not(.nav-item-active):active {
      opacity: 0.7;
    }

    /* Screen visibility */

    .screen {
      display: none;
      flex-direction: column;
      gap: 16px;
      margin-top: 10px;
    }

    .screen-active {
      display: flex;
    }

    .top-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 6px;
      padding: 4px 2px;
    }

    .top-bar-names {
      font-size: 13px;
      color: var(--muted);
    }

    .pill {
      border-radius: 999px;
      padding: 4px 8px;
      font-size: 11px;
      background: rgba(15, 23, 42, 0.9);
      border: 1px solid rgba(148, 163, 184, 0.4);
      color: var(--muted);
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }

    .pill-dot {
      width: 7px;
      height: 7px;
      border-radius: 999px;
      background: #22c55e;
    }

    .pill-danger .pill-dot {
      background: #ef4444;
    }

    .pill-danger {
      border-color: rgba(248, 113, 113, 0.6);
      color: var(--danger);
    }

    .divider {
      height: 1px;
      background: radial-gradient(
        circle at center,
        rgba(148, 163, 184, 0.5),
        transparent
      );
      margin: 6px 0;
    }

    .info-row {
      margin-top: 8px;
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      font-size: 11px;
      color: var(--muted);
    }

    .badge-soft {
      border-radius: 999px;
      padding: 4px 8px;
      background: rgba(15, 23, 42, 0.9);
      border: 1px solid rgba(148, 163, 184, 0.35);
    }

    .error-text {
      margin-top: 8px;
      font-size: 12px;
      color: var(--danger);
    }

    textarea {
      min-height: 70px;
      resize: vertical;
    }

    @media (min-width: 600px) {
      body {
        align-items: center;
      }

      .app-shell {
        margin: 20px auto;
        border-radius: 24px;
        border: 1px solid rgba(148, 163, 184, 0.4);
        backdrop-filter: blur(20px);
      }
    }