/* ╔══════════════════════════════════════════╗
   ║  APPLE VIDEO CONVERTER — PIXEL ART CSS  ║
   ║  Retro Game UI — Warm Beige Palette      ║
   ╚══════════════════════════════════════════╝ */

/* ─── RESET & FONT ─── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

@font-face {
  font-family: 'PixelFont';
  src: url('https://fonts.gstatic.com/s/pressstart2p/v15/e3t4euO8T-267oIAQAu6jDQyK3nVivM.woff2') format('woff2');
}

:root {
  /* Warm retro beige palette */
  --bg:          #c8b89a;
  --bg-dark:     #b5a488;
  --bg-light:    #d4c8ae;
  --panel:       #d9ccb4;
  --panel-dark:  #c2b49a;
  --panel-light: #e6dbc5;
  --border:      #5a4e3c;
  --border-mid:  #7a6e5a;
  --border-light:#9a8e7a;
  --text:        #3a3228;
  --text-mid:    #5a5040;
  --text-light:  #8a7e6a;
  --accent:      #6a5a42;
  --accent-light:#8a7a5e;
  --green:       #5a7a4a;
  --green-light: #7a9a6a;
  --red:         #8a4a3a;
  --red-light:   #aa6a5a;
  --blue:        #4a5a7a;
  --blue-light:  #6a7a9a;
  --yellow:      #9a8a3a;
  --yellow-light:#baa a5a;
  --shadow:      rgba(60, 50, 35, 0.35);

  --pixel: 3px;
  --pixel2: 6px;
  --radius: 0px;
  --font: 'Press Start 2P', 'PixelFont', monospace;
}

html {
  font-size: 18px;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
  image-rendering: pixelated;
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px 10px;
  overflow-y: auto;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(90,80,60,0.06) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(90,80,60,0.06) 0%, transparent 50%);
}

/* ─── CRT SCANLINES ─── */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(60, 50, 35, 0.03) 2px,
    rgba(60, 50, 35, 0.03) 4px
  );
}

/* ─── PIXEL BORDER MIXIN ─── */
.pixel-border {
  border: var(--pixel) solid var(--border);
  box-shadow:
    inset var(--pixel) var(--pixel) 0 var(--panel-light),
    inset calc(var(--pixel) * -1) calc(var(--pixel) * -1) 0 var(--panel-dark),
    var(--pixel2) var(--pixel2) 0 var(--shadow);
}

.pixel-border-sm {
  border: 2px solid var(--border);
  box-shadow:
    inset 2px 2px 0 var(--panel-light),
    inset -2px -2px 0 var(--panel-dark);
}

/* Pressed state */
.pixel-border-pressed {
  border: var(--pixel) solid var(--border);
  box-shadow:
    inset var(--pixel) var(--pixel) 0 var(--panel-dark),
    inset calc(var(--pixel) * -1) calc(var(--pixel) * -1) 0 var(--panel-light);
}

/* ─── GAME SCREEN ─── */
.game-screen {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ─── HEADER ─── */
.header {
  text-align: center;
  padding: 16px 10px 12px;
  position: relative;
}

.header-hearts {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 6px;
}

.heart {
  color: var(--text);
  font-size: 20px;
  text-shadow: 1px 1px 0 var(--bg-dark);
  animation: heartPulse 2s ease-in-out infinite;
}

.heart:nth-child(2) { animation-delay: 0.3s; }
.heart:nth-child(3) { animation-delay: 0.6s; }

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

.header-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}

.dot {
  width: 8px;
  height: 8px;
  background: var(--text);
  border-radius: 0;
}

.title {
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  text-shadow:
    2px 2px 0 var(--bg-dark),
    -1px -1px 0 var(--bg-light);
  letter-spacing: 1px;
}

/* ─── MAIN PANEL ─── */
.main-panel {
  background: var(--panel);
  padding: 0;
  position: relative;
}

