/* 
 * Mobile Sindhi Text Processing Engine Styles
 * RTL-First, Ultra-Compact Mobile UI, Underline Audit
 */

@font-face {
  font-family: 'Sindh Watan';
  src: url('../fonts/Sindh Watan Regular v1.98.ttf') format('truetype'),
       url('../Sindh Watan Regular v1.98.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --primary: #0d6efd;
  --primary-hover: #0b5ed7;
  --primary-subtle: #e7f1ff;
  --primary-border: #b6d4fe;
  
  --success: #198754;
  --success-subtle: #d1e7dd;
  --warning: #fd7e14;
  --warning-subtle: #ffe5d0;
  --danger: #dc3545;
  --danger-subtle: #f8d7da;
  --info: #0dcaf0;
  
  --heh-underline: #f59f00;
  
  --bg-body: #f8f9fa;
  --bg-card: #ffffff;
  --bg-subtle: #f1f3f5;
  --border-color: #dee2e6;
  --text-main: #212529;
  --text-muted: #6c757d;
  --editor-bg: #ffffff;
  --editor-border: #ced4da;
  --editor-focus-border: #86b7fe;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  
  --font-sindhi: 'Sindh Watan', 'Noto Naskh Arabic', 'Lateef', 'MB Sindhi', Tahoma, Arial, sans-serif;
  --font-ui: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

[data-bs-theme="dark"] {
  --primary: #3d8bfd;
  --primary-hover: #5298fd;
  --primary-subtle: #032856;
  --primary-border: #084298;
  
  --bg-body: #111418;
  --bg-card: #1a1d21;
  --bg-subtle: #22262b;
  --border-color: #2e343b;
  --text-main: #e9ecef;
  --text-muted: #9ba3af;
  --editor-bg: #1a1d21;
  --editor-border: #383f47;
  --editor-focus-border: #3d8bfd;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  
  --heh-underline: #ffd43b;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-sindhi);
  background-color: var(--bg-body);
  color: var(--text-main);
  direction: rtl;
  text-align: right;
  line-height: 1.85;
  transition: background-color 0.2s ease, color 0.2s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
}

/* Slim Compact App Header */
.app-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1020;
  padding: 0.4rem 0.75rem;
}

.brand-link {
  color: inherit;
  transition: opacity var(--transition-fast);
}

.brand-link:hover {
  opacity: 0.9;
}

.brand-logo-img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.brand-logo-img:hover {
  transform: scale(1.06);
}

.brand-title {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}

.brand-badge {
  font-size: 0.7rem;
  font-family: var(--font-ui);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  background: var(--primary-subtle);
  color: var(--primary);
  font-weight: 600;
}

.guide-hero-logo {
  max-width: 100%;
  width: 340px;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  transition: transform var(--transition-fast);
}

.guide-hero-logo:hover {
  transform: scale(1.02);
}

.modal-logo-img {
  max-width: 220px;
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

/* Header Action Icon Buttons */
.header-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.85rem;
}

.header-btn-prominent {
  border-radius: 2rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  box-shadow: 0 1.5px 4px rgba(13, 110, 253, 0.25);
  transition: all 0.15s ease;
  line-height: 1.4;
}

.header-btn-prominent:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(13, 110, 253, 0.35);
}

/* Horizontal Compact Action Ribbon Wrapper with Navigation Arrows */
.action-ribbon-wrapper {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  width: 100%;
  position: relative;
}

.action-ribbon-container {
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding: 0.25rem 0.15rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-grow: 1;
}

.action-ribbon-container::-webkit-scrollbar {
  display: none;
}

.ribbon-arrow-btn {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  z-index: 2;
}

.ribbon-arrow-btn:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: scale(1.08);
}

.ribbon-arrow-btn:active {
  transform: scale(0.95);
}

.btn-chip {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
  transition: all 0.15s ease;
  line-height: 1.5;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
}

.btn-chip:hover {
  background: var(--bg-subtle);
  border-color: var(--primary-border);
}

