/* K2b: the new phone scenes (Kalender, Scan, Pipeline, Formular, SMS, Automation). Kontor's own UI colours only. */

/* Tabs: mark only, four areas */
.kapp--phone .kapp__tabs-brand { margin-right: 2px; }
.kapp--phone .ktab { padding: 0 11px; }

/* Shared: fields that fill in (text recognition, form answers) */
.kfields { display: grid; margin: 4px 0 0; }
.kfields > div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-top: 1px solid var(--k-line); font-size: 12.5px; }
.kfields > div:first-child { border-top: 0; }
.kfields dt { color: var(--k-dim); }
.kfields dd { position: relative; margin: 0; font-weight: 700; }
.kfields dd.is-empty { color: transparent; }
.kfields dd.is-empty::before { content: ""; position: absolute; left: 0; top: 50%; width: 70%; height: 8px; margin-top: -4px; border-radius: 4px; background: var(--k-line); }

/* Kalender: a day column from 06 to 16 o'clock */
.kcal { --hour: 40px; --from: 6; position: relative; height: calc(10 * var(--hour)); margin-top: 6px; border: 1px solid var(--k-line); border-radius: var(--r-s); background: var(--k-panel); overflow: hidden; }
.kcal__hours { list-style: none; margin: 0; padding: 0; }
.kcal__hours li { height: var(--hour); padding: 2px 0 0 8px; border-top: 1px solid var(--k-line); font-size: 11px; color: var(--k-dim); font-variant-numeric: tabular-nums; }
.kcal__hours li:first-child { border-top: 0; }
.kcal__ev { position: absolute; left: 42px; right: 8px; top: calc((var(--s) - var(--from)) * var(--hour) + 2px); height: calc((var(--e) - var(--s)) * var(--hour) - 4px); display: grid; align-content: start; gap: 1px; padding: 6px 10px; border-left: 3px solid var(--k-blue); border-radius: 6px; background: var(--k-blue-soft); font-size: 12px; overflow: hidden; }
.kcal__ev b { font-size: 12.5px; }
.kcal__ev span { color: var(--k-dim); }
.kcal__ev.is-past { opacity: .55; padding-block: 2px; }
.kcal__ev.is-past span { display: none; }
.kcal__series { margin-top: 4px; font-size: 11px; }
.kcal__now { position: absolute; left: 36px; right: 0; top: calc((var(--t) - var(--from)) * var(--hour)); height: 2px; background: var(--k-red); }
.kcal__now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--k-red); }
.kcal__now span { position: absolute; right: 6px; top: -18px; padding: 0 4px; border-radius: 4px; background: var(--k-panel); font-size: 10.5px; font-weight: 700; color: var(--k-red); font-variant-numeric: tabular-nums; }
.ktoast { position: absolute; left: 10px; right: 10px; top: 10px; z-index: 2; display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--k-line); border-radius: 12px; background: var(--k-panel); box-shadow: 0 14px 28px -14px rgba(29, 26, 20, .4); }
.ktoast[hidden] { display: none; }
.ktoast svg { margin-top: 2px; color: var(--k-blue); }
.ktoast b { font-size: 12.5px; }

