
/* CSS Reset i Tokeny MedEdu LEK (V1.0) */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}



body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding: 32px 24px 80px;
}

.spec-container {
  max-width: 1400px;
  margin: 0 auto;
}

/* Header Spec */
.spec-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 24px;
  margin-bottom: 36px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
}

.spec-meta {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.spec-title {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
}

.spec-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 860px;
  margin-top: 8px;
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: var(--radius-control);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  min-height: 44px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  background: var(--surface-raised);
}

.theme-toggle-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--focus-ring);
}

/* Section styling */
.spec-section {
  margin-bottom: 56px;
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.section-heading {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.section-subtext {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
  max-width: 900px;
}

/* Mobile Screens Gallery */
.mobile-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 390px));
  gap: 28px;
  justify-content: flex-start;
  align-items: flex-start;
}

.mobile-frame-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.frame-badge-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.state-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface-raised);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.state-tag.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.state-tag.warning {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: var(--warning);
}

.state-tag.danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger);
}

/* Mobile Device Container (390px) */
.mobile-device {
  width: 390px;
  height: 820px;
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: 32px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-md);
}

/* Status Bar */
.mobile-status-bar {
  height: 44px;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  flex-shrink: 0;
  z-index: 20;
}

/* App Header */
.app-header-compact {
  padding: 8px 16px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 10;
}

.header-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-badge {
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.brand-text {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.dict-counter-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-raised);
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

/* Pinned Search Box */
.search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  height: 44px;
  padding: 0 40px 0 38px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  font-size: 14px;
  color: var(--text);
  font-family: var(--font-sans);
  transition: all 0.15s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.search-input::placeholder {
  color: var(--text-subtle);
}

.search-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--text-subtle);
  pointer-events: none;
}

.search-clear-btn {
  position: absolute;
  right: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--surface-raised);
  color: var(--text-muted);
  border-radius: 50%;
  cursor: pointer;
}

/* Scrollable Content inside Device */
.device-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.section-caption-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 4px 0 4px;
}

.section-caption {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.section-counter {
  font-size: 11px;
  color: var(--text-subtle);
}

/* Lexicon Term Item Card */
.term-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  min-height: 60px;
  text-align: left;
  width: 100%;
}

.term-card:hover {
  background: var(--surface-raised);
}

.term-card.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.term-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.term-main-block {
  flex: 1;
  min-width: 0;
}

.term-pl-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 2px;
}

.term-translation-compact {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.term-translation-compact .lang-flag {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-subtle);
  margin-right: 2px;
  letter-spacing: 0.04em;
}

.term-meta-indicators {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-top: 2px;
}

.audio-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-raised);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.audio-chip.available {
  color: var(--accent);
  border-color: var(--accent-soft);
}

.audio-chip.unavailable {
  color: var(--text-subtle);
  border-style: dashed;
}

.chevron-icon {
  width: 14px;
  height: 14px;
  color: var(--text-subtle);
}

/* Bottom Sheet Overlay on Mobile */
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 22, 40, 0.45);
  backdrop-filter: blur(2px);
  z-index: 40;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.bottom-sheet {
  background: var(--surface);
  border-top-left-radius: var(--radius-sheet);
  border-top-right-radius: var(--radius-sheet);
  border-top: 1px solid var(--border);
  box-shadow: var(--shadow-sheet);
  padding: 12px 18px 24px;
  max-height: 86%;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet-grabber {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin: 0 auto 14px;
}

.sheet-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.sheet-title-group {
  flex: 1;
}

.sheet-pl-term {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}

.sheet-term-type {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.close-sheet-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text-muted);
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
}