/* ─── TAB BAR ─── */
.tab-bar {
  display: flex;
  border-bottom: var(--pixel) solid var(--border);
}

.tab {
  flex: 1;
  font-family: var(--font);
  font-size: 11px;
  padding: 10px 4px;
  background: var(--panel-dark);
  color: var(--text-mid);
  border: none;
  border-right: 2px solid var(--border);
  cursor: pointer;
  transition: all 0.1s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
}

.tab:last-child { border-right: none; }

.tab:hover {
  background: var(--panel);
  color: var(--text);
}

.tab.active {
  background: var(--panel);
  color: var(--text);
  box-shadow: inset 0 -3px 0 var(--panel);
  z-index: 1;
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--panel);
}

.tab.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.tab-icon {
  font-size: 18px;
  filter: grayscale(100%);
}

.tab.active .tab-icon {
  filter: grayscale(0%);
}

.tab-text {
  letter-spacing: 1px;
}

/* ─── TAB CONTENT ─── */
.tab-content {
  display: none;
  padding: 16px;
  min-height: 340px;
  animation: fadeIn 0.15s ease-out;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-title {
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.pixel-arrow {
  color: var(--accent);
  margin-right: 4px;
}

/* ─── DROP ZONE ─── */
.drop-zone {
  border: 3px dashed var(--border-mid);
  background: var(--bg);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  margin-bottom: 12px;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--text);
  background: var(--bg-dark);
  transform: scale(1.01);
}

.drop-zone.dragover {
  animation: dropPulse 0.6s ease-in-out infinite;
}

@keyframes dropPulse {
  0%, 100% { background: var(--bg-dark); }
  50% { background: var(--bg); }
}

.drop-icon {
  font-size: 40px;
  margin-bottom: 10px;
  filter: grayscale(80%);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.drop-text {
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: 2px;
}

.drop-subtext {
  font-family: var(--font);
  font-size: 11px;
  color: var(--text-light);
}

.drop-formats {
  font-family: var(--font);
  font-size: 10px;
  color: var(--text-light);
  margin-top: 10px;
  letter-spacing: 1px;
  padding: 4px 8px;
  background: var(--panel);
  display: inline-block;
  border: 1px solid var(--border-light);
}

/* ─── FILE LIST ─── */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-mid) var(--panel-dark);
}

.file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg);
  border: 2px solid var(--border-light);
  font-family: var(--font);
  font-size: 11px;
  color: var(--text);
  animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.file-item-icon {
  font-size: 18px;
  filter: grayscale(80%);
  flex-shrink: 0;
}

.file-item-info {
  flex: 1;
  min-width: 0;
}

.file-item-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.file-item-size {
  color: var(--text-light);
  font-size: 10px;
  margin-top: 2px;
}

.file-item-remove {
  font-family: var(--font);
  font-size: 12px;
  background: none;
  border: 2px solid var(--red);
  color: var(--red);
  cursor: pointer;
  padding: 3px 6px;
  transition: all 0.1s;
  flex-shrink: 0;
}

.file-item-remove:hover {
  background: var(--red);
  color: var(--panel-light);
}

