/* Design tokens — Light / Dark / Accent */

:root {
  --primary-color: #0095f6;
  --accent-color: #0095f6;
  --accent-soft: rgba(0, 149, 246, 0.14);
  --bg-color: #ffffff;
  --bg-elevated: #fafafa;
  --surface-color: #ffffff;
  --text-color: #262626;
  --text-muted: #8e8e8e;
  --border-color: #dbdbdb;
  --danger-color: #ed4956;
  --header-bg: #ffffff;
  --nav-bg: #ffffff;
  --input-bg: #efefef;
  --bubble-in: #efefef;
  --bubble-out: var(--accent-color);
  --overlay: rgba(0, 0, 0, 0.45);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  --radius: 12px;
  --topbar-h: 56px;
  --tabbar-h: 52px;
}

html[data-theme="dark"] {
  --bg-color: #000000;
  --bg-elevated: #121212;
  --surface-color: #1a1a1a;
  --text-color: #f5f5f5;
  --text-muted: #a8a8a8;
  --border-color: #262626;
  --header-bg: #000000;
  --nav-bg: #000000;
  --input-bg: #262626;
  --bubble-in: #262626;
  --bubble-out: var(--accent-color);
  --overlay: rgba(0, 0, 0, 0.72);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

html,
body.full-page {
  background: var(--bg-color);
  color: var(--text-color);
}

body:has(.giami-messages-page),
body:has(.giami-messages-page) .app-layout {
  background: var(--bg-color);
}

.app-layout {
  background: var(--bg-color);
}

/* --- Instagram-style chrome --- */

.ig-topbar.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 12px;
  min-height: var(--topbar-h);
  box-sizing: border-box;
  z-index: 999;
  width: 100%;
  float: none;
}
.ig-topbar .back-btn,
.ig-topbar .top-search,
.ig-topbar .ac-settings,
.ig-topbar .new-post,
.ig-topbar .ig-top-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  float: none;
  color: var(--text-color);
  font-size: 20px;
  cursor: pointer;
  position: relative;
  vertical-align: middle;
}
.ig-topbar .new-post {
  margin-top: 0;
  margin-right: 0;
}
.ig-topbar .new-post > i img {
  filter: none;
  max-width: 18px;
}
html[data-theme="dark"] .ig-topbar .new-post > i img {
  filter: invert(1);
}
.ig-topbar .logo-place {
  flex: 1;
  width: auto;
  text-align: left;
  padding-left: 4px;
}
.ig-topbar .logo-place > a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-color);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
  text-decoration: none;
}
.ig-topbar .logo-place > a > img {
  width: 34px;
  height: 34px;
  max-height: none;
  border-radius: 9px;
  object-fit: contain;
  flex-shrink: 0;
}
.ig-topbar .logo-place > a > span {
  line-height: 1;
}
.welcome-brand {
  display: flex;
  justify-content: center;
  margin: 8px 0 18px;
}
.welcome-brand img,
.empty-state .brand-logo,
.loader-screen img {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: contain;
}
.loader-screen.is-on {
  display: flex !important;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
}
.empty-state .brand-logo {
  display: block;
  margin: 0 auto 16px;
}
.ig-top-actions,
.ig-top-lead {
  display: flex;
  align-items: center;
  gap: 2px;
}
.ig-topbar.topbar {
  justify-content: space-between;
}
.ig-topbar .ig-top-lead,
.ig-topbar .ig-top-actions {
  flex: 0 0 auto;
}
.ig-topbar .logo-place {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  padding-left: 0;
  min-width: 0;
}
.ig-topbar .ig-top-create {
  border: 0;
  background: transparent;
  font-size: 24px;
}
.ig-top-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger-color);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
}
.ig-tabbar-me img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}
.ig-tabbar li.is-active .ig-tabbar-me img {
  box-shadow: 0 0 0 2px var(--text-color);
}

.ig-tabbar.bottom-header {
  background: var(--nav-bg);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  line-height: normal;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  height: auto;
  min-height: var(--tabbar-h);
}
.ig-tabbar .menu-left,
.ig-tabbar .menu-right {
  display: contents;
  float: none;
}
.ig-tabbar ul.menu-left > li,
.ig-tabbar ul.menu-right > li {
  margin: 0;
  line-height: normal;
}
.ig-tabbar ul.menu-left > li > a,
.ig-tabbar ul.menu-right > li > a {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  font-size: 22px;
}
.ig-tabbar li.is-active > a {
  color: var(--accent-color);
}
.ig-tabbar .menu-button {
  display: none;
}
.ig-tabbar .ig-create {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  float: none;
  color: var(--text-color);
  font-size: 22px;
  cursor: pointer;
  border: 1px solid var(--text-color);
  border-radius: 10px;
  box-shadow: none;
}
.ig-tabbar > ul > li span {
  background: var(--danger-color);
}

/* Page shells */
.ig-page {
  background: var(--bg-color);
  color: var(--text-color);
  padding: 0 0 calc(var(--tabbar-h) + 12px);
  min-height: calc(100vh - var(--topbar-h));
}
.ig-page-head {
  padding: 16px 16px 8px;
}
.ig-page-head h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-color);
}
.ig-page-body {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 0 24px;
}

