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

:root {
  --ey-yellow: #ffe600;
  --ey-dark: #2e2e38;
  --ey-black: #1a1a24;
  --ey-gray: #747480;
  --ey-gray-lt: #c4c4cd;
  --ey-white: #ffffff;
  --panel-border: #e0e0e0;
  --panel-bg: #ffffff;
  --page-bg: #f5f5f5;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica", "Arial", sans-serif;
  background-color: var(--page-bg);
  color: var(--ey-dark);
}

body.dark {
  background-color: #15151d;
  color: #e6e6ee;
}

.app-container {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.top-header {
  background-color: #ffffff;
  padding: 16px 24px;
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

body.dark .top-header {
  background-color: #1d1d27;
  border-bottom-color: #333342;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.header-logo {
  background-color: var(--ey-black);
  display: flex;
  height: 2.8571428571rem;
  min-width: 2.8571428571rem;
  width: 2.8571428571rem;
}

.header-logo a {
  display: inline-flex;
  height: 100%;
  padding: 0.3571428571rem 5px;
  text-decoration: none;
  width: 100%;
  align-items: center;
  justify-content: center;
}

.app-title {
  font-size: 18px;
  font-weight: 500;
  white-space: nowrap;
}

.header-nav-tabs {
  display: flex;
  gap: 0;
  align-self: flex-end;
  margin-bottom: -1px;
  width: 100%;
  margin-top: 10px;
}

.header-nav-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 30px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.015em;
  text-decoration: none;
  color: var(--ey-gray);
  border: 1px solid #d0d0d6;
  border-bottom: 1px solid var(--panel-border);
  border-radius: 6px 6px 0 0;
  background: #e8e8ee;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  min-width: 170px;
}

.header-nav-tab + .header-nav-tab {
  margin-left: -1px;
}

.header-nav-tab:hover {
  color: var(--ey-dark);
  background: #f0f0f4;
}

.header-nav-tab.active {
  color: var(--ey-dark);
  background: #ffffff;
  border-bottom: 1px solid #ffffff;
  font-weight: 600;
  z-index: 1;
}

body.dark .header-nav-tab {
  color: #999;
  background: #2e2e3a;
  border-color: #444;
  border-bottom-color: #333;
}

body.dark .header-nav-tab.active {
  color: var(--ey-yellow);
  background: #23232f;
  border-bottom-color: #23232f;
}

.header-actions,
.toggle-switch {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle-label {
  font-size: 14px;
  color: var(--ey-gray);
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #e0e0e0;
  transition: 0.3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--ey-dark);
}

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

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
}

.settings-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px 24px;
  width: 100%;
}

.personal-info {
  background-color: var(--panel-bg);
  padding: 32px;
  border-radius: 12px;
  margin-bottom: 24px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

body.dark .personal-info {
  background-color: #1d1d27;
  border-color: #31313f;
}

.hero-panel {
  position: relative;
  overflow: hidden;
}

.hero-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--ey-yellow), #7fb5ff, #7bd6a5);
}

.panel-badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 230, 0, 0.18);
  color: #7d6900;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 16px;
}

body.dark .panel-badge {
  background: rgba(255, 230, 0, 0.14);
  color: #ffef8a;
}

.section-title {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--ey-dark);
}

body.dark .section-title {
  color: #f5f5fb;
}

.section-description {
  font-size: 15px;
  color: var(--ey-gray);
  line-height: 1.7;
  margin-bottom: 24px;
  max-width: 900px;
}

body.dark .section-description,
body.dark .inline-status,
body.dark .toggle-label {
  color: #a7a7b7;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.status-card {
  border-radius: 12px;
  padding: 18px;
  border: 1px solid #e4e4ea;
  background: #fafafc;
}

body.dark .status-card {
  background: #232331;
  border-color: #373748;
}

