* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.is-hidden {
  display: none !important;
}

header,
footer {
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.site-nav {
  display: inline-flex;
  gap: 0.9rem;
  align-items: center;
  flex-wrap: wrap;
}

.site-nav a {
  color: rgba(226, 232, 240, 0.75);
  text-decoration: none;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.site-nav a:hover {
  color: #ffffff;
  background: rgba(148, 163, 184, 0.28);
  transform: translateY(-1px);
}

.site-nav a[aria-current='page'] {
  color: #0f172a;
  background: linear-gradient(135deg, #22d3ee, #6366f1);
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.28);
}

footer {
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  border-bottom: none;
  margin-top: auto;
  text-align: center;
  font-size: 0.9rem;
}

header h1 {
  margin: 0 0 0.5rem;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem;
}

.controls {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.drop-zone {
  flex: 1 1 280px;
  border: 2px dashed rgba(94, 234, 212, 0.6);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  background: rgba(15, 23, 42, 0.6);
  transition: border-color 0.3s ease, background 0.3s ease;
}

.drop-zone.dragover {
  border-color: #22d3ee;
  background: rgba(34, 211, 238, 0.1);
}

.drop-zone p {
  margin: 0 0 0.75rem;
}

.file-input input[type="file"] {
  display: none;
}

.file-input span {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  background: linear-gradient(135deg, #22d3ee, #38bdf8);
  color: #0f172a;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.file-input span:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(56, 189, 248, 0.4);
}

.default-selector {
  flex: 0 0 240px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 12px;
  padding: 1.2rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.default-selector select,
.default-selector button {
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: none;
  font-size: 1rem;
}

.default-selector select {
  background: rgba(15, 23, 42, 0.9);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.default-selector button {
  background: linear-gradient(135deg, #22d3ee, #6366f1);
  color: #0f172a;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.default-selector button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.viewer {
  display: flex;
  gap: 1.5rem;
  flex: 1;
  min-height: 480px;
}

#canvas-container {
  flex: 3;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  position: relative;
  min-height: 480px;
  overflow: hidden;
}

#blendshape-controls {
  flex: 1;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.tab-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tab-controls .tab-button {
  appearance: none;
  border: none;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  color: #e2e8f0;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.tab-controls .tab-button:hover {
  background: rgba(148, 163, 184, 0.32);
  transform: translateY(-1px);
}

.tab-controls .tab-button[aria-selected='true'] {
  background: linear-gradient(135deg, #22d3ee, #6366f1);
  color: #0f172a;
  box-shadow: 0 12px 28px rgba(56, 189, 248, 0.28);
}

#blendshape-controls h2 {
  margin-top: 0;
}

.control-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.control-panel + .control-panel {
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  padding-top: 1.25rem;
}

#viseme-panel {
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  padding-top: 1.25rem;
}

.panel-description {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.65);
  line-height: 1.4;
}

.sliders {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.slider-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.slider-row.warning {
  border-left: 3px solid rgba(250, 204, 21, 0.7);
  padding-left: 0.75rem;
}

.slider-row label {
  font-weight: 600;
  font-size: 0.95rem;
}

.slider-row input[type="range"] {
  width: 100%;
}

.slider-row input[type="range"]:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.placeholder {
  color: rgba(226, 232, 240, 0.6);
  margin: 0;
}

@media (max-width: 960px) {
  .viewer {
    flex-direction: column;
  }

  #blendshape-controls {
    max-height: 320px;
  }
}

.status {
  flex: 1 1 100%;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  min-height: 64px;
  display: flex;
  align-items: center;
  font-weight: 500;
  color: rgba(226, 232, 240, 0.85);
}
.status.error {
  border-color: rgba(248, 113, 113, 0.6);
  color: #fecaca;
}

.status.success {
  border-color: rgba(52, 211, 153, 0.6);
  color: #bbf7d0;
}
.status.warning {
  border-color: rgba(250, 204, 21, 0.7);
  color: #fef3c7;
}
.slider-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.slider-label .value {
  font-weight: 500;
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.75);
}
.slider-warning {
  margin: 0;
  font-size: 0.8rem;
  color: #fef08a;
  line-height: 1.3;
}
