* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: "Sarabun", sans-serif;
  color: #1f2937;
  background: #fff;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 9997;
  height: 88px;
  background:
    linear-gradient(135deg, rgba(5, 42, 91, 0.96), rgba(4, 114, 217, 0.95)),
    repeating-linear-gradient(45deg, transparent 0 80px, rgba(255, 255, 255, 0.05) 80px 160px);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-box {
  width: 42px;
  height: 42px;
  border: 2px solid #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.brand h1 {
  font-size: 22px;
  margin: 0;
}
.brand small {
  display: block;
  font-size: 13px;
  opacity: 0.85;
  margin-top: 2px;
}
.search {
  width: 270px;
  padding: 10px 14px;
  border: 0;
  border-radius: 8px;
}
.layout {
  display: grid;
  grid-template-columns: 290px 1fr 450px;
  min-height: calc(100vh - 88px);
}
.sidebar {
  border-right: 1px solid #e5e7eb;
  padding: 18px;
  background: #fbfdff;
}
.jump {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  color: #64748b;
  background: #fff;
  margin-bottom: 22px;
}
.group-title {
  margin: 20px 0 8px;
  font-size: 12px;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 700;
}
.menu-item {
  width: 100%;
  border: 0;
  background: transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 9px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #334155;
  text-align: left;
}
.menu-item:hover,
.menu-item.active {
  background: #e8f2ff;
  color: #055fc2;
  font-weight: 700;
}
.method {
  color: #fff;
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 20px;
  font-weight: 800;
}
.GET {
  background: #079669;
}
.POST {
  background: #0875e1;
}
.PUT {
  background: #d97706;
}
.DELETE {
  background: #dc2626;
}

.content {
  padding: 34px;
  border-right: 1px solid #e5e7eb;
}
.endpoint-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}
h2 {
  font-size: 28px;
  margin: 0 0 12px;
}
.endpoint-url {
  font-family: Consolas, monospace;
  color: #334155;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.desc {
  color: #475569;
  margin-bottom: 28px;
  line-height: 1.7;
}
.copy-btn {
  border: 1px solid #dbe3ef;
  background: #fff;
  border-radius: 8px;
  padding: 9px 12px;
  cursor: pointer;
}
.card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 24px;
  background: #fff;
}
.card-title {
  padding: 13px 16px;
  font-weight: 700;
  background: #fbfdff;
  border-bottom: 1px solid #e5e7eb;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  padding: 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  font-size: 13px;
  vertical-align: top;
}
th {
  background: #fafafa;
  color: #64748b;
  font-size: 12px;
}
.param-name {
  font-weight: 800;
  color: #111827;
}
.type {
  color: #64748b;
  font-size: 12px;
  margin-left: 5px;
}
.required {
  color: #ef4444;
  font-size: 12px;
  margin-left: 5px;
}
input,
select,
textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-size: 13px;
}
.actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
button {
  font-family: inherit;
}
.btn {
  border: 0;
  border-radius: 8px;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 800;
}
.btn-primary {
  background: #0875e1;
  color: #fff;
}
.btn-light {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #dbe3ef;
}

.right {
  padding: 28px;
  background: #fff;
}
.section-label {
  font-size: 12px;
  font-weight: 800;
  color: #334155;
  margin-bottom: 10px;
}
.lang-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 22px;
}
.lang-btn {
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 8px;
  padding: 10px 6px;
  cursor: pointer;
  font-size: 12px;
}
.lang-btn.active {
  border-color: #0875e1;
  color: #0875e1;
  box-shadow: 0 0 0 2px #e8f2ff;
  font-weight: 800;
}
.auth-grid {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 8px;
  margin-bottom: 18px;
}
.codebox {
  background: #1f2933;
  color: #dbeafe;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 18px;
  font-family: Consolas, monospace;
  font-size: 13px;
}
.code-head {
  background: #111827;
  color: #fff;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  font-family: Arial, sans-serif;
  font-weight: 800;
}
pre {
  margin: 0;
  padding: 16px;
  white-space: pre-wrap;
  line-height: 1.55;
  max-height: 380px;
  overflow: auto;
}
.response {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}
.status-ok {
  color: #079669;
  font-weight: 800;
}
.status-error {
  color: #dc2626;
  font-weight: 800;
}
.footer-note {
  color: #94a3b8;
  font-size: 12px;
  margin-top: 30px;
  text-align: center;
}