.ig-stories {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--border-color);
  -webkit-overflow-scrolling: touch;
}
.ig-story {
  flex: 0 0 auto;
  width: 72px;
  text-align: center;
  text-decoration: none;
  color: var(--text-color);
}
.ig-story img {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  object-fit: cover;
  padding: 2px;
  border: 2px solid var(--accent-color);
  background: var(--bg-color);
}
.ig-story span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Feed cards */
.ig-page .user-post {
  background: var(--surface-color);
  border: 0;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
  margin: 0;
  padding: 12px 0 8px;
  width: 100%;
  float: none;
}
.ig-page .user-post > figure img {
  width: 36px;
  height: 36px;
  object-fit: cover;
}
.ig-page .user-name > h5 a {
  color: var(--text-color);
}
.ig-page .user-name > span,
.ig-page .coment-state,
.ig-page .commenter > span {
  color: var(--text-muted);
}
.ig-page .post-meta > p,
.ig-page .commenter > p,
.ig-page .commenter > h5 a {
  color: var(--text-color);
}
.ig-page .post-media {
  width: 100%;
  max-height: none;
  border-radius: 0;
  margin: 8px 0;
}
.ig-page .stat-tools {
  color: var(--text-color);
}
.ig-page .stat-tools .Like__link,
.ig-page .stat-tools > a {
  color: var(--text-color);
}
.ig-page .Like__link.liked,
.ig-page .Like__link.liked i {
  color: var(--danger-color);
}
.ig-page .new-comment input {
  background: var(--input-bg);
  color: var(--text-color);
  border-color: var(--border-color);
}
.ig-page .new-comment button {
  color: var(--accent-color);
}

/* Action sheet */
.ig-page .more:hover .more-options {
  opacity: 0;
  visibility: hidden;
  transform: none;
}
.ig-page .more-options.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.ig-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  background: var(--surface-color);
  color: var(--text-color);
  border-radius: 16px 16px 0 0;
  padding: 8px 0 16px;
  z-index: 2000;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2);
}
.ig-sheet > ul li,
.ig-sheet button {
  color: var(--text-color);
}
.ig-sheet .is-danger,
.ig-sheet .is-danger button {
  color: var(--danger-color);
}

/* Lists */
.ig-list {
  background: var(--surface-color);
}
.ig-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);
  text-decoration: none;
}
.ig-list-item img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}
.ig-list-item h5 {
  margin: 0;
  font-size: 14px;
}
.ig-list-item span,
.ig-list-item p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.ig-search-bar {
  padding: 8px 16px 12px;
}
.ig-search-bar input {
  width: 100%;
  border: 0;
  background: var(--input-bg);
  color: var(--text-color);
  border-radius: 10px;
  padding: 10px 14px;
}
.ig-search-bar input::placeholder {
  color: var(--text-muted);
}

/* Buttons / forms */
.main-btn,
button.main-btn,
.follow-men button,
.search-area > form button {
  background: var(--accent-color) !important;
  color: #fff !important;
  border: 0;
}
.white-form input,
.white-form textarea,
.white-form select {
  background: var(--input-bg);
  color: var(--text-color);
  border-color: var(--border-color);
}
.main-title,
.head-meta > h5,
.set-title > h5 {
  color: var(--text-color);
}

