.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--panel-shadow);
  padding: 28px;
}

h1,
h2,
h3 {
  margin: 0 0 12px;
  font-family: "Satoshi", "Noto Sans SC", sans-serif;
  letter-spacing: -0.05em;
}

h1 {
  font-size: clamp(34px, 4.2vw, 58px);
  line-height: 0.96;
}

h2 {
  font-size: clamp(24px, 2.2vw, 36px);
  line-height: 1.02;
}

h3 {
  font-size: 22px;
  line-height: 1.08;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.74);
}

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

form {
  display: grid;
  gap: 8px;
}

label {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.01em;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  font-size: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(27, 29, 36, 0.16);
  box-shadow: 0 0 0 4px rgba(141, 120, 247, 0.1);
}

textarea {
  min-height: 120px;
  resize: vertical;
  font-family: inherit;
}

button,
.btn {
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: var(--action-fill);
  color: var(--action-text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 14px 30px rgba(24, 28, 38, 0.16);
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease,
    background-color 0.22s ease,
    color 0.22s ease;
}

button:hover,
.btn:hover {
  transform: translateY(-2px);
  background: var(--action-fill-hover);
  box-shadow: 0 18px 36px rgba(24, 28, 38, 0.2);
}

body.workspace-mode button,
body.workspace-mode .btn {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  box-shadow: 0 10px 24px rgba(24, 28, 38, 0.08);
}

body.workspace-mode .btn.ghost {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(27, 29, 36, 0.06);
  box-shadow: 0 8px 20px rgba(24, 28, 38, 0.06);
}

body.workspace-mode button:hover,
body.workspace-mode .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(24, 28, 38, 0.14);
}

body.workspace-mode button:active,
body.workspace-mode .btn:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(24, 28, 38, 0.1);
}

.btn.secondary,
button.secondary {
  background: var(--action-fill);
  color: var(--action-text);
  border-color: transparent;
}

.btn.ghost {
  background: rgba(27, 29, 36, 0.08);
  color: var(--brand);
  border-color: rgba(27, 29, 36, 0.12);
  box-shadow: none;
}

.btn.ghost:hover {
  background: rgba(27, 29, 36, 0.14);
  color: var(--brand);
  box-shadow: none;
}

.nav .btn,
.nav button {
  min-height: var(--nav-pill-height);
  padding: 0 var(--nav-pill-padding-x);
  border-radius: 999px;
  font-size: var(--nav-pill-font-size);
  line-height: 1;
}

body.workspace-mode .nav .btn,
body.workspace-mode .nav button {
  min-height: var(--nav-pill-height);
  padding: 0 var(--nav-pill-padding-x);
  font-size: var(--nav-pill-font-size);
}

.btn.linkish {
  background: rgba(27, 29, 36, 0.06);
  border: 1px solid rgba(27, 29, 36, 0.08);
  color: var(--brand);
  box-shadow: none;
}

.btn.linkish:hover {
  background: rgba(27, 29, 36, 0.12);
  color: var(--brand);
  box-shadow: none;
}

