/* KitaTalk – Klares, modernes Split-Screen Design (ohne Emojis) */

:root {
  --bg-root: #0b1120;
  --parent-bg: #072a24;
  --parent-surface: #0c3b33;
  --parent-border: rgba(52, 211, 153, 0.22);
  --parent-btn: #10b981;
  --parent-btn-active: #059669;

  --staff-bg: #0f172a;
  --staff-surface: #1e293b;
  --staff-border: rgba(148, 163, 184, 0.2);
  --staff-btn: #2563eb;
  --staff-btn-active: #1d4ed8;

  --recording-bg: #dc2626;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

input, textarea {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
  touch-action: auto;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Noto Sans Arabic", "Noto Sans Devanagari", "Noto Sans Tamil", "Noto Sans SC", sans-serif;
  background: var(--bg-root);
  color: var(--text-primary);
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

.icon-sm {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.icon-md {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

.icon-mic {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* ===================================================================
   APP SHELL & SPLIT PANELS
   =================================================================== */
.app-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.half-panel {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 14px;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.parent-panel {
  background: var(--parent-bg);
}

.parent-panel.flipped-180 {
  transform: rotate(180deg);
}

.staff-panel {
  background: var(--staff-bg);
}

/* ===================================================================
   HEADERS
   =================================================================== */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

.lang-selector-btn,
.staff-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 6px 11px 6px 8px;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  min-width: 0;
  max-width: 65%;
}

.lang-selector-btn:active {
  background: rgba(255, 255, 255, 0.14);
}

.staff-badge {
  cursor: default;
  background: rgba(255, 255, 255, 0.05);
}

.lang-code-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 28px;
  padding: 0 6px;
  border-radius: 7px;
  background: rgba(16, 185, 129, 0.22);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.lang-code-badge.staff-code {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(59, 130, 246, 0.45);
  color: #93c5fd;
}

.lang-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.lang-name-primary {
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lang-name-secondary {
  font-size: 0.74rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chevron-icon {
  opacity: 0.7;
  margin-left: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.icon-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 36px;
  min-width: 36px;
  padding: 0 9px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-primary);
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.icon-action-btn:active {
  background: rgba(255, 255, 255, 0.18);
}

.flip-btn.active-flip {
  background: #10b981;
  color: #042f2e;
  border-color: #34d399;
}

.btn-label-inline {
  font-size: 0.75rem;
  font-weight: 700;
}

/* ===================================================================
   MESSAGE CARD & PROMINENT TRANSLATING / SPEAKING INDICATOR
   =================================================================== */
.message-card {
  flex: 1;
  margin: 10px 0;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--parent-surface);
  border: 1.5px solid var(--parent-border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
  position: relative;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.staff-panel .message-card {
  background: var(--staff-surface);
  border-color: var(--staff-border);
}

.message-card.is-translating {
  border-color: #f59e0b !important;
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.22);
}

.message-card.is-speaking {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.25);
}

/* Großes, sofort sichtbares Status-Banner in beiden Karten */
.card-activity-banner {
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 99px;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(251, 191, 36, 0.6);
  color: #fde68a;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  animation: bannerPulse 1.2s infinite ease-in-out;
}

.card-activity-banner.mode-speaking {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.65);
  color: #bae6fd;
}

.card-activity-banner.mode-listening {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(248, 113, 113, 0.65);
  color: #fecaca;
}

@keyframes bannerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.activity-bars {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 16px;
}

.activity-bars span {
  display: block;
  width: 3.5px;
  height: 12px;
  border-radius: 2px;
  background: currentColor;
  animation: barBounce 0.7s infinite ease-in-out;
}

.activity-bars span:nth-child(2) { animation-delay: 0.15s; }
.activity-bars span:nth-child(3) { animation-delay: 0.3s; }
.activity-bars span:nth-child(4) { animation-delay: 0.45s; }

@keyframes barBounce {
  0%, 100% { height: 5px; opacity: 0.55; }
  50% { height: 16px; opacity: 1; }
}

.speaker-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

.message-card[dir="rtl"] .speaker-tag {
  align-self: flex-end;
}

.main-speech-text {
  font-size: clamp(1.2rem, 3.8vw, 1.6rem);
  font-weight: 600;
  line-height: 1.4;
  color: #ffffff;
  word-break: break-word;
  -webkit-user-select: none;
  user-select: none;
}

.main-speech-text.placeholder-text {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  font-size: clamp(1.05rem, 3.2vw, 1.3rem);
  -webkit-user-select: none;
  user-select: none;
}

.sub-speech-text {
  margin-top: 8px;
  font-size: 0.86rem;
  line-height: 1.38;
  color: var(--text-secondary);
  -webkit-user-select: none;
  user-select: none;
}

.sub-speech-text:empty {
  display: none;
}

/* ===================================================================
   TALK BUTTONS
   =================================================================== */
.panel-footer {
  flex-shrink: 0;
}

.talk-btn {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.parent-talk-btn {
  background: var(--parent-btn);
}

.parent-talk-btn:active {
  background: var(--parent-btn-active);
  transform: scale(0.99);
}

.staff-talk-btn {
  background: var(--staff-btn);
}

.staff-talk-btn:active {
  background: var(--staff-btn-active);
  transform: scale(0.99);
}

.talk-btn.recording {
  background: var(--recording-bg) !important;
  animation: pulseBorder 1.2s infinite ease-in-out;
}

@keyframes pulseBorder {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
}

.talk-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
}

.talk-btn-texts {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.talk-btn-texts strong {
  font-size: 1rem;
  font-weight: 700;
}

.talk-btn-texts small {
  font-size: 0.76rem;
  opacity: 0.88;
}

/* ===================================================================
   CENTER CONTROL BAR (MIT ANIMIERTEM FORTSCHRITTSBALKEN)
   =================================================================== */
.center-bar {
  flex-shrink: 0;
  height: 48px;
  background: #060a12;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  position: relative;
  z-index: 10;
}

.center-progress-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #f59e0b, #38bdf8, #10b981, transparent);
  background-size: 200% 100%;
  animation: slideProgress 1.1s linear infinite;
}

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

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 4px 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.status-indicator.state-thinking {
  background: rgba(245, 158, 11, 0.22);
  border: 1px solid rgba(245, 158, 11, 0.5);
}

.status-indicator.state-speaking {
  background: rgba(56, 189, 248, 0.22);
  border: 1px solid rgba(56, 189, 248, 0.5);
}

.status-indicator.state-listening {
  background: rgba(239, 68, 68, 0.22);
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.ready {
  background: #10b981;
}

.status-dot.listening {
  background: #ef4444;
  animation: blink 0.8s infinite;
}

.status-dot.thinking {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
  animation: blink 0.5s infinite;
}

.status-dot.speaking {
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.engine-badge-text {
  font-size: 0.72rem;
  font-weight: 800;
  color: #34d399;
  letter-spacing: 0.02em;
}

.engine-badge-text.gemini {
  color: #fbbf24;
}

.status-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
  white-space: nowrap;
}

.center-controls {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.bar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 34px;
  min-width: 34px;
  padding: 0 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  touch-action: manipulation;
  transition: transform 0.1s ease, background 0.15s ease;
}

.bar-btn:active {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(0.96);
}

.bar-btn.active {
  background: #f59e0b;
  color: #0b1120;
  border-color: #fbbf24;
  font-weight: 700;
}

.settings-btn {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
  font-weight: 700;
}

.settings-btn:active {
  background: rgba(16, 185, 129, 0.3);
}

.settings-header-btn {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

.icon-only-btn {
  padding: 0 7px;
}
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.bar-btn:active {
  background: rgba(255, 255, 255, 0.16);
}

.bar-btn.active {
  background: #f59e0b;
  color: #0b1120;
  border-color: #fbbf24;
  font-weight: 700;
}

.settings-btn.needs-key {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fca5a5;
}

/* ===================================================================
   MODALS
   =================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.8);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
}

.modal-sheet {
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  background: #1e293b;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.compact-sheet {
  max-height: 60vh;
}

.modal-header {
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-header h2 {
  font-size: 1.08rem;
  font-weight: 700;
}

.modal-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
}

.search-box-wrap {
  padding: 10px 18px;
  background: #0f172a;
}

.search-box-wrap input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #1e293b;
  color: #ffffff;
  font-size: 0.92rem;
}

.modal-body {
  padding: 14px 18px 20px;
  overflow-y: auto;
  flex: 1;
}

.section-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin: 14px 0 8px;
}

.section-label:first-child {
  margin-top: 0;
}

.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 8px;
}

.lang-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  cursor: pointer;
  text-align: left;
}

.lang-card.selected {
  background: rgba(16, 185, 129, 0.18);
  border-color: #10b981;
}

.lang-card-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 26px;
  padding: 0 5px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.72rem;
  font-weight: 800;
  color: #e2e8f0;
  flex-shrink: 0;
}

.lang-card.selected .lang-card-code {
  background: #10b981;
  color: #042f2e;
}

.lang-card-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.lang-card-title {
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lang-card-native {
  font-size: 0.74rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.phrase-item-btn {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  text-align: left;
  cursor: pointer;
}

.phrase-item-btn:active {
  background: rgba(37, 99, 235, 0.22);
  border-color: #3b82f6;
}

.phrase-content strong {
  display: block;
  font-size: 0.86rem;
  margin-bottom: 3px;
  color: #93c5fd;
}

.phrase-content span {
  font-size: 0.84rem;
  color: #e2e8f0;
}

#manualGermanInput {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #0f172a;
  color: #ffffff;
  font-size: 0.95rem;
  resize: none;
}

.settings-sheet {
  max-height: 90vh;
}

.settings-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding-bottom: 20px;
}

.setting-card {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 14px;
  border-radius: 12px;
}

.status-summary-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.service-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.service-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #64748b;
  flex-shrink: 0;
}

.service-dot.online {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.service-dot.fallback {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

.service-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.service-details strong {
  font-size: 0.85rem;
  color: #f8fafc;
}

.service-details span {
  font-size: 0.76rem;
  color: #94a3b8;
}

/* Admin Lock Card */
.admin-lock-card {
  border: 1px dashed rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.6);
}

.admin-lock-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.admin-lock-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  flex-shrink: 0;
}

.admin-lock-title {
  font-size: 0.92rem;
  color: #f1f5f9;
  display: block;
  margin-bottom: 2px;
}

.admin-unlock-btn {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.86rem;
}

/* Admin Unlocked Section */
.admin-unlocked-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-unlocked-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
  font-size: 0.82rem;
}

.admin-banner-text {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  background: #10b981;
  color: #042f2e;
  font-weight: 800;
  font-size: 0.7rem;
  text-transform: uppercase;
}

.small-text-btn {
  background: transparent;
  border: none;
  color: #fca5a5;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.admin-highlight-card {
  border-color: rgba(16, 185, 129, 0.3);
  background: #0b1e1b;
}

.section-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.brand-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 5px;
  background: #10b981;
  color: #022c22;
  font-size: 0.72rem;
  font-weight: 800;
}

.gemini-tag {
  background: #3b82f6;
  color: #ffffff;
}

.sub-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #cbd5e1;
  margin: 10px 0 4px 0;
}

.setting-text-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #1e293b;
  color: #ffffff;
  font-size: 0.88rem;
}

.setting-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.test-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.btn-sm {
  padding: 7px 12px !important;
  font-size: 0.78rem !important;
  flex: none !important;
}

.test-msg {
  font-size: 0.78rem;
  font-weight: 600;
}

.test-msg.success { color: #6ee7b7; }
.test-msg.error { color: #f87171; }
.test-msg.loading { color: #fcd34d; }

/* PIN Modal & Keypad */
.pin-sheet {
  max-width: 380px;
  background: #0f172a;
}

.pin-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 20px 24px;
}

.pin-dots {
  display: flex;
  gap: 14px;
  margin: 12px 0 16px;
}

.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  transition: all 0.2s ease;
}

.pin-dot.filled {
  background: #10b981;
  border-color: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.pin-error-msg {
  font-size: 0.8rem;
  color: #ef4444;
  font-weight: 600;
  margin-bottom: 12px;
  text-align: center;
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 270px;
}

.pin-key {
  height: 54px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-size: 1.35rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.1s ease, transform 0.05s ease;
}

.pin-key:active {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(0.96);
}

.pin-key-fn {
  font-size: 1rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.03);
}

.shake {
  animation: shakeAnim 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shakeAnim {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

.setting-title {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.setting-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.key-input-row {
  display: flex;
  gap: 8px;
}

.key-input-row input,
.setting-select {
  flex: 1;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #1e293b;
  color: #ffffff;
  font-size: 0.9rem;
}

.icon-btn {
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.setting-checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
}

.setting-checkbox-row input {
  width: 18px;
  height: 18px;
}

.validation-msg {
  margin-top: 8px;
  font-size: 0.8rem;
  font-weight: 600;
}

.modal-actions-row {
  margin-top: 8px;
}

.primary-action-btn {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  background: #10b981;
  color: #042f2e;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  padding: 12px;
  border-radius: 10px;
  background: #0f172a;
  border-left: 3px solid #3b82f6;
}

.history-item.from-parent {
  border-left-color: #10b981;
}

.history-meta {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}

.history-de {
  font-size: 0.92rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 4px;
}

.history-parent {
  font-size: 0.9rem;
  color: #6ee7b7;
}

.modal-footer-bar {
  padding: 12px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 8px;
}

.secondary-action-btn,
.danger-action-btn {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  color: #ffffff;
}

.secondary-action-btn {
  background: #2563eb;
}

.danger-action-btn {
  background: rgba(220, 38, 38, 0.25);
  border-color: #ef4444;
}

.empty-hint {
  text-align: center;
  color: #94a3b8;
  padding: 20px 0;
}