.file-counter {
  font-family: var(--font);
  font-size: 11px;
  color: var(--text-mid);
  padding: 8px 0;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.total-size {
  margin-left: auto;
  color: var(--text-light);
  font-size: 10px;
}

/* ─── BUTTONS ─── */
.pixel-btn {
  font-family: var(--font);
  font-size: 13px;
  padding: 12px 20px;
  background: var(--panel-dark);
  color: var(--text);
  border: var(--pixel) solid var(--border);
  cursor: pointer;
  letter-spacing: 2px;
  text-transform: uppercase;
  width: 100%;
  margin-top: 12px;
  transition: all 0.08s;
  box-shadow:
    inset 2px 2px 0 var(--panel-light),
    inset -2px -2px 0 var(--bg-dark),
    4px 4px 0 var(--shadow);
  position: relative;
}

.pixel-btn:hover {
  background: var(--panel);
  transform: translateY(-1px);
  box-shadow:
    inset 2px 2px 0 var(--panel-light),
    inset -2px -2px 0 var(--bg-dark),
    5px 5px 0 var(--shadow);
}

.pixel-btn:active {
  transform: translateY(2px);
  box-shadow:
    inset 2px 2px 0 var(--bg-dark),
    inset -2px -2px 0 var(--panel-light),
    1px 1px 0 var(--shadow);
}

.pixel-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-arrow, .btn-icon {
  margin-left: 4px;
}

.convert-btn {
  background: var(--green);
  color: var(--panel-light);
  border-color: #3a5a2a;
  box-shadow:
    inset 2px 2px 0 var(--green-light),
    inset -2px -2px 0 #3a5a2a,
    4px 4px 0 var(--shadow);
}

.convert-btn:hover {
  background: var(--green-light);
}

.download-all-btn {
  background: var(--blue);
  color: var(--panel-light);
  border-color: #3a4a6a;
  box-shadow:
    inset 2px 2px 0 var(--blue-light),
    inset -2px -2px 0 #3a4a6a,
    4px 4px 0 var(--shadow);
}

.download-all-btn:hover {
  background: var(--blue-light);
}

.reset-btn {
  background: var(--panel-dark);
  font-size: 11px;
}

/* ─── CATEGORY TABS ─── */
.category-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  border: 2px solid var(--border);
}

.cat-tab {
  flex: 1;
  font-family: var(--font);
  font-size: 11px;
  padding: 8px 4px;
  background: var(--bg);
  color: var(--text-mid);
  border: none;
  border-right: 2px solid var(--border);
  cursor: pointer;
  transition: all 0.1s;
}

.cat-tab:last-child { border-right: none; }

.cat-tab:hover {
  background: var(--panel-dark);
}

.cat-tab.active {
  background: var(--panel-dark);
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* ─── RESOLUTION GRID ─── */
.resolution-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.res-card {
  padding: 10px 8px;
  background: var(--bg);
  border: 2px solid var(--border-light);
  cursor: pointer;
  transition: all 0.1s;
  text-align: center;
  position: relative;
}

.res-card:hover {
  border-color: var(--border);
  background: var(--bg-dark);
  transform: translateY(-1px);
}

.res-card.selected {
  border-color: var(--text);
  background: var(--panel-dark);
  box-shadow:
    inset 2px 2px 0 var(--panel),
    inset -2px -2px 0 var(--bg-dark),
    3px 3px 0 var(--shadow);
}

.res-card.selected::before {
  content: '✔';
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 12px;
  color: var(--green);
}

.res-card.full-width {
  grid-column: 1 / -1;
}

.res-device {
  font-family: var(--font);
  font-size: 11px;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.res-orientation {
  font-family: var(--font);
  font-size: 10px;
  color: var(--accent);
  margin-bottom: 6px;
}

.res-dimensions {
  font-family: var(--font);
  font-size: 12px;
  color: var(--text);
  letter-spacing: 1px;
  padding: 4px 0;
  border-top: 1px solid var(--border-light);
  margin-top: 4px;
}

.res-sublabel {
  font-family: var(--font);
  font-size: 9px;
  color: var(--text-light);
  margin-top: 2px;
}

/* ─── CUSTOM RESOLUTION INPUTS ─── */
.custom-res-inputs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 0 4px;
  border-top: 1px solid var(--border-light);
  margin-top: 4px;
}

.custom-input-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.custom-label {
  font-family: var(--font);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 1px;
}

.custom-input {
  font-family: var(--font);
  font-size: 13px;
  width: 70px;
  padding: 6px 6px;
  background: var(--panel-light);
  color: var(--text);
  border: 2px solid var(--border-mid);
  text-align: center;
  outline: none;
  transition: all 0.1s;
  appearance: textfield;
  -moz-appearance: textfield;
}

.custom-input::-webkit-outer-spin-button,
.custom-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.custom-input:focus {
  border-color: var(--text);
  background: var(--panel);
  box-shadow: inset 1px 1px 0 var(--panel-dark);
}

.custom-input::placeholder {
  color: var(--text-light);
  font-size: 11px;
}

.custom-x {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-mid);
}

