* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: #f5f7fb;
  color: #0f172a;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px;
}

h1,
h2,
h3 {
  margin-top: 0;
}

h4 {
  margin: 20px 0 8px;
}

.panel {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 16px;
  margin-bottom: 16px;
}

form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
}

input,
textarea,
select,
button {
  font: inherit;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
}

button {
  background: #2563eb;
  color: #fff;
  border: none;
  cursor: pointer;
}

button:hover {
  background: #1d4ed8;
}

.list {
  display: grid;
  gap: 8px;
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.mode-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}

.automation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.metric {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}

.progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #dbeafe;
  overflow: hidden;
  margin: 6px 0;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: #2563eb;
  transition: width 250ms ease-in-out;
}

.site-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}

.hidden {
  display: none;
}

.auth-panel {
  max-width: 420px;
  margin: 48px auto 0;
}

.auth-error {
  color: #b91c1c;
  font-size: 14px;
}

.app-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.session-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

#logout-button {
  background: #475569;
}

#logout-button:hover {
  background: #334155;
}

pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px;
  border-radius: 8px;
  overflow: auto;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}

.headers-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  table-layout: fixed;
}

.headers-table th,
.headers-table td {
  text-align: left;
  vertical-align: top;
  padding: 10px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
  overflow: hidden;
}

.headers-table th:nth-child(1),
.headers-table td:nth-child(1) {
  width: 80px;
}

.headers-table th:nth-child(2),
.headers-table td:nth-child(2) {
  width: 30%;
}

.headers-table th:nth-child(3),
.headers-table td:nth-child(3) {
  width: 30%;
}

.headers-table th:nth-child(4),
.headers-table td:nth-child(4) {
  width: 30%;
}

.headers-table th {
  background: #f8fafc;
  font-weight: 600;
}

.headers-table tr:last-child td {
  border-bottom: none;
}

.status-chip {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
}

.status-chip.secure {
  background: #dcfce7;
  color: #166534;
}

.status-chip.unsafe {
  background: #fed7aa;
  color: #9a3412;
}

.expandable-text {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.expandable-text.is-collapsed {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.expandable-text.is-collapsed:hover {
  text-decoration: underline;
}

.expandable-text.is-expanded {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  cursor: pointer;
}