.flash-msg.error { background: #ffe8e8; color: #b42318; }
.flash-msg.success { background: #e7f8ee; color: #027a48; }
html[data-theme="dark"] .flash-msg.error { background: #3a1515; color: #ff8a80; }
html[data-theme="dark"] .flash-msg.success { background: #10331d; color: #81c995; }

.setting-page,
.stg-form-area,
.tabBox,
.tabContent {
  background: var(--surface-color);
  color: var(--text-color);
}
html[data-theme="dark"] .good-day-notification {
  background: var(--surface-color);
  color: var(--text-color);
}

/* Theme settings */
.ig-theme-panel {
  padding: 8px 0 24px;
}
.ig-theme-modes {
  display: flex;
  gap: 8px;
  margin: 12px 0 20px;
}
.ig-theme-modes button {
  flex: 1;
  border: 1px solid var(--border-color);
  background: var(--surface-color);
  color: var(--text-color);
  border-radius: 10px;
  padding: 10px 8px;
  cursor: pointer;
  font-size: 13px;
}
.ig-theme-modes button.is-on {
  border-color: var(--accent-color);
  color: var(--text-color);
  background: var(--accent-soft);
  font-weight: 600;
}
html[data-theme="dark"] .ig-theme-modes button.is-on {
  color: #fff;
  background: var(--accent-color);
  border-color: var(--accent-color);
}
.ig-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.ig-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.ig-swatch.is-on {
  border-color: var(--text-color);
  box-shadow: 0 0 0 2px var(--bg-color), 0 0 0 4px var(--accent-color);
}
.ig-swatches input[type="color"] {
  width: 32px;
  height: 32px;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
}

.side-slide {
  background: var(--surface-color);
  color: var(--text-color);
}
.side-slide > ul li a,
.side-slide .user-options > h5,
.side-slide .user-options > a,
.night-mode {
  color: var(--text-color);
}
.create-new {
  overflow: hidden;
  overscroll-behavior: none;
}
.create-new .post-form,
.search-post {
  background: var(--surface-color);
  color: var(--text-color);
}
.create-new textarea,
.create-new input,
.create-new select,
.search-area input {
  background: var(--input-bg);
  color: var(--text-color);
  border-color: var(--border-color);
}

/* Story rings */
button.ig-story {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.ig-story-avatar {
  position: relative;
  display: block;
  width: 66px;
  height: 66px;
  margin: 0 auto;
  padding: 2px;
  border-radius: 50%;
  background: var(--border-color);
}
.ig-story.is-unseen .ig-story-avatar {
  background: linear-gradient(45deg, #f9ce34, #ee2a7b, #6228d7);
}
.ig-story-avatar img,
.ig-story img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  padding: 0;
  border: 2px solid var(--bg-color);
  background: var(--bg-color);
  box-sizing: border-box;
}
.ig-story-add {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-color);
  color: #fff;
  font-size: 16px;
  line-height: 18px;
  text-align: center;
  border: 2px solid var(--bg-color);
}

/* Story viewer */
.ig-story-viewer {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: #000;
  color: #fff;
  display: flex;
  flex-direction: column;
}
.ig-story-viewer[hidden] {
  display: none !important;
}
body.giami-story-open .bottom-header,
body.giami-story-open .ig-topbar {
  visibility: hidden;
}
.ig-story-progress {
  display: flex;
  gap: 4px;
  padding: 10px 8px 0;
}
.ig-story-progress span {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 2px;
  overflow: hidden;
}
.ig-story-progress i {
  display: block;
  height: 100%;
  width: 100%;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left center;
}
.ig-story-progress .is-done i {
  transform: scaleX(1);
}
.ig-story-progress .is-active i {
  animation-name: ig-story-bar;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}
@keyframes ig-story-bar {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
.ig-story-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}
.ig-story-top img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
.ig-story-top div {
  flex: 1;
}
.ig-story-top strong {
  display: block;
  font-size: 14px;
}
.ig-story-top span {
  font-size: 12px;
  opacity: 0.7;
}
.ig-story-top button {
  background: none;
  border: 0;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.ig-story-stage {
  position: relative;
  flex: 1;
  min-height: 0;
}
.ig-story-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ig-story-tap {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  z-index: 2;
}
.ig-story-tap.is-left { left: 0; }
.ig-story-tap.is-right { right: 0; width: 60%; }
.ig-story-caption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 72px;
  margin: 0;
  text-align: center;
  font-size: 18px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  z-index: 3;
  pointer-events: none;
}
.ig-story-reply {
  display: flex;
  gap: 8px;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 3;
}
.ig-story-reply input {
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
}
.ig-story-reply button {
  border: 0;
  background: transparent;
  color: #fff;
  font-weight: 600;
}

.ig-filter-clarendon { filter: contrast(1.2) saturate(1.35); }
.ig-filter-gingham { filter: brightness(1.05) sepia(0.12) contrast(0.95); }
.ig-filter-moon { filter: grayscale(1) contrast(1.1) brightness(1.1); }
.ig-filter-lark { filter: contrast(0.9) saturate(1.3) brightness(1.1); }
.ig-filter-reyes { filter: sepia(0.22) contrast(0.85) brightness(1.1); }

/* Create sheet */
.ig-create-sheet {
  --create-green: #22c55e;
  --create-green-soft: rgba(34, 197, 94, 0.16);
  --create-card: #2b332e;
  max-height: min(88vh, 720px);
  overflow-x: hidden;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  background: #1c221e !important;
  color: #f4f7f5;
  border-radius: 22px;
  padding: 18px 16px 20px;
  box-sizing: border-box;
  width: min(400px, 92vw);
}
.create-new .ig-create-pane.is-on {
  display: block !important;
  width: 100%;
  float: none;
}
.ig-create-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 14px;
  position: relative;
}
.ig-create-head h5,
.ig-create-sheet .ig-create-head h5 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}
.ig-create-sheet .close-btn {
  position: static;
  float: none;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  top: auto;
  right: auto;
}
.ig-create-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
}
.ig-create-tabs button {
  flex: 1;
  border: 1.5px solid var(--create-green);
  background: transparent;
  color: #d7eadc;
  border-radius: 999px;
  padding: 8px 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.ig-create-tabs button.is-on {
  background: var(--create-green);
  color: #06210f;
  border-color: var(--create-green);
}
.post-form > form.ig-create-pane { display: none; }
.post-form > form.ig-create-pane.is-on { display: block; }
.ig-create-pane textarea,
.ig-create-pane input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  background: var(--create-card);
  color: #fff;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  font-size: 14px;
  margin: 0 0 12px;
}
.ig-create-pane textarea {
  min-height: 44px;
  height: 44px !important;
  resize: none;
}
.ig-create-pane textarea::placeholder,
.ig-create-pane input::placeholder {
  color: #8fa396;
}
.ig-dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 168px;
  margin: 0 0 10px;
  background: var(--create-card);
  border-radius: 22px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  color: #c5d4cb;
}
.ig-dropzone input[type="file"],
.ig-sr-file {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
  opacity: 0 !important;
  font-size: 0 !important;
  color: transparent !important;
  background: transparent !important;
  appearance: none;
}
.ig-dropzone input[type="file"]::-webkit-file-upload-button {
  display: none;
}
.ig-drop-cam {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #22c55e;
  color: #06210f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  z-index: 2;
  pointer-events: none;
}
.ig-dropzone-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  pointer-events: none;
}
.ig-dropzone-empty[hidden] { display: none; }
.ig-dropzone-empty svg {
  width: 56px;
  height: 56px;
  color: #d7eadc;
}
.ig-dropzone-empty span {
  font-size: 15px;
  font-weight: 600;
}
.ig-dropzone-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 6px;
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
  pointer-events: none;
}
.ig-dropzone-preview[hidden] { display: none; }
.ig-dropzone-preview img,
.ig-dropzone-preview video,
.ig-dropzone .js-reel-preview {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 14px;
  background: #111;
}
.ig-dropzone-preview:has(:only-child) {
  grid-template-columns: 1fr;
}
.ig-dropzone-preview:has(:only-child) img,
.ig-dropzone-preview:has(:only-child) video {
  height: 220px;
}
.ig-drop-loader {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(12, 18, 14, 0.78);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  z-index: 2;
  pointer-events: none;
}
.ig-dropzone.is-loading .ig-drop-loader {
  display: flex !important;
  pointer-events: auto;
}
.ig-dropzone.is-loading input[type="file"] {
  pointer-events: none;
}
.ig-spin {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #22c55e;
  border-radius: 50%;
  animation: ig-spin 0.7s linear infinite;
}
@keyframes ig-spin {
  to { transform: rotate(360deg); }
}
.ig-share-btn.is-busy {
  opacity: 0.7;
  pointer-events: none;
}
.ig-dropzone.is-story {
  min-height: 0;
  background: transparent;
}
.ig-dropzone.is-story .ig-studio-preview {
  width: 100%;
  margin: 0;
  pointer-events: none;
}
.ig-create-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 14px;
}
.ig-create-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  background: var(--create-card);
  border-radius: 16px;
  color: #fff;
  cursor: text;
}
.ig-create-chip i {
  font-size: 20px;
  color: var(--create-green);
}
.ig-create-chip span {
  min-width: 0;
  flex: 1;
}
.ig-create-chip strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
}
.ig-create-chip input {
  display: block;
  width: 100%;
  margin: 2px 0 0;
  padding: 0;
  background: transparent;
  border: 0;
  color: #9db3a6;
  font-size: 12px;
}
.ig-create-sheet .ig-share-btn,
.ig-create-pane > button.ig-share-btn {
  width: 100%;
  margin: 4px 0 0;
  padding: 13px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--create-green) !important;
  color: #06210f;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.ig-create-pane {
  margin-top: 0 !important;
}
.ig-create-sheet textarea {
  height: 44px !important;
  min-height: 44px;
  background: var(--create-card) !important;
  color: #fff !important;
}
.ig-create-chip input {
  background: transparent !important;
  color: #9db3a6 !important;
  border: 0 !important;
  height: auto !important;
}
.ig-create-sheet .ig-hint {
  color: #8fa396;
}
.ig-create-sheet .ig-suggest {
  background: var(--create-card);
  border: 0;
  color: #fff;
}
.ig-file-btn {
  display: block;
  margin: 8px 0;
  padding: 10px;
  text-align: center;
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-color);
}
.ig-file-btn input { display: none; }
.ig-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 4px 0 8px;
}
.ig-studio-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 28vh;
  margin: 0 auto;
  background: #111;
  border-radius: 18px;
  overflow: hidden;
}
.ig-studio-preview img,
.ig-studio-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ig-studio-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #c5d4cb;
  font-size: 14px;
  font-weight: 600;
}
.ig-studio-placeholder .lni {
  font-size: 28px;
  color: #22c55e;
}
.ig-filter-row,
.ig-sticker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow: hidden;
  margin: 10px 0;
}
.ig-create-sheet .ig-filter-row button,
.ig-create-sheet .ig-sticker-row button {
  flex: 0 0 auto;
  border: 1.5px solid #22c55e;
  background: #2b332e;
  color: #e8f6ec;
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
  text-transform: capitalize;
  font-size: 13px;
  font-weight: 600;
}
.ig-create-sheet .ig-filter-row button.is-on {
  background: #22c55e;
  color: #06210f;
  border-color: #22c55e;
}
.ig-create-sheet .ig-sticker-row button {
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ig-dropzone-empty .lni {
  font-size: 32px;
  color: #d7eadc;
  margin-bottom: 6px;
}
.ig-suggest {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  max-height: 160px;
  overflow: auto;
}
.ig-suggest li {
  padding: 8px 10px;
  cursor: pointer;
}
.ig-suggest li:hover {
  background: var(--input-bg);
}
.ig-reel-preview {
  width: 100%;
  max-height: 220px;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #000;
}

/* Carousel + likes */
.ig-carousel {
  position: relative;
}
.ig-carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.ig-carousel-track .post-media {
  flex: 0 0 100%;
  scroll-snap-align: start;
  width: 100%;
  max-width: 100%;
}
.ig-dots {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 8px 0 0;
}
.ig-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-color);
}
.ig-dots span.is-on {
  background: var(--accent-color);
}
.ig-aspect-1-1 { aspect-ratio: 1 / 1; object-fit: cover; }
.ig-aspect-4-5 { aspect-ratio: 4 / 5; object-fit: cover; }
.ig-aspect-16-9 { aspect-ratio: 16 / 9; object-fit: cover; }
.ig-aspect-9-16 { aspect-ratio: 9 / 16; object-fit: cover; }
.post-meta {
  position: relative;
}
.ig-heart-burst {
  position: absolute;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%) scale(0.4);
  font-size: 84px;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.ig-heart-burst.is-on {
  animation: ig-pop 0.7s ease;
}
@keyframes ig-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
  35% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.2); }
}
.ig-tags a {
  margin-right: 6px;
  color: var(--accent-color);
}

