/* Gins Core 1.0.0 – shared theme tokens and the setup, lock and Settings screens for every family web app.
 * Copied into each app at build time. App screens keep their own app.css; this file only styles .g-* elements
 * and sets the shared colour tokens. Font: Plus Jakarta Sans (loaded by each app's index.html). */

:root {
  --g-font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --g-brand: #0B6B4E; --g-brand-fg: #FFFFFF; --g-hero: #0B3D2E; --g-hero-2: #072B20; --g-hero-fg: #FFFFFF; --g-hero-sub: #CFE6DC;
  --g-bg: #F4F7F5; --g-card: #FFFFFF; --g-fg: #0E1C17; --g-muted: #52625C; --g-line: #E1E8E4; --g-soft: #E3ECE7;
  --g-input: #C9D4CF; --g-bad: #9B1C1C; --g-bad-bg: #FDECEC; --g-shadow: 0 10px 30px rgba(7, 43, 32, .18); --g-scrim: rgba(7, 43, 32, .55);
  --g-radius: 16px; --g-accent: #0B6B4E;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --g-brand: #3CC58F; --g-brand-fg: #062117; --g-hero: #0F3B2D; --g-hero-2: #0A2A20; --g-hero-sub: #BFDCCF;
    --g-bg: #0A1310; --g-card: #121E19; --g-fg: #E6EFEA; --g-muted: #9DB2A9; --g-line: #23332C; --g-soft: #1C2B25;
    --g-input: #33463E; --g-bad: #F5B4B4; --g-bad-bg: #3B1717; --g-shadow: 0 10px 30px rgba(0, 0, 0, .5); --g-scrim: rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
  --g-brand: #3CC58F; --g-brand-fg: #062117; --g-hero: #0F3B2D; --g-hero-2: #0A2A20; --g-hero-sub: #BFDCCF;
  --g-bg: #0A1310; --g-card: #121E19; --g-fg: #E6EFEA; --g-muted: #9DB2A9; --g-line: #23332C; --g-soft: #1C2B25;
  --g-input: #33463E; --g-bad: #F5B4B4; --g-bad-bg: #3B1717; --g-shadow: 0 10px 30px rgba(0, 0, 0, .5); --g-scrim: rgba(0, 0, 0, .6);
}

.g-i { width: 20px; height: 20px; flex: none; }

