:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background: #f6f8fb;
  color: #172033;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

.sidebar {
  width: min(420px, 100%);
  min-height: 100vh;
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 16px;
}

.header {
  border-bottom: 1px solid #dfe5ef;
  padding-bottom: 14px;
}

.eyebrow {
  margin: 0 0 6px;
  color: #376b46;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.section {
  display: grid;
  gap: 10px;
}

.user-card {
  display: grid;
  gap: 12px;
  border: 1px solid #dfe5ef;
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.user-card strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
}

.user-card small {
  display: block;
  margin-top: 3px;
  color: #667085;
  font-size: 11px;
  word-break: break-all;
}

.quota-tip {
  display: none;
  margin: 0;
  border-radius: 6px;
  background: #fff1f3;
  color: #b42318;
  padding: 8px;
  font-size: 12px;
  line-height: 1.45;
}

.quota-tip.visible {
  display: block;
}

.label,
.user-grid span {
  color: #667085;
  font-size: 12px;
}

.user-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.user-grid div {
  border-radius: 6px;
  background: #f6f8fb;
  padding: 8px;
  min-width: 0;
}

.user-grid b {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.card-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 8px;
}

.top-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

label {
  font-size: 13px;
  font-weight: 800;
}

.url-list {
  display: grid;
  gap: 8px;
}

.url-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: center;
}

.url-row:first-child {
  grid-template-columns: minmax(0, 1fr) 38px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cdd6e4;
  border-radius: 6px;
  padding: 10px;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  color: #172033;
  background: #ffffff;
}

textarea {
  resize: vertical;
  min-height: 72px;
}

button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  background: #2457c5;
  color: #ffffff;
  cursor: pointer;
  white-space: nowrap;
}

button.icon-button {
  width: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
}

button.remove-button {
  min-height: 38px;
  padding: 0;
  background: #eef2f7;
  color: #5b6475;
}

button.ghost {
  background: #e9eef7;
  color: #25324a;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.row {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 8px;
}

.range-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.collect-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px;
  gap: 8px;
}

.collect-actions.hidden {
  display: contents;
}

button.danger {
  background: #d92d20;
  color: #ffffff;
}

button.danger:disabled {
  background: #f4b8b2;
  color: #ffffff;
}

.session-actions {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: center;
}

.session-actions.visible {
  display: grid;
}

.login-status {
  grid-column: 1 / -1;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 800;
  background: #eef2f7;
  color: #344054;
}

.login-status.logged-in {
  background: #e5f6ed;
  color: #166534;
}

.login-status.expired {
  background: #fff1f3;
  color: #b42318;
}

.hint {
  margin: 0;
  color: #667085;
  font-size: 12px;
  line-height: 1.5;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.metrics div {
  border: 1px solid #dfe5ef;
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

dt {
  color: #667085;
  font-size: 12px;
  margin-bottom: 4px;
}

dd {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
  font-weight: 900;
}

.status {
  min-height: 160px;
  max-height: 260px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid #dfe5ef;
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
  color: #344054;
  font: 12px/1.5 Consolas, "Microsoft YaHei", monospace;
}

.quota-dialog {
  width: min(360px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 20px 64px rgba(16, 24, 40, 0.24);
}

.quota-dialog::backdrop {
  background: rgba(16, 24, 40, 0.28);
}

.quota-dialog form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.quota-dialog h2 {
  margin: 0;
  font-size: 18px;
}

.quota-dialog p {
  margin: 0;
  white-space: pre-line;
  color: #344054;
  font-size: 14px;
  line-height: 1.7;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
