:root {
  --bg: #f3efe6;
  --panel: rgba(255, 252, 245, 0.88);
  --panel-strong: #fffaf0;
  --line: rgba(82, 57, 33, 0.12);
  --text: #2d241c;
  --muted: #786554;
  --brand: #0e7c66;
  --brand-deep: #084c3f;
  --accent: #f2b84b;
  --danger: #bf4a38;
  --shadow: 0 18px 50px rgba(70, 45, 20, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Malgun Gothic", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(242, 184, 75, 0.3), transparent 28%),
    radial-gradient(circle at bottom right, rgba(14, 124, 102, 0.18), transparent 24%),
    linear-gradient(135deg, #f4ead7 0%, #f8f4eb 45%, #efe5d3 100%);
}

button,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--line);
  padding: 28px 20px;
  background: rgba(255, 249, 239, 0.78);
  backdrop-filter: blur(14px);
}

.sidebar-header h1,
.hero-card h2,
.panel h3,
.panel h4 {
  margin: 0;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
}

.sidebar-copy,
.hero-description {
  color: var(--muted);
  line-height: 1.55;
}

.sidebar-select {
  margin: 22px 0 18px;
}

.sidebar-select label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.sidebar-select select,
.form-grid input,
.param-row input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.8);
}

.sidebar-hint-card {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
}

.hint-label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hint-points {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.hint-subcopy {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.sidebar-key-field {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.sidebar-key-field span {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.sidebar-key-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.88);
}

#serviceKeyInput[readonly] {
  background: rgba(45, 36, 28, 0.05);
  color: var(--muted);
  cursor: not-allowed;
}

#arrangeInput:disabled {
  background: rgba(45, 36, 28, 0.05);
  color: var(--muted);
  cursor: not-allowed;
}

.hint-points span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  background: rgba(14, 124, 102, 0.08);
  color: var(--brand-deep);
  font-size: 13px;
  font-weight: 600;
}

.content {
  padding: 28px;
}

.hero-card,
.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 26px;
  margin-bottom: 20px;
}

.hero-meta {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.tag,
.status-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
}

.tag {
  background: rgba(14, 124, 102, 0.12);
  color: var(--brand-deep);
}

.tag.muted {
  background: rgba(45, 36, 28, 0.08);
  color: var(--muted);
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.2fr) minmax(280px, 0.8fr);
  gap: 20px;
  margin-bottom: 20px;
}

.panel {
  padding: 22px;
}

.panel-header,
.panel-subtitle,
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-subtitle {
  margin: 18px 0 10px;
}

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

.form-grid label,
.param-row {
  display: grid;
  gap: 8px;
}

.form-grid span,
.info-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.extra-params {
  display: grid;
  gap: 10px;
}

.param-row {
  grid-template-columns: 1fr 1fr auto;
  align-items: center;
}

.primary-button,
.ghost-button,
.danger-button,
.tab-button {
  border: none;
  border-radius: 14px;
  padding: 11px 14px;
  cursor: pointer;
  transition: 0.18s ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--brand) 0%, #15977d 100%);
  color: white;
}

.ghost-button,
.tab-button {
  background: rgba(45, 36, 28, 0.06);
  color: var(--text);
}

.danger-button {
  background: rgba(191, 74, 56, 0.12);
  color: var(--danger);
}

.primary-button:hover,
.ghost-button:hover,
.danger-button:hover,
.tab-button:hover,
.tab-button.active {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(45, 36, 28, 0.1);
}

.tab-button.active {
  background: rgba(14, 124, 102, 0.12);
  color: var(--brand-deep);
}

.actions {
  margin-top: 18px;
  justify-content: flex-start;
}

.info-block + .info-block {
  margin-top: 18px;
}

.code-block {
  margin: 8px 0 0;
  padding: 16px;
  border-radius: 18px;
  background: #201914;
  color: #f8f1e7;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 120px;
}

.response-viewer {
  min-height: 380px;
}

.result-panel {
  min-height: 480px;
}

.result-table-wrap {
  margin-top: 18px;
}

.result-table-header {
  margin-bottom: 10px;
}

.table-status {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.result-table-container {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.result-table-empty {
  margin: 0;
  padding: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.result-table-scroll {
  overflow: auto;
}

.result-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
}

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

.result-table th:last-child,
.result-table td:last-child {
  border-right: none;
}

.result-table th {
  position: sticky;
  top: 0;
  background: #f6efe3;
  color: var(--brand-deep);
  font-size: 13px;
}

.result-table td {
  max-width: 260px;
  white-space: normal;
  word-break: break-word;
  background: rgba(255, 255, 255, 0.9);
}

.summary-view {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.summary-card {
  padding: 18px;
  border-radius: 20px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.summary-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.summary-card strong {
  font-size: 18px;
}

.status-chip.idle {
  background: rgba(45, 36, 28, 0.08);
  color: var(--muted);
}

.status-chip.loading {
  background: rgba(242, 184, 75, 0.2);
  color: #7b5600;
}

.status-chip.success {
  background: rgba(14, 124, 102, 0.14);
  color: var(--brand-deep);
}

.status-chip.warning {
  background: rgba(242, 184, 75, 0.2);
  color: #8a5c00;
}

.status-chip.error {
  background: rgba(191, 74, 56, 0.14);
  color: #8f2e20;
}

.hidden {
  display: none;
}

@media (max-width: 1080px) {
  .app-shell,
  .panel-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  .content,
  .sidebar {
    padding: 18px;
  }

  .hero-card,
  .panel {
    border-radius: 22px;
  }

  .hero-card,
  .panel-header,
  .panel-subtitle,
  .actions,
  .param-row,
  .form-grid,
  .summary-view {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .panel-header,
  .panel-subtitle {
    align-items: flex-start;
  }

  .summary-view {
    display: grid;
  }
}
