/* =========================================================
   Jome Tools theme
   The shared look for every page in jome-gg1/tools, taken from the Ad Board.
   Link it from a tool with:
     <link rel="stylesheet" href="../shared/jome-theme.css">   (a tool in its own folder)
     <link rel="stylesheet" href="shared/jome-theme.css">      (the toolbox itself)
   Fonts: Lilita One for headings and big numbers, Nunito for everything else.
   ========================================================= */
@import url("https://fonts.googleapis.com/css2?family=Lilita+One&family=Nunito:wght@600;700;800;900&display=swap");

:root {
  /* Brand colors */
  --navy: #0A2466;        /* ink, borders, primary buttons */
  --navy-hover: #1C3F96;
  --sky: #C4E8FA;         /* selected rows, highlights */
  --sky-soft: #EAF6FD;    /* page background */
  --white: #FFFFFF;       /* cards and inputs */
  --muted: #3E5486;       /* secondary text */
  --pink: #F27A93;        /* focus rings, "on air", drop markers */

  /* Status colors */
  --ok: #22A06B;
  --warn: #E8A317;
  --bad: #D4334A;
  --bad-ink: #B4233A;
  --bad-soft: #FFE3EA;
  --info: #5FA8E8;

  /* Type */
  --font-display: "Lilita One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, Consolas, monospace;

  /* Shape: chunky navy outlines with a hard offset shadow */
  --line: 3px;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 5px 6px 0 var(--navy);
  --shadow-sm: 3px 3px 0 var(--navy);

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }

body.jt {
  background: var(--sky-soft);
  color: var(--navy);
  font: 700 15px/1.45 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
.jt h1, .jt h2, .jt h3 { font-family: var(--font-display); font-weight: 400; margin: 0; line-height: 1.1; text-wrap: balance; }
.jt h1 { font-size: 34px; }
.jt h2 { font-size: 24px; }
.jt h3 { font-size: 20px; }

/* ---------- Page frame ---------- */
.jt-app {
  max-width: 1360px; margin: 0 auto;
  padding-block: 20px 60px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.jt-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.jt-bear {
  width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0; background: var(--white);
  border: 4px solid var(--navy); box-shadow: 0 0 0 3px var(--white), 4px 5px 0 3px var(--navy);
  object-fit: cover;
}
.jt-sub { color: var(--muted); font-weight: 800; font-size: 14px; margin: 2px 0 0; }
.jt-top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* "← Toolbox" link shown at the top of every tool */
.jt-back {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  font: 900 13px var(--font-body); letter-spacing: .04em; color: var(--navy);
  padding: 6px 12px; border-radius: 999px; border: var(--line) solid var(--navy); background: var(--white);
}
.jt-back:hover { background: var(--sky); }

/* ---------- Surfaces ---------- */
.jt-card {
  background: var(--white); border: var(--line) solid var(--navy); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; min-width: 0;
}
.jt-hint { color: var(--muted); font-size: 13px; font-weight: 700; }
.jt-label { font-weight: 900; font-size: 13px; letter-spacing: .04em; }
.jt-eyebrow { font-size: 12px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.jt-empty { padding: 16px; border: var(--line) dashed var(--navy); border-radius: 16px; text-align: center; color: var(--muted); }

/* ---------- Buttons ---------- */
.jt-btn {
  font: 900 14px var(--font-body); color: var(--navy); background: var(--white);
  border: var(--line) solid var(--navy); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
  padding: 8px 14px; min-height: 44px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.jt-btn:hover { background: var(--sky-soft); }
.jt-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--navy); }
.jt-btn.primary { background: var(--navy); color: var(--white); }
.jt-btn.primary:hover { background: var(--navy-hover); }
.jt-btn.danger { color: var(--bad-ink); border-color: var(--bad-ink); box-shadow: 3px 3px 0 var(--bad-ink); }
.jt-btn.small { min-height: 36px; padding: 5px 10px; font-size: 13px; }
.jt-btn svg { width: 18px; height: 18px; }

/* ---------- Status pill (Synced / Saving / Error) ---------- */
.jt-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: var(--white); border: var(--line) solid var(--navy); font-weight: 900; font-size: 13px;
}
.jt-pill i { width: 10px; height: 10px; border-radius: 50%; background: #8A9BAE; display: inline-block; }
.jt-pill.saved i { background: var(--ok); }
.jt-pill.saving i, .jt-pill.pending i { background: var(--warn); }
.jt-pill.error i { background: var(--bad); }
.jt-pill.local i { background: var(--info); }

/* ---------- Chips ---------- */
.jt-chip {
  font-size: 11px; font-weight: 900; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
  background: var(--sky-soft); border: 2px solid var(--navy);
}
.jt-chip.live { background: var(--navy); color: var(--white); }
.jt-chip.warn { background: var(--bad-soft); border-color: var(--bad-ink); color: var(--bad-ink); }

/* ---------- Form fields ---------- */
.jt-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.jt input[type=text], .jt input[type=url], .jt input[type=number], .jt input[type=date],
.jt input[type=datetime-local], .jt input[type=search], .jt select, .jt textarea {
  font: 800 16px var(--font-body); color: var(--navy); background: var(--white);
  border: var(--line) solid var(--navy); border-radius: var(--radius-sm);
  padding: 10px 12px; min-height: 46px; width: 100%; min-width: 0;
}
.jt textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.jt input[type=range] { width: 100%; accent-color: var(--navy); min-height: 32px; }

/* Segmented control / tabs */
.jt-seg { display: inline-flex; border: var(--line) solid var(--navy); border-radius: var(--radius-sm); overflow: hidden; flex-wrap: wrap; }
.jt-seg button { font: 900 14px var(--font-body); background: var(--white); color: var(--navy); border: 0; padding: 10px 16px; min-height: 44px; cursor: pointer; }
.jt-seg button + button { border-left: var(--line) solid var(--navy); }
.jt-seg button[aria-pressed=true], .jt-seg button[aria-selected=true] { background: var(--navy); color: var(--white); }

/* On/off switch: <label class="jt-switch"><input type="checkbox"><span></span> Label</label> */
.jt-switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; min-height: 44px; }
.jt-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.jt-switch span { width: 46px; height: 28px; border-radius: 999px; background: #C9D4DF; border: var(--line) solid var(--navy); position: relative; flex-shrink: 0; transition: background .15s; }
.jt-switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--white); border: 2px solid var(--navy); transition: transform .15s; }
.jt-switch input:checked + span { background: var(--navy); }
.jt-switch input:checked + span::after { transform: translateX(18px); }

/* ---------- Toast ---------- */
.jt-toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 10;
  transform: translateX(-50%) translateY(140%); transition: transform .25s;
  background: var(--navy); color: var(--white); font-weight: 900; padding: 12px 18px;
  border-radius: 14px; box-shadow: 0 0 0 3px var(--white); max-width: calc(100% - 32px);
}
.jt-toast.show { transform: translateX(-50%) translateY(0); }

/* ---------- Focus and motion ---------- */
.jt :focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
.jt-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  .jt *, .jt *::before, .jt *::after { transition: none !important; animation: none !important; }
}