.res-preview {
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

.res-preview-box {
  border: 2px solid var(--border-mid);
  background: var(--panel-dark);
  transition: all 0.2s;
}

.res-card.selected .res-preview-box {
  border-color: var(--text);
  background: var(--accent);
}

.selected-info {
  padding: 8px 10px;
  background: var(--bg);
  font-family: var(--font);
  font-size: 11px;
  color: var(--green);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ─── CONVERT STATUS ─── */
.convert-status {
  margin-bottom: 12px;
}

.status-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-family: var(--font);
  font-size: 11px;
}

.status-label {
  color: var(--text-light);
}

.status-value {
  color: var(--text);
  letter-spacing: 1px;
}

.status-value.done { color: var(--green); }
.status-value.error { color: var(--red); }
.status-value.processing { color: var(--yellow); animation: blink 1s infinite; }

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

.progress-container {
  background: var(--bg);
  padding: 4px;
  height: 32px;
  position: relative;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  position: relative;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--green);
  transition: width 0.3s ease-out;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 4px,
    rgba(255,255,255,0.1) 4px,
    rgba(255,255,255,0.1) 8px
  );
  animation: progressStripe 0.5s linear infinite;
}

@keyframes progressStripe {
  0% { transform: translateX(0); }
  100% { transform: translateX(8px); }
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font);
  font-size: 12px;
  color: var(--text);
  z-index: 1;
  text-shadow: 1px 1px 0 var(--bg);
}

.progress-details {
  display: flex;
  justify-content: space-between;
  font-family: var(--font);
  font-size: 10px;
  color: var(--text-light);
  margin-top: 6px;
  padding: 0 2px;
}

/* ─── CONVERT FILE LIST ─── */
.convert-file-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  max-height: 200px;
  overflow-y: auto;
}

.convert-file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg);
  border: 2px solid var(--border-light);
  font-family: var(--font);
  font-size: 11px;
}

.convert-file-status {
  flex-shrink: 0;
  font-size: 16px;
}

.convert-file-status.pending::after { content: '⬜'; }
.convert-file-status.converting::after { content: '🔄'; animation: spin 1s linear infinite; }
.convert-file-status.done::after { content: '✅'; }
.convert-file-status.error::after { content: '❌'; }

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.convert-file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.convert-file-progress {
  color: var(--text-light);
  font-size: 10px;
  flex-shrink: 0;
}

/* ─── DOWNLOAD LIST ─── */
.download-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.download-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg);
  border: 2px solid var(--border-light);
  font-family: var(--font);
  font-size: 11px;
}

.download-item-icon {
  font-size: 20px;
  filter: grayscale(60%);
  flex-shrink: 0;
}

.download-item-info {
  flex: 1;
  min-width: 0;
}

