/* Iran-Travian Post Card v48
   Only loaded on the forum page. Main post and author card are separate siblings.
   Existing banner/header/navigation/footer are not restyled by this file. */
:root {
  --itp48-gold: #d8b763;
  --itp48-gold-bright: #ffe6a0;
  --itp48-gold-dim: rgba(216, 183, 99, .35);
  --itp48-green: #0a3219;
  --itp48-green-2: #0d4724;
  --itp48-deep: #03150b;
  --itp48-text: #f5efd9;
  --itp48-muted: #b8c8ba;
  --itp48-border: rgba(216, 183, 99, .75);
}

/* The separate outer rail is NOT inside the post card. Desktop: post on the left, profile card on the right. */
.itp48-post-shell {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(315px, clamp(315px, 27vw, 370px));
  grid-template-areas: "post profile";
  align-items: start;
  gap: 12px;
  width: 100%;
  min-width: 0;
  margin: 0 0 16px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  direction: ltr !important;
  box-sizing: border-box !important;
  clear: both;
}
.itp48-post-shell > .itp48-post-main {
  grid-area: post !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
  float: none !important;
  position: relative;
  box-sizing: border-box !important;
  direction: rtl;
}
.itp48-post-shell > .itp48-card-rail {
  grid-area: profile !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  position: relative;
  box-sizing: border-box !important;
  direction: rtl;
}
.itp48-card-rail > .itp48-user-card,
.itp48-user-card {
  --unused-local: 0;
  position: relative !important;
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 12px !important;
  overflow: hidden !important;
  color: var(--itp48-text) !important;
  text-align: right !important;
  direction: rtl !important;
  font: 13px/1.65 Tahoma, Arial, sans-serif !important;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(49, 119, 55, .32), transparent 50%),
    linear-gradient(155deg, #0c351b 0%, #061b0e 57%, #031109 100%) !important;
  border: 1px solid var(--itp48-border) !important;
  border-radius: 12px !important;
  box-shadow: inset 0 0 0 1px rgba(255, 230, 160, .07), 0 5px 16px rgba(0, 0, 0, .22) !important;
  box-sizing: border-box !important;
}
.itp48-user-card * { box-sizing: border-box; }
.itp48-user-card a { color: #f3e4b6 !important; text-decoration: none !important; }
.itp48-user-card a:hover { color: #fff7d7 !important; text-decoration: underline !important; }
.itp48-card-kicker {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  margin: 0 0 10px !important;
  padding: 0 0 8px !important;
  color: var(--itp48-gold-bright) !important;
  border-bottom: 1px solid var(--itp48-gold-dim) !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: .1px;
}
.itp48-brand-mini { display:inline-flex; align-items:center; gap:6px; }
.itp48-online-pill { display:inline-flex; align-items:center; gap:5px; padding:2px 7px; border:1px solid rgba(77,211,95,.35); border-radius:999px; background:rgba(17,95,35,.28); color:#91ef9c; white-space:nowrap; font-size:10px; font-weight:800; }
.itp48-online-pill.offline { color:#bdc7be; border-color:rgba(189,199,190,.25); background:rgba(130,140,132,.1); }
.itp48-online-dot { width:7px; height:7px; flex:0 0 7px; border-radius:50%; background:#51e16a; box-shadow:0 0 7px rgba(81,225,106,.8); }
.itp48-online-pill.offline .itp48-online-dot { background:#828b84; box-shadow:none; }
.itp48-card-intro { display:grid; grid-template-columns:104px minmax(0, 1fr); gap:10px; align-items:center; margin-bottom:10px; direction:ltr; }
.itp48-user-identity { direction:rtl; }
.itp48-avatar-frame { position:relative; cursor:zoom-in; display:flex; align-items:center; justify-content:center; width:104px; height:104px; max-width:100%; margin:0 auto; padding:4px; border:1px solid var(--itp48-gold); border-radius:10px; background:linear-gradient(145deg,rgba(217,184,95,.25),rgba(0,0,0,.4)); box-shadow:0 0 0 2px rgba(216,183,99,.09),0 4px 12px rgba(0,0,0,.3); }
.itp48-avatar-frame img.itp48-avatar-img { display:block !important; width:100% !important; height:100% !important; max-width:100% !important; max-height:100% !important; margin:0 !important; padding:0 !important; float:none !important; object-fit:cover !important; border:0 !important; border-radius:6px !important; background:#05160b !important; }
.itp48-avatar-zoom { position:absolute; inset:auto 3px 3px auto; display:flex; align-items:center; justify-content:center; width:25px; height:25px; color:#fff0bf !important; background:rgba(1,17,8,.86); border:1px solid var(--itp48-gold); border-radius:5px; }
.itp48-user-identity { min-width:0; text-align:right; }
.itp48-user-identity .largetext,
.itp48-user-identity .smalltext { display:block !important; margin:0 !important; line-height:1.8 !important; }
.itp48-user-identity .largetext { font-size:15px !important; font-weight:900 !important; overflow-wrap:anywhere; }
.itp48-user-identity .largetext a { color:#ffdf77 !important; }
.itp48-user-identity .smalltext { font-size:11px !important; color:var(--itp48-muted) !important; }
.itp48-user-identity img.userstars,
.itp48-user-identity img.groupimage,
.itp48-user-identity .groupimage { max-width:100%; height:auto; vertical-align:middle; }
.itp48-user-title { display:block; margin-top:5px; color:#bfe59b; font-size:11px; font-weight:800; overflow-wrap:anywhere; }
.itp48-role-chips { display:flex; flex-wrap:wrap; gap:4px; align-items:center; margin:8px 0 10px; }
.itp48-chip { display:inline-flex; align-items:center; gap:4px; max-width:100%; padding:3px 6px; border:1px solid rgba(216,183,99,.4); border-radius:5px; color:#f4e6b9; background:rgba(0,0,0,.18); font-size:10px; line-height:1.5; font-weight:700; }
.itp48-chip.role { color:#ffe29a; border-color:rgba(238,190,68,.72); background:rgba(113,76,9,.22); }
.itp48-section { margin:9px 0 0; padding:8px 8px 7px; border:1px solid rgba(216,183,99,.22); border-radius:8px; background:rgba(0,0,0,.18); }
.itp48-section-title { display:flex; align-items:center; gap:6px; margin:0 0 6px; color:var(--itp48-gold-bright); font-size:11px; font-weight:900; }
.itp48-stat-list { display:grid; grid-template-columns:minmax(0,1fr); gap:0; }
.itp48-stat-row { display:grid; grid-template-columns:20px minmax(0,1fr) auto; gap:5px; align-items:center; min-width:0; padding:5px 0; border-bottom:1px solid rgba(216,183,99,.11); font-size:11px; }
.itp48-stat-row:last-child { border-bottom:0; }
.itp48-stat-icon { display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; color:var(--itp48-gold); }
.itp48-stat-label { color:#c3d0c4; overflow-wrap:anywhere; }
.itp48-stat-value { color:#ffe07b; text-align:left; direction:ltr; font-weight:800; overflow-wrap:anywhere; }
.itp48-rank-line { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-bottom:6px; font-size:10px; }
.itp48-rank-line .rank-name { color:#a7e57e; font-weight:900; }
.itp48-progress { width:100%; height:9px; overflow:hidden; border:1px solid rgba(216,183,99,.58); border-radius:999px; background:#041007; box-shadow:inset 0 1px 2px #000; }
.itp48-progress-fill { height:100%; width:0; border-radius:999px; background:linear-gradient(90deg,#299735,#86e34d); box-shadow:0 0 8px rgba(89,216,73,.3); transition:width .3s ease; }
.itp48-progress-note { margin-top:4px; color:var(--itp48-muted); text-align:left; font-size:10px; direction:rtl; }
.itp48-awards { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; align-items:stretch; }
.itp48-award { display:flex; min-width:0; min-height:54px; flex-direction:column; align-items:center; justify-content:center; gap:3px; padding:5px 2px; border:1px solid rgba(216,183,99,.23); border-radius:6px; background:rgba(13,57,28,.35); text-align:center; }
.itp48-award svg { color:var(--itp48-gold); }
.itp48-award span { color:#dce8d6; font-size:9px; line-height:1.35; overflow-wrap:anywhere; }
.itp48-award.locked { opacity:.52; filter:saturate(.35); }
.itp48-award-count { display:flex; align-items:center; justify-content:center; min-height:54px; border:1px dashed rgba(216,183,99,.38); border-radius:6px; color:var(--itp48-gold-bright); font-size:11px; font-weight:900; }
.itp48-links { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; margin:10px 0 0; padding-top:9px; border-top:1px solid var(--itp48-gold-dim); }
.itp48-action { display:flex !important; min-width:0; min-height:49px; flex-direction:column; align-items:center; justify-content:center; gap:3px; padding:5px 3px !important; color:#f7e8b8 !important; background:linear-gradient(180deg,rgba(16,83,42,.72),rgba(2,28,13,.9)) !important; border:1px solid rgba(52,145,69,.7) !important; border-radius:7px !important; text-align:center; font-size:10px !important; line-height:1.35 !important; font-weight:800 !important; overflow-wrap:anywhere; text-decoration:none !important; }
.itp48-action svg { color:#d7e95d; flex:0 0 auto; }
.itp48-action:hover { background:linear-gradient(180deg,rgba(29,113,51,.9),rgba(5,46,20,.95)) !important; border-color:var(--itp48-gold) !important; transform:translateY(-1px); }
.itp48-action.disabled { opacity:.42; cursor:not-allowed; }
.itp48-hidden-author-cell { display:none !important; }
.itp48-author-placeholder { display:none !important; }
.itp48-native-identity img { max-width:100%; height:auto; }
.itp48-avatar-lightbox { position:fixed; z-index:2147483646; inset:0; display:flex; align-items:center; justify-content:center; padding:24px; background:rgba(0,0,0,.88); cursor:zoom-out; }
.itp48-avatar-lightbox img { max-width:min(92vw,400px); max-height:min(400px,90vh); width:auto; height:auto; object-fit:contain; border:2px solid var(--itp48-gold); border-radius:9px; box-shadow:0 0 30px rgba(216,183,99,.25); }
.itp48-card-footnote { margin-top:8px; color:#8fa692; font-size:9px; text-align:center; line-height:1.6; }

/* Keep the MyBB post itself intact visually and let all of its content use the left column. */
.itp48-post-main .post_author,
.itp48-post-main .post_author * { display:none !important; }
.itp48-post-main .post_content,
.itp48-post-main .postbit_message,
.itp48-post-main .post_body,
.itp48-post-main .post_head,
.itp48-post-main .post_controls,
.itp48-post-main .postbit_buttons { min-width:0; max-width:100%; overflow-wrap:anywhere; box-sizing:border-box; }
.itp48-post-main .post_content,
.itp48-post-main .postbit_message,
.itp48-post-main .post_body { float:none !important; width:100% !important; min-width:0 !important; max-width:100% !important; }
.itp48-post-main img { max-width:100%; }
.itp48-post-main iframe,
.itp48-post-main video { max-width:100%; }

@media (max-width: 920px) {
  .itp48-post-shell { grid-template-columns:minmax(0,1fr) !important; grid-template-areas:"profile" "post" !important; gap:8px !important; }
  .itp48-card-rail { grid-row:1 !important; }
  .itp48-post-main { grid-row:2 !important; }
  .itp48-user-card { padding:10px !important; }
  .itp48-card-intro { grid-template-columns:88px minmax(0,1fr); }
  .itp48-avatar-frame { width:88px; height:88px; }
  .itp48-awards { grid-template-columns:repeat(5,minmax(0,1fr)); }
  .itp48-links { grid-template-columns:repeat(6,minmax(0,1fr)); }
  .itp48-action { min-height:43px; }
}
@media (max-width: 520px) {
  .itp48-post-shell { margin-bottom:12px !important; }
  .itp48-card-intro { grid-template-columns:76px minmax(0,1fr); gap:8px; }
  .itp48-avatar-frame { width:76px; height:76px; }
  .itp48-user-identity .largetext { font-size:13px !important; }
  .itp48-awards { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .itp48-links { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .itp48-stat-row { font-size:10px; }
}


/* v48 premium identity row and decorative details, based on the approved mockup. */
.itp48-user-name { display:block; color:#ffdf77; font-size:15px; line-height:1.7; font-weight:900; overflow-wrap:anywhere; }
.itp48-user-name a { color:#ffdf77 !important; }
.itp48-user-title { display:flex; align-items:center; justify-content:flex-start; gap:4px; margin-top:4px; color:#bfe59b; font-size:11px; line-height:1.6; font-weight:800; overflow-wrap:anywhere; }
.itp48-native-title { display:block; margin-top:2px !important; color:var(--itp48-muted) !important; font-size:10px !important; overflow-wrap:anywhere; }
.itp48-user-stars { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-start; gap:2px; margin-top:5px; min-height:15px; }
.itp48-user-stars img { display:inline-block !important; width:auto !important; max-width:100% !important; max-height:18px !important; object-fit:contain; }
.itp48-group-emblem { display:inline-flex; align-items:center; justify-content:center; min-width:22px; min-height:22px; padding:2px; }
.itp48-group-emblem img { max-width:32px !important; max-height:32px !important; width:auto !important; height:auto !important; object-fit:contain; }
.itp48-recent-achievements { margin-top:8px; padding:8px; border:1px solid rgba(216,183,99,.25); border-radius:8px; background:linear-gradient(145deg,rgba(17,71,34,.45),rgba(0,0,0,.19)); }
.itp48-recent-title { display:flex; align-items:center; gap:5px; color:var(--itp48-gold-bright); font-size:10px; font-weight:900; }
.itp48-recent-title svg { flex:0 0 auto; }
.itp48-recent-title strong { margin-right:auto; color:#a9e881; font-size:10px; }
.itp48-recent-subtitle { margin-top:4px; color:var(--itp48-muted); font-size:9px; line-height:1.6; }
.itp48-card-motto { display:flex; align-items:center; justify-content:center; gap:6px; margin-top:8px; padding:8px 6px; border:1px solid rgba(216,183,99,.2); border-radius:7px; background:rgba(1,20,8,.55); color:#e4d29a; text-align:center; font-size:10px; line-height:1.7; }
.itp48-motto-icon { display:inline-flex; color:var(--itp48-gold); flex:0 0 auto; }
.itp48-card-motto svg { display:block; }
.itp48-user-card .itp48-avatar-frame { outline:1px solid rgba(255,230,160,.08); outline-offset:2px; }
.itp48-user-card .itp48-section-title svg { flex:0 0 auto; }
.itp48-user-card img { max-width:100%; }
.itp48-card-rail { min-width:0; }
.itp48-post-shell > .itp48-post-main { align-self:start; }
/* Classic MyBB table postbit: remove only the old author cell after its content has been moved. */
.itp48-post-main td.itp48-hidden-author-cell,
.itp48-post-main th.itp48-hidden-author-cell,
.itp48-post-main .itp48-hidden-author-cell { display:none !important; width:0 !important; min-width:0 !important; max-width:0 !important; padding:0 !important; border:0 !important; }
.itp48-post-main[id^="post_"] { width:100% !important; max-width:100% !important; min-width:0 !important; margin:0 !important; box-sizing:border-box !important; }
table.itp48-post-main { border-collapse:separate; border-spacing:0; table-layout:auto !important; }
.itp48-post-main > tbody > tr > td,
.itp48-post-main > tr > td { min-width:0; box-sizing:border-box; }
.itp48-post-main .post_body,
.itp48-post-main .postbit_message,
.itp48-post-main .post_content { display:block; width:100% !important; max-width:100% !important; min-width:0 !important; overflow-wrap:anywhere; box-sizing:border-box; }
.itp48-post-main .postbit_buttons, .itp48-post-main .post_controls, .itp48-post-main .post_meta { max-width:100%; overflow-wrap:anywhere; }
.itp48-avatar-frame:focus-visible, .itp48-action:focus-visible { outline:2px solid #ffe6a0; outline-offset:2px; }

/* v48: each profile card is a true sibling beside (not a column inside) the original MyBB post. */
.itp48-post-shell { contain:layout style; isolation:isolate; }
.itp48-post-shell > .itp48-post-main { grid-area:post !important; }
.itp48-post-shell > .itp48-card-rail { grid-area:profile !important; }
.itp48-user-card .itp48-stat-row { grid-template-columns:20px minmax(0,1fr) auto; }
.itp48-card-admin-note { margin-top:7px; padding:7px; border:1px dashed rgba(216,183,99,.3); border-radius:6px; background:rgba(2,18,8,.4); color:#c2d1c3; font-size:9px; line-height:1.65; }
.itp48-card-admin-note .itp48-admin-line { display:flex; align-items:center; justify-content:space-between; gap:7px; padding:3px 0; border-bottom:1px solid rgba(216,183,99,.1); }
.itp48-card-admin-note .itp48-admin-line:last-child { border-bottom:0; }
.itp48-action.disabled { cursor:not-allowed; opacity:.42; pointer-events:none; filter:saturate(.3); }
.itp48-section-note { margin-top:5px; color:#8fa692; font-size:9px; line-height:1.55; }
.itp48-post-main > tbody > tr > td:only-child, .itp48-post-main > tr > td:only-child { width:100% !important; }
@media(max-width:1100px) and (min-width:921px) { .itp48-post-shell { grid-template-columns:minmax(0,1fr) minmax(295px,315px); gap:8px; } .itp48-user-card { padding:9px !important; } }

/* v48: force the card and post into two separate sibling areas; the card is never styled inside the post table. */
.itp48-post-shell {
  display:grid !important;
  grid-template-columns:minmax(0,1fr) minmax(315px,clamp(315px,27vw,370px)) !important;
  grid-template-areas:"post profile" !important;
  align-items:start !important;
  gap:12px !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  direction:ltr !important;
  float:none !important;
  clear:both !important;
  margin:0 0 16px !important;
  padding:0 !important;
  border:0 !important;
  background:transparent !important;
  box-shadow:none !important;
  box-sizing:border-box !important;
}
.itp48-post-shell > .itp48-post-main { grid-area:post !important; width:100% !important; min-width:0 !important; max-width:100% !important; margin:0 !important; float:none !important; align-self:start !important; }
.itp48-post-shell > .itp48-card-rail { grid-area:profile !important; width:100% !important; min-width:0 !important; max-width:100% !important; margin:0 !important; padding:0 !important; float:none !important; align-self:start !important; }
.itp48-post-main td.itp48-hidden-author-cell,
.itp48-post-main th.itp48-hidden-author-cell,
.itp48-post-main .itp48-hidden-author-cell { display:none !important; width:0 !important; max-width:0 !important; min-width:0 !important; padding:0 !important; border:0 !important; }
.itp48-copy-profile { appearance:none; cursor:pointer; font-family:Tahoma,Arial,sans-serif !important; }
.itp48-copy-profile.copied { border-color:#85e88b !important; color:#eaffea !important; }
.itp48-copy-profile.copied svg { color:#85e88b !important; }
@media(max-width:920px) {
  .itp48-post-shell { grid-template-columns:minmax(0,1fr) !important; grid-template-areas:"profile" "post" !important; }
  .itp48-post-shell > .itp48-card-rail { grid-area:profile !important; }
  .itp48-post-shell > .itp48-post-main { grid-area:post !important; }
}


/* v48.1: approved 200x200 avatar size; stack identity so the avatar is never squeezed. */
.itp48-card-intro {
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:flex-start !important;
  gap:10px !important;
  margin-bottom:10px !important;
  direction:rtl !important;
}
.itp48-card-intro > .itp48-avatar-frame {
  width:200px !important;
  height:200px !important;
  min-width:200px !important;
  min-height:200px !important;
  max-width:100% !important;
  flex:0 0 200px !important;
  margin:0 auto !important;
}
.itp48-user-identity {
  width:100% !important;
  min-width:0 !important;
  text-align:center !important;
}
.itp48-user-identity .largetext,
.itp48-user-identity .smalltext,
.itp48-user-title { text-align:center !important; }
.itp48-user-stars { display:flex !important; flex-wrap:wrap !important; justify-content:center !important; align-items:center !important; gap:2px !important; margin-top:5px !important; }
.itp48-user-identity .largetext a { overflow-wrap:anywhere !important; }
@media (max-width:920px) {
  .itp48-card-intro { display:flex !important; flex-direction:column !important; grid-template-columns:none !important; }
  .itp48-card-intro > .itp48-avatar-frame { width:200px !important; height:200px !important; min-width:200px !important; min-height:200px !important; flex-basis:200px !important; }
}
@media (max-width:520px) {
  .itp48-card-intro { display:flex !important; flex-direction:column !important; grid-template-columns:none !important; }
  .itp48-card-intro > .itp48-avatar-frame { width:200px !important; height:200px !important; min-width:200px !important; min-height:200px !important; flex-basis:200px !important; }
}

/* IRAN TRAVIAN POST CARD V48 - DETACHED RIGHT PANEL */

.itp48-post-shell {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 280px !important;
    grid-template-areas: "post card" !important;
    direction: ltr !important;
    align-items: start !important;
    gap: 16px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 0 24px !important;
    box-sizing: border-box !important;
}

.itp48-post-shell > .post {
    grid-area: post !important;
    direction: rtl !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    float: none !important;
    box-sizing: border-box !important;
}

.itp48-post-shell > .itp48-card-rail {
    grid-area: card !important;
    direction: rtl !important;
    display: block !important;
    width: 280px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    float: none !important;
    box-sizing: border-box !important;
}

.itp48-post-shell > .itp48-card-rail * {
    max-width: 100%;
    box-sizing: border-box;
}

/* Narrow screens: keep an independent card at the right. */
@media (max-width: 680px) {
    .itp48-post-shell {
        grid-template-columns: minmax(0, 1fr) 160px !important;
        grid-template-areas: "post card" !important;
        gap: 8px !important;
    }

    .itp48-post-shell > .itp48-card-rail {
        width: 160px !important;
        min-width: 0 !important;
        max-width: 160px !important;
    }
}

/* Very narrow screens: stack panels to avoid unreadable post text. */
@media (max-width: 360px) {
    .itp48-post-shell {
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-areas: "card" "post" !important;
    }

    .itp48-post-shell > .itp48-card-rail {
        grid-area: card !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .itp48-post-shell > .post {
        grid-area: post !important;
    }
}

/* ITP48-FINAL-SEPARATE-PANELS */
.itp48-post-shell {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 280px !important;
    grid-template-areas: "post card" !important;
    direction: ltr !important;
    align-items: start !important;
    gap: 16px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 0 24px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: 0 !important;
    overflow: visible !important;
    box-sizing: border-box !important;
}

.itp48-post-shell > .post {
    grid-area: post !important;
    direction: rtl !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    float: none !important;
    border: 1px solid #cbdcc9 !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    box-shadow: 0 3px 12px rgba(25, 70, 35, 0.10) !important;
    box-sizing: border-box !important;
}

.itp48-post-shell > .itp48-card-rail {
    grid-area: card !important;
    direction: rtl !important;
    display: block !important;
    width: 280px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 10px !important;
    float: none !important;
    border: 1px solid #8fbd91 !important;
    border-radius: 12px !important;
    background: #f2faf0 !important;
    box-shadow: 0 4px 14px rgba(25, 70, 35, 0.14) !important;
    box-sizing: border-box !important;
}

.itp48-post-shell > .itp48-card-rail .itp48-user-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.itp48-post-shell > .itp48-card-rail img {
    max-width: 100%;
    height: auto;
    box-sizing: border-box;
}

@media (max-width: 680px) {
    .itp48-post-shell {
        grid-template-columns: minmax(0, 1fr) 160px !important;
        grid-template-areas: "post card" !important;
        gap: 8px !important;
    }

    .itp48-post-shell > .itp48-card-rail {
        width: 160px !important;
        min-width: 0 !important;
        max-width: 160px !important;
        padding: 6px !important;
    }
}

@media (max-width: 360px) {
    .itp48-post-shell {
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-areas: "card" "post" !important;
    }

    .itp48-post-shell > .itp48-card-rail {
        grid-area: card !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .itp48-post-shell > .post {
        grid-area: post !important;
    }
}
/* END ITP48-FINAL-SEPARATE-PANELS */

/* ITP48-HIDE-ORIGINAL-AUTHOR */
/* The author panel is rendered separately in the right-hand rail. */
.itp48-post-shell > .post > .post_author,
.itp48-post-shell > .post .post_author {
    display: none !important;
}

/* Keep the message area independent from the detached profile panel. */
.itp48-post-shell > .post > .post_content {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.itp48-post-shell > .itp48-card-rail {
    position: relative !important;
    align-self: start !important;
    z-index: 2 !important;
}
/* END ITP48-HIDE-ORIGINAL-AUTHOR */

/* ITP48-REMOVE-OUTER-POST-FRAME */
/* Remove the shared MyBB table frame around the posts area only. */
table.tborder.tfixed.clear:has(#posts) {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: 0 !important;
}

table.tborder.tfixed.clear:has(#posts) > tbody,
table.tborder.tfixed.clear:has(#posts) > tbody > tr,
table.tborder.tfixed.clear:has(#posts) > tbody > tr > td#posts_container {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: 0 !important;
}

/* Preserve two visually distinct panels. */
.itp48-post-shell > .post {
    border: 1px solid #cbdcc9 !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    box-shadow: 0 3px 12px rgba(25, 70, 35, 0.10) !important;
}

.itp48-post-shell > .itp48-card-rail {
    border: 1px solid #8fbd91 !important;
    border-radius: 12px !important;
    background: #f2faf0 !important;
    box-shadow: 0 4px 14px rgba(25, 70, 35, 0.14) !important;
}
/* END ITP48-REMOVE-OUTER-POST-FRAME */

/* IT-POST-CARD-V50-LAYOUT-START
   Container-aware independent-panel layout: fit the real post-list width, not only viewport width. */
.posts {
  container-type: inline-size;
  container-name: itp-post-container;
}
.itp48-post-shell {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(260px, clamp(260px, 28vw, 350px)) !important;
  grid-template-areas: "post profile" !important;
  gap: 12px !important;
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}
.itp48-post-shell > .itp48-post-main,
.itp48-post-shell > .itp48-card-rail,
.itp48-card-rail > .itp48-user-card {
  box-sizing: border-box !important;
  min-width: 0 !important;
}
.itp48-card-rail > .itp48-user-card {
  border: 1px solid var(--itp48-border, rgba(216,183,99,.75)) !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  box-shadow: 0 5px 20px rgba(0,0,0,.20) !important;
}
.itp48-post-shell > .itp48-post-main {
  border: 1px solid rgba(216,183,99,.50) !important;
  border-radius: 12px !important;
  overflow-wrap: anywhere;
}
/* The live forum has a narrow .posts container even on some desktop widths.
   In that case panels stack as visibly separate cards instead of being squeezed together. */
@container itp-post-container (max-width: 620px) {
  .itp48-post-shell {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas: "profile" "post" !important;
    gap: 12px !important;
  }
  .itp48-post-shell > .itp48-card-rail { grid-area: profile !important; width: 100% !important; }
  .itp48-post-shell > .itp48-post-main { grid-area: post !important; width: 100% !important; }
  .itp48-card-rail > .itp48-user-card { width: 100% !important; max-width: 100% !important; }
}
/* IT-POST-CARD-V50-LAYOUT-END */


/* v51: other members' cards are compact; only the logged-in viewer's own card remains full. */
.itp48-user-card.itp51-card-compact { padding:9px !important; min-width:0 !important; max-width:100% !important; direction:rtl !important; }
.itp51-compact-card { direction:rtl; min-width:0; color:var(--itp48-text,#e6f1e4); }
.itp51-compact-brand { margin:0 0 7px; color:var(--itp48-gold-bright,#ffe59a); font-size:10px; line-height:1.6; font-weight:900; text-align:center; border-bottom:1px solid rgba(216,183,99,.25); padding-bottom:5px; }
.itp51-compact-head { display:grid; grid-template-columns:58px minmax(0,1fr); gap:9px; align-items:center; direction:rtl; }
.itp51-compact-avatar { width:56px; height:56px; display:flex; align-items:center; justify-content:center; overflow:hidden; border:1px solid rgba(216,183,99,.55); border-radius:7px; background:rgba(1,20,8,.7); color:var(--itp48-gold,#d8b763); }
.itp51-compact-avatar img { display:block; width:100%; height:100%; max-width:100%; object-fit:cover; border-radius:6px; }
.itp51-compact-identity { min-width:0; overflow-wrap:anywhere; }
.itp51-compact-name { color:#ffdf77; font-size:13px; line-height:1.7; font-weight:900; overflow-wrap:anywhere; }
.itp51-compact-name a { color:inherit !important; text-decoration:none; }
.itp51-compact-role { display:inline-block; max-width:100%; margin-top:4px; padding:2px 7px; border:1px solid rgba(216,183,99,.28); border-radius:999px; color:#bfe59b; background:rgba(13,57,28,.45); font-size:10px; line-height:1.6; font-weight:800; overflow-wrap:anywhere; }
.itp51-compact-stats { display:flex; justify-content:space-between; align-items:center; gap:7px; margin-top:8px; color:var(--itp48-muted,#a8bca8); font-size:10px; line-height:1.6; }
.itp51-compact-stats strong { color:var(--itp48-gold-bright,#ffe59a); font-size:11px; font-weight:900; }
.itp51-compact-progress { width:100%; height:6px; margin-top:5px; overflow:hidden; border:1px solid rgba(216,183,99,.35); border-radius:999px; background:#041007; }
.itp51-compact-progress-fill { height:100%; width:0; border-radius:999px; background:linear-gradient(90deg,#299735,#86e34d); transition:width .3s ease; }
.itp51-compact-foot { display:flex; justify-content:flex-start; margin-top:7px; }
.itp51-compact-profile { display:inline-flex; align-items:center; padding:4px 8px; border:1px solid rgba(52,145,69,.6); border-radius:5px; color:#f7e8b8 !important; background:rgba(16,83,42,.55); font-size:10px; font-weight:800; text-decoration:none !important; }
.itp51-compact-profile:hover { border-color:var(--itp48-gold,#d8b763); }
@media(max-width:520px) { .itp48-user-card.itp51-card-compact { padding:8px !important; } .itp51-compact-head { grid-template-columns:50px minmax(0,1fr); gap:7px; } .itp51-compact-avatar { width:48px; height:48px; } .itp51-compact-name { font-size:12px; } }


/* V51 POSITION FIX: explicitly align card and post */
.itp48-post-shell {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(315px, clamp(315px, 27vw, 370px)) !important;
  grid-template-rows: auto !important;
  grid-template-areas: "post profile" !important;
  align-items: start !important;
}

.itp48-post-shell > .itp48-post-main {
  grid-column: 1 !important;
  grid-row: 1 !important;
  align-self: start !important;
}

.itp48-post-shell > .itp48-card-rail {
  grid-column: 2 !important;
  grid-row: 1 !important;
  align-self: start !important;
  margin-top: 0 !important;
  transform: none !important;
}

@media (max-width: 920px) {
  .itp48-post-shell {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    grid-template-areas: "profile" "post" !important;
  }

  .itp48-post-shell > .itp48-card-rail {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  .itp48-post-shell > .itp48-post-main {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }
}

@container itp-post-container (max-width: 620px) {
  .itp48-post-shell {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    grid-template-areas: "profile" "post" !important;
  }

  .itp48-post-shell > .itp48-card-rail {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  .itp48-post-shell > .itp48-post-main {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }
}

/* V51.0.2: align the card with the title edge and let the post fill the remaining space */
.itp48-post-shell {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 252px !important;
  grid-template-rows: auto !important;
  grid-template-areas: "post profile" !important;
  column-gap: 12px !important;
  align-items: start !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.itp48-post-shell > .itp48-post-main {
  grid-column: 1 !important;
  grid-row: 1 !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  justify-self: stretch !important;
  margin: 0 !important;
}

.itp48-post-shell > .itp48-card-rail {
  grid-column: 2 !important;
  grid-row: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  justify-self: stretch !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  box-sizing: border-box !important;
}

.itp48-post-shell > .itp48-card-rail > .itp48-user-card {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

@media (max-width: 920px) {
  .itp48-post-shell {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    grid-template-areas: "profile" "post" !important;
  }

  .itp48-post-shell > .itp48-card-rail {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  .itp48-post-shell > .itp48-post-main {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }
}


/* IRAN-TRAVIAN-RATING-AND-PRESENCE-V51.0.4 */
.itp51-reputation-panel {
  margin-top: 10px !important;
}
.itp51-reputation-score {
  display: block;
  margin: 7px 0;
  color: var(--itp48-gold-bright, #ffe59a) !important;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}
.itp51-reputation-help {
  margin: 5px 0 8px;
  color: var(--itp48-muted, #a8bca8);
  font-size: 10px;
  line-height: 1.8;
  text-align: center;
}
.itp59-reputation-link {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #68b86d;
  border-radius: 7px;
  background: linear-gradient(180deg, #246d36, #103c20);
  color: #f3ffec !important;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}
.itp59-reputation-link:hover:not([aria-disabled="true"]) {
  filter: brightness(1.13);
}
.itp59-reputation-link[aria-disabled="true"] {
  opacity: .5;
  cursor: not-allowed;
}
.itp51-compact-rating {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid rgba(216,183,99,.22);
}
.itp51-compact-rating-title {
  color: var(--itp48-gold-bright, #ffe59a);
  font-size: 10px;
  font-weight: 900;
}
.itp51-compact-rating .itp51-reputation-score {
  margin: 4px 0 6px;
  font-size: 12px;
}
.itp51-compact-rating .itp59-reputation-link {
  padding: 6px;
  font-size: 10px;
}
.itp48-online-pill:not(.offline) .itp48-online-dot {
  background: #22c55e !important;
  box-shadow: 0 0 7px rgba(34,197,94,.8) !important;
}
.itp48-online-pill:not(.offline) > span {
  color: #55df7a !important;
}
.itp48-online-pill.offline .itp48-online-dot {
  background: #f59e0b !important;
  box-shadow: 0 0 7px rgba(245,158,11,.7) !important;
}
.itp48-online-pill.offline > span {
  color: #ffbd59 !important;
}


/* Iran-Travian card update 51.0.5: eight medals in two rows */
.itp48-awards { grid-template-columns:repeat(4,minmax(0,1fr)) !important; }
@media (max-width:520px) { .itp48-awards { grid-template-columns:repeat(4,minmax(0,1fr)) !important; } }

/* v57: make the rating control a genuine clickable link; do not depend on AJAX handlers. */
.itp59-reputation-link { text-decoration:none !important; position:relative; z-index:9999; pointer-events:auto; cursor:pointer; }
.itp59-reputation-link[aria-disabled="true"] { opacity:.55; cursor:not-allowed; }

/* v58: clearer card action and a centered, polished MyBB vote dialog. */
.itp59-reputation-link {
  display:inline-flex !important; align-items:center; justify-content:center; gap:7px;
  min-height:36px; padding:8px 15px; border-radius:10px; text-decoration:none !important;
  position:relative; z-index:4; pointer-events:auto; cursor:pointer; font-weight:800;
  transition:transform .16s ease, filter .16s ease, box-shadow .16s ease;
}
.itp59-reputation-link:hover:not([aria-disabled="true"]) { transform:translateY(-1px); filter:brightness(1.05); box-shadow:0 6px 18px rgba(0,0,0,.16); }
.itp59-reputation-link[aria-disabled="true"] { opacity:.48; cursor:not-allowed; pointer-events:auto; }
.itp58-compact-rating-title { font-weight:800; margin-bottom:4px; }
.jquery-modal.blocker { z-index:99998 !important; background:rgba(10,18,32,.74) !important; padding:18px !important; }
.jquery-modal .modal {
  width:min(520px, calc(100vw - 36px)) !important; max-width:520px !important; box-sizing:border-box;
  margin:0 auto !important; border-radius:18px !important; overflow:hidden; direction:rtl;
  background:#fff; color:#182230; box-shadow:0 22px 80px rgba(0,0,0,.38) !important;
  border:1px solid rgba(255,255,255,.4);
}
.jquery-modal .modal table.tborder { width:100% !important; margin:0 !important; border:0 !important; border-radius:0 !important; border-collapse:separate; border-spacing:0; }
.jquery-modal .modal td.trow1 { padding:22px !important; border:0 !important; background:#fff !important; color:#182230; }
.jquery-modal .modal td.thead { padding:15px 20px !important; background:#182b45 !important; color:#fff !important; }
.jquery-modal .modal input.textbox, .jquery-modal .modal select { box-sizing:border-box; max-width:100%; min-height:38px; border-radius:8px; }
.jquery-modal .modal input.button { min-height:38px; border-radius:9px; padding:8px 17px; cursor:pointer; font-weight:700; }
@media (max-width:520px) {
  .jquery-modal.blocker { padding:8px !important; }
  .jquery-modal .modal { width:calc(100vw - 16px) !important; max-width:calc(100vw - 16px) !important; border-radius:14px !important; }
  .jquery-modal .modal td.trow1 { padding:14px !important; }
}
/* v59: clickable rating control without the old help paragraph, plus a custom modal independent of jQuery modal. */
.itp59-reputation-link {
  display:inline-flex !important; align-items:center; justify-content:center; gap:7px;
  min-height:38px; padding:8px 15px; border:1px solid rgba(216,183,99,.8); border-radius:10px;
  background:linear-gradient(135deg,#203952,#345777); color:#fff !important;
  text-decoration:none !important; position:relative; z-index:4; pointer-events:auto; cursor:pointer;
  font-weight:800; transition:transform .16s ease,filter .16s ease,box-shadow .16s ease;
}
.itp59-reputation-link:hover:not([aria-disabled="true"]) { transform:translateY(-1px); filter:brightness(1.08); box-shadow:0 6px 18px rgba(0,0,0,.2); }
.itp59-reputation-link[aria-disabled="true"] { opacity:.55; cursor:not-allowed; pointer-events:auto; }
.itp59-modal-overlay { position:fixed; inset:0; z-index:2147483000; display:flex; align-items:center; justify-content:center; padding:18px; box-sizing:border-box; background:rgba(4,12,24,.76); backdrop-filter:blur(5px); -webkit-backdrop-filter:blur(5px); }
.itp59-modal-dialog { position:relative; display:flex; flex-direction:column; width:min(560px,calc(100vw - 24px)); max-height:calc(100vh - 32px); overflow:hidden; box-sizing:border-box; border:1px solid rgba(226,190,105,.7); border-radius:18px; background:#fff; color:#172338; box-shadow:0 28px 90px rgba(0,0,0,.48); direction:rtl; text-align:right; }
.itp59-modal-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:15px 19px; background:linear-gradient(135deg,#172b45,#243b59); color:#fff; border-bottom:2px solid #d6b25e; }
.itp59-modal-title { font-size:17px; font-weight:800; line-height:1.5; }
.itp59-modal-close { flex:0 0 auto; display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px; padding:0; border:1px solid rgba(255,255,255,.3); border-radius:10px; background:rgba(255,255,255,.1); color:#fff; font-size:25px; line-height:1; cursor:pointer; }
.itp59-modal-close:hover { background:rgba(255,255,255,.2); }
.itp59-modal-content { overflow-y:auto; padding:18px; min-height:120px; background:#fff; color:#172338; }
.itp59-modal-content .modal { display:block!important; position:static!important; width:auto!important; max-width:none!important; margin:0!important; padding:0!important; border:0!important; border-radius:0!important; background:transparent!important; color:inherit!important; box-shadow:none!important; }
.itp59-modal-content .tborder { width:100%!important; margin:0!important; border:0!important; border-collapse:collapse!important; background:#fff!important; }
.itp59-modal-content .trow1,.itp59-modal-content .trow2 { padding:10px 8px!important; background:#fff!important; color:#172338!important; border:0!important; }
.itp59-modal-content .thead { padding:8px!important; background:#eef2f7!important; color:#172338!important; }
.itp59-modal-content input.textbox,.itp59-modal-content input[type=text],.itp59-modal-content select { box-sizing:border-box; max-width:100%; min-height:40px; border:1px solid #c8d0dc; border-radius:9px; padding:7px 10px; background:#fff; color:#172338; }
.itp59-modal-content input[type=text] { width:100%!important; }
.itp59-modal-content input.button,.itp59-modal-content button.button { min-height:40px; margin:3px; padding:8px 16px; border:0; border-radius:9px; background:#1f466b; color:#fff; font-weight:800; cursor:pointer; }
.itp59-modal-content input.button[name=delete] { background:#9f3434; }
.itp59-modal-loading { padding:24px; text-align:center; color:#41536b; }
.itp59-modal-content .error,.itp59-modal-content .red_alert,.itp59-modal-content .itp59-modal-error { display:block; border:1px solid #e2b1b1; border-radius:10px; padding:13px; background:#fff4f4; color:#842626; line-height:1.8; }
.itp59-modal-retry { margin-top:12px; padding:9px 14px; border:0; border-radius:9px; background:#1f466b; color:#fff; font-weight:700; cursor:pointer; }
@media(max-width:520px) { .itp59-modal-overlay { padding:8px; } .itp59-modal-dialog { width:calc(100vw - 16px); max-height:calc(100vh - 16px); border-radius:13px; } .itp59-modal-head { padding:12px 14px; } .itp59-modal-content { padding:12px; } }