:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #111827;
  --muted: #667085;
  --line: #d8e0ea;
  --line-soft: #edf1f6;
  --brand: #176bf2;
  --brand-dark: #0f4fba;
  --brand-soft: #eaf2ff;
  --success-bg: #e9f8ef;
  --success-text: #087443;
  --warning-bg: #fff4e5;
  --warning-text: #a15c07;
  --shadow: 0 18px 46px rgba(15, 23, 42, 0.09);
  --shadow-soft: 0 10px 28px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, #edf4ff 0, #f4f7fb 310px),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.4;
}

button,
input,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.shell {
  width: min(1440px, calc(100% - 36px));
  margin: 0 auto;
  padding: 26px 0 44px;
}

.hero {
  margin-bottom: 16px;
  padding: 18px 20px 22px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(216, 224, 234, 0.8);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
}

.brandbar,
.hero-content,
.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brandbar {
  margin-bottom: 28px;
}

.brand-logo {
  display: block;
  width: min(184px, 48vw);
  height: auto;
}

.bucket-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(23, 107, 242, 0.24);
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

.title-block {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: none;
  font-size: clamp(2.1rem, 3.3vw, 3.7rem);
  line-height: 0.98;
  white-space: nowrap;
}

h2 {
  font-size: 1.05rem;
  line-height: 1.2;
}

.primary-button,
.action-button,
.pager-button,
.page-jump-button {
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  font-weight: 800;
  transition:
    transform 0.14s ease,
    background 0.14s ease,
    border-color 0.14s ease,
    color 0.14s ease,
    box-shadow 0.14s ease;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 44px;
  padding: 0 18px;
  background: var(--brand);
  border-color: var(--brand);
  color: white;
  box-shadow: 0 10px 22px rgba(23, 107, 242, 0.2);
  white-space: nowrap;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  transform: translateY(-1px);
}

.primary-button:disabled,
.action-button:disabled,
.pager-button:disabled,
.page-jump-button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

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

.metric-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 17px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: var(--shadow-soft);
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--brand);
}

.summary-label {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.summary strong {
  display: block;
  margin-top: 5px;
  color: #0b1220;
  font-size: 1.8rem;
  line-height: 1.05;
}

.controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 190px 120px 190px 150px;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: var(--shadow-soft);
}

.search-field,
.select-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: #4b5563;
  font-size: 0.78rem;
  font-weight: 850;
}

input,
select {
  width: 100%;
  min-height: 43px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

input::placeholder {
  color: #98a2b3;
}

input:focus,
select:focus {
  border-color: var(--brand);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(23, 107, 242, 0.12);
}

.list-header {
  min-height: 42px;
  margin-bottom: 8px;
}

.pagination {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: var(--shadow-soft);
}

.pager-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 0;
  background: #ffffff;
  color: var(--brand-dark);
  font-size: 1.42rem;
  line-height: 1;
}

.pagination .pager-button:first-child {
  border-radius: 7px 0 0 7px;
}

.pagination .pager-button:last-child {
  border-radius: 0 7px 7px 0;
}

.pager-button:hover,
.pager-button:focus-visible {
  border-color: rgba(23, 107, 242, 0.58);
  background: #f8fbff;
}

.pager-button:disabled {
  color: #98a2b3;
  cursor: not-allowed;
  background: #f7f9fc;
}

.page-info {
  min-width: 44px;
  padding: 0 10px 0 2px;
  color: #475467;
  font-size: 0.82rem;
  font-weight: 800;
  text-align: left;
}

.page-jump {
  display: inline-flex;
  align-items: center;
  height: 38px;
  overflow: hidden;
  border: 1px solid #cfd9e6;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
  background: #ffffff;
  color: #475467;
  font-size: 0.8rem;
  font-weight: 850;
  white-space: nowrap;
}

.page-jump:focus-within {
  border-color: rgba(23, 107, 242, 0.58);
  box-shadow: 0 0 0 4px rgba(23, 107, 242, 0.12);
}

.page-jump label {
  padding: 0 9px 0 12px;
}

.page-jump input {
  width: 58px;
  min-height: 36px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: #f6f9fc;
  color: #101828;
  padding: 0 6px;
  font-size: 0.92rem;
  font-weight: 900;
  text-align: center;
}

.page-jump input:focus {
  background: #ffffff;
  box-shadow: none;
}

.page-jump input::-webkit-outer-spin-button,
.page-jump input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.page-jump input[type="number"] {
  appearance: textfield;
}

.page-jump-button {
  align-self: stretch;
  min-width: 42px;
  height: auto;
  padding: 0 12px;
  border: 0;
  border-left: 1px solid rgba(23, 107, 242, 0.22);
  border-radius: 0;
  background: var(--brand);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 900;
}

.page-jump-button:hover,
.page-jump-button:focus-visible {
  background: var(--brand-dark);
  color: #ffffff;
  outline: none;
}