/* Reels */
body:has(.ig-reels) .ig-page {
  padding: 0;
}
.ig-reels {
  height: calc(100dvh - var(--topbar-h) - var(--tabbar-h));
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  background: #000;
}
.ig-reel {
  position: relative;
  height: calc(100dvh - var(--topbar-h) - var(--tabbar-h));
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  color: #fff;
}
.ig-reel-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
.ig-reel-gradient {
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  pointer-events: none;
}
.ig-reel-meta {
  position: absolute;
  left: 12px;
  right: 72px;
  bottom: 96px;
  z-index: 2;
}
.ig-reel-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-decoration: none;
  margin-bottom: 8px;
}
.ig-reel-user img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}
.ig-reel-audio {
  font-size: 13px;
  opacity: 0.9;
}
.ig-reel-actions {
  position: absolute;
  right: 10px;
  bottom: 110px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}
.ig-reel-actions button,
.ig-reel-actions a {
  background: none;
  border: 0;
  color: #fff;
  text-align: center;
  font-size: 22px;
  cursor: pointer;
}
.ig-reel-actions span {
  display: block;
  font-size: 12px;
  margin-top: 2px;
}
.ig-reel-actions .liked,
.ig-reel-actions .liked i {
  color: var(--danger-color);
}
.ig-reel-disc {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #222;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ig-reel-tray {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--tabbar-h) + 8px);
  z-index: 30;
  display: flex;
  gap: 8px;
  padding: 0 12px 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.ig-reel-tray::-webkit-scrollbar {
  display: none;
}
.ig-reel-cam,
.ig-reel-thumb {
  flex: 0 0 48px;
  width: 48px;
  height: 68px;
  border: 0;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
}
.ig-reel-cam {
  background: #22c55e;
  color: #06210f;
  font-size: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ig-reel-thumb {
  background: #111;
  border: 2px solid rgba(255, 255, 255, 0.4);
}
.ig-reel-thumb img,
.ig-reel-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.ig-comment-drawer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 55%;
  background: var(--surface-color);
  color: var(--text-color);
  border-radius: 16px 16px 0 0;
  transform: translateY(110%);
  transition: transform 0.2s ease;
  z-index: 4;
  display: flex;
  flex-direction: column;
}
.ig-comment-drawer.is-open {
  transform: translateY(0);
}
.ig-comment-drawer header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}
.ig-comment-drawer header h3 {
  margin: 0;
  font-size: 16px;
}
.ig-comment-drawer header button {
  background: none;
  border: 0;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-color);
}
.ig-comment-drawer ul {
  list-style: none;
  margin: 0;
  padding: 12px 16px;
  overflow: auto;
  flex: 1;
}
.ig-comment-drawer li {
  margin-bottom: 8px;
}
.ig-comment-drawer form {
  display: flex;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border-color);
}
.ig-comment-drawer input {
  flex: 1;
  border: 0;
  background: var(--input-bg);
  color: var(--text-color);
  border-radius: 999px;
  padding: 10px 14px;
}
.ig-comment-drawer form button {
  border: 0;
  background: none;
  color: var(--accent-color);
  font-weight: 600;
}