.actions.fixed {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
  background: #fff;
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,.15);
}

/* ตัวหลอกความสูง */
.actions-placeholder {
  height: 0;
}

table th:nth-child(1),
table td:nth-child(1){
  width: 30%;
}

table th:nth-child(2),
table td:nth-child(2){
  width: 120px;
  white-space: nowrap;
}

table th:nth-child(3),
table td:nth-child(3){
  width: auto;
}
@media (max-width: 1250px) {
  .layout {
    grid-template-columns: 260px 1fr;
  }
  .right {
    grid-column: 1 / -1;
    border-top: 1px solid #e5e7eb;
  }
}
@media (max-width: 780px) {
  .topbar {
    height: auto;
    flex-direction: column;
    align-items: flex-start;
    padding: 18px;
  }
  .search {
    width: 100%;
  }
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .content {
    padding: 22px;
  }
  .endpoint-head {
    display: block;
  }
}
.mobile-menu-btn {
  display: none;
}

.mobile-overlay {
  display: none;
}

@media (max-width: 780px) {
  .topbar {
    position: sticky;
    top: 0;
    z-index: 9997;
    height: auto;
    padding: 16px 18px 18px;
    flex-direction: column;
    align-items: stretch;
  }

  .brand {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .brand > div:last-child {
    flex: 1;
    min-width: 0;
  }

  .brand-text {
    flex: 1;
    min-width: 0;
  }

  .logo-box {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
  }

  .brand h1 {
    font-size: 20px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand small {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-menu-btn {
    display: flex;
    width: 44px;
    height: 44px;
    margin-left: auto;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 10px;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
    flex-shrink: 0;
  }

  .search {
    width: 100%;
    margin-top: 14px;
  }

  .layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .sidebar {
    display: block;
    position: fixed;
    top: 0;
    left: -310px;
    width: 290px;
    height: 100vh;
    z-index: 9999;
    overflow: auto;
    padding: 18px;
    background: #fbfdff;
    transition: 0.25s ease;
    box-shadow: 8px 0 24px rgba(15, 23, 42, 0.18);
  }

  .sidebar.open {
    left: 0;
  }

  .mobile-overlay.show {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 9998;
  }

  .content {
    padding: 26px 22px;
    border-right: 0;
  }

  .endpoint-head {
    display: block;
  }

  h2 {
    font-size: 28px;
  }

  .copy-btn {
    margin-top: 12px;
  }

  .right {
    padding: 22px;
    border-top: 1px solid #e5e7eb;
  }

  .lang-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .auth-grid {
    grid-template-columns: 1fr;
  }

  .actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  table {
    min-width: 100%;
  }

  th,
  td {
    font-size: 12px;
    padding: 11px 10px;
  }

  pre {
    font-size: 12px;
  }
}
@media(max-width:780px){

  html, body{
    width:100%;
    overflow-x:hidden;
  }

  .topbar,
  .layout,
  .content,
  .right{
    width:100%;
    max-width:100%;
    min-width:0;
  }

  .content{
    padding:24px 16px;
  }

  .endpoint-url{
    word-break:break-all;
    overflow-wrap:anywhere;
  }

  .card{
    width:100%;
    max-width:100%;
    overflow:hidden;
  }

  table{
    width:100%;
    table-layout:fixed;
  }

  #paramBody tr{
    display:block;
    padding:12px;
    border-bottom:1px solid #e5e7eb;
  }

  #paramBody td{
    display:block;
    width:100% !important;
    padding:4px 0;
    border-bottom:0;
  }

  #paramBody input,
  #paramBody select{
    width:100%;
    max-width:100%;
  }

  .right{
    padding:20px 16px;
  }

  .codebox,
  .response{
    width:100%;
    max-width:100%;
  }

  pre{
    max-width:100%;
    overflow:auto;
  }

  .actions.fixed{
    left:50%;
    right:auto;
    transform:translateX(-50%);
    width:calc(100% - 32px);
    justify-content:center;
  }

  .actions.fixed .btn{
    flex:1;
  }
}