.accent-yellow { border-top: 4px solid var(--ey-yellow); }
.accent-blue { border-top: 4px solid #60a5fa; }
.accent-green { border-top: 4px solid #34d399; }

.status-label {
  font-size: 12px;
  color: var(--ey-gray);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.status-value {
  font-size: 18px;
  font-weight: 600;
  color: var(--ey-dark);
}

body.dark .status-value {
  color: #f1f1f7;
}

.mono {
  font-family: Consolas, "Courier New", monospace;
}

.compact {
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}

.toolbar-row,
.section-header-row,
.dev-test-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.toolbar-row {
  margin-bottom: 14px;
}

.section-header-row {
  justify-content: space-between;
  margin-bottom: 12px;
}

.inline-status {
  font-size: 14px;
  color: var(--ey-gray);
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.08);
}

.btn-primary {
  background: var(--ey-dark);
  color: #fff;
}

.btn-secondary {
  background: #f0f0f5;
  color: var(--ey-dark);
  border: 1px solid #dfdfe6;
}

.btn-attention {
  background: #ffe600;
  color: #1f1f24;
  border: 1px solid #ffd400;
  box-shadow: 0 0 0 3px rgba(255, 230, 0, 0.28);
}

body.dark .btn-primary {
  background: var(--ey-yellow);
  color: #1c1c24;
}

body.dark .btn-secondary {
  background: #2b2b37;
  color: #f0f0f6;
  border-color: #454556;
}

body.dark .btn-attention {
  background: var(--ey-yellow);
  color: #1c1c24;
  border-color: #ffd400;
  box-shadow: 0 0 0 3px rgba(255, 230, 0, 0.34);
}

.compact-btn {
  padding: 8px 14px;
  font-size: 13px;
}

.download-action-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid #dfdfe6;
  border-radius: 12px;
  background: #fafafc;
}

.download-action-copy {
  min-width: 0;
}

body.dark .download-action-panel {
  background: #23232f;
  border-color: #454556;
}

.content-grid.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.pdf-upload-zone {
  border: 2px dashed #d6d6df;
  border-radius: 12px;
  padding: 28px 24px;
  text-align: center;
  background: #fafafc;
  transition: border-color 0.2s ease, background 0.2s ease;
  margin-bottom: 18px;
}

.pdf-upload-zone:hover {
  border-color: #b8b8c7;
  background: #f7f7fb;
}

body.dark .pdf-upload-zone {
  background: #232331;
  border-color: #3b3b4b;
}

body.dark .pdf-upload-zone:hover {
  border-color: #56566b;
  background: #272737;
}

.local-upload-zone {
  border-style: solid;
}

.pdf-upload-icon {
  color: var(--ey-gray);
  margin-bottom: 12px;
}

.pdf-upload-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--ey-dark);
  margin-bottom: 6px;
}

.pdf-upload-hint {
  font-size: 13px;
  color: var(--ey-gray);
}

body.dark .pdf-upload-text {
  color: #f1f1f7;
}

body.dark .pdf-upload-hint,
body.dark .pdf-upload-icon {
  color: #adb0c4;
}

.upload-file-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.upload-prompt-card {
  border: 1px solid #e2e2ea;
  border-radius: 10px;
  padding: 16px;
  background: #f8f8fc;
}

body.dark .upload-prompt-card {
  background: #232331;
  border-color: #3a3a49;
}

.upload-prompt-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.upload-prompt-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ey-dark);
}

body.dark .upload-prompt-title {
  color: #f1f1f7;
}

.upload-prompt-subtitle {
  font-size: 12px;
  color: var(--ey-gray);
  margin-top: 4px;
}

body.dark .upload-prompt-subtitle {
  color: #a7a7b7;
}

.upload-prompt-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

.upload-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid #d9d9e2;
  background: #ffffff;
  color: var(--ey-dark);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

body.dark .upload-control {
  background: #2b2b37;
  color: #f0f0f6;
  border-color: #454556;
}

.upload-control input {
  display: none;
}

.selected-upload-name {
  font-size: 12px;
  color: var(--ey-gray);
}

body.dark .selected-upload-name {
  color: #b3b3c3;
}

.parameter-section {
  margin-top: 22px;
}

.subsection-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--ey-dark);
  margin-bottom: 8px;
}

body.dark .subsection-title {
  color: #f5f5fb;
}

.subsection-description {
  font-size: 13px;
  color: var(--ey-gray);
  margin-bottom: 14px;
}

body.dark .subsection-description {
  color: #a7a7b7;
}

.parameter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.parameter-card {
  border: 1px solid #e2e2ea;
  border-radius: 10px;
  padding: 14px;
  background: #f8f8fc;
}

body.dark .parameter-card {
  background: #232331;
  border-color: #3a3a49;
}

