:root {
  --text: #000;
  --text-secondary: rgba(51, 51, 51, 0.6);
  --icon-text: #333;
  --line: rgba(51, 51, 51, 0.2);
  --content-width: 375px;
  --side-padding: 10px;
}

* { box-sizing: border-box; }

html { background: #f4f4f4; }

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { appearance: none; border: 0; padding: 0; background: transparent; color: inherit; cursor: pointer; }

.app-shell { width: 100%; min-height: 100vh; margin: 0 auto; background: #fff; overflow: hidden; }

.topbar { height: 62px; padding: 15px 10px 11px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.instagram-logo { width: 100.8px; height: 36px; display: block; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.icon-button { width: 20px; height: 20px; display: grid; place-items: center; }
.icon-button img { display: block; width: 100%; height: 100%; }

.post { padding-top: 10px; }
.post-profile { height: 36px; padding: 0 8px; display: flex; align-items: center; justify-content: space-between; }
.profile-meta { display: flex; align-items: center; gap: 7px; }
.avatar { flex: 0 0 auto; display: block; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #fe5e55; }
.avatar--author { padding: 2px; }
.profile-meta h1, .profile-meta p { margin: 0; }
.profile-meta h1 { font-size: 12px; line-height: 15px; font-weight: 600; }
.profile-meta p { font-size: 10px; line-height: 12px; font-weight: 400; }
.dots-button { width: 13px; height: 24px; display: grid; place-items: center; }
.dots-button img { width: 13px; height: 3px; display: block; }

.hero-image { display: block; width: 100%; aspect-ratio: 1; margin-top: 4px; object-fit: cover; }
.post-actions { height: 24px; margin: 12px 8px 0; display: flex; align-items: center; justify-content: space-between; }
.engagement-list { display: flex; align-items: center; gap: 10px; min-width: 0; }
.engagement { display: flex; align-items: center; gap: 3px; white-space: nowrap; font-size: 12px; line-height: 15px; font-weight: 600; color: var(--icon-text); }
.engagement img { display: block; width: 24px; height: 24px; }
.icon-button--post { width: 24px; height: 24px; }

.post-caption { width: calc(100% - 20px); margin: 24px auto 0; font-size: 12px; line-height: 14px; font-weight: 400; white-space: normal; }
.post-caption p { margin: 0 0 14px; }
.post-caption strong { font-weight: 700; }
.likes-total { width: calc(100% - 20px); margin: 18px auto 10px; font-size: 10px; line-height: 12px; font-weight: 600; }
.divider { height: 1px; border: 0; margin: 0; background: var(--line); }

.comments-area { width: 100%; }
.comments-title { margin: 0; padding: 20px 10px 10px; border-bottom: 1px solid var(--line); font-size: 16px; line-height: 20px; font-weight: 700; }
.comment--pinned { margin: 20px 10px 0; }
.comment--pinned .comment-copy { display: flex; flex-direction: column; align-items: flex-start; }
.pin-icon { display: block; width: 10px; height: 10px; }
.pinned-link { display: inline-block; margin-top: 3px; color: #3d99ed; font-size: 12px; line-height: 15px; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.comment--pinned .reply-action { margin-top: 5px; }
.comment-composer { margin: 0 10px 20px; padding: 14px 0 10px; border-top: 1px solid var(--line); display: flex; align-items: flex-start; gap: 7px; }
.avatar--you { align-items: center; justify-content: center; display: inline-flex; padding: 0; border: 1px solid rgba(51, 51, 51, 0.28); background: #f2f2f2; color: #555; font-size: 12px; font-weight: 700; line-height: 1; }
.avatar--composer { width: 32px; height: 32px; margin-top: 1px; }
.composer-copy { flex: 1; min-width: 0; }
.composer-label { display: block; margin-bottom: 2px; font-size: 10px; line-height: 12px; color: var(--text-secondary); }
.comment-composer textarea { width: 100%; min-height: 22px; max-height: 96px; padding: 0; border: 0; outline: 0; resize: vertical; color: var(--text); background: transparent; font: inherit; font-size: 12px; line-height: 15px; }
.comment-composer textarea::placeholder { color: rgba(51, 51, 51, 0.48); }
.submit-comment { align-self: center; color: #0095f6; font-size: 12px; font-weight: 600; }
.submit-comment:disabled { color: rgba(0, 149, 246, 0.4); cursor: default; }
.comments-section { padding: 10px 10px 26px; display: flex; flex-direction: column; gap: 10px; }
.comment { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; min-width: 0; }
.comment-main { display: flex; align-items: flex-start; gap: 7px; width: calc(100% - 28px); min-width: 0; }
.comment-copy { flex: 1; min-width: 0; }
.comment-heading { display: flex; align-items: center; gap: 5px; min-height: 15px; white-space: nowrap; }
.comment-name { font-size: 12px; line-height: 15px; font-weight: 600; }
.comment-time { font-size: 8px; line-height: 10px; color: var(--text-secondary); }
.comment-text { margin: 1px 0 0; font-size: 10px; line-height: 12px; font-weight: 400; }
.reply-action { display: inline-block; margin-top: 5px; font-size: 11px; line-height: 14px; font-weight: 600; color: var(--text-secondary); text-decoration: none; }
.comment-like { width: 18px; flex: 0 0 18px; display: flex; flex-direction: column; align-items: center; gap: 0; padding-top: var(--heart-offset, 0px); }
.comment-like img { width: 18px; height: 18px; display: block; }
.comment-like span { font-size: 10px; line-height: 11px; }
.comment--reply { width: calc(100% - 9px); margin-left: 9px; }
.comment--reply .comment-main { width: calc(100% - 43px); }
.reply-marker { flex: 0 0 20px; width: 20px; height: 20px; margin-right: 5px; margin-top: 1px; }
.comment-attachment { display: block; width: 90px; height: 150px; margin-top: 5px; border-radius: 10px; object-fit: cover; }
.engagement.is-active img, .comment-like.is-active img, .icon-button--post.is-active img { display: none; }
.engagement.is-active::before { content: ""; display: block; width: 24px; height: 24px; background: url("/assets/heart-filled.svg") center / contain no-repeat; }
.comment-like.is-active::before { content: ""; display: block; width: 18px; height: 18px; background: url("/assets/heart-filled.svg") center / contain no-repeat; }
.icon-button--post.is-active::before { content: ""; display: block; width: 24px; height: 24px; background: url("/assets/bookmark-filled.svg") center / contain no-repeat; }

@media (max-width: 350px) {
  .engagement-list { gap: 5px; }
  .engagement { font-size: 11px; }
}

/* A 430 px phone has noticeably more room than the 375 px Figma frame. Scale
   controls and type up so the interface stays readable instead of floating as
   a tiny 375 px composition inside a wider screen. */
@media (min-width: 400px) and (max-width: 599px) {
  .topbar { height: 74px; padding: 18px 14px 14px; }
  .instagram-logo { width: 120px; height: 43px; }
  .topbar-actions { gap: 19px; }
  .icon-button { width: 26px; height: 26px; }

  .post { padding-top: 12px; }
  .post-profile { height: 44px; padding: 0 10px; }
  .profile-meta { gap: 9px; }
  .avatar { width: 44px; height: 44px; }
  .profile-meta h1 { font-size: 15px; line-height: 18px; }
  .profile-meta p { font-size: 13px; line-height: 16px; }
  .dots-button { width: 17px; }
  .dots-button img { width: 17px; height: 4px; }

  .hero-image { margin-top: 5px; }
  .post-actions { height: 30px; margin: 15px 10px 0; }
  .engagement-list { gap: 8px; }
  .engagement { gap: 3px; font-size: 14px; line-height: 18px; }
  .engagement img, .icon-button--post { width: 30px; height: 30px; }
  .engagement.is-active::before, .icon-button--post.is-active::before { width: 30px; height: 30px; }

  .post-caption { width: calc(100% - 26px); margin-top: 30px; font-size: 15px; line-height: 19px; }
  .post-caption p { margin-bottom: 18px; }
  .likes-total { width: calc(100% - 26px); margin: 22px auto 13px; font-size: 13px; line-height: 16px; }

  .comments-title { padding: 24px 13px 13px; font-size: 20px; line-height: 25px; }
  .comment--pinned { margin: 24px 13px 0; }
  .pin-icon { width: 13px; height: 13px; }
  .pinned-link { margin-top: 4px; font-size: 15px; line-height: 19px; }
  .comment-composer { margin: 0 13px 24px; padding: 18px 0 13px; gap: 9px; }
  .avatar--composer { width: 40px; height: 40px; font-size: 15px; }
  .composer-label { font-size: 13px; line-height: 16px; }
  .comment-composer textarea { min-height: 28px; font-size: 15px; line-height: 19px; }
  .submit-comment { font-size: 15px; }
  .comments-section { padding: 13px 13px 32px; gap: 14px; }
  .comment { gap: 13px; }
  .comment-main { gap: 9px; width: calc(100% - 35px); }
  .comment-heading { gap: 6px; min-height: 19px; }
  .comment-name { font-size: 15px; line-height: 19px; }
  .comment-time { font-size: 10px; line-height: 13px; }
  .comment-text { font-size: 13px; line-height: 16px; }
  .reply-action { margin-top: 6px; font-size: 14px; line-height: 18px; }
  .comment-like { width: 23px; flex-basis: 23px; }
  .comment-like img, .comment-like.is-active::before { width: 23px; height: 23px; }
  .comment-like span { font-size: 13px; line-height: 14px; }
  .comment--reply { width: calc(100% - 12px); margin-left: 12px; }
  .comment--reply .comment-main { width: calc(100% - 55px); }
  .reply-marker { width: 25px; height: 25px; flex-basis: 25px; margin-right: 6px; }
  .comment-attachment { width: 112px; height: 188px; margin-top: 6px; border-radius: 12px; }
}

/* The supplied design is a 375 px mobile layout. On tablet and desktop it is
   enlarged as one coherent feed instead of leaving a narrow mobile strip. */
@media (min-width: 600px) {
  html, body { background: #333; }
  .app-shell { width: min(100%, 732px); }
  .topbar, .post, .divider, .comments-area { width: calc(100% - 92px); margin-left: auto; margin-right: auto; }

  .topbar { height: 104px; padding: 25px 17px 19px; }
  .instagram-logo { width: 171px; height: 61px; }
  .topbar-actions { gap: 27px; }
  .icon-button { width: 34px; height: 34px; }

  .post { padding-top: 17px; }
  .post-profile { height: 61px; padding: 0 14px; }
  .profile-meta { gap: 12px; }
  .avatar { width: 61px; height: 61px; }
  .avatar--author { padding: 3px; }
  .profile-meta h1 { font-size: 20px; line-height: 26px; }
  .profile-meta p { font-size: 17px; line-height: 20px; }
  .dots-button { width: 22px; height: 41px; }
  .dots-button img { width: 22px; height: 5px; }

  .hero-image { margin-top: 7px; }
  .post-actions { height: 41px; margin: 20px 14px 0; }
  .engagement-list { gap: 17px; }
  .engagement { gap: 5px; font-size: 20px; line-height: 26px; }
  .engagement img, .icon-button--post { width: 41px; height: 41px; }
  .engagement.is-active::before { width: 41px; height: 41px; }
  .comment-like.is-active::before { width: 31px; height: 31px; }
  .icon-button--post.is-active::before { width: 41px; height: 41px; }

  .post-caption { width: calc(100% - 34px); margin-top: 41px; font-size: 20px; line-height: 24px; }
  .post-caption p { margin-bottom: 24px; }
  .likes-total { width: calc(100% - 34px); margin-top: 31px; margin-bottom: 17px; font-size: 17px; line-height: 20px; }

  .comment-composer { margin: 0 17px 34px; padding: 24px 0 17px; gap: 12px; }
  .comments-title { padding: 34px 17px 17px; font-size: 27px; line-height: 34px; }
  .comment--pinned { margin: 34px 17px 0; }
  .pin-icon { width: 17px; height: 17px; }
  .pinned-link { margin-top: 5px; font-size: 20px; line-height: 26px; }
  .avatar--composer { width: 54px; height: 54px; margin-top: 2px; font-size: 20px; }
  .composer-label { margin-bottom: 3px; font-size: 17px; line-height: 20px; }
  .comment-composer textarea { min-height: 37px; max-height: 163px; font-size: 20px; line-height: 25px; }
  .submit-comment { font-size: 20px; }
  .comments-section { padding: 17px 17px 44px; gap: 17px; }
  .comment { gap: 17px; }
  .comment-main { gap: 12px; width: calc(100% - 48px); }
  .comment-heading { gap: 8px; min-height: 26px; }
  .comment-name { font-size: 20px; line-height: 26px; }
  .comment-time { font-size: 14px; line-height: 17px; }
  .comment-text { margin-top: 2px; font-size: 17px; line-height: 20px; }
  .reply-action { margin-top: 8px; font-size: 19px; line-height: 24px; }
  .comment-like { width: 31px; flex-basis: 31px; }
  .comment-like img { width: 31px; height: 31px; }
  .comment-like span { font-size: 17px; line-height: 19px; }
  .comment--reply { width: calc(100% - 15px); margin-left: 15px; }
  .comment--reply .comment-main { width: calc(100% - 73px); }
  .reply-marker { width: 34px; height: 34px; flex-basis: 34px; margin-right: 8px; }
  .comment-attachment { width: 153px; height: 255px; margin-top: 8px; border-radius: 17px; }
}