/* --- Instagram home shell --- */
.has-ig-shell .app-layout > nav,
.has-ig-shell .bottombar {
  display: none !important;
}
.ig-sidenav {
  display: none;
}
.ig-messages-fab {
  display: none;
}
.ig-rail {
  display: none;
}
.ig-sidenav-item,
.ig-sidenav button.ig-sidenav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 2px 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-color);
  font-size: 22px;
  text-decoration: none;
  cursor: pointer;
}
.ig-sidenav-item:hover,
.ig-sidenav-item.is-on {
  background: var(--accent-soft);
}
.ig-sidenav .new-post,
.ig-tabbar .new-post,
.ig-tabbar .ig-create {
  float: none;
  margin: 0;
  width: 48px;
  height: 48px;
  color: var(--text-color);
}
.ig-tabbar .new-post,
.ig-tabbar .ig-create {
  width: 44px;
  height: 44px;
}
.ig-sidenav .new-post > i,
.ig-tabbar .new-post > i,
.ig-topbar .new-post > i {
  color: inherit;
}
.ig-sidenav-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 4px 0 18px;
}
.ig-sidenav-logo img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: contain;
}
.ig-sidenav-grow {
  flex: 1 1 auto;
}
.ig-sidenav-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger-color);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
}
.ig-sidenav-profile img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
.ig-sidenav-profile.is-on {
  box-shadow: 0 0 0 2px var(--text-color);
}
.ig-home .ig-stories {
  max-width: 470px;
  margin: 0 auto;
  border-bottom: 0;
  padding: 16px 8px 12px;
}
.ig-home .ig-page-body {
  max-width: 470px;
  margin: 0 auto;
}
.ig-home .user-post {
  background: transparent;
  border-bottom: 0;
  margin-bottom: 20px;
  padding: 8px 0 16px;
}
.ig-post {
  display: block;
  width: 100%;
  float: none;
}
.ig-post-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 10px;
  position: relative;
}
.ig-post-avatar {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
}
.ig-post-avatar img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 0;
  display: block;
}
.ig-post-who {
  flex: 1 1 auto;
  min-width: 0;
}
.ig-post-user {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-color);
}
.ig-post-user a {
  color: var(--text-color);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ig-post-dot,
.ig-post-user time {
  color: var(--text-muted);
  font-weight: 400;
  flex: 0 0 auto;
}
.ig-post-sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ig-post-sub .lni {
  font-size: 11px;
  margin-right: 2px;
}
.ig-post .more {
  position: relative;
  top: auto;
  right: auto;
  margin-left: auto;
  float: none;
}
.ig-post-more {
  background: none;
  border: 0;
  color: var(--text-color);
  font-size: 20px;
  padding: 4px;
  cursor: pointer;
  line-height: 1;
}
.ig-post-media {
  position: relative;
  margin: 0;
  padding: 0;
  background: #111;
}
.ig-post-media > .post-media,
.ig-post-media > video,
.ig-post-media .ig-carousel {
  width: 100%;
  margin: 0;
  border-radius: 0;
  display: block;
}
.ig-post-text {
  margin: 0;
  padding: 16px 14px 20px;
  font-size: 16px;
  line-height: 1.4;
  color: var(--text-color);
  background: var(--surface-color);
}
.ig-feed-mute {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.ig-feed-mute i,
.ig-feed-mute svg {
  display: none;
  width: 16px;
  height: 16px;
}
.ig-feed-mute.is-muted .ig-mute-off,
.ig-feed-mute:not(.is-muted) .ig-mute-on {
  display: block;
}
.ig-post-actions.stat-tools,
.ig-page .ig-post-actions.stat-tools,
.ig-home .ig-post-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 14px;
  float: none;
  width: 100%;
  margin: 0;
  padding: 10px 12px 6px;
  text-align: left;
}
.ig-post-actions .Like__link,
.ig-post-actions > a,
.ig-post-actions .ig-save,
.ig-page .ig-post-actions .Like__link,
.ig-page .ig-post-actions > a {
  background: none !important;
  border: 0;
  border-radius: 0;
  color: var(--text-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 !important;
  font-size: 24px;
  line-height: 1;
  box-shadow: none;
}
.ig-post-actions .ig-save {
  margin-left: auto;
  background: none;
  border: 0;
  color: var(--text-color);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
}
.ig-post-actions .Like__link.liked,
.ig-post-actions .Like__link.liked i {
  color: #ed4956;
}
.ig-post-likes {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 6px;
  color: var(--text-color);
  font-size: 14px;
}
.ig-like-stack {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ed4956;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}
.ig-post-likes b {
  font-weight: 600;
}
.ig-post-caption,
.ig-post .ig-tags {
  margin: 0;
  padding: 0 12px 4px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-color);
}
.ig-post-caption a {
  color: var(--text-color);
  font-weight: 600;
  text-decoration: none;
  margin-right: 4px;
}
.ig-view-comments {
  display: block;
  padding: 2px 12px 6px;
  color: var(--text-muted);
  font-size: 14px;
  text-decoration: none;
}
.ig-post-comments {
  padding: 0 12px;
}
.ig-post-comments ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ig-post-comments li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}
.ig-post-comments p {
  margin: 0;
  font-size: 14px;
  color: var(--text-color);
  flex: 1;
}
.ig-post-comments p a {
  color: var(--text-color);
  font-weight: 600;
  text-decoration: none;
  margin-right: 4px;
}
.ig-add-comment {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 12px 0;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}
.ig-add-comment input {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--text-color);
  font-size: 14px;
  padding: 6px 0;
  outline: none;
}
.ig-add-comment button {
  background: none;
  border: 0;
  color: var(--accent-color);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
}
.ig-home .post-media,
.ig-home .ig-carousel,
.ig-home .post-meta video {
  border-radius: 0;
  overflow: hidden;
}
.ig-rail-me,
.ig-rail-user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.ig-rail-me img,
.ig-rail-user img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}
.ig-rail-me > div,
.ig-rail-user > div {
  flex: 1;
  min-width: 0;
}
.ig-rail a {
  color: var(--text-color);
  text-decoration: none;
}
.ig-rail strong {
  display: block;
  font-size: 14px;
}
.ig-rail span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ig-rail-switch,
.ig-rail-user button {
  color: var(--accent-color) !important;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.ig-rail-head {
  display: flex;
  justify-content: space-between;
  margin: 18px 0 12px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}
.ig-rail-head a {
  color: var(--text-color);
  font-size: 12px;
}
.ig-rail-foot {
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.6;
}
.ig-tabbar .ig-create {
  appearance: none;
}
body[data-path="/newsfeed"] .ig-topbar .back-btn,
body[data-path="/newsfeed"] .ig-topbar .top-search {
  display: none;
}
body:not([data-path="/newsfeed"]) .ig-topbar .ig-top-create {
  display: none;
}
body .ig-topbar.is-profile .ig-top-create {
  display: inline-flex;
}
body .ig-topbar.is-profile .back-btn {
  display: none;
}

@media (min-width: 900px) {
  body.has-ig-shell,
  body.has-ig-shell .app-layout {
    height: auto;
    min-height: 100%;
    float: none;
    overflow: visible;
  }
  .ig-sidenav {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 72px;
    padding: 18px 0 12px;
    background: var(--bg-color);
    border-right: 1px solid var(--border-color);
    z-index: 1100;
  }
  body.has-ig-shell .ig-topbar,
  body.has-ig-shell .ig-tabbar {
    display: none !important;
  }
  body.has-ig-shell .app-layout {
    padding-left: 72px;
    width: auto;
  }
  body.has-ig-shell .ig-page {
    padding-bottom: 32px;
    min-height: 100vh;
  }
  .ig-feed-layout {
    display: grid;
    grid-template-columns: minmax(0, 470px);
    justify-content: center;
    gap: 40px;
    max-width: 920px;
    margin: 0 auto;
    padding: 28px 24px 48px;
  }
  .ig-rail {
    display: block;
    padding-top: 20px;
  }
  .ig-messages-fab {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1200;
    padding: 10px 16px 10px 12px;
    border-radius: 999px;
    background: var(--surface-color);
    color: var(--text-color);
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    font-weight: 600;
    font-size: 14px;
  }
  .ig-messages-fab i {
    font-size: 18px;
  }
  body[data-path="/messages"] .ig-messages-fab,
  body:has(.giami-messages-page) .ig-messages-fab {
    display: none;
  }
  body:has(.giami-messages-page).has-ig-shell,
  body:has(.giami-messages-page).has-ig-shell .app-layout {
    height: 100%;
    overflow: hidden;
  }
}

@media (min-width: 1160px) {
  .ig-feed-layout {
    grid-template-columns: minmax(0, 470px) 320px;
  }
}

@media (max-width: 899px) {
  .ig-home {
    padding-bottom: calc(var(--tabbar-h) + 16px);
  }
  .create-new .ig-create-sheet {
    width: 100%;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    max-height: 90vh;
    transform: translate(0, 100%);
    border-radius: 22px 22px 0 0;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }
  .create-new.active .ig-create-sheet {
    transform: translate(0, 0);
  }
  .ig-home .ig-stories,
  .ig-home .ig-page-body {
    max-width: none;
  }
  .ig-home .user-post {
    padding-left: 0;
    padding-right: 0;
  }
  .ig-home .post-media,
  .ig-home .ig-carousel {
    border-radius: 0;
  }
}

@media (min-width: 768px) {
  .ig-page-body,
  .ig-sheet {
    max-width: 680px;
  }
  .ig-home .ig-page-body {
    max-width: 470px;
  }
  .ig-reels,
  .ig-reel {
    max-width: 420px;
    margin: 0 auto;
  }
  .ig-reel-tray {
    left: 50%;
    right: auto;
    width: 420px;
    max-width: 92vw;
    transform: translateX(-50%);
    bottom: 16px;
  }
}

/* --- Instagram profile --- */
.ig-topbar.is-profile .logo-place {
  justify-content: center;
}
.ig-profile-title > a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-color);
  text-decoration: none;
  font-size: 18px;
  font-weight: 700;
}
.ig-profile-title .lni {
  font-size: 12px;
  opacity: 0.8;
}
.ig-profile-handle {
  max-width: 46vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ig-profile {
  max-width: 640px;
  margin: 0 auto;
  padding: 12px 16px 0;
  color: var(--text-color);
  background: var(--bg-color);
}
.ig-profile-main {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 18px;
  align-items: center;
}
.ig-profile-avatar {
  position: relative;
  width: 86px;
  height: 86px;
}
.ig-profile-ring {
  display: block;
  width: 86px;
  height: 86px;
  padding: 3px;
  border-radius: 50%;
  background: var(--border-color);
  box-sizing: border-box;
}
.ig-profile-ring.is-own {
  background: linear-gradient(45deg, #f9ce34, #ee2a7b, #6228d7);
}
.ig-profile-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bg-color);
  background: var(--bg-elevated);
}
.ig-profile-add-story {
  position: absolute;
  right: 0;
  bottom: 2px;
  width: 24px;
  height: 24px;
  border: 2px solid var(--bg-color);
  border-radius: 50%;
  background: var(--accent-color);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}
