:root {
  --bg-main: #0f172a;
  --card-bg: rgba(30, 41, 59, 0.7);
  --accent-primary: #8b5cf6;
  --accent-secondary: #ec4899;
  --text-main: #f8fafc;
  --text-dim: #94a3b8;
  --success: #10b981;
  --error: #ef4444;
  --border-color: rgba(255, 255, 255, 0.1);
  --accent: #3b82f6;
}

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

body {
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  background-image:
    radial-gradient(circle at 0% 0%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
  color: var(--text-main);
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* --- TOP BAR & LAYOUT --- */
.top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  z-index: 100;
}

.top-left-group {
  display: flex;
  align-items: center;
  gap: 15px;
}

.top-center {
  position: absolute;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.icon-btn {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0 12px;
  height: 48px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.icon-btn:hover {
  background: var(--accent-primary);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 20px rgba(139, 92, 246, 0.3);
  border-color: transparent;
}

.text-btn {
  background: var(--card-bg);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 0 20px;
  height: 48px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.text-btn:hover {
  background: var(--accent-secondary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
  border-color: transparent;
}

/* --- MODE SWITCH --- */
.mode-switch {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px;
  border-radius: 50px;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.mode-switch input {
  display: none;
}

.mode-switch label {
  flex: 1;
  text-align: center;
  padding: 10px 20px;
  cursor: pointer;
  z-index: 2;
  font-weight: 600;
  transition: all 0.3s ease;
  color: var(--text-dim);
  white-space: nowrap;
  min-width: 100px;
}

.mode-switch input:checked+label {
  color: white;
}

.switch-selection {
  position: absolute;
  top: 4px;
  left: 4px;
  bottom: 4px;
  width: calc(25% - 4px);
  background: linear-gradient(135deg, var(--accent-primary), #6366f1);
  border-radius: 50px;
  z-index: 1;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

#mode-grammar:checked~.switch-selection {
  transform: translateX(100%);
}

#mode-kana:checked~.switch-selection {
  transform: translateX(200%);
}

#mode-kanji:checked~.switch-selection {
  transform: translateX(300%);
}

/* Spezialfall für 2er-Switches (z.B. im Kana-Modal oder Kana-Typ) */
.mode-switch.small .switch-selection {
  width: calc(50% - 4px);
}

#kana-katakana:checked~.switch-selection,
#type-katakana:checked~.switch-selection {
  transform: translateX(100%);
}

/* --- QUIZ CONTAINER --- */
#quiz-container {
  width: 100%;
  max-width: 500px;
  padding: 20px;
  transition: max-width 0.3s ease;
}

#quiz-container.grammar-mode {
  max-width: 800px;
}

#quiz-container.grammar-mode #question-text {
  font-size: 2rem;
  line-height: 1.4;
}

#erklaerung-text {
  margin-top: 15px;
  padding: 15px;
  background: rgba(162, 119, 255, 0.1);
  border-radius: 12px;
  border-left: 4px solid var(--accent-primary);
  font-size: 1rem;
  text-align: left;
  color: var(--text-color);
}

#quiz-card,
.placeholder-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  padding: 40px;
  border-radius: 30px;
  border: 1px solid var(--border-color);
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

#quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

#badge-level {
  background: var(--accent-primary);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: bold;
}

#btn-speak {
  background: none;
  border: none;
  color: var(--accent-primary);
  cursor: pointer;
  transition: transform 0.2s;
}

#btn-speak:hover {
  transform: scale(1.1);
  color: white;
}

#question-text {
  font-size: 56px;
  margin: 20px 0;
}

#romaji-text {
  color: var(--text-dim);
  font-size: 22px;
  margin-bottom: 25px;
}

#image-container img {
  max-width: 100%;
  height: 200px;
  border-radius: 20px;
  object-fit: cover;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent-primary), #6366f1);
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: 16px;
  width: 100%;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  margin-top: 25px;
  transition: all 0.3s;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.4);
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 25px;
}

.mc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 20px;
}

.mc-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 15px;
  border-radius: 14px;
  color: var(--text-main);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 600;
  transition: all 0.2s;
}

.mc-btn:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.action-btn {
  border: none;
  padding: 16px;
  border-radius: 14px;
  color: white;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  transition: all 0.2s;
}

.action-btn.success {
  background: var(--success);
}

.action-btn.error {
  background: var(--error);
}

.action-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