.btn-chip.primary-chip {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.btn-chip.primary-chip:hover {
  background: var(--primary-hover);
}

.btn-chip.warning-chip {
  background: var(--warning-subtle);
  color: #b04e00;
  border-color: #ffd8a8;
}

[data-bs-theme="dark"] .btn-chip.warning-chip {
  background: #3e2608;
  color: #ffc078;
  border-color: #663c00;
}

.btn-chip.danger-chip {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
  border-color: rgba(220, 53, 69, 0.25);
}

.btn-chip.danger-chip:hover {
  background: #dc3545;
  color: #ffffff;
  border-color: #dc3545;
}

[data-bs-theme="dark"] .btn-chip.danger-chip {
  background: rgba(220, 53, 69, 0.2);
  color: #ff6b6b;
  border-color: rgba(220, 53, 69, 0.4);
}

[data-bs-theme="dark"] .btn-chip.danger-chip:hover {
  background: #dc3545;
  color: #ffffff;
}

/* Main Workspace */
main {
  min-height: calc(100vh - 55px);
}

/* Tab panes layout */
.tab-content {
  width: 100%;
}

.tab-pane {
  width: 100%;
}

/* Dual Layer Synchronized Editor Container */
.editor-container-wrapper {
  position: relative;
  background: var(--editor-bg);
  border: 1.5px solid var(--editor-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.editor-container-wrapper:focus-within {
  border-color: var(--editor-focus-border);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.12);
}

/* Responsive Dynamic Height for Editor Box with Mobile Bottom Bar Offset */
.editor-sync-box {
  position: relative;
  width: 100%;
  flex-grow: 1;
  min-height: 240px;
  height: calc(100dvh - 310px);
  height: calc(100vh - 310px);
}

@media (min-width: 768px) {
  .editor-sync-box {
    height: calc(100vh - 260px);
    min-height: 400px;
  }
}

/* The backdrop container sitting behind textarea with generous top/bottom offset */
.editor-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  padding: 1.4rem 0.95rem 4rem 0.95rem;
  margin: 0;
  font-family: var(--font-sindhi);
  font-size: 1.25rem;
  line-height: 2.1;
  text-align: right;
  direction: rtl;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-y: auto;
  overflow-x: hidden;
  color: transparent !important;
  pointer-events: none;
  border: none;
  box-sizing: border-box;
}

/* Underline ONLY for misplaced Heh (Zero background highlight) */
.audit-highlight {
  background: transparent !important;
  background-color: transparent !important;
  color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: inline !important;
  text-decoration: underline wavy 2.5px !important;
  -webkit-text-decoration: underline wavy 2.5px !important;
  text-underline-offset: 6px !important;
}

.audit-wrong-heh {
  text-decoration-color: var(--heh-underline) !important;
  -webkit-text-decoration-color: var(--heh-underline) !important;
}

/* Textarea transparent on top with matching top/bottom scroll offset */
.editor-textarea {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  padding: 1.4rem 0.95rem 4rem 0.95rem;
  margin: 0;
  background: transparent;
  color: var(--text-main);
  border: none;
  outline: none;
  resize: none;
  font-family: var(--font-sindhi);
  font-size: 1.25rem;
  line-height: 2.1;
  text-align: right;
  direction: rtl;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  caret-color: var(--text-main);
}

/* Header Pill Button */
.header-pill-btn {
  border-radius: 2rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s ease;
  font-family: var(--font-ui), var(--font-sindhi);
}

.header-pill-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Separated Modern Toolbars */
.toolbar-tier {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}

.toolbar-tier::-webkit-scrollbar {
  display: none;
}

.text-engine-bar {
  background: var(--bg-card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-bottom: 1px solid var(--border-color);
}

.md-format-bar {
  background: var(--bg-subtle);
}

.toolbar-tier-label {
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
}

.toolbar-tier-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1 1 auto;
}

.tier-divider {
  width: 1px;
  height: 1.35rem;
  background-color: var(--border-color);
  margin: 0 0.25rem;
  flex-shrink: 0;
}

.tier-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 0.18rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.95rem;
  flex-shrink: 0;
  transition: all 0.15s ease;
  font-family: var(--font-ui), var(--font-sindhi);
  cursor: pointer;
  white-space: nowrap;
}

.text-engine-bar .tier-btn {
  background: var(--bg-subtle);
}

.tier-btn:hover {
  background: var(--primary-subtle);
  color: var(--primary);
  border-color: var(--primary-border);
}

.tier-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.tier-btn-primary {
  background: var(--primary-subtle);
  color: var(--primary);
  border-color: var(--primary-border);
}

.tier-btn-primary:hover {
  background: var(--primary);
  color: #ffffff;
}

.tier-btn-warning {
  background: var(--warning-subtle);
  color: #b05700;
  border-color: rgba(253, 126, 20, 0.4);
}

[data-bs-theme="dark"] .tier-btn-warning {
  background: rgba(253, 126, 20, 0.2);
  color: #ffaa5a;
}

.tier-btn-warning:hover {
  background: var(--warning);
  color: #ffffff;
}

.tier-btn.btn-keyboard-tool {
  color: var(--primary);
  border-color: var(--primary-border);
}

.tier-btn.btn-keyboard-tool.active-keyboard {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.md-btn.btn-share-tool {
  color: var(--accent);
  border-color: rgba(16, 185, 129, 0.3);
}

.md-btn.btn-share-tool:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* Status / Stats Bar under Editor */
.editor-footer-bar {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-color);
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-ui), var(--font-sindhi);
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-muted);
}

.stat-pill strong {
  color: var(--text-main);
}

.audit-badge-pill {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 1rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  border: none;
}

/* Navigation Tabs for Desktop */
.nav-pills-custom {
  background: var(--bg-subtle);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  display: flex;
  gap: 0.25rem;
}

