* {
  box-sizing: border-box;
}

body {
  background: #f7f7f7;
  color: #202124;
  font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
}

a {
  color: #1a73e8;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 24px;
}

.brand {
  align-items: center;
  color: #202124;
  display: inline-flex;
  gap: 8px;
  font-size: 16px;
  font-weight: 500;
}

.brand-logo {
  border-radius: 8px;
  height: 32px;
  width: 32px;
}

.brand:hover {
  text-decoration: none;
}

.nav {
  align-items: center;
  display: flex;
  gap: 12px;
  font-size: 14px;
}

.logout-form {
  margin: 0;
}

button,
.button {
  align-items: center;
  background: #1a73e8;
  border: 1px solid #1a73e8;
  border-radius: 20px;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 500;
  justify-content: center;
  min-height: 40px;
  padding: 0 20px;
}

button.secondary,
.button.secondary {
  background: transparent;
  color: #1a73e8;
}

button:hover,
.button:hover {
  text-decoration: none;
  filter: brightness(0.95);
}

.page {
  margin: 0 auto;
  max-width: 1120px;
  padding: 28px 20px 48px;
}

.auth-page,
.hero-page {
  max-width: 480px;
  padding-top: 56px;
  text-align: center;
}

.hero-page .panel {
  text-align: center;
}

.panel {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 6px 20px rgba(0, 0, 0, 0.06);
  padding: 32px;
  text-align: left;
  margin-bottom: 1em;
}

h1 {
  font-size: 2rem;
  font-weight: 500;
  line-height: 1.25;
  margin: 0 0 16px;
}

h2 {
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.3;
  margin: 0 0 14px;
}

p {
  color: #555555;
  line-height: 1.5;
}

label {
  color: #555555;
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin: 14px 0 6px;
  text-align: left;
}

input,
select {
  border: 1px solid #cccccc;
  border-radius: 8px;
  font: inherit;
  min-height: 42px;
  padding: 8px 12px;
  width: 100%;
}

input:focus,
select:focus {
  border-color: #1a73e8;
  outline: 2px solid rgba(26, 115, 232, 0.2);
}

input[type="checkbox"] {
  height: 18px;
  min-height: 0;
  width: 18px;
}

label.checkbox-row {
  align-items: center;
  display: flex;
  font-weight: 400;
  gap: 8px;
  margin: 12px 0;
}

.helptext,
.errorlist {
  color: #888888;
  font-size: 12px;
  margin: 6px 0 0;
  text-align: left;
}

.errorlist {
  color: #b3261e;
  padding-left: 18px;
}

.form-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}

.grid {
  display: grid;
  gap: 16px;
}

.stats {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-bottom: 18px;
}

.stat {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 6px 20px rgba(0, 0, 0, 0.06);
  padding: 16px;
}

.stat-label {
  color: #888888;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.stat-value {
  color: #202124;
  font-size: 26px;
  font-weight: 500;
  margin-top: 6px;
}

table {
  border-collapse: collapse;
  width: 100%;
}

.table-action-form {
  display: inline-block;
  margin: 0;
}

.inline-select {
  min-height: 32px;
  padding: 4px 8px;
  width: auto;
}

.icon-toggle {
  background: transparent;
  border: 1px solid #cccccc;
  border-radius: 999px;
  color: #888888;
  font-size: 11px;
  font-weight: 700;
  height: 26px;
  min-height: 0;
  padding: 0;
  width: 26px;
}

.icon-toggle.exclude.active {
  background: #b3261e;
  border-color: #b3261e;
  color: #ffffff;
}

.icon-toggle.developer.active {
  background: #1a73e8;
  border-color: #1a73e8;
  color: #ffffff;
}

.icon-toggle + .icon-toggle {
  margin-left: 6px;
}

.status-toggle {
  background: transparent;
  border: 1px solid #cccccc;
  border-radius: 999px;
  color: #888888;
  font-size: 12px;
  font-weight: 700;
  min-height: 30px;
  padding: 0 14px;
}

.status-toggle.active {
  background: #1e8e3e;
  border-color: #1e8e3e;
  color: #ffffff;
}

.badge {
  border-radius: 999px;
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-kind-copyguard {
  background: #e0f2fe;
  color: #075985;
}

.badge-kind-chatgpt_page {
  background: #ede9fe;
  color: #5b21b6;
}

.badge-on {
  background: #1e8e3e;
  color: #ffffff;
}

.badge-off {
  background: #e0e0e0;
  color: #555555;
}

th,
td {
  border-bottom: 1px solid #e0e0e0;
  font-size: 13px;
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: #555555;
  font-size: 12px;
  text-transform: uppercase;
}

.preview {
  max-width: 420px;
  white-space: pre-wrap;
  word-break: break-word;
}

.json-block {
  background: #f7f7f7;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
  max-height: 480px;
  overflow: auto;
  padding: 16px;
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-table th {
  text-transform: none;
  white-space: nowrap;
  width: 1%;
}

.muted {
  color: #888888;
}

.pagination {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 16px;
}

footer {
  color: #888888;
  font-size: 0.9rem;
  padding: 40px 20px 24px;
  text-align: center;
}

footer a {
  color: inherit;
  transition: color 0.2s ease;
}

footer a:hover {
  color: #1a73e8;
  text-decoration: none;
}

@media (max-width: 740px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 18px;
  }

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

  .table-wrap {
    overflow-x: auto;
  }
}
