.tabs {
  height: 50px;
}

.tabs button {
  display: grid;
  place-items: center;
  padding: 0;
}

.tabs svg {
  width: 24px;
  height: 24px;
}

.tabs button:first-child svg {
  width: 23px;
  height: 23px;
}

@media (max-width: 370px) {
  .tabs button {
    padding: 0;
  }
}

.post .post-shade,
.crop-shade {
  position: absolute;
  inset: 0;
  background: #000;
  pointer-events: none;
}

.post-hook,
.hook-preview {
  position: absolute;
  z-index: 2;
  left: 8%;
  right: 8%;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .38);
  pointer-events: none;
}

.post-hook {
  font-size: clamp(10px, 3.9vw, 18px) !important;
}

.crop-preview {
  position: relative;
}

.editor-section {
  display: grid;
  gap: 11px;
  padding: 13px;
  border-radius: 11px;
  background: #f5f5f6;
}

.field-label,
.select-field,
.color-field {
  font-size: 13px;
  font-weight: 700;
}

#hookText,
#fontFamily {
  width: 100%;
  border: 1px solid #d9dadd;
  border-radius: 8px;
  background: #fff;
  color: #111;
  padding: 10px;
  font: inherit;
}

#hookText {
  resize: vertical;
  min-height: 72px;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 105px;
  gap: 9px;
  align-items: end;
}

.select-field {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 5px;
}

.color-field {
  display: grid !important;
  grid-template-columns: 1fr 42px !important;
  gap: 7px;
}

#fontColor {
  width: 42px;
  height: 39px;
  border: 1px solid #d9dadd;
  border-radius: 8px;
  padding: 3px;
  background: #fff;
}

.format-row {
  display: flex;
  gap: 7px;
}

.format-row button {
  width: 42px;
  height: 36px;
  border: 1px solid #d8d9dc;
  border-radius: 8px;
  background: #fff;
}

.format-row button[aria-pressed="true"] {
  background: #111;
  color: #fff;
  border-color: #111;
}

.crop-card {
  max-height: min(920px, calc(100dvh - 24px));
  overflow-y: auto;
}

.add-post-tile {
  color: #73777d;
}

.add-post-tile .empty {
  font-size: 34px;
}

.studio-btn.active {
  background: #fff;
  color: #171412;
  border-color: #fff;
}

.feed-tools {
  display: flex;
  justify-content: flex-end;
  padding: 0 14px 9px;
  background: #fff;
}

.feed-tools button {
  border: 1px solid #dcdde0;
  border-radius: 8px;
  background: #fff;
  padding: 7px 11px;
  color: #50555b;
  font-size: 13px;
  font-weight: 700;
}

.feed-tools button.active {
  background: #111;
  color: #fff;
  border-color: #111;
}

.highlights {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 16px -2px 2px;
  padding: 0 2px;
}

.highlight-item {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 0;
}

.highlight-circle {
  width: 62px;
  height: 62px;
  padding: 3px;
  border: 2px solid #e1e3e7;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
}

.highlight-circle span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #fafafa;
  color: #16191e;
  font-size: 30px;
  font-weight: 300;
  line-height: 1;
}

.highlight-circle img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.highlight-name {
  width: 100%;
  min-height: 17px;
  padding: 1px;
  border-radius: 3px;
  overflow: hidden;
  color: #191919;
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.highlight-name:focus {
  outline: none;
  background: #edf7fe;
  box-shadow: 0 0 0 2px rgba(0, 149, 246, .25);
}

@media (max-width: 370px) {
  .highlights {
    gap: 4px;
  }

  .highlight-circle {
    width: 56px;
    height: 56px;
  }
}

.grid.reordering .post {
  cursor: default;
}

.grid.reordering .post::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid rgba(255, 255, 255, .9);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2);
  pointer-events: none;
}

.reorder-controls {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 30px 25px 30px;
  align-items: center;
  justify-items: center;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 18px;
  background: rgba(15, 15, 15, .78);
  color: #fff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .22);
  backdrop-filter: blur(8px);
}

.reorder-controls b {
  font-size: 12px;
  font-weight: 700;
}

.reorder-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 32px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.reorder-button.disabled {
  opacity: .25;
  cursor: default;
}

@media (max-width: 480px) {
  dialog {
    width: calc(100vw - 12px);
  }

  .crop-card {
    padding: 13px;
    border-radius: 15px;
  }

  .crop-preview {
    max-height: 44vh;
  }
}

/* Keep the floating navigation clear of the final feed row. */
.grid {
  padding-bottom: 88px;
}

.mini-avatar.has-image img {
  display: block;
}

@media (max-width: 840px) {
  .grid {
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }
}

.studio-btn:not(.secondary) {
  color: #171412;
}

.current-project-name {
  display: block;
  margin: -4px 0 14px;
  color: #d8b985;
  font-size: 13px;
  font-weight: 600;
}

.projects-view {
  min-height: 100vh;
  padding: 56px clamp(22px, 6vw, 84px);
  background: #f5f1eb;
  color: #211a18;
}

.projects-header {
  max-width: 1080px;
  margin: 0 auto 34px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.projects-header span {
  color: #7a5a42;
  font-size: 11px;
  letter-spacing: .16em;
}

.projects-header h1 {
  margin: 10px 0 8px;
  font: 500 clamp(34px, 5vw, 56px)/1 Georgia, serif;
}

.projects-header p { margin: 0; color: #746b66; }

.projects-header button,
.project-actions .primary {
  border: 0;
  border-radius: 10px;
  padding: 13px 18px;
  background: #68172f;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.projects-list {
  max-width: 1080px;
  margin: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.project-tile,
.projects-empty {
  border: 1px solid #ddd2c7;
  border-radius: 16px;
  background: #fff;
  padding: 22px;
}

.project-tile { display: grid; gap: 14px; min-height: 190px; }
.project-tile small { color: #8b776b; }
.project-tile h2 { margin: 0; font: 500 25px/1.15 Georgia, serif; }
.project-tile code { color: #755b4c; font: 12px/1.45 inherit; overflow-wrap: anywhere; }
.project-tile-actions { display: flex; gap: 8px; margin-top: auto; }
.project-tile-actions button { flex: 1; border: 1px solid #d8cec7; border-radius: 8px; padding: 9px; background: #fff; cursor: pointer; font-weight: 700; }
.project-tile-actions .open-project { background: #211a18; color: #fff; border-color: #211a18; }
.projects-empty { grid-column: 1/-1; text-align: center; color: #746b66; padding: 48px 24px; }

.project-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 16px;
  background: #fff;
}

.project-card label { display: grid; gap: 7px; font-size: 13px; font-weight: 700; }
.project-card input { width: 100%; border: 1px solid #d7d7d7; border-radius: 9px; padding: 11px 12px; font: inherit; }
.url-preview { padding: 11px 12px; border-radius: 9px; background: #f3f0ec; color: #756b65; font-size: 12px; overflow-wrap: anywhere; }
.url-preview b { color: #301e23; }
.project-actions { display: flex; justify-content: flex-end; gap: 8px; }
.project-actions button { border: 1px solid #ddd; border-radius: 9px; padding: 10px 15px; background: #fff; font-weight: 700; cursor: pointer; }

@media (max-width: 760px) {
  .projects-view { padding: 32px 18px; }
  .projects-header { align-items: stretch; flex-direction: column; }
  .projects-header button { width: 100%; }
  .projects-list { grid-template-columns: 1fr; }
}