/* --- MODALS --- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-content {
  background: #1e293b;
  padding: 40px;
  border-radius: 30px;
  width: 600px;
  max-width: 95%;
  border: 1px solid var(--border-color);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
}

.modal-content.large {
  width: 1000px;
}

.modal-content.medium {
  width: 700px;
}

.modal-content.small {
  width: 500px;
}

.hidden {
  display: none !important;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

header h2 {
  font-size: 1.8rem;
}

.close-modal,
.close-submodal {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 36px;
  cursor: pointer;
  transition: color 0.2s;
}

.close-modal:hover,
.close-submodal:hover {
  color: white;
}

/* --- SMALL MODE SWITCH (for modals) --- */
.mode-switch.small {
  padding: 2px;
}

.mode-switch.small label {
  padding: 6px 15px;
  font-size: 0.9rem;
  min-width: 80px;
}

/* --- KANA MODAL STYLES --- */
.kana-layout {
  display: flex;
  flex-direction: column;
  gap: 30px;
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 15px;
}

.kana-section h3 {
  margin-bottom: 12px;
  color: var(--accent-primary);
  font-size: 1.05rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
}

.kana-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  max-width: 380px;
  margin: 0 auto;
}

.kana-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  min-height: 55px;
}

.kana-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.kana-char {
  font-size: 1.4rem;
  font-weight: bold;
  margin-bottom: 0px;
}

.kana-romaji {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kana-item.empty {
  visibility: hidden;
}

/* Responsive grid for smaller screens */
@media (max-width: 600px) {
  .kana-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* --- INFO ACCORDION --- */
.info-accordion {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 15px;
  margin-bottom: 20px;
}

.accordion-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.accordion-item.open {
  overflow: visible;
  /* Erlaubt dem Inhalt (und Scrollbalken) frei zu atmen */
}

.accordion-header {
  padding: 20px 25px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 1.15rem;
}

.accordion-actions {
  display: flex;
  gap: 10px;
  margin-right: 15px;
  margin-left: auto;
}

.edit-info-btn,
.delete-info-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-dim);
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.edit-info-btn:hover {
  background: var(--accent-primary);
  color: white;
  border-color: transparent;
}

.delete-info-btn:hover {
  background: var(--error);
  color: white;
  border-color: transparent;
}

.accordion-header:hover {
  background: rgba(255, 255, 255, 0.06);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0, 1, 0, 1), padding 0.3s ease;
  padding: 0 25px;
  color: var(--text-dim);
  line-height: 1.7;
  white-space: pre-wrap;
  font-size: 1.05rem;
}

.accordion-item.open {
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.accordion-item.open .accordion-content {
  max-height: 800px;
  padding-bottom: 25px;
  overflow-y: auto;
}

.accordion-header::after {
  content: '+';
  font-size: 1.6rem;
  transition: transform 0.3s ease;
  color: var(--accent-primary);
}

.accordion-item.open .accordion-header::after {
  transform: rotate(45deg);
}

.info-footer {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.add-circle-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--success);
  color: white;
  border: none;
  font-size: 2.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.add-circle-btn:hover {
  transform: scale(1.1) rotate(90deg);
}

/* --- ADD INFO FORM --- */
.add-info-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.add-info-form input,
.add-info-form textarea {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 15px;
  color: white;
  font-family: inherit;
  font-size: 1.1rem;
}

.add-info-form textarea {
  resize: vertical;
  min-height: 150px;
}

/* --- VOCAB TABLE & MGMT --- */
.add-vocab-row {
  display: flex;
  gap: 12px;
  margin-bottom: 25px;
  background: rgba(255, 255, 255, 0.03);
  padding: 15px;
  border-radius: 18px;
  border: 1px solid var(--border-color);
}

.add-vocab-row input {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  color: white;
  padding: 12px 15px;
  border-radius: 12px;
  flex: 1;
  font-size: 0.95rem;
}

.add-vocab-row input:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: rgba(0, 0, 0, 0.3);
}

.add-btn {
  background: var(--success);
  border: none;
  color: white;
  padding: 0 20px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 24px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.add-btn:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.search-row {
  margin-bottom: 20px;
}

.search-row .file-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 14px 20px;
  border-radius: 15px;
  color: white;
  font-size: 1rem;
  transition: all 0.3s;
}

.search-row .file-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

.table-wrapper {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.2);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: rgba(255, 255, 255, 0.05);
  text-align: left;
  padding: 15px 20px;
  color: var(--text-dim);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
}

td {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  font-size: 0.95rem;
  color: var(--text-main);
}

tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* --- SECTION STYLING (CSV & STORAGE) --- */
.csv-import-area,
.storage-area {
  margin-top: 30px;
  padding: 25px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 20px;
}

.csv-import-area p,
.storage-area h3 {
  margin-bottom: 15px;
  font-weight: 600;
  color: var(--text-main);
}