.ig-profile-meta {
  min-width: 0;
}
.ig-profile-name {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-color);
}
.ig-profile-stats {
  display: flex;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.ig-profile-stats a {
  display: flex;
  flex-direction: column;
  color: var(--text-color);
  text-decoration: none;
  line-height: 1.15;
}
.ig-profile-stats strong {
  font-size: 16px;
}
.ig-profile-stats span {
  font-size: 12px;
  color: var(--text-muted);
}
.ig-profile-bio {
  margin-top: 14px;
}
.ig-profile-bio > p {
  margin: 0 0 6px;
  color: var(--text-color);
  font-size: 14px;
  line-height: 1.35;
}
.ig-profile-location {
  color: var(--text-muted) !important;
  font-size: 13px !important;
}
.ig-profile-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.ig-profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}
.ig-profile-chip.is-add {
  color: var(--text-muted);
}
.ig-profile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  margin-top: 14px;
}
.ig-profile-follow {
  display: block;
}
.ig-profile-follow button {
  width: 100%;
}
.ig-profile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--text-color);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.ig-profile-btn.is-primary {
  background: var(--accent-color);
  color: #fff;
}
.ig-profile-btn-icon {
  width: 40px;
  padding: 0;
  font-size: 18px;
}
.ig-highlights {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  margin: 18px 0 8px;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.ig-highlight {
  flex: 0 0 auto;
  width: 74px;
  text-align: center;
  text-decoration: none;
  color: var(--text-color);
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.ig-highlight-circle {
  display: block;
  width: 64px;
  height: 64px;
  margin: 0 auto 6px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  overflow: hidden;
  background: var(--bg-elevated);
  box-sizing: border-box;
}
.ig-highlight-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ig-highlight-circle.is-new {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--text-color);
  background: transparent;
}
.ig-highlight > span:last-child {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ig-profile-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 8px;
  border-top: 1px solid var(--border-color);
}
.ig-profile-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 20px;
  border-bottom: 1px solid transparent;
}
.ig-profile-tab.is-on {
  color: var(--text-color);
  border-bottom-color: var(--text-color);
}
.ig-profile-grid-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding-bottom: calc(var(--tabbar-h) + 16px);
  background: var(--bg-color);
}
.ig-profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}
.ig-profile-cell {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  background: var(--bg-elevated);
  overflow: hidden;
}
.ig-profile-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ig-profile-cell-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  color: #fff;
  font-size: 14px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}