.download-item-name {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.download-item-status {
  font-size: 10px;
  color: var(--green);
  margin-top: 2px;
}

.download-item-status.error {
  color: var(--red);
}

.download-item-btn {
  font-family: var(--font);
  font-size: 11px;
  padding: 6px 10px;
  background: var(--panel-dark);
  color: var(--text);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all 0.1s;
  text-decoration: none;
  flex-shrink: 0;
}

.download-item-btn:hover {
  background: var(--panel);
  transform: translateY(-1px);
}

/* ─── FOOTER ─── */
.footer {
  text-align: center;
  padding: 14px 10px 6px;
  position: relative;
}

.footer-border {
  width: 60%;
  margin: 0 auto 10px;
  height: 2px;
  border-top: 2px dashed var(--border-light);
}

.footer-icon {
  font-size: 18px;
  color: var(--text);
  display: inline-block;
  width: 28px;
  height: 28px;
  line-height: 28px;
  border: 2px solid var(--border);
  background: var(--panel-dark);
  cursor: default;
}

/* ─── EMPTY STATE ─── */
.empty-state {
  text-align: center;
  padding: 30px 10px;
  font-family: var(--font);
}

.empty-state-icon {
  font-size: 36px;
  filter: grayscale(80%);
  margin-bottom: 10px;
}

.empty-state-text {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.8;
}

/* ─── TOAST NOTIFICATION ─── */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  font-family: var(--font);
  font-size: 11px;
  padding: 10px 16px;
  background: var(--text);
  color: var(--panel-light);
  border: 2px solid var(--border);
  z-index: 10000;
  transition: transform 0.3s ease-out;
  box-shadow: 4px 4px 0 var(--shadow);
  letter-spacing: 1px;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  background: var(--red);
}

.toast.success {
  background: var(--green);
}

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

::-webkit-scrollbar-track {
  background: var(--panel-dark);
  border: 1px solid var(--border-light);
}

::-webkit-scrollbar-thumb {
  background: var(--border-mid);
  border: 1px solid var(--border);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 480px) {
  html { font-size: 16px; }

  .game-screen { max-width: 100%; }

  .resolution-grid {
    grid-template-columns: 1fr;
  }

  .title { font-size: 15px; }

  .tab-text { display: none; }

  .tab-icon { font-size: 22px; }
}

@media (min-width: 768px) {
  body { padding: 40px 20px; }

  .game-screen { max-width: 560px; }
}

/* ─── LOADING DOTS ─── */
.loading-dots::after {
  content: '';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}

/* ─── FAQ ACCORDION (native details/summary) ─── */
.faq-section {
  width: 100%;
  margin-top: 24px;
  background: var(--panel);
  border: var(--pixel) solid var(--border);
  box-shadow:
    inset var(--pixel) var(--pixel) 0 var(--panel-light),
    inset calc(var(--pixel) * -1) calc(var(--pixel) * -1) 0 var(--panel-dark),
    var(--pixel2) var(--pixel2) 0 var(--shadow);
  overflow: hidden;
}

.faq-header {
  background: var(--panel-dark);
  padding: 14px 16px;
  border-bottom: var(--pixel) solid var(--border);
  font-family: var(--font);
  font-size: 12px;
  color: var(--text);
  letter-spacing: 1px;
  text-align: center;
}

.faq-item {
  border-bottom: var(--pixel) solid var(--border-light);
}

.faq-item:last-of-type {
  border-bottom: none;
}

/* Summary / Question */
.faq-question {
  padding: 16px 18px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* Hide default browser markers */
.faq-question::-webkit-details-marker {
  display: none;
}
.faq-question::marker {
  content: '';
}

/* Toggle icon */
.faq-question::after {
  content: '＋';
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border-light);
  background: var(--panel-dark);
  transition: transform 0.2s ease, background 0.2s ease;
}

details[open] > .faq-question::after {
  content: '−';
  background: var(--accent);
  color: var(--panel-light);
  border-color: var(--border);
  transform: rotate(180deg);
}

details[open] > .faq-question {
  background: var(--panel-light);
  border-bottom: 1px solid var(--border-light);
}

.faq-question:hover,
.faq-question:active {
  background: var(--panel-light);
}

/* Answer Content */
.faq-answer {
  background: var(--bg-light);
  border-top: 1px solid var(--border-light);
}

.faq-answer > div {
  padding: 18px 20px 22px 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-mid);
  letter-spacing: 0.01em;
}

.faq-answer strong {
  color: var(--text);
  font-weight: 700;
}

.faq-answer em {
  font-style: italic;
  color: var(--text);
}

