:root {
  --bg: #f2eee6;
  --ink: #1f2a2d;
  --accent: #006d77;
  --accent-soft: #83c5be;
  --panel: #fffdf8;
  --warn: #c04a2c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at top right, #ffe8d6, var(--bg));
  color: var(--ink);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.hero {
  padding: 1.5rem 2rem;
  background: linear-gradient(120deg, var(--accent), #1b4965);
  color: #fff;
}

.hero-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.hero h1 {
  margin: 0;
  font-size: 1.7rem;
}

.hero p {
  margin: 0.45rem 0 0;
}

.auth-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.auth-bar button {
  width: auto;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
}

.auth-bar button.primary {
  background: #fff;
  color: var(--accent);
}

.auth-bar button.primary:hover {
  background: #e8f4f8;
}

.user-info {
  font-size: 0.85rem;
  opacity: 0.9;
}

.layout {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  grid-template-columns: minmax(280px, 380px) 1fr;
}

.verify-panel {
  grid-column: 1 / -1;
}

.panel {
  background: var(--panel);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.07);
  padding: 1rem;
}

label {
  display: block;
  margin-top: 0.7rem;
  margin-bottom: 0.3rem;
  font-size: 0.92rem;
  font-weight: 600;
}

input,
select,
button {
  width: 100%;
  border: 1px solid #d8d2c8;
  border-radius: 8px;
  font-size: 0.95rem;
  padding: 0.62rem;
}

button {
  cursor: pointer;
  background: var(--accent);
  border: none;
  color: #fff;
  font-weight: 600;
  transition: all 0.25s ease;
}

button:hover:not(:disabled) {
  background: #005665;
  box-shadow: 0 4px 12px rgba(0, 109, 119, 0.3);
}

button:disabled {
  cursor: not-allowed;
  background: #9ca3a8;
  opacity: 0.7;
}

button.secondary {
  background: #5f6b73;
}

.actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.55rem;
}

.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  width: 100%;
  border: 1px solid #d8d2c8;
  border-radius: 8px;
  font-size: 0.95rem;
  padding: 0.62rem;
  background: #5f6b73;
  color: #fff;
  font-weight: 600;
}

.action-link:hover {
  background: #4f5a61;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.checkbox input {
  width: auto;
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.list-header button {
  width: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.8rem;
}

th,
td {
  text-align: left;
  padding: 0.55rem;
  border-bottom: 1px solid #ece8de;
  vertical-align: top;
}

th {
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #4e5a5f;
}

td .row-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

td .row-actions button {
  width: auto;
  padding: 0.4rem 0.6rem;
  font-size: 0.84rem;
}

.device-search {
  width: 100%;
  margin-top: 0.8rem;
  margin-bottom: 0.6rem;
  padding: 0.6rem;
  border: 1px solid #d8d2c8;
  border-radius: 6px;
  font-size: 0.9rem;
  background: #fafaf8;
}

.device-search::placeholder {
  color: #999;
}

.device-search:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(0, 109, 119, 0.1);
}

.device-filter-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.6rem;
  margin-top: 0.2rem;
  flex-wrap: wrap;
}

.device-filter-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #4e5a5f;
}

.inline-radio {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.88rem;
  font-weight: 500;
}

.inline-radio input {
  width: auto;
  margin: 0;
}

.device-filter-count {
  margin: 0.1rem 0 0.5rem;
  font-size: 0.86rem;
  color: #4e5a5f;
  font-weight: 600;
}

.table-scroll-container {
  max-height: 28rem;
  overflow-y: auto;
  border: 1px solid #ece8de;
  border-radius: 6px;
  margin-top: 0.4rem;
}

.table-scroll-container table {
  margin-top: 0;
  border-radius: 0;
}

.table-scroll-container thead {
  position: sticky;
  top: 0;
  background: #f9f7f3;
  z-index: 10;
}

.status {
  margin-top: 0.4rem;
  color: var(--warn);
  min-height: 1.2rem;
  padding: 0.5rem;
  border-radius: 6px;
  font-size: 0.95rem;
}

.verify-status {
  background: #f0f4f6;
  border-left: 3px solid var(--accent);
  color: var(--ink);
}

.verify-status.loading {
  background: #e8f4f8;
  border-left-color: #ff9500;
  color: #1f5c7a;
  animation: pulse-glow 1.5s ease-in-out infinite;
}

.verify-status.impacted {
  background: #fdebec;
  border-left-color: #cf3f4f;
  color: #7a1f2a;
}

.summary-link {
  color: #1d4ed8;
  text-decoration: underline;
  word-break: break-all;
}

.challenge-notice {
  margin-top: 0.6rem;
  padding: 0.7rem;
  border-radius: 8px;
  border-left: 4px solid #d97706;
  background: #fff7ed;
  color: #7c2d12;
  font-size: 0.92rem;
}

.challenge-notice a {
  color: #1d4ed8;
  font-weight: 600;
}

@keyframes pulse-glow {
  0%, 100% {
    background: #e8f4f8;
    box-shadow: inset 0 0 0 1px rgba(255, 149, 0, 0.2);
  }
  50% {
    background: #ddf0f7;
    box-shadow: inset 0 0 0 1px rgba(255, 149, 0, 0.4);
  }
}

.hidden {
  display: none !important;
}

/* Sign-in gate */
.signin-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top right, #ffe8d6, var(--bg));
}

.signin-card {
  background: var(--panel);
  border-radius: 12px;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.12);
  padding: 3rem 2.5rem;
  max-width: 420px;
  width: 90%;
  text-align: center;
}

.signin-card h1 {
  margin: 0 0 0.3rem;
  font-size: 2rem;
  color: var(--accent);
}

.signin-card > p {
  margin: 0.3rem 0;
  color: var(--ink);
}

.signin-hint {
  margin: 1.2rem 0 1.6rem !important;
  font-size: 0.9rem;
  color: #555;
}

.signin-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
}

.signin-error {
  margin-top: 1rem;
  color: var(--warn);
  font-size: 0.9rem;
}

.verify-form {
  margin-top: 0.4rem;
}

.verify-options-grid {
  margin-top: 0.7rem;
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.verify-result {
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid #ece8de;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.55rem;
}

.summary-grid div {
  display: flex;
  flex-direction: column;
  padding: 0.5rem;
  background: #f9f4ec;
  border: 1px solid #ebe3d8;
  border-radius: 8px;
}

.summary-grid strong {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #4f5e63;
}

.summary-grid span {
  margin-top: 0.2rem;
  font-weight: 600;
}

.verify-reason {
  margin: 0.8rem 0 0;
}

.snips {
  margin-top: 0.5rem;
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.snip-card {
  border: 1px solid #ece8de;
  border-radius: 10px;
  padding: 0.6rem;
  background: #fff;
}

.snip-card h4 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
}

.snip-card img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #e4ddd2;
  display: block;
  background: #f5f2ec;
}

.muted {
  margin-top: 0.45rem;
  color: #617177;
  font-size: 0.85rem;
}

.raw-response {
  margin-top: 0.5rem;
  background: #13242b;
  color: #d2e6ee;
  border-radius: 10px;
  padding: 0.8rem;
  overflow: auto;
  max-height: 360px;
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .verify-panel {
    grid-column: auto;
  }
}
