:root {
  color-scheme: light;
  --bg: #f5f5f5;
  --panel: #ffffff;
  --line: #e4e4e4;
  --line-strong: #d6d6d6;
  --text: #141414;
  --muted: #666666;
  --row: #fafafa;
  --focus: #1d4ed8;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Aptos", "Segoe UI Variable Text", "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.app {
  width: min(1440px, calc(100% - 24px));
  margin: 0 auto;
  padding: 16px 0 24px;
}

.tab-bar {
  display: inline-flex;
  gap: 6px;
  margin-bottom: 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.tab-button {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.tab-button.is-active {
  background: #eef4ff;
  color: var(--focus);
  font-weight: 700;
}

.panel {
  display: none;
}

.panel.panel--active {
  display: block;
}

.search-bar,
.inline-form {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 8px 0 12px;
  background: linear-gradient(180deg, var(--bg) 80%, rgba(245, 245, 245, 0));
}

.search-bar input,
.inline-form input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  outline: none;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.search-bar input:focus,
.inline-form input:focus,
.primary-button:focus-visible,
.icon-button:focus-visible {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.primary-button {
  min-width: 112px;
  height: 50px;
  padding: 0 16px;
  border: 1px solid #1845c0;
  border-radius: 12px;
  background: var(--focus);
  color: #ffffff;
  cursor: pointer;
}

.primary-button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.status-text {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

.stack {
  margin-top: 16px;
}

.section-title {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.result-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.result-table--mst {
  min-width: 1160px;
}

.result-table th,
.result-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  line-height: 1.5;
}

.result-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8f8f8;
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
}

.result-table tbody tr:nth-child(even) {
  background: var(--row);
}

.result-table tbody tr:hover {
  background: #f2f6ff;
}

.cell-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cell-type {
  white-space: nowrap;
  color: var(--muted);
}

.cell-empty {
  color: #9a9a9a;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: #4b5563;
  cursor: pointer;
  flex: none;
}

.icon-button:hover {
  background: #eef4ff;
  border-color: #bfd3ff;
  color: var(--focus);
}

.icon-button.is-copied {
  background: #eaf7ef;
  border-color: #9bd2ab;
  color: #12733d;
}

.icon-button.is-error {
  background: #fff1f1;
  border-color: #efb0b0;
  color: #b42318;
}

.icon-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

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

@media (max-width: 640px) {
  .app {
    width: min(100% - 12px, 1440px);
    padding-top: 10px;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .search-bar,
  .inline-form {
    padding-top: 4px;
  }

  .search-bar input,
  .inline-form input,
  .primary-button {
    height: 46px;
    border-radius: 10px;
  }
}
