:root {
  color-scheme: light;
  --ink: #17211c;
  --muted: #657169;
  --paper: #f3f1e9;
  --card: #fffdf7;
  --line: #d8d8cc;
  --accent: #176b4d;
  --accent-dark: #0d4f38;
  --accent-soft: #dcece4;
  --danger: #a1372a;
  --warning: #755600;
  --shadow: 0 20px 60px rgba(33, 45, 37, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(rgba(23, 107, 77, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 107, 77, 0.045) 1px, transparent 1px),
    var(--paper);
  background-size: 34px 34px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 28px;
}

.login-panel {
  width: min(470px, 100%);
  margin: clamp(42px, 10vh, 120px) auto;
  padding: clamp(28px, 6vw, 52px);
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(255, 253, 247, 0.94);
  box-shadow: var(--shadow);
}

.brand-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  margin-bottom: 30px;
  border-radius: 16px 16px 16px 4px;
  color: white;
  background: var(--accent);
  font-weight: 850;
  letter-spacing: -0.04em;
}

.eyebrow,
.step-label {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.login-panel h1 {
  font-size: clamp(2.1rem, 8vw, 3.2rem);
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  letter-spacing: -0.035em;
}

h3 {
  margin-bottom: 18px;
  font-size: 1.3rem;
}

.intro {
  margin-bottom: 30px;
  color: var(--muted);
  line-height: 1.65;
}

.stack {
  display: grid;
  gap: 18px;
}

label {
  display: grid;
  gap: 8px;
  color: #35433a;
  font-size: 0.9rem;
  font-weight: 720;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #c8ccc4;
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: #fff;
  padding: 13px 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea {
  resize: vertical;
  line-height: 1.55;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(23, 107, 77, 0.12);
}

.captcha-row,
.action-row,
.account,
.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.captcha-row input {
  flex: 1;
}

.primary-button,
.secondary-button,
.quiet-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 780;
  text-decoration: none;
}

.primary-button {
  border: 1px solid var(--accent);
  color: #fff;
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(23, 107, 77, 0.18);
}

.primary-button:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.secondary-button {
  border: 1px solid var(--accent);
  color: var(--accent-dark);
  background: transparent;
}

.quiet-button {
  border: 1px solid var(--line);
  color: #3d4b42;
  background: #fff;
}

.message {
  min-height: 1.4em;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.message[data-tone="error"] {
  color: var(--danger);
}

.message[data-tone="success"] {
  color: var(--accent-dark);
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 4px 34px;
}

.topbar h1 {
  margin-bottom: 0;
}

.account {
  color: var(--muted);
  font-size: 0.86rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.7fr);
  gap: 22px;
  align-items: start;
}

.card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 253, 247, 0.95);
  box-shadow: 0 12px 40px rgba(33, 45, 37, 0.06);
}

.publish-card {
  padding: clamp(24px, 4vw, 42px);
}

.publish-lock {
  margin-bottom: 24px;
  border: 1px solid #dfc87d;
  border-radius: 13px;
  color: var(--warning);
  background: #fff8dc;
  padding: 13px 15px;
  font-size: 0.86rem;
  line-height: 1.55;
}

.sites-card {
  position: sticky;
  top: 22px;
  padding: 26px;
}

.section-heading {
  justify-content: space-between;
  margin-bottom: 30px;
}

.count-chip {
  flex: 0 0 auto;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  padding: 9px 13px;
  font-size: 0.8rem;
}

.role-chip {
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  padding: 6px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.domain-input {
  display: flex;
  align-items: center;
  border: 1px solid #c8ccc4;
  border-radius: 12px;
  background: white;
  overflow: hidden;
}

.domain-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(23, 107, 77, 0.12);
}

.domain-input input {
  min-width: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.domain-input small {
  padding-right: 13px;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 600;
  white-space: nowrap;
}

.file-drop {
  place-items: center;
  border: 1px dashed #aeb8ae;
  border-radius: 16px;
  background: #f9faf5;
  padding: 28px 18px;
  cursor: pointer;
  text-align: center;
}

.file-drop:hover {
  border-color: var(--accent);
  background: #f4f9f5;
}

.file-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-drop-title {
  color: var(--accent-dark);
  font-size: 1rem;
}

.file-drop small,
.rules,
.empty-state {
  color: var(--muted);
  font-weight: 480;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-weight: 520;
  line-height: 1.55;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.rules {
  border-left: 3px solid #b7c8bc;
  padding: 5px 0 5px 16px;
  font-size: 0.84rem;
  line-height: 1.55;
}

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

.review-box {
  margin-top: 28px;
  border: 1px solid #b8d5c5;
  border-radius: 18px;
  background: #f3faf5;
  padding: 24px;
}

.report-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 0 22px;
}

.report-list div {
  border-radius: 12px;
  background: white;
  padding: 13px;
}

.report-list dt {
  color: var(--muted);
  font-size: 0.74rem;
}

.report-list dd {
  margin: 5px 0 0;
  font-weight: 750;
}

.action-row {
  flex-wrap: wrap;
}

.site-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.management-card {
  padding: 26px;
}

.review-list,
.user-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.review-item,
.user-item {
  border-top: 1px solid var(--line);
  padding: 15px 0 5px;
}

.review-item header,
.user-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.review-item small,
.user-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.review-item .action-row {
  margin-top: 12px;
}

.compact-form {
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
}

.site-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 15px 0 5px;
}

.site-item strong,
.site-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-item small {
  margin-top: 4px;
  color: var(--muted);
}

.site-item a {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 750;
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .sites-card {
    position: static;
  }
}

@media (max-width: 620px) {
  .shell {
    padding: 14px;
  }

  .topbar,
  .section-heading {
    align-items: flex-start;
  }

  .topbar {
    flex-direction: column;
  }

  .account {
    width: 100%;
    justify-content: space-between;
  }

  .two-columns,
  .report-list {
    grid-template-columns: 1fr;
  }

  .domain-input small {
    display: none;
  }

  .count-chip {
    display: none;
  }
}
