:root {
  --bg: #f4f6f9;
  --card: #fff;
  --text: #1a1a2e;
  --muted: #5c6370;
  --accent: #1565c0;
  --accent-hover: #0d47a1;
  --danger: #c62828;
  --border: #e2e8f0;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "Hiragino Sans", "Yu Gothic UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
.container {
  width: min(1120px, 100% - 32px);
  margin-inline: auto;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 24px 16px 48px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 20, 25, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #1f2937;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
  padding-left: 4px;
}

.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.logo img {
  display: block;
  height: 50px !important;
  max-height: 50px !important;
  width: auto;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 8px 12px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}

.nav a:hover,
.nav a.is-current {
  color: #f8fafc;
  background: #1f2937;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #f8fafc;
  border-radius: 1px;
}

.app-meta {
  margin: 8px 0 0;
  font-size: 0.75rem;
  color: #64748b;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-danger { border-color: #ffcdd2; color: var(--danger); }
.btn-danger:hover { background: #ffebee; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.stat label { font-size: 0.75rem; color: var(--muted); display: block; }
.stat strong { font-size: 1.5rem; }
section { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
section h2 { margin: 0 0 16px; font-size: 1rem; }
.actions { display: flex; flex-direction: column; gap: 10px; }
.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.action-row:hover { background: #fafbfc; }
.action-meta strong { display: block; font-size: 0.9375rem; }
.action-meta span { font-size: 0.8125rem; color: var(--muted); }
.badge {
  font-size: 0.6875rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e3f2fd;
  color: var(--accent);
  margin-right: 6px;
}
#log {
  font-family: ui-monospace, monospace;
  font-size: 0.8125rem;
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 12px;
  border-radius: 8px;
  max-height: 200px;
  overflow: auto;
  white-space: pre-wrap;
}
.loading { text-align: center; padding: 48px; color: var(--muted); }
.err {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 4100;
  width: min(760px, calc(100vw - 24px));
  color: var(--danger);
  padding: 11px 14px;
  background: #ffebee;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.25);
}
.host-badge { display: none; }

/* Tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.tab {
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}
.tab:hover { border-color: var(--accent); color: var(--accent); }
.tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.panel { display: none; }
.panel.is-active { display: block; }
.page-panel { margin-bottom: 0; }
.section-subtitle {
  margin: 24px 0 8px;
  font-size: 1rem;
}
.pick-row { cursor: pointer; }
.pick-row:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.pick-row:hover { background: #e3f2fd !important; }
.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.panel-head h2 { margin: 0; }
.panel-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.panel-lead {
  margin: 0 0 16px;
  font-size: 0.8125rem;
  color: var(--muted);
}
.panel-lead code {
  font-size: 0.75rem;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Forms */
.form-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}
.form-card h3 { margin: 0 0 12px; font-size: 0.9375rem; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}
.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid label.span-2 { grid-column: 1 / -1; }
.form-grid input,
.form-grid select,
.form-grid textarea {
  font: inherit;
  font-weight: 400;
  color: var(--text);
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.form-grid textarea { resize: vertical; min-height: 72px; }
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.form-inline-card { align-items: end; }
.category-url-register-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}
.category-url-register-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}
.category-url-label {
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}
.category-url-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  color: var(--text);
}
.category-url-input:focus {
  outline: 2px solid rgba(21, 101, 192, 0.35);
  border-color: var(--accent);
}
.category-url-status {
  margin: 8px 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}
.category-url-status.is-ok { color: #2e7d32; }
.category-url-status.is-err { color: var(--danger); }
.category-url-status.is-busy { color: var(--accent); }
.req { color: var(--danger); font-weight: 600; }

/* Toolbar & table */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 12px;
}
.toolbar-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}
.toolbar-field input,
.toolbar-field select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  min-width: 140px;
}
.toolbar-grow { flex: 1; min-width: 180px; }
.toolbar-grow input { width: 100%; }
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.data-table th,
.data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table th {
  background: #f8fafc;
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}
.data-table tbody tr:hover { background: #fafbfc; }
.data-table tbody tr:last-child td { border-bottom: none; }
.empty-cell {
  text-align: center;
  color: var(--muted);
  padding: 28px !important;
}
.empty-listings-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 28rem;
  margin: 0 auto;
}
.empty-listings-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.empty-listings-copy {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.view-toggle {
  gap: 4px;
}
.btn-icon {
  padding: 8px;
  min-width: 36px;
  min-height: 36px;
  justify-content: center;
}
.btn-icon .btn-icon-svg {
  display: block;
  width: 18px;
  height: 18px;
}
.btn-icon.is-active {
  background: #e3f2fd;
  border-color: var(--accent);
  color: var(--accent);
}
.btn-sm.btn-icon {
  padding: 7px;
  min-width: 34px;
  min-height: 34px;
}
.btn-sm {
  padding: 4px 10px;
  font-size: 0.75rem;
}
.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
}
.status-pill-btn {
  border: none;
  cursor: pointer;
  font: inherit;
  line-height: inherit;
}
.status-pill-btn:hover {
  filter: brightness(0.94);
}
#listingsTable {
  table-layout: fixed;
}
#listingsTable th,
#listingsTable td {
  vertical-align: middle;
}
#listingsTable th.listings-status-col,
#listingsTable td.listings-status-col {
  width: 6.75rem;
  min-width: 6.75rem;
  white-space: nowrap;
}
#listingsTable th.listings-sort-th {
  cursor: pointer;
  user-select: none;
}
#listingsTable th.listings-sort-th:hover,
#listingsTable th.listings-sort-th.is-sorted {
  color: var(--accent);
}
#listingsTable .listings-sort-mark {
  font-size: 0.625rem;
}
#listingsTable .listings-title-col {
  width: 100%;
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#listingsTable .listings-price-col {
  width: 7.25rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