/* ---------------------------------------------------------------- gate: setup and lock */
.g-gate {
  min-height: 100vh; min-height: 100dvh; box-sizing: border-box; display: flex; flex-direction: column; align-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 40px) 16px calc(env(safe-area-inset-bottom, 0px) + 20px);
  background: linear-gradient(165deg, var(--g-hero) 0%, var(--g-hero-2) 100%); color: var(--g-hero-fg);
  font-family: var(--g-font); text-align: center;
}
.g-tile { width: 64px; height: 64px; border-radius: 18px; background: var(--g-accent); color: #fff; display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25); margin-bottom: 14px; }
.g-tile svg { width: 32px; height: 32px; }
.g-title { font-size: 22px; font-weight: 800; margin: 0 0 4px; letter-spacing: -.01em; }
.g-sub { margin: 0 0 12px; color: var(--g-hero-sub); font-size: 14px; max-width: 340px; }
.g-who { font-size: 13px; padding: 5px 12px; border-radius: 99px; background: rgba(255, 255, 255, .12); margin: 0 0 14px; }
.g-facebtn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; max-width: 300px; min-height: 48px;
  border: 0; border-radius: 14px; background: #fff; color: #0B3D2E; font: 700 15px var(--g-font); cursor: pointer; }
.g-or { margin: 10px 0 2px; font-size: 12px; color: var(--g-hero-sub); }
.g-dots { display: flex; gap: 14px; justify-content: center; margin: 14px 0 18px; }
.g-dots span { width: 13px; height: 13px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .8); box-sizing: border-box; transition: background .12s; }
.g-dots span.on { background: #fff; }
.g-dots.shake { animation: g-shake .35s; }
@keyframes g-shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.g-pad { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px 22px; justify-content: center; }
.g-pad button, .g-pad span { width: 72px; height: 72px; }
.g-pad button { border-radius: 50%; border: 0; background: rgba(255, 255, 255, .13); color: #fff; font: 600 26px var(--g-font); cursor: pointer;
  display: grid; place-items: center; -webkit-tap-highlight-color: transparent; }
.g-pad button:active { background: rgba(255, 255, 255, .28); }
.g-pad button.g-plain { background: transparent; }
.g-pad .g-i { width: 28px; height: 28px; }
.g-msg { min-height: 20px; margin: 14px 0 4px; font-size: 14px; color: #FFD9C7; max-width: 320px; }
.g-link { background: none; border: 0; color: rgba(255, 255, 255, .88); text-decoration: underline; font: 600 14px var(--g-font); cursor: pointer; padding: 8px; }
.g-foot { margin-top: auto; padding-top: 22px; font-size: 12px; color: var(--g-hero-sub); max-width: 360px; }
.g-steps { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.g-stepn { font-size: 12px; font-weight: 700; color: var(--g-muted); white-space: nowrap; }
.g-bars { display: flex; gap: 5px; flex: 1; max-width: 160px; }
.g-bars i { flex: 1; height: 5px; border-radius: 3px; background: var(--g-soft); }
.g-bars i.on { background: var(--g-brand); }
.g-steps.g-onhero { width: 100%; max-width: 300px; margin: 0 0 4px; }
.g-steps.g-onhero .g-stepn { color: var(--g-hero-sub); }
.g-steps.g-onhero .g-bars i { background: rgba(255, 255, 255, .2); }
.g-steps.g-onhero .g-bars i.on { background: #fff; }

.g-panel { width: 100%; max-width: 380px; box-sizing: border-box; background: var(--g-card); color: var(--g-fg); border-radius: 20px; padding: 18px;
  box-shadow: var(--g-shadow); text-align: left; display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.g-panel h2 { margin: 0; font-size: 18px; font-weight: 800; }
.g-help { margin: 0; font-size: 14px; color: var(--g-muted); }
.g-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; }
.g-field small { font-weight: 500; color: var(--g-muted); }
.g-field input { font: 500 16px var(--g-font); padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--g-input); background: var(--g-card); color: var(--g-fg); min-width: 0; }
.g-field input:focus { outline: 2px solid var(--g-brand); outline-offset: 1px; border-color: transparent; }
.g-err { margin: 0; min-height: 18px; font-size: 13px; color: var(--g-bad); }
.g-gbtn { display: flex; justify-content: center; min-height: 44px; align-items: center; }
.g-pair summary { cursor: pointer; font-size: 14px; color: var(--g-muted); padding: 4px 0; }
.g-pair form { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }

/* ---------------------------------------------------------------- buttons */
.g-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 12px;
  font: 700 15px var(--g-font); cursor: pointer; border: 1.5px solid transparent; text-decoration: none; box-sizing: border-box; }
.g-btn.block { width: 100%; }
.g-btn.primary { background: var(--g-brand); color: var(--g-brand-fg); }
.g-btn.ghost { background: transparent; color: var(--g-fg); }
.g-btn.line { background: transparent; color: var(--g-fg); border-color: var(--g-line); }
.g-btn.danger { background: var(--g-bad-bg); color: var(--g-bad); border-color: transparent; }
.g-btn:disabled { opacity: .6; cursor: default; }
.g-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 99px; border: 1.5px solid var(--g-line);
  background: var(--g-card); color: var(--g-fg); font: 700 13px var(--g-font); cursor: pointer; text-decoration: none; white-space: nowrap; }
.g-chip .g-i { width: 16px; height: 16px; }
.g-spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--g-soft); border-top-color: var(--g-brand); animation: g-spin .8s linear infinite; display: inline-block; }
@keyframes g-spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- sheet, toast, update bar */
.g-scrim { position: fixed; inset: 0; background: var(--g-scrim); z-index: 1000; display: flex; align-items: flex-end; justify-content: center; }
.g-sheet { width: 100%; max-width: 460px; max-height: 92vh; overflow: auto; box-sizing: border-box; background: var(--g-card); color: var(--g-fg);
  font-family: var(--g-font); border-radius: 22px 22px 0 0; padding: 10px 18px calc(env(safe-area-inset-bottom, 0px) + 18px);
  display: flex; flex-direction: column; gap: 10px; text-align: center; }
