/* =========================================================
   Safety Cross (Safety hub, version 48)
   Loaded after theme.css on the tool pages. Same frame as the other tools (.tk): the board on the left, focus and notes
   on the right. Safety coral takes the place of safety yellow inside this tool. The cross is a square 7 by 7 grid like
   the paper board; on wider screens its corners hold the counts, the color key and the month's focus, and on phones
   (640 px and under) the counts sit above the cross and the key below it.
   The three day colors stay the same in both themes, and each has a mark (check, !, x) so the board never relies on
   color alone: green #267a4c and red #d33a2c take white (5.3:1 and 4.8:1), yellow #f2b705 takes ink (9:1).
   ========================================================= */
.sx .s-g, .sx-sheet .s-g { --sc: #267a4c; --sc-ink: #fff; }
.sx .s-y, .sx-sheet .s-y { --sc: #f2b705; --sc-ink: #1b2125; }
.sx .s-r, .sx-sheet .s-r { --sc: #d33a2c; --sc-ink: #fff; }

@media screen {

#panel-cross {
  --mascot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 58'%3E%3Cellipse cx='25' cy='54' rx='18' ry='3' fill='%231B2125' opacity='.15'/%3E%3Cg transform='translate(1 4)'%3E%3Cpath d='M24 4l13 38H11z' fill='%23F47C66' stroke='%231B2125' stroke-width='2.4' stroke-linejoin='round'/%3E%3Cpath d='M20 16.5h8' stroke='%23fff' stroke-width='3' stroke-linecap='round'/%3E%3Crect x='6' y='41' width='36' height='5' rx='2' fill='%23F47C66' stroke='%231B2125' stroke-width='2.4'/%3E%3Ccircle cx='21' cy='25.5' r='2' fill='%231B2125'/%3E%3Ccircle cx='27' cy='25.5' r='2' fill='%231B2125'/%3E%3Cpath d='M22 30q2 2.2 4 0' fill='none' stroke='%231B2125' stroke-width='1.9' stroke-linecap='round'/%3E%3Cellipse cx='18.6' cy='30.2' rx='1.9' ry='1.2' fill='%23F4B6B0'/%3E%3Cellipse cx='29.4' cy='30.2' rx='1.9' ry='1.2' fill='%23F4B6B0'/%3E%3C/g%3E%3C/svg%3E");
  --mascot-w: 50px; --mascot-h: 60px; --note: "one color a day";
  /* the tool's accent: Safety coral (ink text on it is 6.9:1) */
  --yel: #f47c66; --yel-hover: #f6917f; --yel-soft: #fde6e1; --yel-line: #f6c3b8; --yel-ink: #8f2c1c; --on-yel: #1b2125; --hl: #f47c66;
}
:root:lang(es) #panel-cross { --note: "un color por día"; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-tc-theme="light"]) #panel-cross { --yel-soft: #3a1f19; --yel-line: #6b382d; --yel-ink: #f6b4a7; --hl: #8a3b2d; }
}
:root[data-theme="dark"]:not([data-tc-theme="light"]) #panel-cross, :root[data-tc-theme="dark"] #panel-cross { --yel-soft: #3a1f19; --yel-line: #6b382d; --yel-ink: #f6b4a7; --hl: #8a3b2d; }

/* ---------- the frame: the board on the left, focus and notes on the right ---------- */
.sx .tk-main { grid-template-columns: minmax(0, 1fr) minmax(280px, 330px); }
.sx-side { display: grid; gap: 18px; align-content: start; background: var(--canvas); }
@media (min-width: 921px) { .sx-side { border-left: 2px solid var(--edge); border-radius: 0 16px 16px 0; } }
.sx .tk-try, .sx .notice, .sx .warn { margin: 8px 0 0; }

/* ---------- the month and its arrows ---------- */
.sx-mhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; min-height: 40px; }
.sx-mnav { display: flex; align-items: center; gap: 8px; }
.sx-mnav h2 { margin: 0; min-width: 8.4em; font: 700 24px/1.1 var(--f-cond); text-align: center; }
.sx-mbtn { flex: none; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 2px solid var(--edge); border-radius: 10px;
  background: var(--surface); color: var(--ink); cursor: pointer; }
.sx-mbtn:hover:not(:disabled) { background: var(--yel-soft); }
.sx-mbtn:disabled { border-style: dashed; color: var(--soft); cursor: default; }
.sx-mbtn svg { width: 18px; height: 18px; }
.sx-print-btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- today, one tap ---------- */
.sx-today { display: grid; gap: 10px; margin-top: 14px; padding: 12px 14px 14px; border: 2px solid var(--edge); border-radius: 14px; background: var(--yel-soft); }
.sx-today-l { margin: 0; font-size: 15px; line-height: 1.3; }
.sx-today-l b { margin-right: 4px; font: 700 19px/1 var(--f-cond); }
.sx-picks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sx-pick { display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 48px; padding: 6px 10px; border: 2px solid var(--edge); border-radius: 10px;
  background: var(--surface); color: var(--ink); font: 600 14px/1.2 var(--f-ui); text-align: left; cursor: pointer; }
.sx-pick:hover { box-shadow: 2px 2px 0 var(--drop); }
.sx-pick-t { min-width: 0; overflow-wrap: anywhere; }
.sx-sw { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border: 2px solid #1b2125; border-radius: 7px; background: var(--sc); color: var(--sc-ink); }
.sx-sw svg { width: 16px; height: 16px; }
/* the color the day has: filled, lifted, and a thicker outline (so it shows in forced colors too) */
.sx-pick[aria-pressed="true"] { border-width: 3px; padding: 5px 9px; background: var(--sc); color: var(--sc-ink); box-shadow: var(--pop-sm); }
.sx-pick[aria-pressed="true"] .sx-sw { border-color: currentColor; }
.sx-picks-big { grid-template-columns: minmax(0, 1fr); }
.sx-picks-big .sx-pick { min-height: 54px; font-size: 15.5px; }

/* ---------- the cross: a square 7 by 7 grid, so every box is square ---------- */
.sx-cross { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(7, minmax(0, 1fr)); gap: 5px;
  width: 100%; max-width: 640px; aspect-ratio: 1; margin: 18px auto 0; }
.sx-day { position: relative; min-width: 0; min-height: 0; padding: 0; border: 2px solid var(--edge); border-radius: 9px; background: var(--surface);
  color: var(--ink); font: inherit; overflow: hidden; cursor: pointer; }
.sx-day:hover:not(:disabled) { box-shadow: 2px 2px 0 var(--drop); }
.sx-day:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; z-index: 1; }
.sx-num { position: absolute; top: 5px; left: 7px; font: 700 clamp(13px, 2.6vw, 19px)/1 var(--f-cond); }
.sx-day[class*=" s-"] { background: var(--sc); color: var(--sc-ink); }
.sx-mark { position: absolute; right: 8%; bottom: 8%; width: 40%; height: 40%; max-width: 30px; max-height: 30px; }
.sx-mark svg { display: block; width: 100%; height: 100%; }
.sx-dot { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
/* today: a coral ring (focus takes it over while the box has focus); its name says "today" too */
.sx-day.today { outline: 3px solid var(--yel); outline-offset: 1px; }
.sx-day.today:focus-visible { outline-color: var(--focus); }
.sx-day.later { border-style: dashed; border-color: var(--line-2); background: transparent; color: var(--soft); cursor: default; }
.sx-day.out { border: 2px dashed var(--line-2); background: repeating-linear-gradient(135deg, transparent 0 7px, var(--line) 7px 8px); cursor: default; }

/* the corners: the counts, the key with this month's tally, the best run and the focus */
.sx-corner { display: flex; flex-direction: column; min-width: 0; min-height: 0; border: 2px solid var(--edge); border-radius: 12px; background: var(--surface); overflow: hidden; }
.sx-ch { margin: 0; padding: 7px 10px; background: var(--ink); color: var(--surface); font: 700 12.5px/1.2 var(--f-ui); }
.sx-big { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; }
.sx-big b { font: 700 40px/1 var(--f-cond); font-variant-numeric: tabular-nums; }
.sx-big span { font-size: 13px; color: var(--muted); }
/* the small "days" sits on the number's baseline and hangs below it, so the number keeps room under it */
.sx-corner .sx-big { margin-top: auto; padding: 6px 10px 10px; }
.sx-corner .sx-big:has(+ .sx-asof) { padding-bottom: 2px; }
.sx-corner .sx-big b { font-size: clamp(36px, 5.4vw, 56px); }
.sx-asof { padding: 0 10px 8px; font-size: 12px; color: var(--muted); }
.sx-c-key ul { list-style: none; margin: 0; padding: 6px 8px 8px; display: grid; gap: 4px; align-content: start; }
.sx-c-key li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px; font-size: 12px; line-height: 1.2; }
.sx-c-key .sx-sw { width: 20px; height: 20px; border-width: 1.5px; border-radius: 5px; }
.sx-c-key .sx-sw svg { width: 13px; height: 13px; }
.sx-kn { font: 700 15px/1 var(--f-cond); font-variant-numeric: tabular-nums; }
.sx-ft { margin: 0; padding: 8px 10px; font: 700 16px/1.25 var(--f-cond); overflow-wrap: anywhere; }
.sx-ft.none { font: 400 13px/1.35 var(--f-ui); color: var(--muted); }

/* phones: no corners; the counts above the cross, the key below it */
.sx-stats, .sx-key { display: none; }
@media (max-width: 640px) {
  .sx-corner { display: none; }
  .sx-stats { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 14px; }
  .sx-stat { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px 10px; border: 2px solid var(--edge); border-radius: 12px; background: var(--surface); }
  .sx-stat-l { font: 600 12.5px/1.25 var(--f-ui); color: var(--muted); }
  .sx-stat .sx-big { margin-top: auto; }
  .sx-stat .sx-asof { padding: 0; }
  .sx-cross { gap: 4px; margin-top: 14px; }
  .sx-day { border-radius: 7px; }
  .sx-num { top: 4px; left: 5px; }
  .sx-dot { top: 4px; right: 4px; width: 6px; height: 6px; }
  .sx-key { display: flex; flex-wrap: wrap; gap: 6px 14px; list-style: none; margin: 12px 0 0; padding: 0; }
  .sx-key li { display: flex; align-items: center; gap: 6px; font-size: 13px; }
  .sx-key .sx-sw { width: 20px; height: 20px; border-width: 1.5px; border-radius: 5px; }
  .sx-key .sx-sw svg { width: 13px; height: 13px; }
  .sx-today { padding: 10px 10px 12px; }
  .sx-pick { flex-direction: column; align-items: flex-start; gap: 6px; padding: 8px; font-size: 13px; }
  .sx-pick[aria-pressed="true"] { padding: 7px; }
  .sx-picks-big .sx-pick { flex-direction: row; align-items: center; gap: 9px; padding: 6px 10px; font-size: 15px; }
  .sx-picks-big .sx-pick[aria-pressed="true"] { padding: 5px 9px; }
}

.sx-left { margin: 14px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--ink); font-size: 14px; }
.sx-program { margin: 12px 0 0; }

