/* Do by Businlog: "What does juggling tools cost you?" calculator (I3). Markup: templates/_calc_compare.html,
   behaviour: static/compare.js. Everything is prefixed "cc-" and scoped under .cc. Light only, 360px safe. */

.cc { --cc-violet: #5b3df5; --cc-violet-2: #8b7bff; --cc-sun: #ffb020; --cc-pink: #ff4d8d;
  --cc-save-ink: #0f7a55; --cc-save-soft: #e9f8f1; --cc-more-ink: #8a4b00; --cc-more-soft: #fff4e2;
  position: relative; }

/* hide what only works with (or without) JavaScript; html.js is set inline in base.html <head> */
html:not(.js) .cc .cc-js { display: none !important; }
.js .cc .cc-nojs-actions { display: none; }

/* ---------- head ---------- */
.cc-head { max-width: 46rem; margin: 0 auto clamp(28px, 4vw, 44px); text-align: center; }
.cc-head h2 { margin: 0 0 12px; font-size: clamp(1.75rem, 1.22rem + 2.2vw, 2.6rem); line-height: 1.12; letter-spacing: -.03em; }
.cc-head .lead { margin: 0 auto; }

/* ---------- layout ---------- */
.cc-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(16px, 2.4vw, 28px); align-items: start; margin: 0; }
@media (min-width: 960px) {
  .cc-form { grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); }
  .cc-out { position: sticky; top: calc(var(--head-h, 64px) + 20px); }
}
.cc-in { display: grid; gap: clamp(14px, 2vw, 20px); min-width: 0; }
.cc-out { min-width: 0; }

.cc-card { background: var(--surface, #fff); border: 1px solid var(--line, rgba(70, 45, 10, .1)); border-radius: var(--r-lg, 24px);
  padding: clamp(18px, 3vw, 28px); box-shadow: 0 1px 2px rgba(70, 45, 10, .05), 0 14px 32px -18px rgba(255, 140, 40, .3); min-width: 0; }
fieldset.cc-card { margin: 0; }

.cc-lab { display: block; font: 650 1rem/1.35 var(--f-display); letter-spacing: -.01em; color: var(--ink); }
.cc-hint { margin: 10px 0 0; color: var(--ink-3); font-size: .875rem; line-height: 1.55; }

/* ---------- team size ---------- */
.cc-team-top { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.cc-team-top .cc-lab { font-size: 1.08rem; }
.cc-stepper button { min-width: 44px; }
.cc-stepper button:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; border-radius: 0; }
.cc-stepper input { width: 76px; }
.cc-stepper input:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; border-radius: 0; }
.cc-range { display: block; width: 100%; margin: 20px 0 4px; cursor: pointer; touch-action: pan-y; }
/* a taller hit area for the slider thumb on touch screens */
.cc-range::-webkit-slider-thumb { width: 28px; height: 28px; }

/* ---------- tool rows ---------- */
.cc-tools { padding-top: clamp(16px, 2.6vw, 24px); }
.cc-tools-legend { padding: 0; float: left; width: 100%; margin: 0 0 12px; }  /* float: lets the legend sit inside the padding like a heading */
.cc-tools-legend + * { clear: both; }
.cc-tools-title { font: 700 1.08rem/1.3 var(--f-display); letter-spacing: -.01em; color: var(--ink); }
.cc-flag { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 6px; padding: 9px 14px; border-radius: 12px;
  background: var(--cc-more-soft); border: 1px solid rgba(255, 159, 26, .35); color: var(--cc-more-ink); font-size: .9rem; font-weight: 600; line-height: 1.45; }
