:root {
  --bg: #f4f7fb;
  --panel: #fff;
  --ink: #172033;
  --muted: #667085;
  --line: #d9e2ef;
  --primary: #165dff;
  --primary-dark: #0b3fb3;
  --danger: #b42318;
  --green: #12805c;
  --shadow: 0 18px 60px rgba(23, 32, 51, .12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 6vw;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.topbar nav {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 1.1rem;
}

.brand span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #e7f8f1;
  color: var(--green);
  font-size: .68rem;
  letter-spacing: .04em;
}

.btn,
button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.btn.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.btn.primary:hover {
  background: var(--primary-dark);
}

.btn.small {
  min-height: 34px;
  padding: 0 12px;
  font-size: .9rem;
}

.btn.danger,
.danger {
  color: var(--danger);
}

.public-main {
  width: min(1180px, 88vw);
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
  gap: 56px;
  align-items: center;
  min-height: calc(100vh - 72px);
  padding: 54px 0;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--primary);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .8rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(3rem, 8vw, 6.8rem);
  line-height: .9;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 720px;
  margin: 24px 0;
  color: #475467;
  font-size: 1.25rem;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.device-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.epaper-preview {
  display: grid;
  align-content: center;
  min-height: 360px;
  aspect-ratio: 600 / 448;
  padding: 36px;
  border: 16px solid #20283a;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(0, 0, 0, .08) 1px, transparent 1px),
    linear-gradient(135deg, #fff 0 28%, #fff238 28% 54%, #ff7e00 54% 72%, #6440ff 72% 100%);
  background-size: 28px 28px, 28px 28px, auto;
  color: #111827;
}

.epaper-preview span,
.epaper-preview em {
  font-style: normal;
  font-weight: 900;
}

.epaper-preview strong {
  display: block;
  max-width: 380px;
  margin: 12px 0;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
}

.feature-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 18px 0 56px;
}

.feature-band article,
.panel,
.auth-card,
.design-card,
.asset-card,
.stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 32px rgba(23, 32, 51, .08);
}

.feature-band article,
.panel {
  padding: 24px;
}

.feature-band h2,
.panel h2 {
  margin: 0 0 10px;
}

.feature-band p,
.panel p,
.page-head p {
  color: var(--muted);
  line-height: 1.5;
}

.auth-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 32px;
}

.auth-card {
  display: grid;
  gap: 14px;
  width: min(440px, 100%);
  padding: 28px;
}

.auth-card h1 {
  margin: 0;
}

.auth-card p {
  margin: 0;
  color: var(--muted);
}

label {
  display: grid;
  gap: 7px;
  font-weight: 800;
  color: #344054;
}

input,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
}

.notice {
  padding: 12px;
  border: 1px solid #a6f4c5;
  border-radius: 8px;
  background: #ecfdf3;
  color: #067647;
  font-weight: 800;
}

.notice.danger {
  border-color: #fecdca;
  background: #fff5f4;
  color: var(--danger);
}

.app-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100vh;
  padding: 24px 18px;
  background: #111827;
  color: #fff;
}

.sidebar nav {
  display: grid;
  gap: 8px;
}

.sidebar nav a,
.logout {
  padding: 11px 12px;
  border-radius: 8px;
  color: #d7deea;
  font-weight: 800;
}

.sidebar nav a:hover,
.logout:hover {
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

.logout {
  margin-top: auto;
}

.main {
  min-width: 0;
  padding: 34px;
}

.designer-main {
  padding: 24px;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.page-head.compact {
  margin-bottom: 14px;
}

.page-head h1 {
  margin: 0;
  font-size: 2.2rem;
}

.page-head p {
  margin: 6px 0 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat {
  padding: 20px;
}

.stat span {
  display: block;
  color: var(--muted);
  font-weight: 900;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 2.5rem;
}

.card-grid,
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.design-card {
  padding: 14px;
}

.design-card h2 {
  margin: 12px 0 4px;
  font-size: 1.08rem;
}

.design-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: .9rem;
}

.thumb {
  display: grid;
  place-items: center;
  aspect-ratio: 600 / 448;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: repeating-conic-gradient(#eef2f7 0 25%, #fff 0 50%) 50% / 28px 28px;
  overflow: hidden;
  color: var(--muted);
  font-weight: 900;
}

.thumb img,
.asset-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.card-actions form {
  margin: 0;
}

.form-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.form-stack {
  display: grid;
  gap: 14px;
  max-width: 620px;
}

.asset-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.asset-card img {
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.asset-card strong,
.asset-card span {
  display: block;
  overflow-wrap: anywhere;
}

.asset-card span {
  color: var(--muted);
  font-size: .86rem;
}

.link {
  border: 0;
  background: none;
  padding: 0;
  font-weight: 900;
  cursor: pointer;
}

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

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

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

td span {
  color: var(--muted);
}

code {
  display: block;
  max-width: 100%;
  overflow: auto;
  padding: 12px;
  border-radius: 8px;
  background: #101828;
  color: #e6edf7;
}

.empty {
  color: var(--muted);
}

@media (max-width: 900px) {
  .hero,
  .feature-band,
  .app-shell,
  .stats {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .main,
  .designer-main {
    padding: 18px;
  }

  .page-head,
  .form-row {
    align-items: stretch;
    flex-direction: column;
  }
}
