/* ==========================================================================
   உரையாடல் பயிற்சி — Conversation coach (js/views/talk.js)
   ========================================================================== */
.tk-home, .tk-topic-page, .tk-logpage { min-width: 0; }
.tk-home .en, .tk-topic-page .en, .tk-logpage .en { color: var(--ink-3); font-size: .86rem; }
.tk-muted { color: var(--ink-3); }
.tk-hint { margin: 0 0 12px; color: var(--ink-2); font-size: .92rem; }
.tk-head-actions { margin-top: 14px; position: relative; }

/* Grade switch */
.tk-grades { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 4px; }
.tk-grades .pp-toggle { min-height: 44px; }
.tk-mine { font-weight: 700; color: var(--zari-deep); }

/* Cards */
.tk-card { padding: 18px 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); min-width: 0; }
.tk-card .sec-title { font-size: 1.2rem; margin-bottom: 10px; }
.tk-top-grid { display: grid; gap: 16px; margin-top: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: start; }

/* This week */
.tk-thisweek { border: 2px solid var(--kumkum); background: linear-gradient(160deg, var(--kumkum-soft), var(--surface) 55%); }
.tk-thisweek-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.tk-thisweek-head .sec-title { margin: 0; }
.tk-week-ctl { display: flex; align-items: center; gap: 6px; }
.tk-week-ctl .btn { min-width: 44px; min-height: 44px; padding: 0; font-size: 1.3rem; }
.tk-week-n { font-weight: 700; white-space: nowrap; }
.tk-week-n b { font-size: 1.2rem; color: var(--kumkum); }
.tk-task { display: grid; gap: 2px; margin: 10px 0; }
.tk-task .ml { font-weight: 600; }
.tk-suggest { display: grid; gap: 10px; }
.tk-suggest-label { margin: 0; font-weight: 700; color: var(--ink-2); }
.tk-suggest-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--surface); border: 2px dashed var(--kumkum); color: var(--ink); text-decoration: none; min-width: 0; }
.tk-suggest-card:hover { border-style: solid; }
.tk-suggest-card > .icon { flex: none; color: var(--kumkum); }
.tk-suggest-text { flex: 1; display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.tk-suggest-text .ml { font-family: var(--f-ml); font-weight: 700; font-size: 1.05rem; line-height: 1.5; }

/* Rules */
.tk-target { margin: 0 0 10px; }
.tk-target b { color: var(--kumkum); font-size: 1.1rem; }
.tk-rule-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tk-rule-list li { display: flex; gap: 8px; align-items: flex-start; }
.tk-rule-list li > .icon { flex: none; width: 18px; height: 18px; margin-top: 4px; color: var(--leaf); }
.tk-rule-list li > span { display: grid; gap: 1px; }
.tk-src { margin: 12px 0 0; font-size: .82rem; color: var(--ink-3); }

/* Topic list */
.tk-topics { margin-top: 28px; }
.tk-topics-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.tk-topics-head .sec-title { margin: 0; }
.tk-count { margin: 8px 0 0; color: var(--ink-2); }
.tk-group { margin-top: 18px; }
.tk-group-title { font-size: 1.05rem; margin: 0 0 10px; color: var(--peacock-deep); display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.tk-topic-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.tk-topic { height: 100%; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: start; align-content: start; padding: 12px 14px; min-height: 64px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.tk-topic:hover { border-color: var(--kumkum); }
.tk-topic .chip { grid-column: 2; justify-self: start; }
.tk-topic.is-used { background: linear-gradient(90deg, var(--leaf-soft), var(--surface) 70%); }
.tk-topic.is-used .tk-num { background: var(--leaf); color: var(--surface); }
.tk-topic-text { display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.tk-topic-text .ml { font-weight: 600; line-height: 1.5; }
.tk-clamp { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tk-num { flex: none; display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px; border-radius: 999px; background: var(--kumkum-soft); color: var(--kumkum); font: 800 .95rem var(--f-ui); }
.tk-num--sm { min-width: 28px; height: 28px; font-size: .82rem; }

/* Topic page */
.tk-title { overflow-wrap: anywhere; }
.tk-title.is-long .rt-line { font-size: clamp(1.05rem, 1rem + .4vw, 1.25rem); line-height: 1.6; }
.tk-title .rt-word { color: var(--hi); }
.tk-used-flag { display: flex; gap: 6px; align-items: center; margin: 10px 0 0; padding: 8px 12px; border-radius: 14px; background: var(--leaf-soft); color: var(--leaf); font-weight: 600; position: relative; }
.tk-steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.tk-step { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--line-2); background: var(--surface); color: var(--ink); font: 600 .95rem var(--f-ui); cursor: pointer; }
.tk-step b { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--kumkum); color: var(--surface); font-size: .8rem; }
.tk-step:hover { border-color: var(--kumkum); }
.tk-examples { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 12px; }
.tk-examples .chip { white-space: normal; }
.tk-prep-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); align-items: start; }
.tk-topic-page > .tk-card { margin-top: 18px; }
.tk-topic-page .tk-card { scroll-margin-top: calc(var(--top-h) + 12px); }

/* Word web: a hub with the words around it */
.tk-web { position: relative; display: grid; gap: 12px; }
.tk-hub { justify-self: center; display: grid; place-items: center; width: 92px; height: 92px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--marigold), var(--kumkum)); color: #FFF8EC; box-shadow: 0 0 0 6px var(--kumkum-soft); text-align: center; }
.tk-hub-n { font: 800 1.8rem/1 var(--f-display); }
.tk-hub .ml { font-size: .82rem; font-weight: 700; }
.tk-web-words { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.tk-web-words .pp-word { position: relative; min-height: 58px; }
.tk-web-words li { position: relative; }
@media (min-width: 700px) {
  .tk-web::before { content: ""; position: absolute; left: 50%; top: 100px; bottom: 30px; width: 2px; background: repeating-linear-gradient(var(--line-2) 0 6px, transparent 6px 12px); }
}

/* Questions */
.tk-qs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tk-q { display: grid; grid-template-columns: 84px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.tk-qw { display: grid; justify-items: center; gap: 0; padding: 6px 4px; border-radius: 12px; background: var(--peacock-soft); color: var(--peacock-deep); text-align: center; }
.tk-qw .ml { font-weight: 800; font-size: .95rem; }
.tk-qw .en { font-size: .72rem; color: var(--peacock-deep); }
.tk-q-body { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.tk-q-body .ml { font-family: var(--f-ml); font-weight: 600; font-size: 1.05rem; line-height: 1.5; }
@media (max-width: 480px) { .tk-q { grid-template-columns: 1fr auto; } .tk-qw { grid-column: 1 / -1; justify-self: start; grid-auto-flow: column; gap: 6px; padding: 3px 10px; } }

/* Starters */
.tk-starters { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tk-starter { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 16px; border: 2px dashed var(--line-2); background: var(--surface); }
.tk-starter-body { flex: 1; display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.tk-starter-body .ml { font-family: var(--f-ml); font-weight: 600; font-size: 1.05rem; line-height: 1.5; }

/* Links */
.tk-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tk-link { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 14px; border-radius: 14px; background: var(--peacock-soft); color: var(--peacock-deep); text-decoration: none; font-weight: 600; }
.tk-link .en { flex: 1; color: var(--peacock-deep); opacity: .85; }
.tk-link:hover { outline: 2px solid var(--peacock); }

/* Talk now */
.tk-talk { border: 2px solid var(--marigold); }
.tk-clock { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; }
.tk-time { font: 800 clamp(3.2rem, 2.4rem + 4vw, 5rem)/1 var(--f-display); color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.tk-target { color: var(--ink-2); font-weight: 600; }
.tk-bar { position: relative; height: 18px; margin: 14px 0 26px; border-radius: 999px; background: var(--ground-2); border: 1px solid var(--line-2); }
.tk-bar-fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 999px; background: var(--zari); transition: width .25s linear; }
.tk-bar.is-ok .tk-bar-fill { background: var(--leaf); }
.tk-bar-min, .tk-bar-max { position: absolute; top: -4px; bottom: -4px; width: 3px; background: var(--ink-2); border-radius: 2px; }
.tk-bar-max { right: 0; }
.tk-bar-min span, .tk-bar-max span { position: absolute; top: 100%; margin-top: 4px; font-size: .78rem; font-weight: 700; color: var(--ink-2); white-space: nowrap; transform: translateX(-50%); }
.tk-bar-max span { transform: translateX(-90%); }
.tk-status { margin: 0 0 12px; font-weight: 600; color: var(--ink-2); }
.tk-controls { margin-bottom: 12px; }
.tk-nudge { display: flex; gap: 10px; align-items: flex-start; margin: 0; min-height: 0; }
.tk-nudge:not(:empty) { padding: 12px 14px; border-radius: 16px; background: var(--zari-soft); border: 1px solid var(--zari); }
.tk-nudge > .icon { flex: none; color: var(--zari-deep); margin-top: 3px; }
.tk-nudge > span { display: grid; gap: 2px; }
.tk-nudge .ml { font-family: var(--f-ml); font-weight: 700; font-size: 1.1rem; }
@media (prefers-reduced-motion: no-preference) { :root:not([data-motion="reduced"]) .tk-nudge:not(:empty) { animation: tk-pop .35s var(--ease); } }
@keyframes tk-pop { from { transform: scale(.97); opacity: .4; } to { transform: none; opacity: 1; } }
.tk-share-box { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line-2); }
.tk-sub { font-size: 1rem; margin: 0 0 8px; }
.tk-who-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tk-who { display: grid; gap: 2px; justify-items: center; min-height: 64px; padding: 10px; border-radius: 18px; border: 2px solid var(--line-2); background: var(--surface); color: var(--ink); cursor: pointer; text-align: center; }
.tk-who .ml { font-family: var(--f-ml); font-weight: 700; font-size: 1.02rem; }
.tk-who[data-who="child"][aria-pressed="true"] { border-color: var(--marigold-deep); background: var(--zari-soft); box-shadow: inset 0 0 0 2px var(--marigold); }
.tk-who[data-who="grown"][aria-pressed="true"] { border-color: var(--peacock); background: var(--peacock-soft); box-shadow: inset 0 0 0 2px var(--peacock); }
.tk-who[aria-pressed="true"]::before { content: "● "; }
.tk-share { display: flex; height: 14px; margin: 12px 0 6px; border-radius: 999px; overflow: hidden; background: var(--ground-2); border: 1px solid var(--line-2); }
.tk-share-child { background: var(--marigold); width: 0; transition: width .3s; }
.tk-share-grown { background: var(--peacock); width: 0; transition: width .3s; }
.tk-share-label { margin: 0; font-size: .88rem; color: var(--ink-2); }

/* Recording */
.tk-rec-state { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-weight: 600; color: var(--ink-2); }
.tk-rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--kumkum); }
@media (prefers-reduced-motion: no-preference) { :root:not([data-motion="reduced"]) .tk-rec-dot { animation: tk-blink 1s steps(2) infinite; } }
@keyframes tk-blink { 50% { opacity: .25; } }
.tk-recs { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.tk-rec-item { display: grid; gap: 8px; padding: 12px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.tk-rec-meta { display: flex; flex-wrap: wrap; gap: 0 4px; font-size: .9rem; color: var(--ink-2); }
.tk-rec-label { flex-basis: 100%; overflow-wrap: anywhere; color: var(--ink-3); font-size: .82rem; }
.tk-rec-item audio { width: 100%; max-width: 420px; }

/* Log form */
.tk-log { border: 2px solid var(--leaf); }
.tk-log-form { display: grid; gap: 14px; }
.tk-field { display: grid; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.tk-field legend, .tk-field > span { font-weight: 700; margin-bottom: 6px; padding: 0; }
.tk-partners { display: flex; flex-wrap: wrap; gap: 8px; }
.tk-partners .pp-toggle { min-height: 44px; }
.tk-field-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.tk-field .fill-input { width: 100%; min-height: 48px; font: 600 1rem var(--f-ui); padding: 8px 12px; border-radius: 14px; border: 2px solid var(--line-2); background: var(--surface); color: var(--ink); }
.tk-field .fill-input:focus { border-color: var(--peacock); outline: none; box-shadow: 0 0 0 4px var(--peacock-soft); }
.tk-log-msg { margin: 0; font-weight: 600; color: var(--kumkum); min-height: 1.2em; }
.tk-done { display: grid; gap: 10px; }
.tk-done-big { display: flex; align-items: center; gap: 8px; margin: 0; font: 800 1.4rem var(--f-display); color: var(--leaf); }

/* Log page */
.tk-sum { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.tk-sum li { display: grid; gap: 0; padding: 10px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); min-width: 120px; }
.tk-sum b { font: 800 1.6rem/1.1 var(--f-display); color: var(--kumkum); }
.tk-sum span { font-size: .85rem; color: var(--ink-2); }
.tk-table-wrap { margin-top: 16px; overflow-x: auto; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); }
.tk-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tk-table th { text-align: left; vertical-align: bottom; padding: 10px 12px; background: var(--surface-2); font-size: .85rem; }
.tk-table th .ml { display: block; }
.tk-table th .en { display: block; font-weight: 600; }
.tk-table td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.tk-table td .en { display: block; }
.tk-c { text-align: center; font-weight: 700; }
.tk-nowrap { white-space: nowrap; }
.tk-log-topic { display: flex; gap: 8px; align-items: flex-start; color: var(--ink); text-decoration: none; min-width: 180px; }
.tk-log-topic > span:last-child { display: grid; gap: 2px; }
.tk-log-topic:hover .ml { text-decoration: underline; }
.tk-short { color: var(--kumkum); }
.tk-sign-line { display: none; }
.tk-foot { font-size: .85rem; color: var(--ink-3); margin-top: 8px; }
.tk-empty { display: grid; gap: 12px; justify-items: start; margin-top: 18px; padding: 20px; border-radius: 20px; border: 2px dashed var(--line-2); }
.tk-print-name { display: none; }
.tk-logpage > .tk-card { margin-top: 24px; }
@media (max-width: 640px) {
  .tk-table { font-size: .88rem; }
  .tk-table th, .tk-table td { padding: 8px; }
  .tk-log-topic { min-width: 150px; }
  .tk-card { padding: 16px 14px; }
}

/* High contrast */
:root[data-contrast="high"] .tk-card, :root[data-contrast="high"] .tk-topic, :root[data-contrast="high"] .tk-q, :root[data-contrast="high"] .tk-starter { border-width: 2px; border-color: var(--ink-2); }
:root[data-contrast="high"] .tk-who[aria-pressed="true"], :root[data-contrast="high"] .tk-step:hover { outline: 3px solid var(--ink); }
:root[data-contrast="high"] .tk-bar-fill, :root[data-contrast="high"] .tk-share-child { background: var(--ink); }
:root[data-contrast="high"] .tk-home .en, :root[data-contrast="high"] .tk-topic-page .en, :root[data-contrast="high"] .tk-logpage .en { color: var(--ink-2); }

/* Print: just the log, like the handbook's */
@media print {
  .tk-noprint, .tk-logpage .mod-emoji, .tk-logpage .mod-head .speaker, .tk-sum, .tk-foot { display: none !important; }
  .tk-logpage .mod-head { background: none; border: 0; padding: 0 !important; overflow: visible; border-radius: 0; }
  .tk-logpage .mod-head h1 { font-size: 20pt; padding: 0; }
  .tk-logpage .mod-head .eyebrow { padding: 0; }
  body, .tk-logpage { background: #fff !important; color: #000; }
  .tk-print-name { display: block; font-weight: 700; margin: 4px 0 10px; }
  .tk-table-wrap { border: 0; overflow: visible; }
  .tk-table { font-size: 11pt; color: #000; }
  .tk-table th, .tk-table td { border: 1px solid #000; background: #fff; color: #000; }
  .tk-table .en, .tk-table .ml { color: #000; }
  .tk-table tr { break-inside: avoid; }
  .tk-table .chip { background: none; color: #000; padding: 0; }
  .tk-sign-line { display: block; margin-top: 18px; border-bottom: 1px solid #000; min-width: 90px; }
  .tk-clamp { -webkit-line-clamp: unset; line-clamp: unset; display: block; }
}
