/* ============================================================
   SMS Mockups — Mobile Phone-Frame Kit
   Realistic device frames for the Parent / Student / Teacher
   app galleries. Same indigo/slate design system, mobile scale.
   Loaded ONLY by 16-mobile gallery pages, after base stylesheets.
   ============================================================ */

/* ---------- Gallery layout ---------- */
.phone-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(348px, 1fr));
  gap: 34px 22px; align-items: start; margin-top: 8px;
}
.phone-item { display: flex; flex-direction: column; align-items: center; }
.phone-label { width: 320px; margin-bottom: 10px; }
.phone-label .t { font-weight: 700; font-size: .92rem; font-family: var(--font-display); }
.phone-label .d { font-size: .76rem; color: var(--text-3); line-height: 1.4; margin-top: 2px; }

/* ---------- Device frame ---------- */
.phone {
  width: 320px; height: 660px; flex-shrink: 0;
  background: linear-gradient(160deg, #1e293b, #0f172a 55%);
  border-radius: 44px; padding: 11px; position: relative;
  box-shadow: 0 30px 60px -22px rgba(15, 23, 42, .5), 0 0 0 1px #334155;
}
.phone .notch {
  position: absolute; top: 11px; left: 50%; transform: translateX(-50%);
  width: 112px; height: 24px; background: #0f172a;
  border-radius: 0 0 16px 16px; z-index: 6;
}
.phone-screen {
  background: var(--bg); border-radius: 34px; height: 100%;
  overflow: hidden; display: flex; flex-direction: column; position: relative;
}

/* ---------- Status bar / app bar / tab bar ---------- */
.m-status {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 22px 4px; font-size: .68rem; font-weight: 700; color: var(--text-2);
  background: var(--surface);
}
.m-header {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px 12px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.m-header .m-title { font-weight: 700; font-size: .98rem; font-family: var(--font-display); flex: 1; }
.m-header .m-ic { font-size: 1rem; position: relative; cursor: pointer; }
.m-header .m-ic .dot-badge {
  position: absolute; top: -3px; right: -5px; width: 8px; height: 8px;
  background: var(--danger); border-radius: 50%; border: 2px solid var(--surface);
}
.m-body { flex: 1; overflow-y: auto; padding: 12px; zoom: .86; }
.m-body::-webkit-scrollbar { width: 0; }
.m-tabbar { display: flex; border-top: 1px solid var(--border); background: var(--surface); flex-shrink: 0; }
.m-tabbar button {
  flex: 1; background: none; border: none; padding: 8px 0 14px;
  font-size: .6rem; color: var(--text-3); cursor: pointer; font-family: var(--font);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.m-tabbar button .ic { font-size: 1.05rem; }
.m-tabbar button.on { color: var(--primary); font-weight: 700; }

/* ---------- Mobile components ---------- */
.m-tile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.m-tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px 13px;
}
.m-tile .v { font-size: 1.3rem; font-weight: 700; font-family: var(--font-display); letter-spacing: -.02em; }
.m-tile .l { font-size: .68rem; color: var(--text-3); margin-top: 1px; }
.m-tile.hero { grid-column: 1 / -1; background: linear-gradient(135deg, var(--primary), #6d28d9); border: none; color: #fff; }
.m-tile.hero .l { color: #c7d2fe; }

.m-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 13px; padding: 10px 12px; margin-bottom: 8px; font-size: .8rem;
}
.m-row .grow { flex: 1; min-width: 0; }
.m-row .ttl { font-weight: 600; font-size: .82rem; }
.m-row .sub { font-size: .7rem; color: var(--text-3); }

.m-section-title {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-3); margin: 14px 2px 8px;
}

/* Child switcher */
.m-child-switch { display: flex; gap: 8px; margin-bottom: 12px; }

/* Floating action button */
.m-fab {
  position: absolute; right: 16px; bottom: 76px; z-index: 5;
  width: 50px; height: 50px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--primary); color: #fff; font-size: 1.35rem;
  box-shadow: 0 10px 22px -6px rgba(79, 70, 229, .55);
}

/* Offline / sync pills */
.m-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: var(--radius-full);
  font-size: .68rem; font-weight: 700;
}
.m-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.m-pill.offline { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.m-pill.offline::before { background: var(--warning); animation: pulse 1.4s infinite; }
.m-pill.synced { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.m-pill.synced::before { background: var(--success); }
@keyframes pulse { 50% { opacity: .35; } }

/* Attendance ring (conic) */
.m-ring {
  width: 110px; height: 110px; border-radius: 50%; margin: 6px auto;
  background: conic-gradient(var(--success) calc(var(--pct) * 1%), var(--border) 0);
  display: flex; align-items: center; justify-content: center;
}
.m-ring .inner {
  width: 84px; height: 84px; border-radius: 50%; background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.m-ring .inner .v { font-weight: 800; font-size: 1.15rem; font-family: var(--font-display); }
.m-ring .inner .l { font-size: .6rem; color: var(--text-3); }

/* Bus tracking map */
.m-map {
  border-radius: 14px; height: 190px; position: relative; overflow: hidden;
  background:
    linear-gradient(rgba(79, 70, 229, .04), rgba(79, 70, 229, .08)),
    repeating-linear-gradient(0deg, transparent 0 34px, #e2e8f0 34px 35px),
    repeating-linear-gradient(90deg, transparent 0 34px, #e2e8f0 34px 35px),
    #f1f5f9;
  border: 1px solid var(--border);
}
.m-map .route {
  position: absolute; left: 14%; top: 78%; width: 74%; height: 4px;
  background: var(--primary); border-radius: 2px; transform: rotate(-24deg); transform-origin: left;
}
.m-map .stop {
  position: absolute; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 3px solid var(--primary);
}
.m-map .bus {
  position: absolute; font-size: 1.25rem; filter: drop-shadow(0 3px 5px rgba(15,23,42,.3));
  animation: busBob 2.2s ease-in-out infinite;
}
@keyframes busBob { 50% { transform: translateY(-3px); } }

/* Chat bubbles */
.m-bubble { max-width: 78%; padding: 8px 12px; border-radius: 14px; font-size: .78rem; margin-bottom: 8px; }
.m-bubble.in  { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.m-bubble.out { background: var(--primary); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.m-bubble .tm { display: block; font-size: .6rem; opacity: .65; margin-top: 3px; text-align: right; }

/* Numeric keypad (PIN unlock) */
.m-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 8px 26px; }
.m-keypad button {
  height: 52px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); font-size: 1.05rem; font-weight: 600;
  font-family: var(--font); cursor: pointer;
}
.m-keypad button:active { background: var(--primary-50); }
.m-pin-dots { display: flex; gap: 12px; justify-content: center; margin: 14px 0; }
.m-pin-dots span { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--border-strong); }
.m-pin-dots span.fill { background: var(--primary); border-color: var(--primary); }

/* Full-screen phone states (login / upgrade) */
.m-splash { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.m-applogo {
  width: 64px; height: 64px; border-radius: 16px; margin-bottom: 14px;
  background: var(--primary); color: #fff; font-family: var(--font-display);
  font-weight: 800; font-size: 1.5rem; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 26px -8px rgba(79, 70, 229, .5);
}

/* Timetable strip */
.m-period {
  display: flex; gap: 10px; align-items: center; padding: 9px 12px;
  border-left: 3px solid var(--border); background: var(--surface);
  border-radius: 0 12px 12px 0; margin-bottom: 7px; font-size: .76rem;
}
.m-period.now { border-left-color: var(--primary); background: var(--primary-50); }
.m-period .tm { font-weight: 700; font-size: .68rem; color: var(--text-3); width: 46px; flex-shrink: 0; }