/* Audio Player Bar Component */
.audio-player-component {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.audio-player-component.playing {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.audio-play-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: var(--accent-contrast);
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  transition: all 0.15s ease;
}

.audio-play-button.paused-state {
  background: var(--accent);
}

.audio-play-button.playing-state {
  background: var(--surface);
  color: var(--accent);
  border: 2px solid var(--accent);
}

.audio-play-button:disabled {
  background: var(--surface-raised);
  color: var(--text-subtle);
  cursor: not-allowed;
  border: 1px dashed var(--border);
}

.audio-info-label {
  display: flex;
  flex-direction: column;
}

.audio-status-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.audio-waveform-icon {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 12px;
}

.waveform-bar {
  width: 2px;
  height: 100%;
  background: currentColor;
  border-radius: 1px;
}

.waveform-bar:nth-child(1) { height: 6px; }
.waveform-bar:nth-child(2) { height: 12px; }
.waveform-bar:nth-child(3) { height: 8px; }

.audio-accent-subtext {
  font-size: 11px;
  color: var(--text-muted);
}

/* Sheet Translations Grid */
.translations-card-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.trans-row {
  display: flex;
  align-items: baseline;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  gap: 12px;
}

.trans-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  width: 30px;
  flex-shrink: 0;
  letter-spacing: 0.05em;
}

.trans-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

.trans-text.missing {
  color: var(--text-subtle);
  font-style: italic;
}

/* Context Line */
.context-box {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.4;
}

.context-icon {
  width: 14px;
  height: 14px;
  margin-top: 2px;
  color: var(--accent);
  flex-shrink: 0;
}

.context-link {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

/* Bottom Tab Bar (App Shell) */
.mobile-bottom-bar {
  height: 60px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-shrink: 0;
  z-index: 10;
}

.tab-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  min-width: 44px;
  min-height: 44px;
  gap: 2px;
}

.tab-link.active {
  color: var(--accent);
}

.tab-icon {
  width: 20px;
  height: 20px;
}

/* Wide Screen Layout (Desktop 1280px) */
.desktop-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.desktop-browser-chrome {
  height: 40px;
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
}

.browser-dots {
  display: flex;
  gap: 6px;
}

.browser-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}

.browser-url-pill {
  flex: 1;
  max-width: 520px;
  height: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.desktop-layout-inner {
  display: flex;
  min-height: 720px;
}

/* Sidebar (App Shell) */
.desktop-sidebar {
  width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  flex-shrink: 0;
}

.sidebar-brand-block {
  margin-bottom: 28px;
}

.sidebar-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-control);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  min-height: 44px;
  transition: all 0.15s ease;
}

.sidebar-nav-item:hover {
  background: var(--surface-raised);
  color: var(--text);
}

.sidebar-nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.sidebar-footer-info {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  font-size: 11px;
  color: var(--text-subtle);
}

/* Main Split-View Area */
.desktop-main-split {
  flex: 1;
  display: flex;
  background: var(--bg);
}

/* Left Pane: Search and Scrollable List */
.split-left-pane {
  width: 440px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.split-header-search {
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.pane-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}

.split-list-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 640px;
}

/* Right Pane: Selected Entry Detail */
.split-right-pane {
  flex: 1;
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.right-pane-breadcrumbs {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.entry-detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  max-width: 680px;
}

.entry-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.entry-big-term {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.entry-term-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Detail Translations Box */
.detail-translations-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.trans-detail-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 14px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
}

.trans-detail-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  width: 80px;
  flex-shrink: 0;
}

.trans-detail-val {
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
}

.trans-detail-val.missing-state {
  color: var(--text-subtle);
  font-style: italic;
  font-size: 16px;
}

.context-detail-panel {
  background: var(--surface-raised);
  border-left: 3px solid var(--accent);
  padding: 14px 18px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

.context-detail-panel strong {
  color: var(--accent);
}

/* Empty State / No Match Box */
.empty-state-card {
  padding: 48px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-card);
  margin: 12px 0;
}

.empty-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-subtle);
}

.empty-state-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.empty-state-desc {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 260px;
  line-height: 1.4;
}

/* Skeleton Loading Helpers */
.skeleton-line {
  background: linear-gradient(90deg, var(--surface-raised) 25%, var(--border) 50%, var(--surface-raised) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite ease-in-out;
  border-radius: 4px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Audit / Table matrix */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  overflow: hidden;
  font-size: 13px;
}

.spec-table th {
  background: var(--surface-raised);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.spec-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: top;
}

.spec-table tr:last-child td {
  border-bottom: none;
}

.spec-table strong {
  color: var(--text);
}