.file-upload-wrapper,
.storage-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.file-input {
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-main);
  padding: 10px 15px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  font-family: inherit;
  flex: 1;
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.08);
  color: white;
  border: 1px solid var(--border-color);
  padding: 12px 20px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.storage-controls.vertical {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 15px;
}

.storage-buttons {
  display: flex;
  gap: 15px;
  align-items: center;
}

.status-badge {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-badge.connected {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
  border: 1px solid var(--success);
}

.status-badge.disconnected {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
  border: 1px solid var(--error);
}

.status-badge.syncing {
  background: rgba(59, 130, 246, 0.2);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.hint {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-top: 10px;
}

/* --- STATS & CHARTS --- */
.chart-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chart-row {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 8px 0;
}

.chart-label {
  width: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dim);
}

.chart-bar-bg {
  flex: 1;
  background: rgba(0, 0, 0, 0.2);
  height: 12px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  position: relative;
}

.chart-bar-fill {
  height: 100%;
  border-radius: 20px;
  transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.chart-count {
  width: 35px;
  text-align: right;
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--text-main);
}

.fill-0 {
  background: #64748b;
}

.fill-1 {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.fill-2 {
  background: linear-gradient(90deg, #f97316, #fb923c);
}

.fill-3 {
  background: linear-gradient(90deg, #eab308, #fde047);
}

.fill-4 {
  background: linear-gradient(90deg, #84cc16, #a3e635);
}

.fill-5 {
  background: linear-gradient(90deg, var(--success), #34d399);
}

/* --- SETTINGS LAYOUT --- */
.settings-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}

.stats-section,
.config-section {
  background: rgba(255, 255, 255, 0.03);
  padding: 25px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
}

.stats-section h3,
.config-section h3 {
  margin-bottom: 20px;
  font-size: 1.1rem;
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-group {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 25px;
}

.switch-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 8px 0;
}

.switch-text {
  font-size: 1rem;
  color: var(--text-main);
}

/* Custom Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .4s;
  border: 1px solid var(--border-color);
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
}

input:checked+.slider {
  background-color: var(--accent-primary);
  border-color: transparent;
}

input:checked+.slider:before {
  transform: translateX(22px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Interval Grid */
.interval-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.interval-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.interval-grid span {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 600;
}

.interval-grid input {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  color: white;
  padding: 10px;
  border-radius: 10px;
  font-size: 1rem;
  width: 100%;
}

.interval-grid input:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: rgba(0, 0, 0, 0.3);
}

/* Responsive Settings */
@media (max-width: 800px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }
}

/* --- SCROLLBAR --- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
  .top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    pointer-events: none;
  }

  .top-bar>* {
    pointer-events: auto;
  }

  .top-left-group {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    gap: 8px;
  }

  .top-center {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: 100%;
  }

  .mode-switch {
    width: 100%;
    justify-content: space-between;
  }

  .mode-switch label {
    padding: 8px 5px;
    font-size: 0.85rem;
    min-width: auto;
  }

  #quiz-container {
    position: absolute;
    bottom: 15vh;
    left: 0;
    right: 0;
    margin: 0 auto;
    padding: 10px;
  }

  #quiz-card,
  .placeholder-card {
    padding: 25px 15px;
    border-radius: 20px;
  }

  #question-text {
    font-size: 2.2rem;
  }

  #quiz-container.grammar-mode #question-text {
    font-size: 1.5rem;
  }

  #romaji-text {
    font-size: 1.2rem;
  }

  .action-grid {
    gap: 10px;
  }

  .action-btn {
    padding: 12px;
    font-size: 0.9rem;
  }

  .modal-content {
    padding: 20px 15px;
    border-radius: 20px;
    max-height: 90vh;
    overflow-y: auto;
  }

  header {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  header h2 {
    font-size: 1.3rem;
  }

  .close-modal,
  .close-submodal {
    position: absolute;
    top: 10px;
    right: 15px;
  }

  .table-wrapper {
    overflow-x: auto;
  }

  table th,
  table td {
    padding: 10px;
    font-size: 0.85rem;
  }

  .add-vocab-row {
    flex-direction: column;
  }

  .add-btn {
    padding: 12px;
    font-size: 1.2rem;
  }

  .storage-controls.vertical {
    gap: 10px;
  }

  .storage-buttons {
    flex-wrap: wrap;
  }

  .kana-grid {
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 4px;
  }

  .kana-item {
    min-height: 45px;
    padding: 4px 2px;
  }

  .kana-char {
    font-size: 1.1rem;
  }

  .kana-romaji {
    font-size: 0.65rem;
  }
}