.faq-answer code {
  background: var(--panel-dark);
  padding: 3px 6px;
  border-radius: 3px;
  color: var(--text);
  font-family: "SF Mono", "Menlo", "Monaco", "Courier New", monospace;
  font-size: 13px;
  border: 1px solid var(--border-light);
}


/* ═══════════════════════════════════════════════════════════
   TELECHAT WIDGET — RETRO PIXEL ART OVERRIDES
   Matches the warm beige palette & pixel-border aesthetic
   ═══════════════════════════════════════════════════════════ */

/* ─── TOGGLE BUTTON (Floating Bubble) — LEFT SIDE ─── */
#telechat-widget-toggle {
  border-radius: 0 !important;
  border: 3px solid var(--border) !important;
  box-shadow:
    inset 2px 2px 0 var(--panel-light),
    inset -2px -2px 0 var(--bg-dark),
    4px 4px 0 var(--shadow) !important;
  background: var(--accent) !important;
  transition: all 0.08s !important;
  image-rendering: pixelated !important;
  width: 52px !important;
  height: 52px !important;
  /* Force left-bottom positioning */
  right: auto !important;
  left: 18px !important;
  bottom: 18px !important;
  position: fixed !important;
  z-index: 9998 !important;
}

#telechat-widget-toggle:hover {
  background: var(--accent-light) !important;
  transform: translateY(-2px) !important;
  box-shadow:
    inset 2px 2px 0 var(--panel-light),
    inset -2px -2px 0 var(--bg-dark),
    5px 5px 0 var(--shadow) !important;
}

#telechat-widget-toggle:active {
  transform: translateY(2px) !important;
  box-shadow:
    inset 2px 2px 0 var(--bg-dark),
    inset -2px -2px 0 var(--panel-light),
    1px 1px 0 var(--shadow) !important;
}

#telechat-widget-toggle svg {
  filter: brightness(1.4) !important;
}

/* ─── MAIN CHAT CONTAINER — LEFT SIDE ─── */
#telechat-widget-container {
  border-radius: 0 !important;
  border: 3px solid var(--border) !important;
  box-shadow:
    inset 3px 3px 0 var(--panel-light),
    inset -3px -3px 0 var(--panel-dark),
    6px 6px 0 var(--shadow) !important;
  background: var(--panel) !important;
  overflow: hidden !important;
  font-family: var(--font) !important;
  image-rendering: pixelated !important;
  /* Force left-bottom positioning */
  right: auto !important;
  left: 18px !important;
  bottom: 80px !important;
  position: fixed !important;
  z-index: 9998 !important;
}

/* ─── CHAT HEADER ─── */
#telechat-widget-container [class*="header"],
#telechat-widget-container > div:first-child {
  background: var(--panel-dark) !important;
  border-bottom: 3px solid var(--border) !important;
  border-radius: 0 !important;
  font-family: var(--font) !important;
  color: var(--text) !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  padding: 14px 16px !important;
}

#telechat-widget-container [class*="header"] *,
#telechat-widget-container > div:first-child * {
  font-family: var(--font) !important;
  color: var(--text) !important;
}

#telechat-widget-container [class*="title"],
#telechat-widget-container [class*="brand"] {
  font-family: var(--font) !important;
  font-size: 11px !important;
  color: var(--text) !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  text-shadow:
    1px 1px 0 var(--panel-light),
    -1px -1px 0 var(--panel-dark) !important;
}

#telechat-widget-container [class*="subtitle"],
#telechat-widget-container [class*="status"] {
  font-family: var(--font) !important;
  font-size: 9px !important;
  color: var(--text-mid) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

/* ─── CLOSE / MINIMIZE BUTTON ─── */
#telechat-widget-container [class*="close"],
#telechat-widget-container [class*="minimize"],
#telechat-widget-container button[aria-label="Close"],
#telechat-widget-container button[aria-label="close"] {
  border-radius: 0 !important;
  border: 2px solid var(--border) !important;
  background: var(--panel-dark) !important;
  color: var(--text) !important;
  font-family: var(--font) !important;
  transition: all 0.08s !important;
}

