/* குறள் பயிற்சி — Kural practice (js/views/kuraldrill.js) */
.kd { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; min-width: 0; }

.kd-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.kd-tab { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 6px 14px; border-radius: var(--r-pill);
  border: 2px solid var(--line); background: var(--surface); color: var(--ink-2); text-decoration: none; font-weight: 600; white-space: nowrap; }
.kd-tab .icon { width: 18px; height: 18px; }
.kd-tab .ml { font-family: var(--f-display); }
.kd-tab .en { font-size: .82rem; }
.kd-tab[aria-current="page"] { background: var(--zari-deep); border-color: var(--zari-deep); color: var(--surface); }
@media (max-width: 760px) { .kd-tab .en { display: none; } .kd-tab { padding: 6px 12px; } }
@media (max-width: 560px) { .kd-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; } .kd-tab:last-child { grid-column: span 2; } }

.kd-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.kd-setpick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; flex: 1 1 320px; }
.kd-setpick-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink-2); }
.kd-setpick-label .icon { width: 18px; height: 18px; color: var(--zari-deep); }
.kd-setpick-label .ml { font-family: var(--f-display); }
.kd-select { flex: 1 1 220px; width: 100%; min-width: 0; max-width: 100%; min-height: 48px; padding: 8px 12px; border-radius: 14px; border: 2px solid var(--line-2); background: var(--surface); color: var(--ink); font: 600 1rem var(--f-ui); }

/* Home */
.kd-home { display: grid; gap: 18px; }
.kd-modes { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.kd-mode { height: 100%; display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--line);
  background: linear-gradient(150deg, var(--zari-soft), var(--surface) 70%); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-1); }
.kd-mode:hover { border-color: var(--zari-deep); }
.kd-mode > .icon { margin-top: 6px; flex: none; }
.kd-mode-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--surface); color: var(--zari-deep); border: 2px solid var(--zari); }
.kd-mode-icon .icon { width: 22px; height: 22px; }
.kd-mode-text { flex: 1; display: grid; gap: 2px; min-width: 0; }
.kd-mode-text .ml { font: 800 1.1rem/1.35 var(--f-display); color: var(--zari-deep); }
.kd-mode-text .en { font-weight: 700; color: var(--ink-2); }
.kd-mode-about { font-size: .86rem; color: var(--ink-2); }

.kd-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.kd-kural { height: 100%; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; padding: 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); }
.kd-kural.is-perfect { border-color: var(--zari); box-shadow: inset 0 0 0 1px var(--zari); }
.kd-kural-num { grid-row: span 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--zari-soft); color: var(--zari-deep); font: 800 .95rem var(--f-ui); text-decoration: none; }
.kd-kural-lines { display: grid; gap: 2px; font: 600 1.02rem/1.55 var(--f-ml); min-width: 0; overflow-wrap: anywhere; }
.kd-kural-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.kd-open { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 6px; color: var(--peacock); font-weight: 600; text-decoration: none; }
.kd-open .icon { width: 16px; height: 16px; }

/* Practice */
.kd-run, .kd-recite { display: grid; gap: 12px; }
.kd-q { display: grid; gap: 12px; }
.kd-ask { margin: 0; text-align: center; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 8px; }
.kd-ask .ml { font: 700 1.1rem var(--f-display); color: var(--ink); }
.kd-ask .en { color: var(--ink-2); font-size: .92rem; }
.kd-card { width: min(100%, 720px); justify-self: center; display: grid; gap: 10px; justify-items: center; padding: 20px 18px; border-radius: 26px;
  background: linear-gradient(160deg, var(--zari-soft), var(--surface) 75%); box-shadow: 0 5px 0 var(--zari), var(--shadow-1); text-align: center; }
.kd-verse { display: grid; gap: 4px; }
.kd-line { margin: 0; font: 700 clamp(1.15rem, 1rem + 1vw, 1.55rem)/1.6 var(--f-display); color: var(--ink); overflow-wrap: anywhere; }
.kd-blank { display: inline-block; min-width: 4.5em; padding: 0 .3em; border-bottom: 3px dashed var(--kumkum); color: var(--kumkum); }
.kd-blank-line { color: var(--ink-3); letter-spacing: .1em; }
.kd-opts.is-en .quiz-opt { padding-right: 44px; }
.kd-opts.is-en .quiz-opt-en { font-size: 1rem; line-height: 1.45; color: var(--ink); }
@media (min-width: 760px) { .kd-opts:not(.is-en) { grid-template-columns: 1fr; max-width: 720px; justify-self: center; width: 100%; } }
.kd-choices { display: grid; gap: 10px; }
.kd-after { display: grid; gap: 10px; justify-items: center; text-align: center; }
.kd-after:empty { display: none; }
.kd-mean { margin: 0; max-width: 60ch; color: var(--ink-2); }
.kd-mean-ml { margin: 0; max-width: 60ch; line-height: 1.6; }
.kd-words { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.kd-run > .btn--primary { justify-self: center; }

/* word order */
.kd-build { gap: 6px; }
.kd-built { margin: 0; min-height: 2.4em; width: 100%; padding: 4px 10px; border-radius: 12px; border: 2px dashed var(--line-2); font: 700 clamp(1.1rem, 1rem + .8vw, 1.45rem)/1.6 var(--f-display); overflow-wrap: anywhere; }
.kd-built.is-active { border-color: var(--peacock); background: var(--surface); }
.kd-built.is-done { border-style: solid; border-color: var(--leaf); background: var(--leaf-soft); }
.kd-pool { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.kd-tile { height: auto; min-height: 56px; min-width: 0; padding: 8px 14px; font-size: clamp(1.1rem, 1rem + .6vw, 1.35rem); line-height: 1.3; cursor: pointer; touch-action: manipulation; border: 3px solid transparent; }
.kd-tile:disabled { opacity: .35; cursor: default; transform: none; }

/* recite */
.kd-recite-card { min-height: 190px; align-content: center; }
.kd-step { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; }
.kd-step .ml { font: 700 1rem var(--f-display); color: var(--zari-deep); }
.kd-step .en { color: var(--ink-2); font-size: .9rem; }
.kd-hidden { font-size: 3.4rem; line-height: 1; }
.kd-hint { margin: 0; color: var(--ink-2); }
.kd-recite-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
.kd-recite-actions .feedback { flex-basis: 100%; }
.kd-recite-actions .feedback:empty { display: none; }
.kd-tick[aria-pressed="true"] { background: var(--leaf); color: #fff; }
.kd-recite .kd-ask .btn { min-height: 44px; }

:root[data-contrast="high"] .kd-kural, :root[data-contrast="high"] .kd-mode, :root[data-contrast="high"] .kd-built { border-color: var(--ink-2); }
:root[data-contrast="high"] .kd-tick[aria-pressed="true"] { color: var(--ground); }
.kd-tab[aria-current="page"] .en { color: inherit; }