/* Scan: a receipt under a moving scan line */
.kscan { position: relative; padding: 14px 18px; border-radius: var(--r-s); background: #DCD8D1; overflow: hidden; }
.kscan__sheet { position: relative; padding: 12px 14px 10px; border-radius: 3px; background: #FDFCFA; box-shadow: 0 6px 14px -8px rgba(29, 26, 20, .35); transform: rotate(-1.2deg); font-size: 10.5px; color: #3B3833; }
.kscan__from { margin: 0; font-weight: 800; font-size: 12px; letter-spacing: .02em; }
.kscan__meta { margin: 2px 0 8px; color: var(--k-dim); }
.kscan__sheet i { display: block; height: 5px; margin: 6px 0; border-radius: 3px; background: #E4E1DB; }
.kscan__sheet i.is-s { width: 62%; }
.kscan__sum { display: flex; justify-content: space-between; margin: 10px 0 0; padding-top: 6px; border-top: 1px solid #CFCBC4; font-weight: 800; font-variant-numeric: tabular-nums; }
.kscan__line { position: absolute; left: 10px; right: 10px; top: 14px; height: 2px; border-radius: 2px; background: var(--k-blue); box-shadow: 0 0 12px 2px rgba(35, 85, 159, .45); opacity: 0; }
.kscan__line.is-on { opacity: 1; }
.kocr { margin-top: 10px; }

/* Pipeline: three stages side by side, the card moves one stage on */
.kboard3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; align-items: start; }
.kst { min-height: 172px; padding: 0 5px 6px; border-top: 3px solid var(--k-blue); border-radius: 8px 8px 6px 6px; background: #ECE9E3; }
.kst--orange { border-top-color: var(--k-orange); background: #F1E5DD; }
.kst--green { border-top-color: var(--k-green-dot); background: #E6EFE7; }
.kst h3 { display: flex; align-items: baseline; justify-content: space-between; margin: 0; padding: 8px 3px 4px; font-size: 12px; font-weight: 700; color: var(--k-blue); }
.kst--orange h3 { color: var(--k-orange); }
.kst--green h3 { color: var(--k-green); }
.kst h3 small { color: var(--k-dim); font-weight: 400; font-variant-numeric: tabular-nums; }
.kcl { margin-top: 6px; padding: 7px 8px; border: 1px solid var(--k-line); border-radius: 6px; background: var(--k-panel); box-shadow: 0 1px 1px rgba(29, 26, 20, .04); font-size: 11.5px; line-height: 1.3; }
.kcl b { display: block; font-size: 11.5px; overflow-wrap: anywhere; hyphens: auto; }
.kcl p { margin: 2px 0 0; color: var(--k-dim); font-size: 11px; }
.kcl.is-moved { border-color: var(--k-blue-line); background: var(--k-blue-soft); }
.knote { margin-top: 10px; }
.knote .kmeta { font-size: 12.5px; line-height: 1.45; color: var(--k-ink); }

/* Formular */
.kv[data-view-pane="formular"] .krow { border-top: 0; padding: 2px 0; }
.kv[data-view-pane="formular"] .krow > svg { color: var(--k-blue); }
.kanswers { margin-top: 10px; }
.kinto { display: flex; align-items: center; gap: 8px; margin: 10px 2px 0; font-size: 12.5px; font-weight: 700; color: var(--k-green); }
.kinto[hidden] { display: none; }
.kinto svg { stroke-width: 2.4; }

/* SMS */
.kchan { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 14px 0 12px; padding: 12px 14px; border: 1px solid var(--k-line); border-radius: var(--r-s); background: var(--k-panel); }
.kchan__title { flex-basis: 100%; margin: 0 0 2px; font-size: 13.5px; font-weight: 700; }
.kchan .kmeta { flex-basis: 100%; margin: 2px 0 0; }
.ksms { padding: 14px; border: 1px solid var(--k-line); border-radius: 12px; background: var(--k-panel); }
.ksms__to { margin: 0 0 10px; font-size: 11.5px; color: var(--k-dim); }
.ksms__bubble { margin-left: 28px; padding: 10px 12px; border-radius: 14px 14px 4px 14px; background: var(--k-blue-soft); color: var(--k-ink); font-size: 13px; line-height: 1.45; transform-origin: 100% 100%; }
.ksms__state { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin: 8px 0 0; font-size: 11.5px; color: var(--k-lila); font-weight: 600; }
.ksms__state.is-sent { color: var(--k-green); }
.ksms__state .kdot { margin: 0; }

/* Automation: steps as a vertical chain on the canvas */
.kflow__head { justify-content: space-between; flex-wrap: nowrap; }
.kswitch { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--k-dim); }
.kswitch i { position: relative; width: 34px; height: 20px; border-radius: 999px; background: #CFCBC4; transition: background-color var(--dur-mod) var(--ease-std); }
.kswitch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--k-panel); transition: transform var(--dur-mod) var(--ease-std); }
.kswitch.is-on { color: var(--k-green); }
.kswitch.is-on i { background: var(--k-green-dot); }
.kswitch.is-on i::after { transform: translateX(14px); }
.kflow { list-style: none; display: grid; justify-items: center; gap: 18px; margin: 4px 0 0; padding: 12px 8px; border: 1px dashed #CFCBC4; border-radius: 12px; background: radial-gradient(circle, #DEDAD3 1px, transparent 1.2px) 0 0 / 14px 14px, var(--k-bg); }
.kflow > li { position: relative; }
.kflow > li + li::before { content: ""; position: absolute; left: 50%; top: -18px; width: 2px; height: 18px; margin-left: -1px; background: #A9A6A0; }
.knode { display: grid; gap: 1px; min-width: 176px; padding: 7px 12px; border: 1px solid var(--k-line); border-left: 3px solid var(--k-blue); border-radius: 8px; background: var(--k-panel); font-size: 12px; text-align: left; box-shadow: 0 2px 6px -4px rgba(29, 26, 20, .25); }
.knode small { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--k-dim); }
.knode b { font-size: 12.5px; }
.knode--trigger { border-left-color: var(--k-orange); }
.knode--stop { border-left-color: var(--k-red); }
.knode--act { border-left-color: var(--k-green-dot); min-width: 0; }
.knode-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.knode-pair::after { content: ""; position: absolute; left: 25%; right: 25%; top: -9px; height: 9px; border: 2px solid #A9A6A0; border-bottom: 0; border-radius: 6px 6px 0 0; }
.kflow > li.knode-pair::before { height: 9px; }
.ktest { margin-top: 10px; }

/* Dark mode for the new scenes (18:30 phone) is not needed; the scenes only appear in daylight. */

@media (prefers-reduced-motion: reduce) {
  .kswitch i, .kswitch i::after { transition: none; }
}