.nav-pills-custom .nav-link {
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.nav-pills-custom .nav-link.active {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

/* Audit Summary Card */
.audit-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

.audit-metric-box {
  padding: 0.75rem;
  border-radius: var(--radius-md);
  text-align: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
}

.audit-metric-box.initial-medial {
  border-right: 4px solid var(--heh-underline);
}

.audit-metric-box.jeem-gaaf {
  border-right: 4px solid #1098ad;
}

.audit-metric-box.final-issue {
  border-right: 4px solid #e8590c;
}

.audit-metric-box.sindhi {
  border-right: 4px solid var(--success);
}

.audit-metric-value {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-ui);
  line-height: 1.2;
}

.audit-metric-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Twitter Card & Splitter */
.twitter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

.tweet-box-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-bottom: 0.75rem;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tweet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-family: var(--font-ui);
}

.tweet-content {
  font-size: 1.1rem;
  line-height: 2;
  white-space: pre-wrap;
  word-wrap: break-word;
  padding: 0.35rem 0;
  color: var(--text-main);
}

.tweet-actions {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border-color);
}

.char-progress-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.char-progress-bar {
  flex-grow: 1;
  height: 6px;
  background-color: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
}

.char-progress-fill {
  height: 100%;
  background-color: var(--primary);
  transition: width 0.2s ease, background-color 0.2s ease;
}

.char-progress-fill.warning {
  background-color: var(--warning);
}

.char-progress-fill.danger {
  background-color: var(--danger);
}

/* Markdown Preview Container */
.preview-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  min-height: 320px;
  box-shadow: var(--shadow-sm);
}

.preview-content {
  font-size: 1.15rem;
  line-height: 2.2;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.preview-content p {
  margin-bottom: 1rem;
}

.preview-content p:last-child {
  margin-bottom: 0;
}

.preview-content h1,
.preview-content h2,
.preview-content h3 {
  font-weight: 700;
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--primary);
}

.preview-content blockquote {
  border-right: 4px solid var(--primary);
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  color: var(--text-muted);
  font-style: italic;
  background: var(--primary-subtle);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.preview-content pre {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  overflow-x: auto;
  direction: ltr;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.preview-content code {
  background: var(--bg-subtle);
  color: var(--danger);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.preview-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.preview-content ul,
.preview-content ol {
  padding-right: 1.5rem;
  margin-bottom: 1rem;
}

.preview-content li {
  margin-bottom: 0.35rem;
}

.preview-content hr {
  margin: 1.5rem 0;
  opacity: 0.2;
}

/* Mobile Floating Bottom Bar */
.mobile-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 0.35rem 0.5rem;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1010;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
}

.mobile-bottom-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  background: transparent;
  border: none;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, transform 0.1s ease;
  cursor: pointer;
}

.mobile-bottom-btn span {
  display: none !important;
}

.mobile-bottom-btn i {
  font-size: 1.35rem;
  margin: 0;
}

.mobile-bottom-btn.active,
.mobile-bottom-btn:hover {
  color: var(--primary);
  transform: scale(1.1);
}

/* Toast Customization */
.toast-container {
  position: fixed;
  bottom: 4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1090;
  width: 90%;
  max-width: 380px;
}

.custom-toast {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-family: var(--font-sindhi);
  font-size: 0.95rem;
}

/* Modal styling */
.modal-content {
  font-family: var(--font-sindhi);
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.modal-header {
  border-bottom: 1px solid var(--border-color);
}

.modal-footer {
  border-top: 1px solid var(--border-color);
}

/* Responsive padding and bottom offset for mobile */
@media (max-width: 767.98px) {
  body {
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 1rem);
  }
  
  main {
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 1.25rem) !important;
  }

  .editor-container-wrapper {
    margin-bottom: 0.5rem;
  }
  
  #editor-pane,
  #audit-pane,
  #twitter-pane,
  #preview-pane,
  #guide-pane {
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 0.5rem);
  }
}

/* Sindhi Keyboard Chart & Visual Map Styling */
.kb-chart-diagram-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  overflow-x: auto;
}

.kb-chart-row {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
  justify-content: center;
  direction: ltr;
  min-width: 600px;
}

.kb-chart-key {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  min-width: 48px;
  height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  font-family: var(--font-sindhi);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  padding: 0.2rem;
  flex: 1 1 0;
}

.kb-chart-key:hover {
  border-color: var(--primary);
  background: var(--primary-subtle);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

.kb-chart-key .en-key {
  position: absolute;
  top: 3px;
  left: 5px;
  font-size: 0.65rem;
  font-weight: 700;
  font-family: var(--font-ui), sans-serif;
  color: #70757a;
}

[data-bs-theme="dark"] .kb-chart-key .en-key {
  color: #9aa0a6;
}

.kb-chart-key .sindhi-char {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
  margin-top: 4px;
}

.kb-chart-key .shift-char {
  position: absolute;
  top: 2px;
  right: 5px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
}

/* 52 Letter Matrix Cards */
.kb-letter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.kb-letter-card:hover {
  border-color: var(--primary);
  background: var(--primary-subtle);
  transform: translateY(-2px);
}

.kb-letter-char {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.kb-letter-shortcut {
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  margin-top: 0.35rem;
  color: var(--primary);
  font-family: var(--font-ui), monospace;
}

.kb-letter-name {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}
