:root {
  --bg: #fafafa;
  --card: #fff;
  --ink: #262626;
  --muted: #8e8e8e;
  --line: #dbdbdb;
  --accent: #8a6a4f;
  --focus: #c9a882;
  --heart: #e0245e;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-y: scroll;
}

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

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

.wrap {
  max-width: 468px;
  margin: 0 auto;
  padding: 16px 0 40px;
}

.page-header {
  padding: 12px 16px 16px;
  margin-bottom: 8px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0;
}

.page-header p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 14px;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.controls .search {
  grid-column: 1 / -1;
}

.controls label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.controls select,
.controls input {
  min-height: 32px;
  width: 100%;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  outline: none;
}

.controls select:focus,
.controls input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(201, 168, 130, .15);
}

.tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 0 14px;
  margin-bottom: 8px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.tab,
.stat {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.stat strong {
  margin-right: 4px;
  color: var(--ink);
  font-weight: 700;
}

.feed {
  display: flex;
  flex-direction: column;
}

.card {
  margin-bottom: 8px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}

.avatar {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  outline: 2px solid #c9a882;
  background: linear-gradient(135deg, #c9a882, #8a6a4f);
}

.account-info {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
}

.account-name {
  font-size: 16px;
  font-weight: 600;
}

.account-sub {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

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

.schedule-date,
.schedule-time {
  padding: 1px 4px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  outline: none;
}

.schedule-date:hover,
.schedule-time:hover {
  border-color: var(--line);
  background: #faf7f4;
}

.schedule-date:focus,
.schedule-time:focus {
  border-color: var(--focus);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(201, 168, 130, .15);
}

.schedule-date {
  width: 130px;
}

.schedule-time {
  width: 80px;
}

.media-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.media-shell {
  width: 100%;
  aspect-ratio: 4 / 5;
  background: #e8ddd0;
}

.media-shell img,
.media-shell video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-empty {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.btn-edit-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  padding: 5px 12px;
  border: 0;
  border-radius: 20px;
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.overlay-panel {
  position: absolute;
  top: 50%;
  left: 10px;
  right: 10px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 18px;
  border-radius: 20px;
  background: rgba(0, 0, 0, .15);
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(-50% - 200%));
  transition: transform .32s cubic-bezier(.4, 0, .2, 1), opacity .25s ease;
  backdrop-filter: blur(4px);
}

.overlay-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%);
}

.btn-replace,
.btn-regen {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 20px;
  background: rgba(255, 255, 255, .14);
  color: rgba(255, 255, 255, .9);
  cursor: pointer;
  font-size: 13px;
}

.input-replace {
  display: none;
}

.field-cta {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  outline: none;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 4px;
}

.heart {
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  user-select: none;
}

.heart:hover,
.heart.liked {
  color: var(--heart);
}

.post-tag {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fafafa;
  color: var(--muted);
  font-size: 12px;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 14px 18px;
}

.field-wrap {
  display: flex;
  flex-direction: column;
}

.field-title,
.field-cap {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  outline: none;
  resize: none;
}

.field-title:hover,
.field-cap:hover {
  border-color: var(--line);
  background: #faf7f4;
}

.field-title:focus,
.field-cap:focus {
  border-color: var(--focus);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(201, 168, 130, .15);
}

.field-title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
}

.field-cap {
  min-height: 80px;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.65;
}

.hidden-meta {
  display: none;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

.post-id {
  color: var(--muted);
  font-size: 11px;
}

.save-button {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.save-button.saved {
  border-color: var(--focus);
  background: #faf7f4;
}

.empty {
  padding: 48px 16px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 520px) {
  .wrap {
    max-width: 100%;
    padding-top: 0;
  }

  .controls {
    grid-template-columns: 1fr;
  }
}