/* ---------- focus and notes ---------- */
.sx-side-h { margin: 0; min-height: 40px; display: flex; align-items: center; font: 700 24px/1.1 var(--f-cond); }
.sx-side .tk-l em { font-style: normal; font-weight: 400; color: var(--muted); }
.sx-box h3 { margin: 0 0 8px; font: 700 19px/1.2 var(--f-cond); }
.sx-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sx-notes[hidden] { display: none; }
.sx-nrow { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 8px 8px 10px;
  border: 2px solid var(--edge); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.sx-nrow:hover { box-shadow: 2px 2px 0 var(--drop); }
.sx-nrow > svg { width: 18px; height: 18px; color: var(--muted); }
.sx-nt { display: grid; gap: 1px; min-width: 0; font-size: 14px; line-height: 1.35; }
.sx-ns { font-size: 13px; color: var(--muted); }
.sx-nn { overflow-wrap: anywhere; }
.sx-none { margin: 0; color: var(--muted); font-size: 14px; }
.sx-carry summary { min-height: 44px; display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; list-style: none; }
.sx-carry summary::-webkit-details-marker { display: none; }
.sx-carry summary::before { content: ""; flex: none; width: 7px; height: 7px; margin: 0 2px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); }
.sx-carry[open] summary::before { transform: rotate(45deg); }
.sx-carry .tk-f { margin-top: 4px; }
.sx-carry #sx-carry { max-width: 160px; font-variant-numeric: tabular-nums; }
.sx-carry .tk-hint { margin: 6px 0 0; }

