/* Page canvas. Light on purpose, so the two white previews stay readable. */

* {
  box-sizing: border-box;
}

/* Author display rules must not bring a hidden block back. */
[hidden] {
  display: none !important;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  background: #e7e2d8;
  color: #1c1916;
  font-family: "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

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

button {
  cursor: pointer;
}

.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 28px 56px;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  align-items: end;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6d675f;
}

h1 {
  margin: 0;
  font-family: "Palatino Linotype", Palatino, "Times New Roman", serif;
  font-size: 40px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
}

.intro {
  max-width: 360px;
  margin: 0;
  color: #5e584f;
}

/* One horizontal ad, under the title, out of the profile previews. */
.ad-banner {
  margin: 0 0 28px;
}

.ad-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6d675f;
}

.ad-slot {
  max-width: 728px;
  min-height: 90px;
}

.layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

/* Left column: the batch. */

.panel {
  background: #f6f3ed;
  border: 1px solid #ddd6ca;
  border-radius: 18px;
  padding: 16px;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.dropzone {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  min-height: 112px;
  border: 1.5px dashed #b7b0a4;
  border-radius: 14px;
  background: #fbfaf6;
  text-align: center;
}

.dropzone strong {
  font-size: 16px;
}

.dropzone span,
.status {
  color: #6d675f;
  font-size: 14px;
}

.dropzone.is-over {
  border-color: #1e3d32;
  background: #e7f0eb;
}

.dropzone:focus-visible,
button:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 2px solid #1e3d32;
  outline-offset: 2px;
}

.status {
  min-height: 1.2em;
  margin: 10px 2px;
}

.mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  margin-bottom: 14px;
  background: #ebe6dc;
  border-radius: 12px;
}

.mode button {
  border: 0;
  border-radius: 9px;
  padding: 8px 10px;
  background: transparent;
}

.mode button[aria-pressed="true"] {
  background: #1e3d32;
  color: #f4f1ea;
}

.fields,
.post-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #5e584f;
}

