/* Companora — core.css — shared variables, resets, dashboard */
*{box-sizing:border-box;margin:0;padding:0}

:root{
  --bg:#fbf6f3;
  --card:#ffffff;
  --text:#1a1523;
  --muted:#6b6478;
  --accent:#a855f7;
  --accent2:#ec4899;
  --accent-gradient:linear-gradient(135deg,#a855f7,#ec4899);
  --accent-soft:rgba(168,85,247,.08);
  --border:#efe6e4;
  --user-bg:#a855f7;
  --user-text:#fff;
  --asst-bg:#f7f1ef;
  --danger:#ef4444;
  --shadow:0 1px 3px rgba(0,0,0,.06);
  --surface:#fbf6f3;
}

body.night-mode{
  --bg:#15121c;
  --card:#1e1a29;
  --text:#f2eef7;
  --muted:#9891a8;
  --border:#2c2636;
  --asst-bg:#241f30;
  --accent-soft:rgba(168,85,247,.16);
}

/* No overflow:hidden here on purpose -- body's own content (.app-shell)
   is exactly 100dvh tall so there's nothing to scroll in normal use, but
   leaving body free to scroll is what lets the phone's own native
   pull-to-refresh gesture exist at all (it needs the document itself to
   be a real scrollable/overscrollable surface at scrollTop 0; .app-shell
   underneath still keeps overflow:hidden so none of its own fixed layout
   changes). This has no effect on an installed home-screen PWA though --
   standalone display mode removes browser chrome entirely, and native
   pull-to-refresh is part of that chrome, not something CSS can restore. */
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;background:var(--bg);color:var(--text);height:100vh;height:100dvh;display:flex;justify-content:center;transition:background .15s,color .15s}
::selection{background:var(--accent);color:#fff}

.app-shell{width:100%;max-width:480px;display:flex;flex-direction:column;height:100vh;height:100dvh;background:var(--bg);position:relative;overflow:hidden}
@media (max-width:500px){ .app-shell{max-width:100%} }

/* ── Dashboard: character grid ─────────────────────────────────────── */
.home-mind-heading{padding:20px 18px 14px}
.home-mind-heading h1{font-family:Georgia,"Iowan Old Style","Palatino Linotype","Times New Roman",serif;font-size:27px;font-weight:700;letter-spacing:-.01em;color:var(--text);line-height:1.22;margin:0}
.home-mind-accent{color:var(--accent)}
.home-mind-heading p{font-size:13px;color:var(--muted);margin-top:4px}

/* The Jar teaser -- same quiet card language as .profile-status-card, just
   with --accent-soft behind it so it reads as a little warmer than a plain
   bordered card, without reaching for a hard accent color or a gradient
   button. One line, top of the dashboard (seen on every open now that Pro
   is going away), never a room tile -- it isn't a companion experience. */
.jar-teaser{
  display:flex;align-items:center;gap:10px;margin:0 18px 4px;padding:12px 14px;
  background:var(--accent-soft);border:1px solid var(--border);border-radius:14px;
  text-decoration:none;
}
.jar-teaser-emoji{font-size:17px;line-height:1}
.jar-teaser-text{flex:1;font-size:13px;color:var(--text);line-height:1.35}
.jar-teaser-arrow{color:var(--muted);font-size:15px}

/* One-off notice when the schedule_gate filter (app/filters.php) bounces a
   direct room/game/spiritual URL hit back here -- same quiet card language
   as .jar-teaser, not a hard red error banner, since "come back Tuesday"
   isn't a failure state. */
.schedule-notice{margin:12px 18px 0;padding:12px 14px;background:var(--accent-soft);border:1px solid var(--border);border-radius:14px;font-size:13px;color:var(--text);line-height:1.4}

/* Every dashboard section (Companions, Games, ...) renders through this
   one shared grid+tile format -- same shell for all of them, only the
   icon slot differs (a real photo for characters, an emoji for games).
   Format copied from himcare's dashboard.php emo-groups/room-tile
   pattern; colors/fonts stay Companora's own (var(--*) tokens). */
.dash-groups{padding:4px 14px 24px;display:flex;flex-direction:column;gap:22px;overflow-y:auto;flex:1}
.dash-head{display:flex;align-items:baseline;gap:8px;margin-bottom:10px}
.dash-head-icon{font-size:15px}
.dash-head-label{font-family:Georgia,"Iowan Old Style","Palatino Linotype","Times New Roman",serif;font-size:15px;font-weight:700;color:var(--text)}
.dash-head-tagline{font-size:11.5px;color:var(--muted);margin-bottom:10px}
.dash-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.dash-tile{
  position:relative;display:flex;flex-direction:column;gap:6px;
  min-height:118px;padding:14px 13px 12px;
  border-radius:18px;border:1px solid var(--border);background:var(--card);
  text-decoration:none;color:inherit;box-shadow:var(--shadow);transition:transform .12s;
}
.dash-tile:active{transform:scale(.97)}
.dash-tile-icon{font-size:22px;line-height:1}
.dash-tile-photo{width:36px;height:36px;border-radius:50%;overflow:hidden;background:var(--accent-soft)}
.dash-tile-photo img{width:100%;height:100%;object-fit:cover;object-position:top center;display:block}
.dash-tile-name{font-family:Georgia,"Iowan Old Style","Palatino Linotype","Times New Roman",serif;font-size:14.5px;font-weight:700;color:var(--text);margin-top:2px}
.dash-tile-line{font-size:11.5px;color:var(--muted);line-height:1.4;flex:1}

/* Day-scheduled rooms only -- a real "poster" image, not the small circular
   avatar Companions use (.dash-tile-photo, untouched, still 36px). Bleeds
   to the card's own edges via negative margin matching .dash-tile's own
   padding, rounded to match the card's top corners, so it reads as one
   image-led tile (Netflix/movie-poster style) instead of an icon inset
   inside a card. */
.dash-tile-poster{aspect-ratio:1/1;margin:-14px -13px 8px;overflow:hidden;border-radius:18px 18px 0 0;background:var(--accent-soft)}
.dash-tile-poster img,.dash-tile-poster video{width:100%;height:100%;object-fit:cover;display:block}

/* ── Bottom tab bar -- shared by dashboard/pro/account (himcare's
   lib/partials/footer_nav.php), real <a> links so back/forward/refresh
   just work, no JS tab-switching. ──────────────────────────────────── */
.footer-tabs{display:flex;background:var(--card);border-top:1px solid var(--border);box-shadow:0 -2px 10px rgba(0,0,0,.04);flex-shrink:0;padding:4px 16px env(safe-area-inset-bottom,4px);gap:0}
.footer-tabs[hidden]{display:none!important}
.footer-tab{flex:1;display:flex;flex-direction:column;align-items:center;gap:1px;padding:8px 0 4px;border:none;background:none;color:var(--muted);font-size:10px;font-weight:500;cursor:pointer;transition:color .15s;position:relative;text-decoration:none}
.footer-tab i{font-size:20px;transition:transform .15s}
.footer-tab.active{color:var(--accent)}
.footer-tab.active i{transform:scale(1.1)}
.footer-tab.active::before{content:'';position:absolute;top:0;left:25%;right:25%;height:2px;background:var(--accent);border-radius:0 0 2px 2px}

/* ── Plan picker + buy button -- shared base, pro.css layers the paywall-
   specific hero/compare-table/trust-row treatment on top. ──────────── */
.plan-picker{display:flex;gap:10px;margin-top:4px}
.plan-option{flex:1;display:flex;flex-direction:column;align-items:center;gap:6px;padding:16px 8px;border-radius:14px;border:2px solid var(--border);background:var(--card);cursor:pointer;transition:border-color .15s,background .15s}
.plan-option.selected{border-color:var(--accent);background:var(--accent-soft)}
.plan-option-featured{border-color:var(--accent2)}
.plan-option-duration{font-size:12px;font-weight:700;color:var(--muted)}
.plan-option-price{font-size:18px;font-weight:800;color:var(--text)}
.pro-buy-btn{width:100%;padding:14px;border-radius:12px;border:none;background:linear-gradient(135deg,var(--accent),var(--accent2));color:#fff;font-size:16px;font-weight:700;cursor:pointer;transition:opacity .2s}
.pro-buy-btn:hover{opacity:.9}
.pro-buy-btn:disabled{opacity:.6;cursor:default}

/* ── Account page: plan status card ──────────────────────────────────── */
.profile-status-card{background:var(--card);border-radius:16px;border:1px solid var(--border);padding:4px 16px;margin-bottom:16px}
.profile-status-row{display:flex;justify-content:space-between;align-items:center;padding:12px 0;border-bottom:1px solid var(--border)}
.profile-status-row:last-child{border-bottom:none}
.profile-status-label{font-size:13px;color:var(--muted)}
.profile-status-value{font-size:13px;font-weight:600;color:var(--text)}