#listingsTable .listings-price-col.is-buy-now-only {
  color: var(--muted);
}
#listingsTable .listings-actions-col {
  width: 8.5rem;
  white-space: nowrap;
}
#listingsTable .listing-thumb-head-col,
#listingsTable .listing-thumb-cell {
  width: 9rem;
}
.listings-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
}
.listings-image-count {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}
.status-出品 { background: #e3f2fd; color: #1565c0; }
.status-済 { background: #e8f5e9; color: #2e7d32; }
.status-下書き { background: #f3f4f6; color: #4b5563; }
.status-不良 { background: #ffebee; color: #c62828; }
.status-other { background: #fff3e0; color: #e65100; }

.admin-user-form {
  display: grid;
  gap: 14px;
}
.admin-user-form .auth-field {
  display: grid;
  gap: 6px;
}
.admin-user-form .auth-field label {
  font-size: 0.875rem;
  font-weight: 600;
}
.admin-user-form .auth-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
}
.admin-user-admin-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}
.admin-user-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.admin-user-form-actions #btnAdminUserDelete {
  margin-left: auto;
}
.admin-user-stats {
  margin: 4px 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}
.admin-user-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px 12px;
  margin: 0;
}
.admin-user-stats-grid > div {
  margin: 0;
}
.admin-user-stats-grid dt {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
}
.admin-user-stats-grid dd {
  margin: 2px 0 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.user-id-badge {
  display: inline-block;
  min-width: 2.25em;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
  line-height: 1.4;
}
.user-id-badge--admin {
  color: #b71c1c;
  background: #ffcdd2;
}
.user-id-badge--test {
  color: #e65100;
  background: #fff9c4;
}
.user-id-badge--free {
  color: #1565c0;
  background: #bbdefb;
}
.user-id-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0 0 10px;
  font-size: 0.8125rem;
  color: var(--muted);
}
.user-id-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.user-id-legend-hint {
  flex: 1 1 100%;
  font-size: 0.75rem;
  color: #64748b;
}
button.user-id-badge,
.user-id-badge--btn {
  border: 0;
  cursor: pointer;
  font: inherit;
}
button.user-id-badge:hover:not(:disabled),
.user-id-badge--btn:hover:not(:disabled) {
  filter: brightness(0.94);
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.12);
}
button.user-id-badge:disabled,
.user-id-badge--btn:disabled {
  opacity: 0.65;
  cursor: wait;
}
button.user-id-badge:focus-visible,
.user-id-badge--btn:focus-visible {
  outline: 2px solid #42a5f5;
  outline-offset: 2px;
}
.user-id-cell {
  white-space: nowrap;
}
.admin-user-id-col,
.user-id-cell {
  width: 1%;
  white-space: nowrap;
  padding-left: 8px;
  padding-right: 8px;
}
.admin-user-email-col,
.admin-user-email-cell {
  width: 1%;
  white-space: nowrap;
  padding-left: 8px;
  padding-right: 8px;
}
.admin-user-email-cell code {
  font-size: 0.75rem;
}
.admin-user-display-name-col,
.admin-user-display-name-cell {
  width: 8rem;
  max-width: 8rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-left: 6px;
  padding-right: 6px;
}
.admin-user-listing-count-col,
.admin-user-listing-count-cell {
  width: 1%;
  white-space: nowrap;
  padding-left: 8px;
  padding-right: 8px;
  text-align: right;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: #475569;
}
.admin-user-sort-col {
  padding-top: 6px;
  padding-bottom: 6px;
  cursor: pointer;
}
.admin-user-sort-col:hover .admin-user-sort-btn {
  color: #334155;
}
.admin-user-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 0.75rem;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.admin-user-sort-btn:hover {
  color: #334155;
}
.admin-user-sort-btn.is-active {
  color: #1565c0;
  font-weight: 600;
}
.admin-user-sort-btn:focus-visible {
  outline: 2px solid #42a5f5;
  outline-offset: 2px;
  border-radius: 4px;
}
.admin-user-sort-indicator {
  font-size: 0.85em;
  line-height: 1;
}
.admin-user-image-sort-col {
  padding-left: 6px;
  padding-right: 6px;
}
.admin-user-created-at-col,
.admin-user-created-at {
  width: 1%;
  white-space: nowrap;
  padding-left: 8px;
  padding-right: 8px;
  font-size: 0.75rem;
  color: #475569;
}
.admin-image-usage-cell {
  width: 72px;
  max-width: 72px;
  min-width: 72px;
  padding-left: 6px;
  padding-right: 6px;
}
.admin-image-usage {
  min-width: 0;
  max-width: 100%;
}
.admin-image-usage-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 2px;
  font-size: 0.625rem;
  line-height: 1.15;
}
.admin-image-usage-label {
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-image-usage-pct {
  color: #64748b;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  font-size: 0.625rem;
}
.admin-image-usage-meta {
  display: block;
  margin-top: 1px;
  font-size: 0.625rem;
  color: #64748b;
  white-space: nowrap;
}
.admin-image-usage--unlimited .admin-image-usage-label {
  color: #1565c0;
}
.admin-image-usage-bar {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.admin-image-usage-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #42a5f5, #1565c0);
  transition: width 0.2s ease;
}
.admin-image-usage-bar-fill.is-warn {
  background: linear-gradient(90deg, #ffb74d, #f57c00);
}
.admin-image-usage-bar-fill.is-full {
  background: linear-gradient(90deg, #ef5350, #c62828);
}
#adminUserModalTitle .user-id-badge {
  font-size: 0.85em;
  vertical-align: middle;
  margin-left: 4px;
}

.admin-graphs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.metric-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
  padding: 10px 12px;
}
.metric-title {
  margin: 0 0 6px;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}
.metric-values {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8125rem;
  margin-bottom: 6px;
}
.metric-bar {
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.metric-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #42a5f5, #1565c0);
}

.admin-analytics {
  margin: 20px 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.admin-analytics-head {
  margin-bottom: 12px;
}
.admin-analytics-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.admin-period-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: #e2e8f0;
}
.admin-period-tab {
  border: 0;
  background: transparent;
  color: #475569;
  font-size: 0.8125rem;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.admin-period-tab.is-active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.admin-period-tab:focus-visible {
  outline: 2px solid #42a5f5;
  outline-offset: 2px;
}
.admin-analytics-head h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}
.admin-analytics-note {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
}
.admin-access-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.admin-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.admin-chart-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
  padding: 12px;
}
.admin-chart-panel--wide {
  margin-top: 4px;
}
.admin-chart-panel h4 {
  margin: 0 0 10px;
  font-size: 0.875rem;
  color: #334155;
}
.admin-chart-note {
  margin: -6px 0 10px;
  font-size: 0.75rem;
  color: var(--muted);
}
.chart-empty {
  margin: 0;
  padding: 16px 8px;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
}
.access-vchart-inner {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  min-height: 180px;
  padding: 8px 4px 0;
  overflow-x: auto;
}
.access-vchart-col {
  flex: 1 0 44px;
  max-width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.access-vchart-bar-wrap {
  width: 100%;
  height: 120px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.access-vchart-bar {
  width: 70%;
  min-height: 4px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #64b5f6, #1565c0);
  transition: height 0.2s ease;
}
.access-vchart-value {
  font-size: 0.75rem;
  font-weight: 700;
  color: #1565c0;
}
.access-vchart-label {
  font-size: 0.6875rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
}
.access-hchart-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}
.access-hchart-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.access-hchart-rank {
  flex: 0 0 22px;
  height: 22px;
  border-radius: 999px;
  background: #e3f2fd;
  color: #1565c0;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
}
.access-hchart-body {
  flex: 1;
  min-width: 0;
}
.access-hchart-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.8125rem;
}
.access-hchart-label {
  font-weight: 600;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.access-hchart-meta {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.75rem;
}
.access-hchart-bar {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.access-hchart-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #81c784, #2e7d32);
}
.access-hchart-list--ranked .access-hchart-bar-fill {
  background: linear-gradient(90deg, #ffb74d, #ef6c00);
}
.access-error-chart {
  min-height: 180px;
}
.access-error-inner {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  min-height: 180px;
  padding: 8px 4px 0;
  overflow-x: auto;
}
.access-error-col {
  flex: 1 0 44px;
  max-width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.access-error-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  width: 100%;
  height: 120px;
}
.access-error-bar {
  width: 40%;
  min-height: 0;
  border-radius: 4px 4px 0 0;
  transition: height 0.2s ease;
}
.access-error-bar--4xx {
  background: linear-gradient(180deg, #ffb74d, #f57c00);
}
.access-error-bar--5xx {
  background: linear-gradient(180deg, #ef5350, #c62828);
}

.log-section {
  margin-top: 20px;
  padding-top: 0;
  background: transparent;
  border: none;
}
.log-section h2 { font-size: 1rem; margin-bottom: 12px; }

/* Modal — 画像登録 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}
.modal-card {
  position: relative;
  width: min(520px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.15);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.modal-head h2 { margin: 0; font-size: 1.125rem; }
.modal-close {
  min-width: 36px;
  font-size: 1.25rem;
  line-height: 1;
  padding: 4px 10px;
}
.upload-status {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.875rem;
}
.upload-status.is-ok { background: #ecfdf5; color: #047857; }
.upload-status.is-err { background: #ffebee; color: var(--danger); }

.toolbar-label {
  display: inline-block;
  margin-bottom: 4px;
  font-size: 0.75rem;
  color: var(--muted);
}
.inventory-thumb-cell {
  width: 72px;
  padding: 6px 8px;
  vertical-align: middle;
}
.inventory-thumb {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: zoom-in;
}
.listing-thumb-cell {
  width: 140px;
  padding: 6px 8px;
  vertical-align: middle;
}
.listing-first-image {
  display: block;
  width: 128px;
  max-width: 128px;
  height: 128px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: zoom-in;
}
body.is-listing-preview-open,
body.is-admin-user-modal-open {
  overflow: hidden;
}
.modal-card-image {
  width: min(92vw, 960px);
  max-height: 92vh;
  padding: 12px 16px 16px;
}
.listing-preview-body {
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: calc(92vh - 72px);
  overflow: auto;
}
.listing-preview-body img {
  display: block;
  max-width: 100%;
  max-height: calc(92vh - 88px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
}
.listing-no-image {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 128px;
  height: 128px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.75rem;
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: #0f1419;
    border-bottom: 1px solid #1f2937;
    padding: 12px 16px 16px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
  }

  .nav.is-open {
    display: flex;
  }

  .header-inner {
    position: relative;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid label.span-2 { grid-column: auto; }
}

.plan-badge {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  vertical-align: middle;
}

.plan-badge-soon {
  background: #fef3c7;
  color: #92400e;
}

.plan-badge-paid {
  background: #dbeafe;
  color: #1d4ed8;
}

.plan-paywall {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
}

.plan-paywall-lead {
  margin: 0 0 8px;
  font-size: 1rem;
}

.plan-paywall p {
  margin: 0 0 10px;
  font-size: 0.875rem;
  color: var(--muted);
}

.plan-paywall p:last-child {
  margin-bottom: 0;
}

.admin-plan-notice {
  margin: 0 0 12px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.admin-user-admin-check.is-disabled {
  opacity: 0.65;
}

.app-affiliate-disclosure {
  margin: -4px 0 16px;
  font-size: 0.75rem;
  color: var(--muted);
}

.app-affiliate-disclosure a {
  color: inherit;
  text-decoration: underline;
}

.app-affiliate-banner {
  margin: 12px 0 8px;
  line-height: 0;
}

.app-affiliate-banner a {
  display: inline-block;
  max-width: 100%;
}

.app-affiliate-banner img {
  display: block;
  width: min(728px, 100%);
  height: auto;
  aspect-ratio: 728 / 90;
  border: 0;
}

.app-footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px 32px;
}

.footer-affiliate {
  position: static;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  line-height: 0;
}

.footer-affiliate-link,
.footer-affiliate-picture {
  display: inline-block;
  max-width: 100%;
}

.footer-affiliate-img {
  display: block;
  height: auto;
  border: 0;
}

.footer-affiliate-img {
  width: min(728px, 100%);
  aspect-ratio: 728 / 90;
}

.footer-affiliate-disclosure {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .footer-affiliate-img {
    width: min(300px, 100%);
    aspect-ratio: 300 / 250;
  }
}