textarea,
input[type="text"] {
  width: 100%;
  border: 1px solid #ddd6ca;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  resize: vertical;
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.post-row {
  display: grid;
  grid-template-columns: auto 64px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 8px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid transparent;
}

.post-row.is-selected {
  border-color: #1e3d32;
}

.post-tools {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.post-tools button,
.duplicate,
.mirror,
.remove,
.clear {
  border: 1px solid #ddd6ca;
  border-radius: 8px;
  background: #fbfaf6;
}

.handle {
  padding: 4px 6px;
  cursor: grab;
  letter-spacing: -1px;
}

.post-tools button {
  padding: 2px 6px;
}

.post-tools button:disabled {
  opacity: 0.35;
  cursor: default;
}

.thumb-button {
  width: 64px;
  height: 64px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #e6e2da;
}

.thumb-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.post-body {
  min-width: 0;
}

.post-index,
.post-name {
  margin: 0;
}

.post-index {
  font-size: 13px;
  color: #6d675f;
}

.post-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.post-fields {
  margin-top: 8px;
}

.post-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.duplicate {
  padding: 2px 6px;
  font-size: 11px;
  line-height: 1.2;
}

.mirror,
.remove {
  padding: 6px 8px;
  font-size: 13px;
}

.clear {
  width: 100%;
  margin-top: 14px;
  padding: 10px 12px;
}

/* Desktop preview, then the phone under it. */

.stage {
  display: flex;
  flex-direction: column;
  gap: 36px;
  align-items: stretch;
}

.preview-label {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6d675f;
}

.upload-note {
  margin: 0;
  max-width: 42rem;
  color: #5e584f;
  font-size: 14px;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.save-copy {
  width: 100%;
  margin: 0 0 14px;
  padding: 12px;
  border: 0;
  border-radius: 10px;
  background: #1e3d32;
  color: #f4f1ea;
}

.phone {
  width: min(418px, 100%);
  padding: 12px;
  border-radius: 40px;
  background: #161616;
  box-shadow: 0 18px 40px rgba(30, 24, 16, 0.18);
}

.phone-screen {
  height: 700px;
  overflow: auto;
  background: #fff;
  border-radius: 30px;
}

.browser {
  background: #fff;
  border: 1px solid #d9d3c7;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(30, 24, 16, 0.1);
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  background: #f3f0ea;
  border-bottom: 1px solid #e4ded4;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c9c2b6;
}

.url {
  margin-left: 8px;
  color: #6d675f;
  font-size: 13px;
}

.browser-page {
  max-height: 860px;
  overflow: auto;
  background: #fff;
}

/* Instagram profile chrome. The grid rules below are the part that has to match. */

.ig {
  color: #000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.avatar {
  flex: none;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 38%, #cfcfcf 0 18%, transparent 19%),
    radial-gradient(circle at 50% 78%, #cfcfcf 0 28%, transparent 29%),
    #efefef;
}

.avatar-desktop {
  width: 150px;
  height: 150px;
}

.avatar-mobile {
  width: 86px;
  height: 86px;
}

.ig-username,
.ig-display,
.ig-stats-line {
  margin: 0;
}

.ig-username {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
}

.ig-username-desktop {
  margin-bottom: 12px;
  font-size: 20px;
  font-weight: 500;
}

.ig-display {
  font-size: 14px;
  font-weight: 600;
}

.ig-desktop {
  max-width: 935px;
  margin: 0 auto;
}

.ig-desktop-head {
  display: flex;
  gap: 72px;
  align-items: center;
  padding: 28px 20px 20px;
}

.ig-stats-line {
  display: flex;
  gap: 28px;
  font-size: 16px;
}

.ig-stats-line strong {
  font-weight: 600;
}

.ig-mobile-bar {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 14px;
}

.ig-mobile-head {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 16px;
  align-items: center;
  padding: 8px 16px 10px;
}

.ig-stats-mobile {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: center;
}

.ig-stats-mobile strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
}

.ig-stats-mobile span {
  font-size: 13px;
}

.ig-display-mobile {
  padding: 0 16px 12px;
}

.ig-tabs {
  color: #737373;
  border-top: 1px solid #dbdbdb;
}

.ig-tab {
  display: grid;
  place-items: center;
  height: 44px;
}

.ig-tab.is-active {
  color: #000;
  box-shadow: inset 0 1px 0 #000;
}

.ig-tabs-desktop {
  display: flex;
  justify-content: center;
  gap: 60px;
}

.ig-tabs-mobile {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

/* Profile grid since January 2025: 3 columns, 3:4, center crop, about 2px of gap.
   The home feed is a single column, up to 4:5. This preview is the profile. */

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #fff;
}

.grid-mobile,
.grid-desktop {
  gap: 2px;
}

.cell {
  aspect-ratio: 3 / 4;
  background: #efefef;
  overflow: hidden;
}

.cell img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

.cell.has-photo {
  cursor: grab;
}

.cell.is-over {
  outline: 2px solid #1e3d32;
  outline-offset: -2px;
}

.cell.is-selected {
  box-shadow: inset 0 0 0 3px #1e3d32;
}

.legend {
  flex-basis: 100%;
  background: #f6f3ed;
  border: 1px solid #ddd6ca;
  border-radius: 18px;
  padding: 16px 18px;
}

.legend h2 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6d675f;
}

.legend-same,
.legend-item p {
  margin: 0;
  white-space: pre-line;
}

.legend-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid #e2dcd2;
}

.legend-item.is-selected .legend-index {
  color: #1e3d32;
  font-weight: 700;
}

.legend-index {
  color: #6d675f;
}

.tags {
  color: #2c5c49;
}

.muted {
  color: #8a847a;
}

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

  .panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 800px) {
  .page {
    padding: 16px 14px 40px;
  }

  .top {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
  }

  .ad-banner {
    margin-bottom: 16px;
  }

  h1 {
    font-size: 32px;
  }

  .stage {
    gap: 24px;
  }

  .ig-desktop-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 12px;
  }

  .avatar-desktop {
    width: 96px;
    height: 96px;
  }

  .ig-stats-line {
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 14px;
  }

  .phone {
    padding: 8px;
    border-radius: 28px;
  }

  .phone-screen {
    height: 620px;
    border-radius: 22px;
  }

  .browser-page {
    max-height: 70vh;
  }

  .post-row {
    grid-template-columns: auto 56px minmax(0, 1fr);
  }

  .thumb-button {
    width: 56px;
    height: 56px;
  }

  .post-actions {
    grid-column: 1 / -1;
    flex-direction: row;
  }

  .mode button,
  .mirror,
  .remove,
  .clear,
  .save-copy {
    min-height: 44px;
  }

  .mirror,
  .remove {
    flex: 1;
  }
}

@media (pointer: coarse) {
  .handle {
    display: none;
  }
}
