:root {
  --accent-cyan: #22d3ee;
  --accent-start: #3b82f6;
  --accent-end: #8b5cf6;
  --text-primary: #1e3a5f;
  --text-secondary: #5b7a9d;
  --text-muted: #94a3b8;
  --glass-bg: rgba(255, 255, 255, 0.82);
  --glass-border: rgba(219, 234, 254, 0.65);
  --glass-shadow: 0 8px 32px rgba(59, 130, 246, 0.07),
                  0 2px 10px rgba(139, 92, 246, 0.04);
  --glass-shadow-hover: 0 16px 44px rgba(59, 130, 246, 0.11),
                        0 4px 16px rgba(34, 211, 238, 0.06);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang SC', 'Helvetica Neue', sans-serif;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(
    165deg,
    #ffffff 0%,
    #fefefe 40%,
    #fcfdff 70%,
    #fafcff 100%
  );
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.22;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, transparent 80%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, transparent 80%);
}

.bg-glow {
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
}

.bg-glow--1 {
  width: 300px;
  height: 300px;
  top: -90px;
  right: -90px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.12) 0%, transparent 68%);
}

.bg-glow--2 {
  width: 280px;
  height: 280px;
  top: 40%;
  left: -110px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.09) 0%, transparent 68%);
}

.bg-glow--3 {
  width: 240px;
  height: 240px;
  bottom: 80px;
  right: -50px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 68%);
}

.bg-noise {
  position: fixed;
  inset: 0;
  z-index: 1;
  opacity: 0.08;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px 128px;
  mix-blend-mode: soft-light;
}

.app {
  position: relative;
  z-index: 2;
  padding: 0 18px 28px;
  max-width: 480px;
  margin: 0 auto;
}

.safe-top {
  padding-top: max(20px, env(safe-area-inset-top));
}

.title {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.6px;
  background: linear-gradient(135deg, #1e3a5f 25%, var(--accent-start) 55%, var(--accent-end) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  margin-top: 10px;
  font-size: 15px;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
}

.accent-line {
  margin-top: 16px;
  width: 48px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-start), var(--accent-end));
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.25);
}

.header {
  padding: 16px 4px 20px;
}

.header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.header-text {
  flex: 1;
  min-width: 0;
}

.header--center {
  text-align: center;
}

.header--center .accent-line {
  margin-left: auto;
  margin-right: auto;
}

.user-menu {
  position: relative;
  flex-shrink: 0;
  padding-top: 6px;
}

.user-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 2px 6px rgba(59, 130, 246, 0.06),
    0 6px 18px rgba(100, 116, 139, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
  -webkit-tap-highlight-color: transparent;
}

.user-avatar__icon {
  width: 23px;
  height: 23px;
  color: #b0bdd0;
}

.user-avatar:active {
  transform: scale(0.94);
  background: rgba(248, 250, 252, 0.95);
}

.user-menu.is-open .user-avatar {
  background: rgba(255, 255, 255, 0.95);
  box-shadow:
    0 0 0 3px rgba(186, 210, 235, 0.35),
    0 4px 14px rgba(100, 116, 139, 0.1);
}

.user-menu.is-open .user-avatar__icon {
  color: #94a3b8;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 148px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(219, 234, 254, 0.85);
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(59, 130, 246, 0.14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
  z-index: 50;
}

.user-menu.is-open .user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown__name {
  padding: 8px 10px 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(219, 234, 254, 0.5);
  margin-bottom: 4px;
}

.user-dropdown__logout {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  color: #dc2626;
  background: transparent;
  border: none;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease;
}

.user-dropdown__logout:active {
  background: rgba(254, 226, 226, 0.6);
}

.sections {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-card {
  width: 100%;
  padding: 18px 16px 8px;
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  box-shadow: 0 8px 32px rgba(59, 130, 246, 0.10),
              0 2px 12px rgba(139, 92, 246, 0.06);
  position: relative;
  overflow: hidden;
}

.section-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.75) 0%,
    rgba(248, 250, 255, 0.12) 55%,
    rgba(255, 255, 255, 0) 75%
  );
  pointer-events: none;
}

.section-card__title {
  position: relative;
  z-index: 1;
  margin-bottom: 12px;
  padding: 0 4px 12px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.2px;
  border-bottom: 1px solid rgba(219, 234, 254, 0.55);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-card__title::before {
  content: '';
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent-cyan), var(--accent-end));
  flex-shrink: 0;
}

.section-card__items {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-bottom: 10px;
}

.section-card__empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 18px 8px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted, #94a3b8);
}

.sub-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  padding: 12px 10px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(1.45);
  -webkit-backdrop-filter: blur(20px) saturate(1.45);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 6px 24px rgba(59, 130, 246, 0.09),
              0 2px 10px rgba(139, 92, 246, 0.05);
  text-align: left;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.28s cubic-bezier(0.34, 1.2, 0.64, 1),
              box-shadow 0.28s ease,
              border-color 0.28s ease;
  -webkit-tap-highlight-color: transparent;
}

.sub-item::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.72) 0%,
    rgba(248, 250, 255, 0.1) 55%,
    rgba(255, 255, 255, 0) 75%
  );
  pointer-events: none;
}

.sub-item .icon,
.sub-item .info {
  position: relative;
  z-index: 1;
}

.sub-item:active {
  transform: scale(0.97);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.12);
  border-color: rgba(219, 234, 254, 0.9);
}

.sub-item .icon {
  width: 36px;
  height: 36px;
  font-size: 18px;
  border-radius: 10px;
}

.sub-item .icon--image {
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: none;
  box-shadow: none;
}

.sub-item .icon--image .icon-glow {
  display: none;
}

.sub-item .icon__img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}

.sub-item .info {
  width: 100%;
}

.sub-item .info h3 {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sub-item .info p {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.section-title {
  margin: 24px 0 12px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent-cyan), var(--accent-end));
}

.grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 16px 16px 16px 14px;
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: var(--glass-shadow);
  text-align: left;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1),
              box-shadow 0.35s ease,
              border-color 0.35s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.75) 0%,
    rgba(248, 250, 255, 0.15) 50%,
    rgba(255, 255, 255, 0) 70%
  );
  pointer-events: none;
}

.card::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 20px 0 0 20px;
  background: linear-gradient(180deg, var(--accent-cyan), var(--accent-start), var(--accent-end));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--glass-shadow-hover);
  border-color: rgba(219, 234, 254, 0.9);
}

.card:hover::after {
  opacity: 0.75;
}

.card:active {
  transform: translateY(-1px) scale(0.985);
}

.icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96) 0%, rgba(239, 246, 255, 0.65) 100%);
  border: 1px solid rgba(219, 234, 254, 0.75);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.08);
}

.icon-glow {
  position: absolute;
  inset: -3px;
  border-radius: 17px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-start), var(--accent-end));
  opacity: 0.12;
  z-index: -1;
  filter: blur(8px);
}

.info {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.info h2 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
}

.info p {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-secondary);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.chevron {
  font-size: 20px;
  color: #c8daf0;
  font-weight: 300;
  transition: color 0.3s ease, transform 0.3s ease;
}

.card:hover .chevron {
  color: var(--accent-start);
  transform: translateX(2px);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(32px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px);
  background: rgba(30, 58, 95, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #fff;
  padding: 11px 18px;
  border-radius: 14px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 100;
  max-width: calc(100% - 32px);
  text-align: center;
  border: 1px solid rgba(147, 197, 253, 0.25);
  box-shadow: 0 8px 28px rgba(59, 130, 246, 0.2);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .card:hover { transform: none; }
}