.parameter-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ey-dark);
  margin-bottom: 8px;
}

body.dark .parameter-label {
  color: #f1f1f7;
}

.parameter-input,
.parameter-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d8d8e0;
  border-radius: 8px;
  font-size: 14px;
  background: #ffffff;
  color: var(--ey-dark);
}

body.dark .parameter-input,
body.dark .parameter-select {
  background: #2b2b37;
  color: #f0f0f6;
  border-color: #454556;
}

.parameter-help {
  margin-top: 8px;
  font-size: 12px;
  color: var(--ey-gray);
}

body.dark .parameter-help {
  color: #a7a7b7;
}

.file-section {
  margin-top: 22px;
}

.upload-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #e2e2ea;
  border-radius: 10px;
  background: #f8f8fc;
}

body.dark .upload-file-item {
  background: #232331;
  border-color: #3a3a49;
}

.hidden-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.file-name {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--ey-dark);
  margin-bottom: 4px;
  word-break: break-word;
}

.file-size {
  font-size: 12px;
  color: var(--ey-gray);
}

.file-status-tag {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.file-status-tag.ok {
  background: #dcfce7;
  color: #166534;
}

.file-status-tag.missing {
  background: #fee2e2;
  color: #991b1b;
}

body.dark .file-name {
  color: #f1f1f7;
}

body.dark .file-size {
  color: #a7a7b7;
}

body.dark .file-status-tag.ok {
  background: #14532d;
  color: #9be7b4;
}

body.dark .file-status-tag.missing {
  background: #4c1d1d;
  color: #ffb0b0;
}

.runner-actions-row {
  margin-top: 18px;
}

.processing-panel {
  text-align: center;
  padding-top: 60px;
  padding-bottom: 60px;
}

.processing-title {
  margin-top: 20px;
}

.processing-copy {
  margin-bottom: 0;
}

.pdf-spinner {
  width: 52px;
  height: 52px;
  border: 4px solid rgba(46, 46, 56, 0.12);
  border-top-color: var(--ey-dark);
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 1s linear infinite;
}

body.dark .pdf-spinner {
  border-color: rgba(255, 255, 255, 0.12);
  border-top-color: var(--ey-yellow);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.results-actions-row {
  display: flex;
  justify-content: center;
  margin-top: -4px;
  margin-bottom: 24px;
}

.preview-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.preview-card {
  background: #f8f8fc;
  border: 2px solid #e0e0e8;
  border-radius: 10px;
  padding: 18px;
}

body.dark .preview-card {
  background: #232331;
  border-color: #3a3a49;
}

.preview-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.preview-card-title {
  font-size: 16px;
  font-weight: 600;
}

.preview-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.preview-badge.ok {
  background: #dcfce7;
  color: #166534;
}

.preview-badge.missing {
  background: #fee2e2;
  color: #991b1b;
}

body.dark .preview-badge.ok {
  background: #14532d;
  color: #9be7b4;
}

body.dark .preview-badge.missing {
  background: #4c1d1d;
  color: #ffb0b0;
}

.preview-path {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ey-gray);
  word-break: break-word;
}

body.dark .preview-path {
  color: #b2b2c2;
}

.pdf-diag-panel {
  margin-top: 4px;
}

.embed-log {
  margin-top: 8px;
  max-height: 620px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 10px;
  background: #f7f7fb;
  border: 1px solid #e3e3ea;
  padding: 16px;
  font-family: Consolas, "Courier New", monospace;
  color: #1f2937;
}

body.dark .embed-log {
  background: #171721;
  border-color: #333346;
  color: #d9e1ee;
}

footer {
  margin-top: auto;
  padding: 20px 24px 28px;
}

.ey-footer-logo {
  width: 48px;
  height: auto;
}

.ey-footer-text,
.body-3-light,
.text-link {
  color: var(--ey-gray);
  font-size: 12px;
  text-decoration: none;
}

body.dark .ey-footer-text,
body.dark .body-3-light,
body.dark .text-link {
  color: #a6a6b6;
}

.mt-5 {
  margin-top: 5px;
}

@media (max-width: 960px) {
  .content-grid.two-col,
  .status-grid,
  .parameter-grid {
    grid-template-columns: 1fr;
  }

  .top-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .settings-container {
    padding: 16px;
  }

  .personal-info {
    padding: 22px;
  }
}