.status-message {
  min-height: 22px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.status-message.error {
  color: #b42318;
  font-weight: 800;
}

.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 352px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: separate;
  border-spacing: 0;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f2f6fb;
  color: #475467;
  font-size: 0.75rem;
  text-align: left;
  text-transform: uppercase;
  box-shadow: inset 0 -1px 0 var(--line);
}

th,
td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr {
  transition:
    background 0.12s ease,
    opacity 0.12s ease;
}

tbody tr:hover {
  background: #f8fbff;
}

tbody tr.is-completed {
  background: #f4f6f8;
  opacity: 0.58;
}

tbody tr.is-completed:hover {
  background: #eef2f6;
  opacity: 0.78;
}

.id-cell {
  width: 82px;
  color: var(--brand-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
  font-weight: 900;
}

.name-cell {
  min-width: 340px;
  color: #101828;
  font-weight: 850;
}

.name-picker-field {
  display: grid;
  max-width: 430px;
}

.name-picker-select {
  width: 100%;
  min-height: 46px;
  padding: 0 42px 0 13px;
  border: 1px solid rgba(23, 107, 242, 0.28);
  border-radius: 7px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  color: #101828;
  font-size: 0.93rem;
  font-weight: 850;
  line-height: 1.2;
  box-shadow:
    inset 3px 0 0 var(--brand),
    0 1px 2px rgba(16, 24, 40, 0.05);
  cursor: pointer;
}

.name-picker-select:hover,
.name-picker-select:focus-visible {
  border-color: rgba(23, 107, 242, 0.58);
  background: #ffffff;
}

.name-picker-select:focus-visible {
  box-shadow: 0 0 0 4px rgba(23, 107, 242, 0.12);
  outline: none;
}

.gif-cell {
  width: 112px;
  color: var(--muted);
  font-weight: 800;
}

.gif-preview-button {
  display: inline-flex;
  width: 76px;
  height: 56px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  cursor: zoom-in;
}

.gif-preview-button:hover,
.gif-preview-button:focus-visible {
  border-color: rgba(23, 107, 242, 0.58);
  box-shadow: 0 0 0 4px rgba(23, 107, 242, 0.12);
  outline: none;
}

.gif-preview {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bucket-cell {
  min-width: 230px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 850;
  white-space: nowrap;
}

.badge.success {
  background: var(--success-bg);
  color: var(--success-text);
}

.badge.warning {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.source-line {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  max-width: 410px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 88px;
}

.action-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  background: #ffffff;
  color: #344054;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.action-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.action-button:hover,
.action-button:focus-visible {
  border-color: rgba(23, 107, 242, 0.58);
  color: var(--brand-dark);
  background: #f8fbff;
}

.action-button.copied {
  border-color: rgba(8, 116, 67, 0.32);
  color: var(--success-text);
  background: var(--success-bg);
}

.action-button::before,
.action-button::after {
  position: absolute;
  left: 50%;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition:
    opacity 0.12s ease,
    transform 0.12s ease;
}

.action-button::before {
  content: attr(data-tooltip);
  bottom: calc(100% + 9px);
  width: max-content;
  max-width: 180px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #111827;
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}

.action-button::after {
  content: "";
  bottom: calc(100% + 4px);
  width: 8px;
  height: 8px;
  background: #111827;
  transform: translate(-50%, 4px) rotate(45deg);
}

.action-button:hover::before,
.action-button:hover::after,
.action-button:focus-visible::before,
.action-button:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.action-button:hover::after,
.action-button:focus-visible::after {
  transform: translate(-50%, 0) rotate(45deg);
}

.gif-dialog {
  width: min(940px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
}

.gif-dialog::backdrop {
  background: rgba(15, 23, 42, 0.68);
}

.gif-dialog-panel {
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(216, 224, 234, 0.85);
  border-radius: 9px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.gif-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 10px 12px 10px 16px;
  border-bottom: 1px solid var(--line);
}

.gif-dialog-header strong {
  min-width: 0;
  overflow: hidden;
  color: #101828;
  font-size: 0.98rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialog-close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: #344054;
  cursor: pointer;
  font-size: 1.45rem;
  line-height: 1;
}

.dialog-close-button:hover,
.dialog-close-button:focus-visible {
  border-color: rgba(23, 107, 242, 0.58);
  color: var(--brand-dark);
  background: #f8fbff;
}

.gif-dialog-image {
  display: block;
  width: 100%;
  max-height: calc(100vh - 96px);
  object-fit: contain;
  background: #0b1220;
}

@media (max-width: 940px) {
  .summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 680px) {
  .shell {
    width: min(100% - 20px, 1440px);
    padding-top: 12px;
  }

  .hero {
    padding: 15px;
  }

  .brandbar,
  .hero-content,
  .list-header {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    font-size: 2.05rem;
    white-space: normal;
  }

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

  .table-wrap {
    max-height: none;
  }
}
