
:root {
  --bg: #f2f6fb;
  --bg-soft: #eef4fa;
  --panel: #ffffff;
  --panel-soft: #f8fbfd;
  --border: #d8e2ec;
  --border-strong: #c6d4e3;
  --text: #122033;
  --muted: #66788d;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eaf1ff;
  --secondary: #0f766e;
  --secondary-dark: #0c5c56;
  --secondary-soft: #e8f7f4;
  --danger: #dc2626;
  --danger-soft: #fdeceb;
  --success: #15803d;
  --success-soft: #e9f8ee;
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, #f9fcff 0%, #eef4fb 38%, #ecf3f9 100%);
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(216, 226, 236, 0.95);
}

.topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

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

.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.22);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.brand-copy h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.brand-copy p {
  margin: 5px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.page-wrap {
  max-width: 1440px;
  margin: 0 auto;
  padding: 22px;
}

.panel {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(216, 226, 236, 0.95);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.upload-panel,
.left-panel,
.center-panel,
.right-panel,
.results-panel {
  padding: 22px;
}

.upload-panel {
  margin-bottom: 18px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}

.left-panel,
.center-panel,
.right-panel {
  height: 100%;
}

.left-panel .panel-head h2 {
  font-size: 18px;
}

.left-panel .panel-head p {
  font-size: 13px;
}

.left-panel .session-summary {
  padding: 10px;
}

.left-panel .summary-card {
  padding: 10px 12px;
}

.left-panel .files-list {
  gap: 8px;
}

.left-panel .file-item {
  padding: 10px 12px;
}

.left-panel .file-name {
  font-size: 13px;
}

.left-panel .file-meta {
  font-size: 12px;
}


.panel-head {
  margin-bottom: 16px;
}

.panel-head-tight {
  margin-bottom: 14px;
}

.panel-head-small {
  margin-bottom: 14px;
}

.panel-head h2 {
  margin: 10px 0 8px;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.panel-head h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.panel-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.dropzone {
  display: block;
  cursor: pointer;
}

.dropzone-inner {
  border: 2px dashed #b9cbe7;
  border-radius: 22px;
  background: linear-gradient(180deg, #fbfdff 0%, #edf4ff 100%);
  text-align: center;
  padding: 34px 18px;
  transition: 0.2s ease;
}

.dropzone.drag-over .dropzone-inner {
  border-color: var(--primary);
  background: linear-gradient(180deg, #e9f2ff 0%, #dce8ff 100%);
  transform: translateY(-1px);
}

.dropzone-icon {
  font-size: 34px;
  margin-bottom: 10px;
}

.dropzone-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
}

.dropzone-subtitle,
.dropzone-meta {
  color: var(--muted);
  font-size: 14px;
}

.dropzone-meta {
  margin: 12px 0 18px;
}

.btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
  color: #fff;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.16);
}

.btn-soft {
  background: #eef3f8;
  color: #1e293b;
}

.btn-danger-outline {
  background: #fff;
  color: var(--danger);
  border: 1px solid #f2c1c1;
}

.btn-danger-outline:hover {
  background: var(--danger-soft);
}

.btn-small {
  padding: 10px 14px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

.message-box,
.session-summary,
#results-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel-soft);
}

.message-box {
  margin-top: 16px;
  padding: 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.action-message {
  margin-top: 14px;
}

.session-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 12px;
  margin-bottom: 14px;
}

.summary-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 10px 12px;
}

.summary-label {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.summary-value {
  font-size: 14px;
  font-weight: 700;
  word-break: break-word;
}

.panel-subhead {
  display: block;
  margin-bottom: 12px;
}

.subhead-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.3;
  white-space: nowrap;
}

.subhead-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.subhead-actions .btn {
  width: 100%;
  justify-content: center;
}

.files-list {
  display: grid;
  gap: 10px;
}

.file-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
  padding: 12px;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.file-item.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.file-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.file-name {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  word-break: break-word;
}

.file-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.file-status {
  align-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 11px;
  font-weight: 700;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-height: 100%;
}

.preview-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #fff;
}

.preview-frame {
  background: #edf3f9;
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-card-body {
  padding: 12px;
}

.preview-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  word-break: break-word;
}

.preview-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.action-stack {
  display: grid;
  gap: 14px;
}

.action-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  padding: 16px;
}

.action-card-head {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.action-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 20px;
}

.action-icon.blue {
  background: var(--primary-soft);
}

.action-icon.green {
  background: var(--secondary-soft);
}

.action-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.action-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field span {
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
}

.field input:focus,
.field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.results-panel {
  margin-top: 2px;
}

#results-box {
  padding: 14px;
  min-height: 140px;
}

.result-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
  padding: 14px;
  margin-bottom: 12px;
}

.result-card:last-child {
  margin-bottom: 0;
}

.result-card-title {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 700;
}

.result-line {
  margin: 6px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.result-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.result-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  text-decoration: none;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
}

.empty-block {
  color: var(--muted);
  font-size: 14px;
  padding: 10px 2px;
}

@media (max-width: 1240px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .left-panel,
  .center-panel,
  .right-panel {
    height: auto;
  }

  .preview-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar-inner,
  .page-wrap {
    padding-left: 14px;
    padding-right: 14px;
  }

  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .panel-subhead {
    flex-direction: column;
    align-items: stretch;
  }

  .subhead-actions,
  .result-links {
    flex-direction: column;
  }

  .subhead-actions .btn,
  .result-link {
    width: 100%;
  }

  .dropzone-title {
    font-size: 20px;
  }
}