@media (min-width: 900px) {
  .ig-profile,
  .ig-profile-grid-wrap {
    padding-left: 0;
    padding-right: 0;
    margin-top: 12px;
  }
  .ig-profile-main {
    grid-template-columns: 150px 1fr;
    gap: 36px;
  }
  .ig-profile-avatar,
  .ig-profile-ring {
    width: 140px;
    height: 140px;
  }
  .ig-profile-name {
    font-size: 20px;
  }
}

.ig-profile-ai {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0 0 6px;
}
.ig-profile-link {
  margin: 6px 0 0;
}
.ig-profile-link a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 600;
  word-break: break-all;
}
.ig-profile-link a:hover {
  text-decoration: underline;
}

.ig-edit-profile .ig-page-body {
  max-width: 560px;
  padding: 0 16px calc(var(--tabbar-h) + 48px);
}
.ig-edit-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--input-bg);
  border-radius: 22px;
  padding: 14px 16px;
  margin: 8px 0 22px;
}
.ig-edit-hero img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.ig-edit-hero-meta {
  min-width: 0;
  flex: 1;
}
.ig-edit-hero-meta strong {
  display: block;
  font-size: 15px;
  line-height: 1.2;
  color: var(--text-color);
}
.ig-edit-hero-meta span,
.ig-edit-hero-meta em {
  display: block;
  font-size: 13px;
  font-style: normal;
  color: var(--text-muted);
}
.ig-edit-photo-form {
  margin: 0;
}
.ig-edit-photo-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-color);
  color: #fff;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.ig-edit-photo-btn input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}
