:root {
  color-scheme: light;
  --ink: #090713;
  --paper: #fff8ea;
  --hot: #ff2e88;
  --blue: #3568ff;
  --cyan: #00d8ff;
  --lime: #b9ff1b;
  --yellow: #ffe84d;
  --orange: #ff7a00;
  --purple: #9b5cff;
  --shadow: 5px 5px 0 var(--ink);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1040px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(9, 7, 19, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(9, 7, 19, 0.06) 1px, transparent 1px),
    var(--paper);
  background-size: 24px 24px;
  font-size: 14px;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 12px 42px;
  border-bottom: 3px solid var(--ink);
  background: #ffffff;
}

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

.brand img {
  width: 42px;
  height: 42px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--yellow);
  box-shadow: 3px 3px 0 var(--ink);
}

.brand strong {
  display: block;
  font-size: 23px;
  line-height: 1;
}

.brand span {
  display: inline-flex;
  margin-top: 5px;
  padding: 2px 8px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--lime);
  font-weight: 900;
}

.nav-pill {
  display: flex;
  gap: 8px;
  padding: 5px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--cyan);
  box-shadow: 4px 4px 0 var(--ink);
}

.nav-item,
.bubble-button,
.pop-button,
.close-button {
  border: 3px solid var(--ink);
  color: var(--ink);
  font-weight: 950;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.nav-item {
  min-width: 112px;
  padding: 10px 18px;
  border-radius: 999px;
  background: #ffffff;
}

.nav-item.active {
  background: var(--purple);
  color: #ffffff;
}

.top-actions {
  justify-self: end;
  display: flex;
  gap: 10px;
}

.bubble-button {
  padding: 10px 17px;
  border-radius: 999px;
  box-shadow: 3px 3px 0 var(--ink);
}

.bubble-button.pink {
  background: #ffb4d5;
}

.bubble-button.blue {
  background: #b9c9ff;
}

.nav-item:hover,
.bubble-button:hover,
.pop-button:hover,
.close-button:hover,
.folder-button:hover,
.message-item:hover {
  transform: translate(-2px, -2px) rotate(-1deg);
  box-shadow: 5px 5px 0 var(--ink);
  filter: saturate(1.2);
}

main {
  width: min(1680px, calc(100% - 48px));
  margin: 20px auto 48px;
}

.view[hidden] {
  display: none;
}

.page-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.icon-burst {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: var(--hot);
  color: #ffffff;
  font-size: 26px;
  box-shadow: var(--shadow);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 32px;
}

.page-title p {
  margin-top: 5px;
  font-weight: 800;
  color: #594f73;
}

.panel {
  border: 3px solid var(--ink);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.dash-card,
.guide-card {
  position: relative;
  overflow: hidden;
}

.dash-card::after,
.guide-card::after {
  content: "";
  position: absolute;
  right: -34px;
  bottom: -42px;
  width: 104px;
  height: 104px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--cyan);
  opacity: 0.22;
  pointer-events: none;
}

.welcome-card {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(360px, 1fr);
  align-items: center;
  gap: 24px;
  min-height: 178px;
  padding: 20px 34px;
  background: #ffffff;
}

.total-card {
  min-height: 178px;
  padding: 20px 34px;
  background: #fff7fb;
}

.welcome-copy {
  min-width: 0;
}

.dash-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 10px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: var(--purple);
  color: #ffffff;
  font-size: 20px;
  font-weight: 1000;
  box-shadow: 4px 4px 0 var(--ink);
}

.dash-icon.small {
  width: 38px;
  height: 38px;
  margin-bottom: 0;
  border-radius: 15px;
  background: var(--yellow);
  color: var(--ink);
}

.dash-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dash-title h2,
.welcome-card h2,
.guide-card h2 {
  font-size: 22px;
}

.welcome-card h3 {
  margin: 12px 0 8px;
  color: var(--blue);
  font-size: 28px;
}

.welcome-card p,
.total-card p,
.guide-lines p {
  color: #493e61;
  font-weight: 800;
  line-height: 1.55;
}

.feature-list {
  display: grid;
  grid-template-columns: 1fr;
  justify-self: end;
  gap: 12px;
  margin: 0 28px 0 0;
  padding: 0;
  list-style: none;
  font-weight: 950;
}

.feature-list li {
  position: relative;
  padding-left: 34px;
}

.feature-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #69f0ae;
  color: var(--ink);
  font-size: 13px;
  line-height: 1;
}

