/* ThornMobile — the phone shell. Scoped to .tm-* so it never affects the desktop
   layout; the palette tokens come from styles.css (loaded first). */
.tm-home {
  position: fixed; inset: 0; display: flex; flex-direction: column; overflow: hidden;
  padding: 0 22px; color: var(--text);
  background:
    radial-gradient(120% 55% at 50% -6%, rgba(255,45,85,.22), transparent 58%),
    radial-gradient(90% 50% at 50% 108%, rgba(52,209,125,.06), transparent 60%),
    linear-gradient(#0b0d13, #070810);
}
.tm-status { display: flex; align-items: center; justify-content: space-between; padding: 14px 4px 4px; font-family: var(--mono); font-size: 13px; color: #cfd3df; flex: none; }
.tm-status-r { display: flex; align-items: center; gap: 10px; }
.tm-net { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--dim); }
.tm-net .tm-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff5a6e; box-shadow: 0 0 6px #ff5a6e; }
.tm-net.on .tm-dot { background: var(--leaf); box-shadow: 0 0 6px var(--leaf); }
.tm-srose { width: 16px; height: 16px; opacity: .9; }

.tm-widget { margin: 18px 2px 8px; flex: none; }
.tm-time { font-family: var(--disp); font-weight: 600; font-size: 56px; line-height: 1; letter-spacing: .01em; }
.tm-date { font-family: var(--mono); font-size: 13px; color: var(--dim); margin-top: 6px; letter-spacing: .06em; }
.tm-brand { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-family: var(--disp); font-weight: 600; font-size: 15px; letter-spacing: .04em; color: #c9cede; }
.tm-brand img { width: 22px; height: 22px; filter: drop-shadow(0 0 6px var(--glow)); }
.tm-brand b { color: var(--crimson); font-weight: 600; }

.tm-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px 8px; margin-top: 18px; align-content: start; overflow-y: auto; padding-bottom: 12px; }
.tm-app { display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; }
.tm-ic { width: 60px; height: 60px; border-radius: 17px; display: grid; place-items: center; background: linear-gradient(160deg, #1c2130, #0c0e15); border: 1px solid var(--hair-2); box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 8px 18px -12px #000; }
.tm-ic img { width: 34px; height: 34px; }
.tm-app .tm-lab { font-size: 11.5px; color: #d3d7e2; text-shadow: 0 1px 3px #000; text-align: center; }

.tm-dock { margin-top: auto; margin-bottom: 18px; display: flex; justify-content: space-around; align-items: center; padding: 12px 14px; background: rgba(20,23,32,.66); border: 1px solid var(--hair); border-radius: 26px; backdrop-filter: blur(14px); flex: none; }
.tm-dock .tm-ic { width: 52px; height: 52px; border-radius: 15px; }
.tm-dock .tm-ic img { width: 30px; height: 30px; }

/* ---- an app open full-screen ---- */
.tm-appview { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--void); }
.tm-appbar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; padding-top: max(12px, env(safe-area-inset-top)); border-bottom: 1px solid var(--hair); background: linear-gradient(90deg, rgba(255,45,85,.12), rgba(255,45,85,.02)); flex: none; }
.tm-back { width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--hair-2); background: var(--raised); color: var(--text); font-size: 19px; cursor: pointer; }
.tm-appbar-ic { width: 22px; height: 22px; }
.tm-appbar-title { font-family: var(--disp); font-weight: 600; font-size: 17px; letter-spacing: .02em; }
.tm-appbody { flex: 1; min-height: 0; display: flex; overflow: auto; }
.tm-appbody > * { flex: 1; min-height: 0; min-width: 0; }

/* toasts */
#tm-toasts { position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; z-index: 9999; }
.tm-toast { background: rgba(18,21,29,.96); color: var(--text); border: 1px solid var(--hair-2); border-left: 4px solid var(--crimson); border-radius: 10px; padding: 11px 14px; font-size: 13px; box-shadow: 0 12px 30px -12px #000; transition: opacity .3s; }

/* action sheet (mobile context menu) */
.tm-sheet-bg { position: fixed; inset: 0; background: rgba(4,5,8,.6); z-index: 12000; display: flex; align-items: flex-end; }
.tm-sheet { width: 100%; background: rgba(18,21,29,.98); border-top: 1px solid var(--hair-2); border-radius: 18px 18px 0 0; padding: 8px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
.tm-sheet-item { display: block; width: 100%; text-align: left; background: transparent; border: 0; color: var(--text); font: inherit; padding: 14px 16px; border-radius: 12px; cursor: pointer; }
.tm-sheet-item:active { background: var(--glow-soft); }
.tm-sheet-item.danger { color: #ff5a6e; }

/* narrow-screen fixes for apps that assume a wide window */
@media (max-width: 767px) {
  .fi-d-body { flex-direction: column; }
  .fi-d-left { width: 100%; flex-direction: row; align-items: flex-start; }
  .fi-d-cover, .fi-cover-btn { width: 150px; }
  .fi-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .rz-panel .rz-wheelwrap, .rz-panel .rz-controls { display: block; width: 100%; padding-left: 0; }
  .settings { padding: 14px; }
  .hv-pw-row { grid-template-columns: 1fr; }
}