.flash-list {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.flash {
  border-radius: 18px;
  padding: 14px 16px;
  font-size: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 12px 26px rgba(24, 28, 38, 0.04);
}

.flash.success {
  background: rgba(43, 122, 61, 0.08);
  color: var(--ok);
}

.flash.error {
  background: rgba(166, 56, 43, 0.08);
  color: var(--err);
}

.support-card,
.info-card {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 12px 34px rgba(24, 28, 38, 0.05);
}

.support-card h3,
.info-card h3 {
  margin-bottom: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
  border-radius: 0;
  overflow: visible;
}

th,
td {
  padding: 14px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  background: rgba(255, 255, 255, 0.7);
  color: rgba(23, 25, 32, 0.62);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reader-block {
  margin: 0 0 18px;
  content-visibility: auto;
  contain-intrinsic-size: 320px;
}

.reader-block:last-child {
  margin-bottom: 0;
}

.reader-block.anchor-focus {
  scroll-margin-top: 112px;
  content-visibility: visible;
}

.report-heading {
  margin: 0 0 14px;
  font-family: "Satoshi", "Noto Sans SC", sans-serif;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.report-heading.level-1 {
  font-size: clamp(30px, 3.4vw, 42px);
  line-height: 1;
}

.report-heading.level-2 {
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.08;
}

.report-heading.level-3,
.report-heading.level-4,
.report-heading.level-5,
.report-heading.level-6 {
  font-size: 18px;
  line-height: 1.2;
}

.report-paragraph {
  margin: 0;
  color: rgba(23, 25, 32, 0.88);
  font-size: 15px;
  line-height: 1.9;
  word-break: break-word;
}

.report-formula {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 20px;
  border-radius: 20px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  background: rgba(255, 255, 255, 0.82);
}

.report-formula.inline {
  display: inline-flex;
  justify-content: flex-start;
  padding: 10px 12px;
}

.report-formula.display {
  margin: 6px 0 2px;
}

.report-formula-math {
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

.report-formula-math mjx-container[jax="CHTML"][display="true"] {
  margin: 0 !important;
  max-width: 100%;
  overflow: visible !important;
}

.report-formula-math mjx-container[jax="CHTML"][display="true"] > mjx-math {
  max-width: 100%;
}

.report-formula-math mjx-assistive-mml {
  display: none !important;
}

.report-formula-math mjx-container[jax="CHTML"] {
  overflow: visible !important;
  scrollbar-width: none;
}

.report-formula-math mjx-container[jax="CHTML"]::-webkit-scrollbar {
  display: none;
}

.report-image {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.report-image-frame {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 16px;
  border-radius: 24px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(246, 249, 252, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  overflow: hidden;
}

.report-image-asset {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(72vh, 720px);
  object-fit: contain;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.caption {
  justify-self: stretch;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
}

.report-table {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 24px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
  overflow-x: auto;
}

.report-table h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.report-table table {
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid rgba(17, 24, 39, 0.09);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.96);
}

.report-table td {
  padding: 12px 14px;
  border-right: 1px solid rgba(17, 24, 39, 0.08);
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
  font-size: 14px;
  line-height: 1.6;
}

.report-table tr:first-child td,
.report-table thead th {
  background: rgba(15, 23, 42, 0.06);
  color: rgba(23, 25, 32, 0.82);
  font-weight: 700;
}

.report-table tbody tr:nth-child(even) td {
  background: rgba(247, 249, 252, 0.84);
}

.report-table tr td:last-child {
  border-right: 0;
}

.report-table tr:last-child td {
  border-bottom: 0;
}

.muted {
  color: var(--muted);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.stat {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 12px 32px rgba(24, 28, 38, 0.05);
}

.stat strong {
  display: block;
  font-family: "Satoshi", "Noto Sans SC", sans-serif;
  font-size: 30px;
  margin-bottom: 4px;
  letter-spacing: -0.05em;
}

.kv {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px 14px;
  margin: 16px 0 0;
}

.kv dt {
  color: var(--muted);
  font-weight: 600;
}

.kv dd {
  margin: 0;
  word-break: break-all;
}

.soft-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.soft-list li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
}

.soft-list li::before {
  content: "";
  position: absolute;
  top: 11px;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8d78f7, #ffbb72);
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.72);
  color: var(--brand);
  border: 1px solid rgba(20, 24, 34, 0.06);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  white-space: nowrap;
}

.status-badge.queued,
.status-badge.handoff_building,
.status-badge.running,
.status-badge.handoff_ready,
.status-badge.succeeded,
.status-badge.completed,
.status-badge.failed,
.status-badge.cancelled {
  border: 0;
}

.status-badge.queued::before,
.status-badge.handoff_building::before,
.status-badge.running::before,
.status-badge.handoff_ready::before,
.status-badge.succeeded::before,
.status-badge.completed::before,
.status-badge.failed::before,
.status-badge.cancelled::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  background: currentColor;
  transform-origin: center;
  -webkit-mask: var(--status-icon) center / contain no-repeat;
  mask: var(--status-icon) center / contain no-repeat;
}

.status-badge.queued {
  color: var(--status-queue-text);
  background: var(--status-queue-bg);
  --status-icon: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%3E%3Ccircle%20cx='8'%20cy='8'%20r='5.5'%20stroke='black'%20stroke-width='1.8'/%3E%3Cpath%20d='M8%205.2V8L9.9%209.3'%20stroke='black'%20stroke-width='1.8'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3C/svg%3E");
}

.status-badge.handoff_building,
.status-badge.running {
  color: var(--status-building-text);
  background: var(--status-building-bg);
  --status-icon: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%3E%3Cpath%20d='M8%202.3A5.7%205.7%200%201%200%2013.7%208'%20stroke='black'%20stroke-width='1.8'%20stroke-linecap='round'/%3E%3Cpath%20d='M13.7%204.5V8H10.2'%20stroke='black'%20stroke-width='1.8'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3C/svg%3E");
}

.status-badge.handoff_ready,
.status-badge.succeeded,
.status-badge.completed {
  color: var(--status-done-text);
  background: var(--status-done-bg);
  --status-icon: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%3E%3Ccircle%20cx='8'%20cy='8'%20r='5.5'%20stroke='black'%20stroke-width='1.8'/%3E%3Cpath%20d='M5.1%208.1L7.1%2010.1L10.9%206.3'%20stroke='black'%20stroke-width='1.8'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3C/svg%3E");
}

.status-badge.failed,
.status-badge.cancelled {
  color: var(--status-fail-text);
  background: var(--status-fail-bg);
  --status-icon: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%3E%3Ccircle%20cx='8'%20cy='8'%20r='5.5'%20stroke='black'%20stroke-width='1.8'/%3E%3Cpath%20d='M5.8%205.8L10.2%2010.2M10.2%205.8L5.8%2010.2'%20stroke='black'%20stroke-width='1.8'%20stroke-linecap='round'/%3E%3C/svg%3E");
}

.status-badge.handoff_building::before,
.status-badge.running::before {
  animation: status-badge-spin 1.5s linear infinite;
}

@keyframes status-badge-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.empty {
  padding: 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 22px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.54);
}

.empty-state {
  padding: 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 22px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.54);
}
