:root {
  color-scheme: light;
  --ink: #172338;
  --muted: #68758a;
  --line: #dce3ea;
  --panel: #fff;
  --canvas: #f2f5f7;
  --blue: #0d4c92;
  --blue-dark: #083866;
  --blue-soft: #eaf3fb;
  --green: #13795b;
  --green-soft: #e8f6f1;
  --red: #bd2c2c;
  --red-soft: #fff0f0;
  --amber: #9a6000;
  --amber-soft: #fff5dc;
  --shadow: 0 18px 50px rgba(23, 35, 56, .08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: radial-gradient(circle at 12% 0%, rgba(13, 76, 146, .09), transparent 30rem), var(--canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
button, input { font: inherit; }
.shell { width: min(1040px, calc(100% - 32px)); margin: 0 auto; padding: 54px 0 36px; }
.hero { max-width: 820px; margin-bottom: 30px; }
.brand { display: flex; align-items: center; gap: 16px; }
.brand-mark {
  display: grid; width: 52px; height: 52px; place-items: center; color: #fff; border-radius: 15px;
  background: linear-gradient(145deg, var(--blue), #2577bf);
  box-shadow: 0 12px 25px rgba(13, 76, 146, .24); font-size: 24px; font-weight: 800;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(27px, 4vw, 40px); letter-spacing: -.035em; line-height: 1.1; }
h2 { margin-bottom: 0; font-size: 22px; letter-spacing: -.02em; }
h3 { margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.eyebrow { margin-bottom: 5px; color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.intro { max-width: 690px; margin: 20px 0 18px 68px; color: var(--muted); font-size: 17px; }
.context { display: flex; flex-wrap: wrap; gap: 8px; margin-left: 68px; }
.context span, .count-badge { padding: 6px 11px; color: var(--blue-dark); border: 1px solid #cfe0f0; border-radius: 999px; background: var(--blue-soft); font-size: 12px; font-weight: 750; }
.panel { border: 1px solid rgba(220, 227, 234, .9); border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); }
.query-panel, .notification-panel { padding: 26px; }
.section-heading, .result-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.text-button { padding: 8px 3px; color: var(--blue); border: 0; background: transparent; cursor: pointer; font-weight: 750; }
.text-button:hover { color: var(--blue-dark); text-decoration: underline; }
form { display: grid; grid-template-columns: 150px minmax(210px, 1fr) auto; align-items: end; gap: 16px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 13px; font-weight: 750; }
.field input {
  width: 100%; height: 48px; padding: 0 14px; color: var(--ink); border: 1px solid #c8d2dc;
  border-radius: 10px; outline: none; background: #fbfcfd; transition: border-color 150ms, box-shadow 150ms;
}
.field input:focus { border-color: #4f8fc9; background: #fff; box-shadow: 0 0 0 4px rgba(37, 119, 191, .12); }
.primary-button {
  display: inline-flex; height: 48px; align-items: center; justify-content: center; gap: 9px; padding: 0 22px;
  color: #fff; border: 0; border-radius: 10px; background: var(--blue); cursor: pointer; font-weight: 800;
  box-shadow: 0 8px 18px rgba(13, 76, 146, .2); transition: background 150ms, transform 150ms;
}
.primary-button:hover { background: var(--blue-dark); transform: translateY(-1px); }
.primary-button:disabled { opacity: .72; cursor: wait; transform: none; }
.spinner { display: none; width: 17px; height: 17px; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: spin 800ms linear infinite; }
.is-loading .spinner { display: block; }
.form-note { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.message { margin-top: 18px; padding: 14px 16px; border-radius: 11px; }
.error-message { color: #8d2020; border: 1px solid #efc4c4; background: var(--red-soft); }
.loading-panel { display: flex; align-items: center; gap: 18px; margin-top: 20px; padding: 22px 26px; }
.loading-panel p { margin: 3px 0 0; color: var(--muted); }
.loading-orbit { width: 34px; height: 34px; flex: 0 0 auto; border: 3px solid #dbe9f5; border-top-color: var(--blue); border-radius: 50%; animation: spin 900ms linear infinite; }
.results { margin-top: 34px; }
.result-heading { margin-bottom: 16px; }
.success-tag { padding: 7px 11px; color: var(--green); border-radius: 999px; background: var(--green-soft); font-size: 12px; font-weight: 800; }
.summary-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.summary-card { min-height: 125px; padding: 22px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }
.summary-card-wide { grid-column: 1 / -1; min-height: auto; }
.summary-card p { margin-bottom: 12px; color: var(--muted); font-size: 13px; }
.summary-card strong { font-size: 20px; }
.channel { display: inline-flex; width: fit-content; padding: 6px 10px; border-radius: 8px; }
.channel-red { color: var(--red); background: var(--red-soft); }
.channel-green { color: var(--green); background: var(--green-soft); }
.channel-amber { color: var(--amber); background: var(--amber-soft); }
.notification-panel { margin-top: 16px; }
.notification-list { display: grid; gap: 12px; }
.notification-card { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fbfcfd; }
.notification-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); background: #fff; }
.notification-card header span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.notification-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 16px 18px; }
.meta-item p, .notification-detail p { margin-bottom: 4px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.meta-item strong { font-size: 13px; overflow-wrap: anywhere; }
.notification-detail { padding: 0 18px 18px; }
.notification-detail div { max-height: 260px; overflow: auto; padding: 14px; border-radius: 9px; background: #fff; color: #344258; font-size: 13px; white-space: pre-wrap; }
.subsection-title { margin-top: 25px; }
.empty-state, .notification-empty { display: flex; align-items: center; gap: 13px; padding: 18px; color: var(--muted); border: 1px dashed #cbd5df; border-radius: 12px; background: #fafcfd; }
.empty-state span { display: grid; width: 34px; height: 34px; place-items: center; color: var(--green); border-radius: 50%; background: var(--green-soft); font-weight: 900; }
.empty-state p, .notification-empty p { margin: 2px 0 0; font-size: 13px; }
.raw-result { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.raw-result summary { padding: 14px 17px; cursor: pointer; font-size: 13px; font-weight: 750; }
.raw-result pre { max-height: 420px; overflow: auto; margin: 0; padding: 18px; border-top: 1px solid var(--line); background: #111a27; color: #dce8f5; font-size: 12px; }
footer { padding: 0 16px 30px; color: #7d8999; text-align: center; font-size: 12px; }
[hidden] { display: none !important; }

.mode-tabs {
  display: inline-flex;
  gap: 5px;
  margin-bottom: 14px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .72);
}
.mode-tab {
  padding: 10px 18px;
  color: var(--muted);
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}
.mode-tab.active { color: #fff; background: var(--blue); box-shadow: 0 5px 12px rgba(13, 76, 146, .2); }
.access-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(280px, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
  padding: 16px 18px;
  color: var(--blue-dark);
  border: 1px solid #c8dced;
  border-radius: 13px;
  background: var(--blue-soft);
}
.access-panel p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.access-control { display: flex; gap: 8px; }
.access-control input { min-width: 0; height: 42px; flex: 1; padding: 0 12px; border: 1px solid #b6ccdf; border-radius: 8px; outline: none; }
.access-control input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(13, 76, 146, .1); }
.secondary-button { padding: 0 13px; color: var(--blue); border: 1px solid #aac5dc; border-radius: 8px; background: #fff; cursor: pointer; font-weight: 800; }
.access-status { color: var(--amber); font-size: 11px; font-weight: 800; white-space: nowrap; }
.access-status.ready { color: var(--green); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.time-tag {
  padding: 8px 12px;
  color: var(--blue-dark);
  border: 1px solid #cfe0f0;
  border-radius: 10px;
  background: var(--blue-soft);
  font-size: 13px;
}
.limit-note { color: var(--muted); font-size: 12px; }
.bulk-form { display: grid; grid-template-columns: 1fr; align-items: stretch; }
.bulk-controls { display: grid; grid-template-columns: minmax(170px, 1fr) minmax(210px, 1fr); gap: 16px; }
.field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  color: var(--ink);
  border: 1px solid #c8d2dc;
  border-radius: 10px;
  outline: none;
  background: #fbfcfd;
  transition: border-color 150ms, box-shadow 150ms;
}
.field select { height: 48px; padding-top: 0; padding-bottom: 0; }
.field textarea { resize: vertical; min-height: 150px; line-height: 1.55; }
.field select:focus, .field textarea:focus { border-color: #4f8fc9; background: #fff; box-shadow: 0 0 0 4px rgba(37, 119, 191, .12); }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.label-row span { color: var(--muted); font-size: 12px; }
.upload-row { display: flex; align-items: center; gap: 13px; min-width: 0; }
.upload-button {
  padding: 9px 13px;
  color: var(--blue);
  border: 1px solid #bcd3e8;
  border-radius: 9px;
  background: var(--blue-soft);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}
.upload-button:hover { border-color: var(--blue); }
#fileName { min-width: 0; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
#clearBulkButton { margin-left: auto; flex: 0 0 auto; }
.bulk-submit { justify-self: start; }
.bulk-summary { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.bulk-summary span { padding: 7px 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 12px; }
.bulk-summary strong { color: var(--ink); }
.progress-track { height: 7px; overflow: hidden; margin-bottom: 12px; border-radius: 999px; background: #dfe7ee; }
.progress-track div { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), #3184ca); transition: width 250ms ease; }
.table-shell { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
table { width: 100%; min-width: 920px; border-collapse: collapse; font-size: 13px; }
th { padding: 12px 14px; color: var(--muted); border-bottom: 1px solid var(--line); background: #f7f9fb; text-align: left; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
td { padding: 14px; border-bottom: 1px solid #e7ecf1; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcfd; }
.numeric { text-align: center; }
.row-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; }
.row-status.processing { color: var(--blue); }
.row-status.failed { color: var(--red); }
.mini-spinner { width: 13px; height: 13px; border: 2px solid #cbddeb; border-top-color: var(--blue); border-radius: 50%; animation: spin 800ms linear infinite; }
.error-row { background: #fffafa; }
.table-channel { display: inline-flex; padding: 5px 8px; border-radius: 7px; font-size: 11px; font-weight: 800; }
.detail-button {
  padding: 6px 10px;
  color: var(--blue);
  border: 1px solid #bed4e8;
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}
.detail-button:hover { color: #fff; border-color: var(--blue); background: var(--blue); }
dialog {
  width: min(760px, calc(100% - 28px));
  max-height: min(82vh, 850px);
  padding: 0;
  color: var(--ink);
  border: 0;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(15, 28, 45, .28);
}
dialog::backdrop { background: rgba(13, 25, 39, .55); backdrop-filter: blur(3px); }
.dialog-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 24px; border-bottom: 1px solid var(--line); background: #fff; }
.dialog-close { display: grid; width: 35px; height: 35px; place-items: center; color: var(--muted); border: 1px solid var(--line); border-radius: 50%; background: #fff; cursor: pointer; font-size: 23px; line-height: 1; }
#dialogContent { padding: 22px 24px 28px; }
.dialog-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 17px; border-radius: 12px; background: #f5f8fa; }
.dialog-section-title { margin: 24px 0 12px; color: var(--ink); font-size: 16px; }
.api-reference { margin-top: 42px; padding: 28px; }
.api-reference-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 22px;
}
.api-reference-heading p:not(.eyebrow) { max-width: 660px; margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.api-reference-links { display: flex; flex: 0 0 auto; gap: 8px; }
.api-reference-links a {
  padding: 9px 12px;
  color: var(--blue);
  border: 1px solid #bcd3e8;
  border-radius: 9px;
  background: var(--blue-soft);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}
.api-reference-links a:hover { color: #fff; border-color: var(--blue); background: var(--blue); }
.api-base-url {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #cfe0f0;
  border-radius: 11px;
  background: var(--blue-soft);
}
.api-base-url span { flex: 0 0 auto; color: var(--blue-dark); font-size: 12px; font-weight: 800; }
.api-base-url code { min-width: 0; overflow-wrap: anywhere; color: var(--ink); font-size: 13px; }
.endpoint-grid, .api-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.endpoint-card, .api-detail-grid article { padding: 19px; border: 1px solid var(--line); border-radius: 13px; background: #fbfcfd; }
.endpoint-title { display: flex; align-items: center; gap: 10px; }
.endpoint-title > code { color: var(--ink); font-size: 14px; font-weight: 800; }
.method { padding: 5px 8px; color: #fff; border-radius: 6px; font-size: 10px; font-weight: 900; letter-spacing: .05em; }
.method-get { background: var(--green); }
.method-post { background: var(--blue); }
.endpoint-card > p { min-height: 42px; margin: 13px 0; color: var(--muted); font-size: 13px; }
.endpoint-card pre, .curl-example pre {
  overflow-x: auto;
  margin: 0;
  padding: 15px;
  border-radius: 9px;
  background: #111a27;
  color: #dce8f5;
  font-size: 12px;
  line-height: 1.6;
}
.request-meta { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 10px; font-size: 11px; }
.request-meta span { color: var(--muted); font-weight: 800; }
.api-detail-grid { margin-top: 14px; }
.api-detail-grid h3 { color: var(--ink); }
.parameter-list { display: grid; gap: 10px; }
.parameter-list div { display: grid; grid-template-columns: minmax(130px, .7fr) 1.3fr; gap: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.parameter-list code { color: var(--blue-dark); font-size: 12px; font-weight: 800; overflow-wrap: anywhere; }
.parameter-list span { color: var(--muted); font-size: 12px; }
.curl-example { margin-top: 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; }
.curl-example summary { padding: 13px 16px; cursor: pointer; color: var(--blue); font-size: 13px; font-weight: 800; }
.curl-example pre { border-radius: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 720px) {
  .shell { padding-top: 30px; }
  .intro, .context { margin-left: 0; }
  form, .summary-grid { grid-template-columns: 1fr; }
  .primary-button { width: 100%; }
  .summary-card-wide { grid-column: auto; }
  .bulk-controls { grid-template-columns: 1fr; }
  .bulk-summary { justify-content: flex-start; }
  .access-panel { grid-template-columns: 1fr; gap: 10px; }
  .api-reference-heading { display: grid; }
  .api-reference-links { flex-wrap: wrap; }
  .endpoint-grid, .api-detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .shell { width: min(100% - 22px, 1040px); }
  .brand { align-items: flex-start; }
  .brand-mark { width: 45px; height: 45px; }
  .query-panel, .notification-panel { padding: 19px; }
  .section-heading, .result-heading { align-items: flex-start; }
  .notification-meta { grid-template-columns: 1fr; }
  .notification-card header { display: grid; }
  .mode-tabs { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .mode-tab { padding: 10px 8px; }
  .upload-row { flex-wrap: wrap; }
  #clearBulkButton { margin-left: 0; }
  .bulk-submit { width: 100%; }
  .dialog-summary { grid-template-columns: 1fr; }
  .api-reference { padding: 19px; }
  .api-base-url { display: grid; gap: 5px; }
  .parameter-list div { grid-template-columns: 1fr; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