@media (min-width: 700px) { .g-scrim { align-items: center; } .g-sheet { border-radius: 22px; } }
.g-grab { width: 40px; height: 5px; border-radius: 3px; background: var(--g-line); margin: 0 auto 6px; }
.g-sheet h2 { margin: 4px 0 0; font-size: 19px; }
.g-lead { margin: 0; color: var(--g-muted); font-size: 14px; }
.g-sheet .g-dots span { border-color: var(--g-fg); }
.g-sheet .g-dots span.on { background: var(--g-fg); }
.g-sheet .g-pad button { background: var(--g-soft); color: var(--g-fg); }
.g-sheet .g-pad button.g-plain { background: transparent; }
.g-msg.dark { color: var(--g-bad); margin: 6px auto; }
.g-bigic { width: 56px; height: 56px; border-radius: 16px; background: var(--g-soft); color: var(--g-brand); display: grid; place-items: center; margin: 4px auto 0; }
.g-bigic .g-i { width: 28px; height: 28px; }
.g-code { font: 800 34px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 4px; margin: 4px 0; }
.g-toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 90px); transform: translateX(-50%) translateY(20px); opacity: 0;
  background: #0E1C17; color: #fff; font: 600 14px var(--g-font); padding: 10px 16px; border-radius: 12px; z-index: 1100; pointer-events: none;
  transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); box-sizing: border-box; text-align: center; }
.g-toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.g-update { position: fixed; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top, 0px) + 10px); z-index: 1050;
  display: flex; align-items: center; gap: 8px; border: 0; border-radius: 99px; padding: 10px 16px; background: var(--g-brand); color: var(--g-brand-fg);
  font: 700 14px var(--g-font); box-shadow: var(--g-shadow); cursor: pointer; max-width: calc(100vw - 32px); }

/* ---------------------------------------------------------------- Settings */
.g-set { font-family: var(--g-font); color: var(--g-fg); display: flex; flex-direction: column; gap: 18px; max-width: 720px; }
.g-sec h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--g-muted); margin: 0 0 8px 4px; font-weight: 800; }
.g-card { background: var(--g-card); border: 1px solid var(--g-line); border-radius: var(--g-radius); overflow: hidden; }
.g-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--g-line); flex-wrap: wrap; }
.g-card > .g-row:first-child, .g-card > .g-me + .g-row { border-top: 0; }
.g-me + .g-row { border-top: 1px solid var(--g-line) !important; }
.g-lab { font-weight: 700; font-size: 15px; display: flex; flex-direction: column; gap: 2px; flex: 1 1 180px; min-width: 0; }
.g-lab small { font-weight: 500; font-size: 12.5px; color: var(--g-muted); }
.g-val { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.g-muted { color: var(--g-muted); }
.g-small { font-size: 12.5px; }
.g-center { text-align: center; }
.g-pad16 { padding: 0 16px 12px; margin: 8px 0 0; }
.g-me { display: flex; gap: 12px; align-items: center; padding: 14px 16px; }
.g-me > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.g-me small { color: var(--g-muted); overflow-wrap: anywhere; }
.g-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--g-accent); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; }
.g-select { font: 600 14px var(--g-font); padding: 8px 10px; border-radius: 10px; border: 1.5px solid var(--g-line); background: var(--g-card); color: var(--g-fg); }
.g-seg { display: flex; padding: 4px; gap: 4px; }
.g-seg button { flex: 1; min-height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--g-fg); font: 700 14px var(--g-font); cursor: pointer; }
.g-seg button[aria-pressed="true"] { background: var(--g-brand); color: var(--g-brand-fg); }
.g-devs { border-top: 1px solid var(--g-line); }
.g-dev { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--g-line); }
.g-devic { width: 34px; height: 34px; border-radius: 10px; background: var(--g-soft); color: var(--g-brand); display: grid; place-items: center; flex: none; }
.g-devt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.g-devt small { color: var(--g-muted); overflow-wrap: anywhere; }
.g-devt em { font-style: normal; font-size: 11px; font-weight: 800; color: var(--g-brand); background: var(--g-soft); padding: 2px 6px; border-radius: 6px; margin-left: 4px; }
.g-signout { margin-top: 2px; }
.g-busy .g-pad { opacity: .55; pointer-events: none; transition: opacity .15s; }
.g-lab { flex: 1 1 120px; }
@media (max-height: 760px) {
  .g-gate { padding-top: calc(env(safe-area-inset-top, 0px) + 18px); }
  .g-tile { width: 52px; height: 52px; border-radius: 15px; margin-bottom: 8px; }
  .g-tile svg { width: 26px; height: 26px; }
  .g-sub { margin-bottom: 8px; } .g-who { margin-bottom: 10px; }
  .g-or { display: none; }
  .g-dots { margin: 10px 0 12px; }
  .g-pad { grid-template-columns: repeat(3, 64px); gap: 10px 20px; }
  .g-pad button, .g-pad span { width: 64px; height: 64px; }
  .g-msg { margin: 8px 0 0; } .g-foot { padding-top: 10px; }
}