.cc-flag-ic { flex: none; display: inline-flex; margin-top: 2px; }
.cc[data-edited] .cc-flag { background: #f1efff; border-color: rgba(91, 61, 245, .22); color: #4b2fd6; }

.cc-rows { list-style: none; margin: 0; padding: 0; }
.cc-row { display: grid; grid-template-columns: 40px minmax(0, 1fr); grid-template-areas: "ic main" "ctl ctl"; gap: 10px 14px;
  padding: 16px 0; border-bottom: 1px solid var(--line); }
.cc-row:last-child { border-bottom: 0; }
.cc-row-ic { grid-area: ic; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #6d4bff, #8b5cf6); box-shadow: 0 6px 14px -8px rgba(91, 61, 245, .7); }
.cc-ic-meet { background: linear-gradient(135deg, #0ea371, #12b886); box-shadow: 0 6px 14px -8px rgba(18, 184, 134, .8); }
.cc-ic-files { background: linear-gradient(135deg, #f08c00, #ffb020); box-shadow: 0 6px 14px -8px rgba(240, 140, 0, .8); }
.cc-ic-rota { background: linear-gradient(135deg, #e0367a, #ff4d8d); box-shadow: 0 6px 14px -8px rgba(224, 54, 122, .7); }
.cc-row-main { grid-area: main; min-width: 0; }
.cc-row-do { margin: 3px 0 0; color: var(--ink-3); font-size: .86rem; line-height: 1.5; }
.cc-row-do b { color: var(--ink-2); font-weight: 650; }
.cc-row-ctl { grid-area: ctl; display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; }
@media (min-width: 560px) {
  .cc-row { grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas: "ic main ctl"; align-items: start; }
  .cc-row-ctl { flex-direction: column; align-items: flex-end; gap: 8px; }
  .cc-row-ctl .cc-unit { display: none; }
}

.cc-money { position: relative; display: inline-flex; align-items: center; }
.cc-money-sym { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-weight: 650; color: var(--ink-2); pointer-events: none; }
.cc-money input { width: 112px; height: 46px; padding: 0 12px 0 28px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface);
  color: var(--ink); font: 650 1.06rem/1 var(--f-body); font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield;
  transition: border-color .15s, box-shadow .15s; }
.cc-money input::-webkit-outer-spin-button, .cc-money input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cc-money input:hover { border-color: rgba(91, 61, 245, .45); }
.cc-money input:focus { border-color: var(--cc-violet); box-shadow: 0 0 0 4px rgba(91, 61, 245, .16); outline: none; }
.cc-money input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.cc-unit { color: var(--ink-3); font-size: .8rem; line-height: 1.2; }

.cc-keep { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 2px 4px; margin: 0 -4px; border-radius: 8px;
  font-size: .84rem; font-weight: 550; color: var(--ink-2); cursor: pointer; user-select: none; }
.cc-keep input { width: 18px; height: 18px; margin: 0; accent-color: var(--cc-violet); cursor: pointer; flex: none; }
.cc-keep:hover { color: var(--ink); }
.cc-row.is-kept .cc-keep { color: #4b2fd6; }

.cc-subtotal { margin: 4px 0 0; padding: 14px 16px; border-radius: 14px; background: var(--surface-2, #fffaf2); border: 1px solid var(--line);
  font-size: .95rem; color: var(--ink-2); }
.cc-subtotal b { color: var(--ink); font: 750 1.08rem/1 var(--f-display); font-variant-numeric: tabular-nums; }

.cc-nojs-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 16px; }
.cc-reset-link { font-weight: 600; font-size: .92rem; }

/* ---------- result ---------- */
.cc-result { position: relative; overflow: hidden; }
.cc-result::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg, #5b3df5, #ff4d8d, #ffb020); }
.cc-result-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.cc-result-h { margin: 0; font: 650 .78rem/1 var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: #c2410c; }
.cc-plan { border: 0; margin: 0; padding: 0; min-width: 0; }
.cc-plan .seg label { padding: 8px 14px; font-size: .86rem; }

.cc-verdict { padding: 18px 18px 16px; border-radius: 18px; background: var(--cc-save-soft); border: 1px solid rgba(18, 184, 134, .28);
  transition: background-color .25s, border-color .25s; }
.cc-result[data-tone="more"] .cc-verdict { background: var(--cc-more-soft); border-color: rgba(255, 159, 26, .38); }
.cc-result[data-tone="same"] .cc-verdict { background: #f3f1ff; border-color: rgba(91, 61, 245, .2); }
.cc-verdict p { margin: 0; }
.cc-verdict-k { font-size: .86rem; font-weight: 600; color: var(--ink-2); }
.cc-verdict-big { margin-top: 6px !important; font: 700 clamp(1.3rem, 1.05rem + 1.1vw, 1.7rem)/1.2 var(--f-display); letter-spacing: -.02em; color: var(--ink); overflow-wrap: anywhere; }
.cc-amt { display: inline-block; font-size: 1.45em; font-weight: 780; letter-spacing: -.04em; font-variant-numeric: tabular-nums; color: var(--cc-save-ink); margin-right: .1em; }
.cc-result[data-tone="more"] .cc-amt { color: var(--cc-more-ink); }
.cc-verdict-sub { margin-top: 8px !important; color: var(--ink-2); font-size: .94rem; line-height: 1.55; }

.cc-table { width: 100%; border-collapse: collapse; margin: 18px 0 0; font-variant-numeric: tabular-nums; table-layout: fixed; }
.cc-table thead th { font: 600 .76rem/1.2 var(--f-body); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); text-align: right; padding: 0 0 8px; }
.cc-table thead th:first-child { width: 52%; }
.cc-table tbody th, .cc-table tbody td { padding: 12px 0; border-top: 1px solid var(--line); vertical-align: top; }
.cc-table tbody th { text-align: left; font-weight: 400; padding-right: 12px; }
.cc-table tbody td { text-align: right; font: 700 1rem/1.3 var(--f-display); color: var(--ink); overflow-wrap: anywhere; padding-left: 8px; }
.cc-table tbody td + td { color: var(--ink-2); font-weight: 600; }
.cc-t-name { display: block; font: 650 .95rem/1.3 var(--f-display); color: var(--ink); }
.cc-t-note { display: block; margin-top: 2px; font-size: .78rem; line-height: 1.35; color: var(--ink-3); }
.cc-t-pick { display: inline-block; margin-left: 4px; padding: 2px 7px; border-radius: 999px; vertical-align: 2px;
  font: 650 .66rem/1.3 var(--f-body); letter-spacing: .04em; text-transform: uppercase; color: #4b2fd6; background: #efecff; }

.cc-bar { display: flex; height: 8px; margin-top: 9px; border-radius: 999px; background: var(--bg-2, #fff3e0); overflow: hidden; }
.cc-bar-a, .cc-bar-k { display: block; height: 100%; min-width: 0; transition: width .45s cubic-bezier(.2, .7, .2, 1); }
.cc-t-now .cc-bar-a { background: linear-gradient(90deg, #ffb020, #ff4d8d); }
.cc-t-do .cc-bar-a { background: linear-gradient(90deg, #5b3df5, #8b7bff); }
.cc-bar-k { background: repeating-linear-gradient(135deg, #b9adff 0 4px, #d9d2ff 4px 8px); }
.cc-t-do:not(.is-picked) .cc-bar-a { opacity: .55; }

.cc-kept { margin: 12px 0 0; font-size: .84rem; color: var(--ink-3); }
.cc-kept b { color: var(--ink-2); }

.cc-gets { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.cc-gets-h { margin: 0 0 10px; font: 650 .98rem/1.35 var(--f-display); color: var(--ink); }
.cc-gets-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cc-gets-list li { position: relative; padding-left: 28px; font-size: .9rem; line-height: 1.5; color: var(--ink-2); }
.cc-gets-list li::before { content: ""; position: absolute; left: 0; top: 2px; width: 19px; height: 19px; border-radius: 50%;
  background: var(--mint-soft, rgba(18, 184, 134, .14)) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='%23059669' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }

.cc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.cc-actions .btn { flex: 1 1 200px; }
.cc-tools-row { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 14px; }
.cc-linkbtn { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 4px 2px; border: 0; background: none; cursor: pointer;
  font: 600 .88rem/1.2 var(--f-body); color: var(--accent-ink, #4f3ff0); border-radius: 8px; }
.cc-linkbtn:hover span { text-decoration: underline; }
.cc-linkbtn[data-cc="reset"] svg { transform: scaleX(-1); }
.cc-linkbtn.is-done { color: var(--cc-save-ink); }

.cc-fine { margin: 14px 4px 0; color: var(--ink-3); font-size: .8rem; line-height: 1.55; }
.cc-noscript { color: var(--ink-2); }

/* a soft pulse on the verdict when the numbers change (not under reduced motion) */
@keyframes cc-pop { 0% { transform: scale(.985); } 60% { transform: scale(1.006); } 100% { transform: none; } }
.cc-verdict.is-pop { animation: cc-pop .32s ease-out; }

@media (prefers-reduced-motion: reduce) {
  .cc-bar-a, .cc-bar-k, .cc-verdict, .cc-money input { transition: none; }
  .cc-verdict.is-pop { animation: none; }
}

@media (max-width: 420px) {
  .cc-verdict { padding: 16px 14px 14px; }
  .cc-table thead th:first-child { width: 46%; }
  .cc-table tbody td { font-size: .92rem; }
  .cc-plan, .cc-plan .seg { width: 100%; }
  .cc-plan .seg label { flex: 1; justify-content: center; }
}