#telechat-widget-container [class*="close"]:hover,
#telechat-widget-container [class*="minimize"]:hover {
  background: var(--red) !important;
  color: var(--panel-light) !important;
  border-color: #3a2a2a !important;
}

/* ─── MESSAGES AREA ─── */
#telechat-widget-container [class*="messages"],
#telechat-widget-container [class*="chat-body"],
#telechat-widget-container [class*="conversation"] {
  background: var(--bg) !important;
  scrollbar-width: thin !important;
  scrollbar-color: var(--border-mid) var(--panel-dark) !important;
}

/* ─── MESSAGE BUBBLES ─── */
#telechat-widget-container [class*="message"] {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
  border-radius: 0 !important;
}

/* Agent / Bot messages */
#telechat-widget-container [class*="agent"],
#telechat-widget-container [class*="bot"],
#telechat-widget-container [class*="received"],
#telechat-widget-container [class*="incoming"] {
  background: var(--panel-dark) !important;
  color: var(--text) !important;
  border: 2px solid var(--border-light) !important;
  border-radius: 0 !important;
  box-shadow:
    inset 1px 1px 0 var(--panel-light),
    inset -1px -1px 0 var(--bg-dark) !important;
}

/* User messages */
#telechat-widget-container [class*="user"],
#telechat-widget-container [class*="sent"],
#telechat-widget-container [class*="outgoing"] {
  background: var(--accent) !important;
  color: var(--panel-light) !important;
  border: 2px solid #4a3a22 !important;
  border-radius: 0 !important;
  box-shadow:
    inset 1px 1px 0 var(--accent-light),
    inset -1px -1px 0 #4a3a22 !important;
}

/* ─── TIME STAMPS ─── */
#telechat-widget-container [class*="time"],
#telechat-widget-container [class*="timestamp"] {
  font-family: var(--font) !important;
  font-size: 8px !important;
  color: var(--text-light) !important;
  letter-spacing: 0.5px !important;
}

/* ─── INPUT AREA / FOOTER ─── */
#telechat-widget-container [class*="input-area"],
#telechat-widget-container [class*="footer"],
#telechat-widget-container [class*="composer"],
#telechat-widget-container form {
  background: var(--panel-dark) !important;
  border-top: 3px solid var(--border) !important;
  padding: 10px !important;
  border-radius: 0 !important;
}

/* Text input */
#telechat-widget-container input[type="text"],
#telechat-widget-container textarea,
#telechat-widget-container [contenteditable="true"] {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
  font-size: 13px !important;
  background: var(--bg) !important;
  color: var(--text) !important;
  border: 2px solid var(--border-mid) !important;
  border-radius: 0 !important;
  outline: none !important;
  padding: 8px 10px !important;
  transition: all 0.1s !important;
}

#telechat-widget-container input[type="text"]:focus,
#telechat-widget-container textarea:focus,
#telechat-widget-container [contenteditable="true"]:focus {
  border-color: var(--text) !important;
  background: var(--panel) !important;
  box-shadow: inset 1px 1px 0 var(--panel-dark) !important;
}

#telechat-widget-container input::placeholder,
#telechat-widget-container textarea::placeholder {
  color: var(--text-light) !important;
  font-family: var(--font) !important;
  font-size: 9px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

/* ─── SEND BUTTON ─── */
#telechat-widget-container [class*="send"],
#telechat-widget-container button[type="submit"] {
  border-radius: 0 !important;
  border: 2px solid #3a5a2a !important;
  background: var(--green) !important;
  color: var(--panel-light) !important;
  font-family: var(--font) !important;
  cursor: pointer !important;
  transition: all 0.08s !important;
  box-shadow:
    inset 1px 1px 0 var(--green-light),
    inset -1px -1px 0 #3a5a2a !important;
}