.ig-edit-form {
  display: flow-root;
}
.ig-edit-block {
  float: none;
  width: auto;
  margin-bottom: 22px;
}
.ig-edit-form select.js-keep-native,
.ig-edit-select select {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.ig-edit-block h2 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-color);
}
.ig-edit-label {
  display: block;
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-color);
}
.ig-edit-form input[type="text"],
.ig-edit-form textarea,
.ig-edit-form select {
  width: 100%;
  box-sizing: border-box;
  background: var(--input-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 14px 16px;
  font: inherit;
  font-size: 15px;
}
.ig-edit-form textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.45;
}
.ig-edit-form input:focus,
.ig-edit-form textarea:focus,
.ig-edit-form select:focus {
  outline: 0;
  border-color: var(--accent-color);
}
.ig-edit-bio {
  position: relative;
}
.ig-edit-bio textarea {
  padding-bottom: 28px;
}
.ig-edit-bio .js-bio-count {
  position: absolute;
  right: 14px;
  bottom: 10px;
  font-size: 12px;
  color: var(--text-muted);
}
.ig-edit-hint {
  margin: 8px 2px 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-muted);
}
.ig-edit-select {
  position: relative;
}
.ig-edit-select select {
  appearance: none;
  padding-right: 40px;
}
.ig-edit-select::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.ig-edit-toggle {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 14px 16px;
  cursor: pointer;
}
.ig-edit-toggle span {
  flex: 1;
  min-width: 0;
}
.ig-edit-toggle strong {
  display: block;
  font-size: 15px;
  color: var(--text-color);
}
.ig-edit-toggle small {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-muted);
}
.ig-edit-toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.ig-edit-toggle i {
  flex-shrink: 0;
  width: 44px;
  height: 28px;
  border-radius: 999px;
  background: #4a4a4a;
  position: relative;
  transition: background 0.15s ease;
}
.ig-edit-toggle i::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}
.ig-edit-toggle input:checked + i {
  background: var(--accent-color);
}
.ig-edit-toggle input:checked + i::before {
  transform: translateX(16px);
}
.ig-edit-actions {
  display: flex;
  justify-content: flex-end;
  padding: 8px 0 24px;
}
.ig-edit-actions button {
  background: var(--accent-color);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
html[data-theme="light"] .ig-edit-toggle i {
  background: #cfcfcf;
}