.total-card strong {
  display: block;
  margin: 18px 0 10px;
  color: var(--blue);
  font-size: 68px;
  line-height: 0.9;
}

.guide-card {
  padding: 24px 34px;
}

.guide-lines {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
  margin-top: 18px;
}

.guide-lines p {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 10px;
  margin: 0;
  padding: 12px 14px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: #fffdf8;
}

.guide-lines span {
  min-width: 0;
}

.ad-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.ad-card {
  position: relative;
  display: block;
  min-height: 168px;
  padding: 22px 26px;
  border: 3px solid var(--ink);
  border-radius: 22px;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 4px 4px 0 var(--ink);
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.ad-card::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -42px;
  width: 112px;
  height: 112px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
}

.ad-card:hover {
  transform: translate(-2px, -2px) rotate(-0.5deg);
  box-shadow: 6px 6px 0 var(--ink);
  filter: saturate(1.1);
}

.ai-ad {
  background: linear-gradient(135deg, #b9ff1b 0%, #00d8ff 100%);
}

.plus-ad {
  background: linear-gradient(135deg, #ffb4d5 0%, #ffe84d 100%);
}

.ad-kicker {
  display: inline-flex;
  padding: 6px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #ffffff;
  font-weight: 950;
}

.ad-card h2 {
  position: relative;
  z-index: 1;
  margin: 14px 0 8px;
  font-size: 24px;
}

.ad-card p {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0;
  color: #20182f;
  font-weight: 800;
  line-height: 1.6;
}

.ad-cta {
  position: relative;
  z-index: 1;
  display: inline-flex;
  margin-top: 16px;
  padding: 8px 14px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #ffffff;
  font-weight: 1000;
}

.import-panel {
  padding: 24px;
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.panel-heading h2 {
  font-size: 20px;
}

.mini-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--yellow);
  font-weight: 1000;
}

.import-grid {
  display: grid;
  grid-template-columns: 260px 320px 1fr;
  gap: 14px;
  align-items: end;
}

label span {
  display: block;
  margin-bottom: 7px;
  font-weight: 950;
}

input,
textarea {
  width: 100%;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: #fffdf8;
  color: var(--ink);
  outline: none;
  box-shadow: 3px 3px 0 var(--ink);
}

input {
  height: 46px;
  padding: 0 15px;
  font-weight: 850;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  padding: 0;
  margin: 0;
  border: 2px solid var(--ink);
  border-radius: 4px;
  box-shadow: none;
  accent-color: var(--purple);
  vertical-align: middle;
}

textarea {
  display: none;
  min-height: 104px;
  margin-top: 16px;
  padding: 14px 16px;
  resize: vertical;
}

textarea.visible {
  display: block;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pop-button {
  min-height: 46px;
  padding: 0 14px;
  border-radius: 17px;
  box-shadow: 3px 3px 0 var(--ink);
  white-space: nowrap;
}

.primary {
  background: var(--blue);
  color: #ffffff;
}

.green {
  background: #69f0ae;
}

.orange {
  background: #ffb347;
}

.danger {
  background: #ff6a6a;
}

.purple {
  background: var(--purple);
  color: #ffffff;
}

.neutral {
  background: #ffffff;
}

.drop-zone {
  margin-top: 20px;
  padding: 16px;
  border: 3px dashed var(--ink);
  border-radius: 20px;
  background: #f5f2ff;
  text-align: center;
  font-weight: 950;
}

.drop-zone.dragging {
  background: var(--lime);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.stat-card {
  padding: 18px 22px;
  border: 3px solid var(--ink);
  border-radius: 22px;
  box-shadow: 4px 4px 0 var(--ink);
}

.stat-card span {
  display: block;
  font-weight: 950;
}

.stat-card strong {
  display: block;
  margin-top: 5px;
  font-size: 32px;
}

.stat-card.yellow {
  background: var(--yellow);
}

.stat-card.cyan {
  background: var(--cyan);
}

.stat-card.lime {
  background: var(--lime);
}

.account-panel {
  overflow: hidden;
}

.table-heading {
  justify-content: space-between;
  padding: 20px 24px 0;
}

.table-heading > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status {
  max-width: 560px;
  padding: 7px 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow);
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-wrap {
  overflow: auto;
}

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

th,
td {
  padding: 12px;
  border-top: 2px solid var(--ink);
  text-align: left;
  vertical-align: middle;
}

th {
  background: #ffe1ef;
  font-size: 14px;
}

td {
  background: #ffffff;
  font-weight: 820;
}

th:nth-child(1),
td:nth-child(1) {
  width: 44px;
}

th:nth-child(2),
td:nth-child(2) {
  width: 46px;
}

th:nth-child(3),
td:nth-child(3) {
  width: 280px;
}

th:nth-child(4),
td:nth-child(4) {
  width: 150px;
}

th:nth-child(5),
td:nth-child(5) {
  width: 260px;
}

th:nth-child(6),
td:nth-child(6) {
  width: 240px;
}

th:nth-child(7),
td:nth-child(7) {
  width: 180px;
}

th:nth-child(8),
td:nth-child(8) {
  width: 210px;
}

.clip {
  display: inline-flex;
  max-width: calc(100% - 32px);
  padding: 6px 9px;
  border: 2px solid var(--ink);
  border-radius: 11px;
  background: #f1f1f1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.copy {
  width: 24px;
  height: 24px;
  margin-left: 6px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--cyan);
  font-weight: 1000;
}

.status-pill {
  display: inline-flex;
  max-width: 100%;
  padding: 6px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #e6ffbc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.small-button {
  padding: 7px 10px;
  border: 2px solid var(--ink);
  border-radius: 11px;
  background: #dfe5ff;
  font-weight: 950;
}

.small-button.danger {
  background: #ffc5c5;
}

.mail-window {
  width: min(1480px, calc(100vw - 64px));
  max-width: calc(100vw - 64px);
  padding: 0;
  border: 3px solid var(--ink);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.mail-window::backdrop {
  background: rgba(9, 7, 19, 0.48);
}

.window-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.window-button {
  height: 36px;
  padding: 0 14px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--cyan);
  color: var(--ink);
  font-weight: 950;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.window-button:hover {
  transform: translate(-2px, -2px) rotate(-1deg);
  box-shadow: 5px 5px 0 var(--ink);
  filter: saturate(1.2);
}

.refresh-window {
  background: var(--yellow);
}

.mail-drawer {
  display: none;
  margin-top: 24px;
  border: 3px solid var(--ink);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.mail-drawer.open {
  display: block;
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 3px solid var(--ink);
  background: var(--lime);
}

.drawer-head h2 {
  font-size: 23px;
}

.drawer-head p {
  margin-top: 6px;
  font-weight: 850;
}

.close-button {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #ffffff;
  font-size: 23px;
  line-height: 1;
}

.mail-layout {
  display: grid;
  grid-template-columns: 180px 360px 1fr;
  min-height: 460px;
}

.folder-list,
.message-list,
.message-view {
  min-height: 460px;
  max-height: 620px;
  overflow: auto;
}

.folder-list {
  padding: 14px;
  border-right: 3px solid var(--ink);
  background: #e8fbff;
}

.folder-button {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 9px;
  padding: 10px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 3px 3px 0 var(--ink);
  font-weight: 950;
}

.folder-button.active {
  background: var(--yellow);
}

.message-list {
  border-right: 3px solid var(--ink);
  background: #fff7fb;
}

.message-item {
  width: 100%;
  padding: 12px;
  border: 0;
  border-bottom: 2px solid var(--ink);
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.message-item.active {
  background: #d9ff68;
}

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

.message-item p {
  display: -webkit-box;
  margin-top: 6px;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: #493e61;
  font-weight: 750;
}

.message-view {
  padding: 20px;
}

.message-view h3 {
  margin: 0 0 10px;
  font-size: 23px;
}

.meta-line {
  margin-bottom: 6px;
  font-weight: 850;
  color: #493e61;
}

.body-text {
  margin-top: 16px;
  padding: 16px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: #fffdf2;
  white-space: pre-wrap;
  line-height: 1.65;
  font-weight: 650;
}

.empty-state {
  display: grid;
  min-height: 240px;
  place-items: center;
  border: 3px dashed var(--ink);
  border-radius: 20px;
  background: #f2f5ff;
  font-size: 18px;
  font-weight: 950;
}

dialog {
  width: 640px;
  max-width: calc(100vw - 48px);
  border: 3px solid var(--ink);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

dialog.mail-window {
  width: min(1480px, calc(100vw - 64px));
  max-width: calc(100vw - 64px);
  border-radius: 24px;
}

dialog::backdrop {
  background: rgba(9, 7, 19, 0.45);
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.feedback-wrap {
  position: relative;
}

.feedback-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 20;
  width: 260px;
  padding: 14px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: #fff7fb;
  box-shadow: 5px 5px 0 var(--ink);
}

.feedback-popover[hidden] {
  display: none;
}

.feedback-popover::before {
  content: "";
  position: absolute;
  top: -10px;
  right: 34px;
  width: 16px;
  height: 16px;
  border-left: 3px solid var(--ink);
  border-top: 3px solid var(--ink);
  background: #fff7fb;
  transform: rotate(45deg);
}

.feedback-popover-title {
  margin-bottom: 10px;
  font-weight: 1000;
}

.feedback-popover img {
  display: block;
  width: 100%;
  margin: 0 auto;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: #ffffff;
}

pre {
  padding: 16px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: #10101a;
  color: #b9ff1b;
  overflow: auto;
}

@media (max-width: 1180px) {
  body {
    min-width: 0;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px 20px;
  }

  .nav-pill,
  .top-actions {
    justify-self: stretch;
  }

  .nav-item,
  .bubble-button {
    flex: 1;
  }

  main {
    width: min(100% - 32px, 980px);
  }

  .dashboard-grid,
  .ad-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .welcome-card {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .feature-list {
    grid-template-columns: repeat(3, max-content);
    justify-self: start;
    margin: 0;
  }

  .guide-lines {
    grid-template-columns: 1fr;
  }

  .import-grid {
    grid-template-columns: 220px 1fr;
  }

  .button-row {
    grid-column: 1 / -1;
  }

  table {
    min-width: 1420px;
  }

  dialog.mail-window {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
  }

  .mail-layout {
    grid-template-columns: 150px 320px 1fr;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 13px;
    background-size: 18px 18px;
  }

  .topbar {
    position: static;
    padding: 10px 14px;
  }

  .brand strong {
    font-size: 20px;
  }

  .brand img {
    width: 38px;
    height: 38px;
  }

  .nav-pill {
    border-radius: 18px;
  }

  .nav-item {
    min-width: 0;
    padding: 9px 10px;
  }

  main {
    width: calc(100% - 20px);
    margin: 14px auto 30px;
  }

  .panel,
  .ad-card,
  .mail-window {
    border-radius: 18px;
  }

  .welcome-card,
  .total-card,
  .guide-card,
  .import-panel {
    padding: 18px;
  }

  .dash-card::after,
  .guide-card::after,
  .ad-card::after {
    width: 76px;
    height: 76px;
    right: -28px;
    bottom: -28px;
  }

  .dash-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }

  .welcome-card h3 {
    font-size: 24px;
  }

  .feature-list {
    grid-template-columns: 1fr;
  }

  .total-card strong {
    font-size: 54px;
  }

  .guide-lines p {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .ad-card {
    min-height: 0;
    padding: 18px;
  }

  .ad-card h2 {
    font-size: 20px;
  }

  .page-title {
    align-items: flex-start;
  }

  .icon-burst {
    width: 44px;
    height: 44px;
    border-radius: 15px;
    font-size: 22px;
  }

  h1 {
    font-size: 26px;
  }

  .import-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .button-row {
    grid-column: auto;
  }

  .pop-button {
    flex: 1 1 calc(50% - 10px);
    min-width: 130px;
  }

  .table-heading {
    display: grid;
    gap: 12px;
    padding: 18px 18px 0;
  }

  .status {
    max-width: 100%;
  }

  table {
    min-width: 1180px;
  }

  dialog.mail-window {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .drawer-head {
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
  }

  .drawer-head h2 {
    font-size: 20px;
  }

  .window-actions {
    flex-shrink: 0;
  }

  .mail-layout {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .folder-list {
    display: flex;
    gap: 10px;
    min-height: 0;
    max-height: none;
    padding: 12px;
    border-right: 0;
    border-bottom: 3px solid var(--ink);
    overflow-x: auto;
  }

  .folder-button {
    min-width: 130px;
    margin-bottom: 0;
  }

  .message-list {
    min-height: 180px;
    max-height: 230px;
    border-right: 0;
    border-bottom: 3px solid var(--ink);
  }

  .message-view {
    min-height: 260px;
    max-height: calc(100vh - 500px);
    padding: 16px;
  }
}

@media (max-width: 420px) {
  .top-actions,
  .nav-pill {
    flex-direction: column;
  }

  .pop-button {
    flex-basis: 100%;
  }

  .drawer-head {
    display: grid;
  }

  .window-actions {
    justify-self: end;
  }

  .message-view {
    max-height: 320px;
  }
}