#telechat-widget-container [class*="send"]:hover,
#telechat-widget-container button[type="submit"]:hover {
  background: var(--green-light) !important;
  transform: translateY(-1px) !important;
}

#telechat-widget-container [class*="send"]:active,
#telechat-widget-container button[type="submit"]:active {
  transform: translateY(1px) !important;
  box-shadow:
    inset 1px 1px 0 #3a5a2a,
    inset -1px -1px 0 var(--green-light) !important;
}

/* ─── SCROLLBAR INSIDE WIDGET ─── */
#telechat-widget-container ::-webkit-scrollbar {
  width: 8px !important;
}

#telechat-widget-container ::-webkit-scrollbar-track {
  background: var(--panel-dark) !important;
  border: 1px solid var(--border-light) !important;
}

#telechat-widget-container ::-webkit-scrollbar-thumb {
  background: var(--border-mid) !important;
  border: 1px solid var(--border) !important;
  border-radius: 0 !important;
}

#telechat-widget-container ::-webkit-scrollbar-thumb:hover {
  background: var(--border) !important;
}

/* ─── WELCOME / PRE-CHAT SCREEN ─── */
#telechat-widget-container [class*="welcome"],
#telechat-widget-container [class*="pre-chat"],
#telechat-widget-container [class*="intro"] {
  background: var(--bg) !important;
  font-family: var(--font) !important;
  color: var(--text) !important;
}

#telechat-widget-container [class*="welcome"] h1,
#telechat-widget-container [class*="welcome"] h2,
#telechat-widget-container [class*="welcome"] h3 {
  font-family: var(--font) !important;
  font-size: 12px !important;
  color: var(--text) !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  text-shadow:
    1px 1px 0 var(--bg-dark),
    -1px -1px 0 var(--bg-light) !important;
}

/* ─── GENERIC BUTTONS INSIDE WIDGET ─── */
#telechat-widget-container button {
  border-radius: 0 !important;
  font-family: var(--font) !important;
  cursor: pointer !important;
  transition: all 0.08s !important;
}

/* ─── AVATAR ─── */
#telechat-widget-container [class*="avatar"] {
  border-radius: 0 !important;
  border: 2px solid var(--border) !important;
  image-rendering: pixelated !important;
}

/* ─── NOTIFICATION BADGE (unread count) ─── */
#telechat-widget-toggle [class*="badge"],
#telechat-widget-toggle [class*="count"],
#telechat-widget-toggle span {
  border-radius: 0 !important;
  border: 2px solid var(--border) !important;
  background: var(--red) !important;
  color: var(--panel-light) !important;
  font-family: var(--font) !important;
  font-size: 9px !important;
  box-shadow: 2px 2px 0 var(--shadow) !important;
}

/* ─── LINK STYLING ─── */
#telechat-widget-container a {
  color: var(--blue) !important;
  text-decoration: underline !important;
}

#telechat-widget-container a:hover {
  color: var(--blue-light) !important;
}

/* ─── POWERED BY / BRANDING FOOTER ─── */
#telechat-widget-container [class*="powered"],
#telechat-widget-container [class*="branding"] {
  font-family: var(--font) !important;
  font-size: 8px !important;
  color: var(--text-light) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  border-top: 2px solid var(--border-light) !important;
  background: var(--panel) !important;
}

/* ─── EMOJI / ATTACHMENT BUTTONS ─── */
#telechat-widget-container [class*="emoji"],
#telechat-widget-container [class*="attach"],
#telechat-widget-container [class*="file-upload"] {
  border-radius: 0 !important;
  color: var(--text-mid) !important;
  transition: color 0.1s !important;
}

#telechat-widget-container [class*="emoji"]:hover,
#telechat-widget-container [class*="attach"]:hover {
  color: var(--text) !important;
}

/* ─── IFRAME OVERRIDES (if widget uses iframe) ─── */
#telechat-widget-container iframe {
  border-radius: 0 !important;
  border: none !important;
}