/* ---------- the day window ---------- */
@media (min-width: 641px) { .sx-dlg { width: min(460px, calc(100vw - 32px)); } }
.sx-day-q { display: grid; gap: 8px; }
.sx-day-q .tk-l { margin: 0; }
.tk .sx-clear { justify-self: start; min-height: 36px; }
.sx-dlg textarea:disabled { opacity: .6; cursor: not-allowed; }
.sx-dlg .tk-l em { font-style: normal; font-weight: 400; color: var(--muted); }

/* ---------- phones and tablets: one column ---------- */
@media (max-width: 920px) {
  .sx .tk-main { display: block; }
  .sx-side { padding-top: 16px; border-top: 2px solid var(--edge); }
}

} /* end screen */

/* ---------- the printed month (screen preview and paper), letter upright ---------- */
.sx-s-month { margin-top: 4px; font: 700 17px/1.2 var(--f-cond); color: var(--pt-sub); }
.sx-s-cross { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(7, 100px); gap: 4px; margin-top: 16px;
  break-inside: avoid; page-break-inside: avoid; }
.sx-s-day { position: relative; border: 1.5px solid var(--pt-head); border-radius: 6px; background: #fff; }
.sx-s-day.out { border: 1.5px dashed var(--pt-rule); }
.sx-s-n { position: absolute; top: 6px; left: 8px; font: 700 18px/1 var(--f-cond); color: var(--pt-head); }
.sx-s-day[class*=" s-"] { background: var(--sc); }
.sx-s-day[class*=" s-"] .sx-s-n { color: var(--sc-ink); }
.sx-s-m { position: absolute; right: 9px; bottom: 9px; width: 30px; height: 30px; color: var(--sc-ink); }
.sx-s-m svg { display: block; width: 100%; height: 100%; }
.sx-s-corner { display: flex; flex-direction: column; min-width: 0; border: 1.5px solid var(--pt-head); border-radius: 6px; overflow: hidden; }
.sx-s-ch { padding: 6px 9px; border-bottom: 1.5px solid var(--pt-head); background: var(--pt-band); color: var(--pt-head); font: 700 10.5px/1.25 var(--f-ui); }
.sx-s-big { display: flex; align-items: baseline; gap: 6px; margin-top: auto; padding: 4px 10px 0; }
.sx-s-big b { font: 700 54px/1 var(--f-cond); color: var(--pt-head); }
.sx-s-big span { font-size: 11px; color: var(--pt-label); }
.sx-s-asof { padding: 2px 10px 8px; font-size: 10px; color: var(--pt-label); }
.sx-s-corner > .sx-s-big:last-child { padding-bottom: 10px; }
.sx-s-key { list-style: none; margin: 0; padding: 7px 9px; display: grid; gap: 6px; }
.sx-s-key li { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 7px; font-size: 10.5px; line-height: 1.2; color: #1b2125; }
.sx-s-key b { font: 700 14px/1 var(--f-cond); color: var(--pt-head); }
.sx-s-sw { width: 18px; height: 18px; display: grid; place-items: center; border: 1.2px solid #1b2125; border-radius: 4px; background: var(--sc); color: var(--sc-ink); }
.sx-s-sw svg { width: 12px; height: 12px; }
.sx-s-focus { margin: 0; padding: 8px 10px; font: 700 15px/1.3 var(--f-cond); color: var(--pt-head); overflow-wrap: anywhere; }
.sx-s-lines { display: grid; gap: 22px; padding: 24px 10px 10px; }
.sx-s-lines i { border-bottom: 1px solid var(--pt-line); }
.sx-s-how { margin: 12px 0 0; font-size: 11px; color: var(--pt-sub); }
/* Ink saver: no fills; the marks say which color a day was */
[data-pt="ink"] .sx-s-day[class*=" s-"], [data-pt="ink"] .sx-s-sw { background: #fff; }
[data-pt="ink"] .sx-s-day .sx-s-n, [data-pt="ink"] .sx-s-m, [data-pt="ink"] .sx-s-sw { color: #1b2125; }

/* Ctrl+P on the Safety Cross: the board without the buttons */
@media print {
  .sx-today, .sx-mbtn, .sx-print-btn, .sx-side, .sx-left, .sx-stats, .sx-key { display: none !important; }
  .sx-corner { display: flex !important; }
  .sx-cross { max-width: 6.5in; }
  .sx-day, .sx-corner { border: 1.5px solid #1b2125 !important; }
}
