/* Printable A4 Kannada charts. Sizes are in mm/pt so paper and screen match.
   Markup is generated by scripts/build-kannada-charts.mjs. */

@page { size: A4 portrait; margin: 0; }

:root {
  --ink: #2E3147;
  --ink-soft: #5C6079;
  --indigo: #4F41C8;
  --coral: #E14F55;
  --sheet: #FFFDF9;
  --font-display: "Baloo 2", "Baloo Tamma 2", sans-serif;
  --font-kn-display: "Baloo Tamma 2", "Noto Sans Kannada", sans-serif;
  --font-kn: "Noto Sans Kannada", "Kannada MN", sans-serif;
  --font-body: "Nunito", "Trebuchet MS", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { background: #ECE6DC; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.kn { font-family: var(--font-kn); }
mark { background: none; color: var(--coral); }

/* group colours: [tint, edge, strong] */
.g-vowel, .g-yoga { --tint: #FFF3C9; --edge: #EBCF73; --strong: #9A6B00; }
.g-ka  { --tint: #FFE4EE; --edge: #F2AFC9; --strong: #B4245C; }
.g-cha { --tint: #DCF6E8; --edge: #A2D9BD; --strong: #14724A; }
.g-tta { --tint: #E1F1FF; --edge: #A9CFF0; --strong: #1B5E96; }
.g-ta  { --tint: #EAE5FF; --edge: #C3B6F0; --strong: #4F41C8; }
.g-pa  { --tint: #FFE8D9; --edge: #F0BC98; --strong: #A3501B; }
.g-av  { --tint: #E2F5F2; --edge: #A5D8D0; --strong: #0F6F64; }

/* ---------------------------------------------------------- screen chrome */
.toolbar {
  width: 210mm; margin: 14px auto 0;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 14px; font-weight: 700;
}
.toolbar a { color: var(--ink-soft); text-decoration: none; padding: 6px 10px; border-radius: 999px; }
.toolbar a[aria-current] { background: var(--ink); color: #fff; }
.toolbar .tabs { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.toolbar button {
  font: inherit; font-weight: 800; color: #fff; background: var(--indigo);
  border: 0; border-radius: 999px; padding: 9px 18px; cursor: pointer;
  box-shadow: 0 3px 0 #3B2FA3;
}
.after { width: 210mm; margin: 0 auto 28px; font-size: 14px; color: var(--ink-soft); }
.after a { color: var(--indigo); font-weight: 800; }

/* ------------------------------------------------------------------ sheet */
.sheet {
  width: 210mm; height: 297mm;
  margin: 14px auto;
  padding: 8mm 9mm 6mm;
  background: var(--sheet);
  box-shadow: 0 2px 18px rgba(46, 49, 71, 0.16);
  display: flex; flex-direction: column;
  overflow: hidden;
  break-after: page;
}
.sheet:last-child { break-after: auto; }

.sheet-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 6mm;
  padding-bottom: 2.4mm; margin-bottom: 2.6mm;
  border-bottom: 0.8mm solid var(--ink);
}
.sheet-head .t-kn {
  font-family: var(--font-kn-display); font-weight: 800;
  font-size: 28pt; line-height: 1.3; color: var(--indigo);
}
.sheet-head h1 {
  font-family: var(--font-display); font-weight: 800;
  font-size: 15pt; line-height: 1.1; letter-spacing: 0.01em; margin-top: 0.6mm;
}
.sheet-head .sub { font-size: 9pt; line-height: 1.35; text-align: right; color: var(--ink-soft); }
.sheet-head .sub b { color: var(--ink); font-weight: 800; }

.sheet-foot {
  margin-top: auto; padding-top: 2.2mm;
  display: flex; align-items: center; justify-content: space-between; gap: 5mm;
  font-size: 7.6pt; color: var(--ink-soft);
}
.sheet-foot .brand { display: flex; align-items: center; gap: 1.6mm; font-weight: 800; color: var(--ink); white-space: nowrap; }
.sheet-foot img { width: 5mm; height: 5mm; border-radius: 1.2mm; }

.band {
  display: flex; align-items: baseline; gap: 2mm;
  font-family: var(--font-display); font-weight: 800; font-size: 10.5pt; line-height: 1.2;
  margin: 1.2mm 0 1.6mm;
}
.band .kn { font-family: var(--font-kn-display); font-size: 12.5pt; }
.band i { font-family: var(--font-body); font-style: normal; font-weight: 600; font-size: 7.8pt; color: var(--ink-soft); }
.band--v .kn { color: #9A6B00; }
.band--c .kn { color: var(--indigo); }
.band--w .kn { color: var(--coral); }

/* ------------------------------------------------ alphabet + picture grid */
.grid5 { display: grid; grid-template-columns: 13mm repeat(5, 1fr); gap: 1.7mm; flex: 3; grid-auto-rows: 1fr; }
.grid5:not(.grid5--labelled) { grid-template-columns: repeat(5, 1fr); padding-left: 14.7mm; }
.grid5--labelled { flex: 7; }

.cell {
  background: var(--tint); border: 0.45mm solid var(--edge); border-radius: 3mm;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 0; line-height: 1;
}
.g-yoga.cell { border-style: dashed; }
.cell .L { font-family: var(--font-kn); font-weight: 600; font-size: 26pt; line-height: 1.3; color: var(--ink); margin-top: 0.8mm; }
.cell .r { font-weight: 800; font-size: 11pt; color: var(--strong); }
.cell .h { font-size: 7.6pt; color: var(--ink-soft); margin-top: 0.7mm; }
.cell .h b { color: var(--ink); font-weight: 800; text-decoration: underline; text-underline-offset: 0.5mm; }

.rowlabel {
  background: var(--strong); color: #fff; border-radius: 3mm;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; line-height: 1.1; padding: 0 0.6mm;
}
.rowlabel .kn { font-weight: 700; font-size: 17pt; line-height: 1.25; }
.rowlabel b { font-size: 7.4pt; font-weight: 800; letter-spacing: 0.02em; }
.rowlabel i { font-style: normal; font-size: 6.3pt; font-weight: 700; opacity: 0.9; margin-top: 0.5mm; }
.rowlabel--tall { grid-row: span 2; }
.rowlabel--tall .kn { font-size: 9pt; writing-mode: vertical-rl; transform: rotate(180deg); line-height: 1; }
.rowlabel--tall i { writing-mode: vertical-rl; transform: rotate(180deg); margin: 1mm 0 0; }
.rowlabel--tall { flex-direction: row-reverse; gap: 0.6mm; }

.cell--app { background: #fff; border: 0.45mm dashed #B9BCD0; flex-direction: row; gap: 1.6mm; padding: 0 1.6mm; }
.cell--app img { width: 13.5mm; height: 13.5mm; }
.cell--app span { font-size: 7.2pt; line-height: 1.25; color: var(--ink-soft); }
.cell--app b { display: block; color: var(--ink); font-weight: 800; font-size: 8pt; }

/* picture variant */
.cell--pic .top { display: flex; align-items: center; justify-content: center; gap: 2.4mm; }
.cell--pic .L { font-size: 24pt; line-height: 1.25; }
.cell--pic .emo { font-family: "Noto Color Emoji", "Apple Color Emoji", sans-serif; font-size: 19pt; line-height: 1; }
.cell--pic .w { font-family: var(--font-kn); font-weight: 600; font-size: 11.5pt; line-height: 1.45; }
.cell--pic .m { font-size: 7.3pt; font-weight: 700; color: var(--ink-soft); }

/* --------------------------------------------------------------- kagunita */
.kg {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: 12.5mm repeat(15, 1fr);
  grid-template-rows: 9.5mm repeat(34, 1fr);
  border: 0.45mm solid var(--ink); border-radius: 2.5mm; overflow: hidden;
}
.kg > div { display: flex; align-items: center; justify-content: center; min-height: 0; }
.kg-corner { background: var(--ink); color: #fff; font-weight: 800; font-size: 11pt; }
.kg-col { background: var(--ink); color: #fff; flex-direction: column; line-height: 1; gap: 0.5mm; }
.kg-col .kn { font-weight: 600; font-size: 11pt; line-height: 1.15; }
.kg-col i { font-style: normal; font-size: 7pt; font-weight: 700; opacity: 0.85; }
.kg-row { background: var(--strong); color: #fff; gap: 1.2mm; line-height: 1; }
.kg-row .kn { font-weight: 700; font-size: 11.5pt; }
.kg-row i { font-style: normal; font-size: 6.6pt; font-weight: 700; opacity: 0.9; min-width: 4.4mm; }
.kg-cell {
  font-family: var(--font-kn); font-weight: 500; font-size: 11.6pt; line-height: 1;
  background: var(--tint);
  border-left: 0.2mm solid rgba(46, 49, 71, 0.13);
  border-top: 0.2mm solid rgba(46, 49, 71, 0.13);
  padding-bottom: 0.3mm;
}
.kg-first { border-top: 0.5mm solid var(--ink) !important; }

/* ----------------------------------------------------- matras + ottakshara */
.signs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.6mm; flex: 30; grid-auto-rows: 1fr; }
.sign {
  --tint: #FFF3C9; --edge: #EBCF73; --strong: #9A6B00;
  background: var(--tint); border: 0.45mm solid var(--edge); border-radius: 3mm;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; min-height: 0;
}
.sign .L { font-family: var(--font-kn); font-weight: 600; font-size: 20pt; line-height: 1.4; margin-top: 0.8mm; }
.sign .eq { font-size: 8.4pt; font-weight: 800; color: var(--strong); }
.sign .eq .kn { font-weight: 600; font-size: 9pt; color: var(--ink); }
.sign .nm { font-size: 6.6pt; color: var(--ink-soft); margin-top: 0.9mm; font-weight: 700; text-align: center; line-height: 1.25; }
.sign .nm .kn { font-size: 7.4pt; color: var(--ink); font-weight: 600; }
.sign .nm i { display: block; font-style: normal; }

.ottu { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1.6mm; flex: 50; grid-auto-rows: 1fr; }
.ot {
  background: var(--tint); border: 0.45mm solid var(--edge); border-radius: 3mm;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; min-height: 0;
}
.ot .L { font-family: var(--font-kn); font-weight: 600; font-size: 21pt; line-height: 1.6; }
.ot .r { font-size: 8.6pt; font-weight: 800; color: var(--strong); }
.ot--note { background: #fff; border: 0.45mm dashed #B9BCD0; font-size: 7.4pt; line-height: 1.3; text-align: center; padding: 0 1.6mm; color: var(--ink-soft); }
.ot--note b { color: var(--ink); }

.words { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.6mm; flex: 17; grid-auto-rows: 1fr; }
.wd {
  background: #fff; border: 0.45mm solid #E3D9CB; border-radius: 3mm;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; min-height: 0;
}
.wd .w { font-family: var(--font-kn); font-weight: 600; font-size: 14pt; line-height: 1.6; }
.wd .m { font-size: 7.2pt; font-weight: 700; color: var(--ink-soft); }

/* ------------------------------------------------------- print + snapshot */
html.shot, html.shot body { background: var(--sheet); }
html.shot .toolbar, html.shot .after { display: none; }
html.shot .sheet { margin: 0; box-shadow: none; }

@media print {
  html, body { background: #fff; }
  .toolbar, .after { display: none; }
  .sheet { margin: 0; box-shadow: none; }
}
