/* Batch 6, group calc6: days until Christmas, week number, Julian date converter, hex / binary calculator, online ruler.
   Widget: app/views/tools/_b6-calc6.php. Script: assets/js/tools/_b6-calc6.js. Prefix c6-. */
.c6 { min-width: 0; }
.c6 [hidden] { display: none !important; }
.c6-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 900px) {
  .c6-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .c6-cols-xmas { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
}
.c6-card { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.c6-mt { margin-top: 14px; }
.c6-h { margin: 0 0 10px; font-size: 1.02rem; line-height: 1.3; }
.c6-h-gap { margin-top: 18px; }
.c6-kicker { margin: 0 0 8px; font-size: .95rem; font-weight: 700; color: var(--brand-ink); letter-spacing: .01em; }
.c6-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 10px; }
.c6-row-tight { margin-top: 0; }
.c6-hrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 6px; }
.c6-hrow .c6-h { margin: 0; }
.c6-small { margin: 8px 0 0; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.c6-nomargin { margin: 0; }
.c6-mono { font-family: var(--mono); overflow-wrap: anywhere; }
.c6-inline { font-weight: 600; font-size: .9rem; }
.c6 input.c6-num { width: 110px; }
.c6-tabs { margin-bottom: 10px; }
.c6-hrow .c6-tabs, .c6-rbar .c6-tabs { margin-bottom: 0; }
.c6-bad { color: #b91c1c; }
.c6-ok { color: #15803d; }
.c6-out { margin-top: 12px; }
.c6-out .out-v { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
.c6-out .out-row { gap: 10px; }
.c6-dl { display: grid; margin: 10px 0 0; font-size: .92rem; }
.c6-dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.c6-dl dt { color: var(--muted); }
.c6-dl dd { margin: 0; text-align: right; font-weight: 600; min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.c6-note { margin-top: 8px; }
.c6-answer { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--soft); font-weight: 600; line-height: 1.5; }
.c6-answer .copy-btn { margin-left: 6px; }
.c6-fields3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 560px) { .c6-fields3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .c6-fields3 .field:last-child { grid-column: 1 / -1; } }

/* Christmas countdown */
.c6-hero { background: linear-gradient(160deg, #fff 0%, var(--soft) 100%); }
.c6-banner { margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; background: #dcfce7; color: #166534; font-weight: 700; }
.c6-clock { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.c6-clock > div { padding: 12px 4px 10px; text-align: center; border-radius: 12px; background: #b91c1c; color: #fff; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15); }
.c6-clock > div:nth-child(2n) { background: #166534; }
.c6-clock b { display: block; font-size: clamp(1.6rem, 6vw, 2.6rem); line-height: 1.1; font-variant-numeric: tabular-nums; }
.c6-clock span { font-size: .78rem; opacity: .9; text-transform: uppercase; letter-spacing: .04em; }
.c6-sub { margin: 10px 0 0; font-size: .95rem; line-height: 1.45; }
.c6-stats { margin-top: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.c6-stats .stat { padding: 10px 4px; background: #fff; }
.c6-stats .stat b { font-size: 1.25rem; }
.c6-share { margin-top: 12px; }
.c6-sharetext { margin: 0; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; background: #fff; font-size: .92rem; line-height: 1.45; }
.c6-chips { margin: 8px 0 12px; }
.c6-table td, .c6-table th { padding: 8px 10px; }
.c6-table tbody th { background: none; font-weight: 600; white-space: normal; }
.c6-num-cell { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.c6-table thead th:last-child { text-align: right; }
.c6-on td, .c6-on th { background: #eef2ff !important; }
.c6-link { padding: 0; border: 0; background: none; color: var(--brand); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.c6-link:hover { text-decoration: underline; }

/* Week number */
.c6-bignum { margin: 0; font-size: 1.4rem; font-weight: 700; }
.c6-bignum b { font-size: 3rem; line-height: 1; color: var(--brand-ink); font-variant-numeric: tabular-nums; }
.c6-caltable { max-height: 420px; overflow: auto; margin-top: 10px; }
.c6-caltable thead th { position: sticky; top: 0; z-index: 1; }
.c6-caltable tbody th { background: none; font-variant-numeric: tabular-nums; }
.c6-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--brand); color: #fff; font-size: .72rem; font-weight: 600; }

/* Hex / binary calculator */
.c6-calc { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 600px) { .c6-calc { grid-template-columns: minmax(0, 1fr) 170px minmax(0, 1fr); align-items: end; } }
.c6-calc input, .c6-conv input { font-family: var(--mono); }
.c6-expr { margin: 0 0 6px; color: var(--muted); font-size: .9rem; }
.c6-steps:empty { display: none; }
.c6-stepbox { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.c6-gridwrap { overflow-x: auto; margin-top: 8px; }
.c6-grid { width: auto; border-collapse: collapse; font-family: var(--mono); font-size: 1rem; }
.c6-grid td, .c6-grid th { min-width: 1.35em; padding: 2px 3px; border: 0; text-align: center; }
.c6-grid th { padding-right: 8px; background: none; color: var(--muted); font-size: .74rem; font-weight: 600; text-align: right; font-family: var(--font); }
.c6-grid .c6-carry td { color: #b45309; font-size: .78rem; font-weight: 700; }
.c6-grid .c6-line td { border-bottom: 2px solid var(--ink); }
.c6-grid .c6-sum td { font-weight: 700; color: var(--brand-ink); }
.c6-bits { padding: 10px 12px; border-radius: 10px; background: #0f172a; color: #e2e8f0; font-size: 1rem; letter-spacing: .04em; line-height: 1.6; }
.c6-twos .out-rows { margin-top: 8px; }
.c6-convmsg.c6-bad { color: #b91c1c; }

/* Online ruler */
.c6-rbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 10px; }
.c6-calchip { padding: 5px 10px; border-radius: 999px; font-size: .82rem; font-weight: 600; }
.c6-calchip.c6-warn { background: #fef3c7; color: #92400e; }
.c6-calchip.c6-okchip { background: #dcfce7; color: #166534; }
.c6-rwrap { position: relative; width: 100%; overflow: hidden; border: 1px solid #d6c98a; border-radius: 4px; background: #fffbea; }
.c6-rwrap.c6-vert { width: 132px; }
.c6-rcanvas { display: block; touch-action: none; cursor: crosshair; }
.c6-rcanvas:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.c6-reading { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--soft); font-weight: 600; font-variant-numeric: tabular-nums; }
.c6-cal { margin-top: 14px; }
.c6-cardbox-wrap { margin-top: 10px; min-width: 0; }
.c6-cardbox { display: flex; align-items: flex-end; justify-content: flex-start; padding: 8px; box-sizing: border-box; border: 2px solid var(--brand); border-radius: 10px; background: linear-gradient(135deg, #e0e7ff, #f5f3ff); }
.c6-cardbox span { font-size: .8rem; font-weight: 600; color: var(--brand-ink); }
.c6-crange { flex: 1 1 160px; min-width: 120px; }
