.portfolio-comments-ui {
  --comment-accent: #6c5ce7;
  position: relative;
  z-index: 240;
  font-family: Helvetica, Arial, sans-serif;
  color: #171717;
  font-size: 13px;
  line-height: 1.35;
}

.portfolio-comments-ui[hidden],
.portfolio-comments-ui [hidden] { display: none !important; }

body.is-home-loading .portfolio-comments-ui { visibility: hidden; }

.portfolio-comment-pins { position: fixed; z-index: 241; inset: 0; pointer-events: none; }

.portfolio-comment-launcher {
  position: fixed;
  z-index: 246;
  top: 8px;
  right: 112px;
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid rgba(0, 0, 0, .13);
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: #171717;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .07);
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.portfolio-comment-launcher:hover,
.portfolio-comment-launcher.is-active { border-color: #171717; background: #171717; color: #fff; }

.portfolio-comment-launcher:focus-visible,
.portfolio-comment-pin:focus-visible,
.portfolio-comment-hint button:focus-visible,
.portfolio-comment-card button:focus-visible,
.portfolio-comment-composer button:focus-visible,
.portfolio-comment-composer textarea:focus-visible { outline: 2px solid #8a4b00; outline-offset: 2px; }

.portfolio-comment-launcher-icon { position: relative; width: 13px; height: 11px; border: 1.5px solid currentColor; border-radius: 4px; }
.portfolio-comment-launcher-icon::after { position: absolute; bottom: -4px; left: 2px; width: 4px; height: 4px; border-bottom: 1.5px solid currentColor; border-left: 1.5px solid currentColor; content: ""; transform: skewY(-35deg); }

.portfolio-comment-count { display: grid; min-width: 18px; height: 18px; place-items: center; margin-right: -6px; padding: 0 5px; border-radius: 999px; background: #ededed; color: #171717; font-size: 10px; font-weight: 600; }
.portfolio-comment-launcher.is-active .portfolio-comment-count { background: rgba(255,255,255,.18); color: #fff; }

.portfolio-comment-hint {
  position: fixed;
  z-index: 247;
  top: 48px;
  right: 112px;
  width: min(300px, calc(100vw - 24px));
  padding: 16px;
  border: 1px solid rgba(0, 0, 0, .1);
  border-radius: 14px;
  background: #171717;
  color: #fff;
  box-shadow: 0 16px 50px rgba(0, 0, 0, .2);
  animation: portfolio-comment-in 180ms ease-out both;
}

.portfolio-comment-hint::before { position: absolute; top: -6px; right: 42px; width: 12px; height: 12px; background: #171717; content: ""; transform: rotate(45deg); }
.portfolio-comment-hint p { margin: 0 24px 14px 0; font-size: 14px; line-height: 1.4; }
.portfolio-comment-hint-close { position: absolute; top: 7px; right: 8px; width: 28px; height: 28px; border: 0; background: transparent; color: rgba(255,255,255,.65); font-size: 20px; cursor: pointer; }
.portfolio-comment-hint-action { min-height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: #fff; color: #171717; font-weight: 600; cursor: pointer; }

.portfolio-comment-mode-hint {
  position: fixed;
  z-index: 247;
  top: 54px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #171717;
  color: #fff;
  box-shadow: 0 8px 26px rgba(0,0,0,.2);
  transform: translateX(-50%);
  pointer-events: none;
}
.portfolio-comment-mode-hint strong { font-size: 12px; }
.portfolio-comment-mode-hint span { color: rgba(255,255,255,.58); font-size: 11px; }

body.is-comment-mode,
body.is-comment-mode :where(main, article, section, figure, img, video, p, h1, h2, h3, a) { cursor: crosshair !important; }

.portfolio-comment-pin {
  position: fixed;
  z-index: 242;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 8px;
  background: transparent;
  box-shadow: 0 2px 10px rgba(0,0,0,.28);
  transform: translate(-50%, -100%) rotate(-10deg);
  pointer-events: auto;
  cursor: pointer;
  transition: scale 120ms ease, filter 120ms ease;
}
.portfolio-comment-pin > * { transform: rotate(10deg); }
.portfolio-comment-pin:hover { scale: 1.08; }
.portfolio-comment-pin.is-draft { opacity: .9; pointer-events: none; }
.portfolio-comment-pin.is-highlighted { animation: portfolio-comment-pulse 1.2s ease 2; }

.portfolio-comment-avatar {
  position: relative;
  display: inline-block;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  overflow: visible;
  border: 1.5px solid rgba(23, 23, 23, .72);
  border-radius: 46% 46% 42% 42%;
  background: linear-gradient(145deg, hsl(var(--avatar-hue) 78% 72%), hsl(var(--avatar-hue-two) 78% 50%));
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .08);
}
.portfolio-comment-avatar > i { position: absolute; display: block; pointer-events: none; }
.portfolio-comment-avatar .avatar-deco { z-index: 0; inset: 0; }
.portfolio-comment-avatar .avatar-deco::before,
.portfolio-comment-avatar .avatar-deco::after,
.portfolio-comment-avatar .avatar-eyes::before,
.portfolio-comment-avatar .avatar-eyes::after { position: absolute; display: block; content: ""; }

/* Six tiny creatures, all assembled from the same three CSS parts. */
.portfolio-comment-avatar.creature-0 .avatar-deco::before,
.portfolio-comment-avatar.creature-0 .avatar-deco::after { top: -4px; width: 10px; height: 10px; border: 1.5px solid #171717; border-radius: 3px 7px 2px 7px; background: hsl(var(--avatar-hue) 78% 67%); transform: rotate(45deg); }
.portfolio-comment-avatar.creature-0 .avatar-deco::before { left: 1px; }
.portfolio-comment-avatar.creature-0 .avatar-deco::after { right: 1px; transform: rotate(45deg) scaleX(-1); }
.portfolio-comment-avatar.creature-1 { border-radius: 48% 48% 35% 35%; }
.portfolio-comment-avatar.creature-1 .avatar-deco::before,
.portfolio-comment-avatar.creature-1 .avatar-deco::after { top: -5px; width: 7px; height: 10px; border: 1.5px solid #171717; border-radius: 80% 20% 60% 30%; background: hsl(var(--avatar-accent) 88% 70%); }
.portfolio-comment-avatar.creature-1 .avatar-deco::before { left: 2px; transform: rotate(-28deg); }
.portfolio-comment-avatar.creature-1 .avatar-deco::after { right: 2px; transform: rotate(28deg) scaleX(-1); }
.portfolio-comment-avatar.creature-2 { border-radius: 52% 52% 44% 44%; }
.portfolio-comment-avatar.creature-2 .avatar-deco::before,
.portfolio-comment-avatar.creature-2 .avatar-deco::after { top: -8px; width: 6px; height: 10px; border-top: 5px solid hsl(var(--avatar-accent) 88% 70%); border-left: 1.5px solid #171717; border-radius: 50%; }
.portfolio-comment-avatar.creature-2 .avatar-deco::before { left: 7px; transform: rotate(-18deg); }
.portfolio-comment-avatar.creature-2 .avatar-deco::after { right: 5px; transform: rotate(18deg) scaleX(-1); }
.portfolio-comment-avatar.creature-3 { border-radius: 45% 45% 52% 52%; }
.portfolio-comment-avatar.creature-3 .avatar-deco::before,
.portfolio-comment-avatar.creature-3 .avatar-deco::after { top: -5px; width: 10px; height: 10px; border: 1.5px solid #171717; border-radius: 50%; background: hsl(var(--avatar-hue-two) 78% 59%); }
.portfolio-comment-avatar.creature-3 .avatar-deco::before { left: 2px; }
.portfolio-comment-avatar.creature-3 .avatar-deco::after { right: 2px; }
.portfolio-comment-avatar.creature-4 { border-radius: 7px; }
.portfolio-comment-avatar.creature-4 .avatar-deco::before,
.portfolio-comment-avatar.creature-4 .avatar-deco::after { top: 8px; width: 5px; height: 11px; border: 1.5px solid #171717; background: hsl(var(--avatar-accent) 80% 70%); }
.portfolio-comment-avatar.creature-4 .avatar-deco::before { left: -5px; border-radius: 3px 0 0 3px; }
.portfolio-comment-avatar.creature-4 .avatar-deco::after { right: -5px; border-radius: 0 3px 3px 0; }
.portfolio-comment-avatar.creature-5 { border-radius: 55% 42% 50% 38%; rotate: -3deg; }
.portfolio-comment-avatar.creature-5 .avatar-deco::before { top: -5px; left: 8px; width: 6px; height: 8px; border: 1.5px solid #171717; border-radius: 70% 30% 60% 20%; background: hsl(var(--avatar-accent) 88% 70%); transform: rotate(-25deg); box-shadow: 6px -1px 0 -1px hsl(var(--avatar-accent) 88% 70%); }

.portfolio-comment-avatar .avatar-eyes { z-index: 1; inset: 0; }
.portfolio-comment-avatar .avatar-eyes::before,
.portfolio-comment-avatar .avatar-eyes::after { top: 9px; width: 7px; height: 8px; border: 1px solid #171717; border-radius: 50%; background: radial-gradient(circle at 55% 52%, #171717 0 27%, #fff 31% 100%); }
.portfolio-comment-avatar .avatar-eyes::before { left: 5px; }
.portfolio-comment-avatar .avatar-eyes::after { right: 5px; }
.portfolio-comment-avatar.eyes-1 .avatar-eyes::before,
.portfolio-comment-avatar.eyes-1 .avatar-eyes::after { top: 11px; height: 3px; border: 0; border-radius: 999px; background: #171717; }
.portfolio-comment-avatar.eyes-2 .avatar-eyes::before { height: 9px; transform: scale(1.18); }
.portfolio-comment-avatar.eyes-2 .avatar-eyes::after { top: 12px; height: 2px; border: 0; border-radius: 999px; background: #171717; }
.portfolio-comment-avatar.eyes-3 .avatar-eyes::before { left: 50%; width: 9px; height: 9px; transform: translateX(-50%); }
.portfolio-comment-avatar.eyes-3 .avatar-eyes::after { display: none; }

.portfolio-comment-avatar .avatar-mouth { z-index: 1; top: 19px; left: 50%; width: 10px; height: 5px; border-bottom: 2px solid #171717; border-radius: 50%; transform: translateX(-50%); }
.portfolio-comment-avatar.mood-1 .avatar-mouth { top: 22px; height: 0; border-top: 2px solid #171717; border-bottom: 0; border-radius: 0; }
.portfolio-comment-avatar.mood-2 .avatar-mouth { top: 19px; width: 6px; height: 7px; border: 1.5px solid #171717; border-radius: 50%; background: rgba(255,255,255,.7); }
.portfolio-comment-avatar.mood-3 .avatar-mouth { top: 19px; width: 11px; height: 6px; border: 1.5px solid #171717; border-radius: 2px 2px 5px 5px; background: linear-gradient(to right, #fff 0 45%, #171717 46% 54%, #fff 55% 100%); }
.portfolio-comment-avatar.is-pin { width: 100%; height: 100%; border-width: 1px; }

.portfolio-comment-card,
.portfolio-comment-composer {
  position: fixed;
  z-index: 245;
  width: min(320px, calc(100vw - 24px));
  padding: 14px;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 14px;
  background: #fff;
  color: #171717;
  box-shadow: 0 18px 60px rgba(0,0,0,.22);
  pointer-events: auto;
  animation: portfolio-comment-in 140ms ease-out both;
}
.portfolio-comment-card header,
.portfolio-comment-composer header { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; }
.portfolio-comment-card header > span:nth-child(2) { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.portfolio-comment-card header strong,
.portfolio-comment-composer header strong { font-size: 12px; font-weight: 600; }
.portfolio-comment-surface { width: fit-content; margin-top: 2px; padding: 1px 5px; border-radius: 999px; background: #f0f0f0; color: #666; font-size: 9px; line-height: 1.4; }
.portfolio-comment-card time { color: #686868; font-size: 10px; }
.portfolio-comment-card > p { margin: 0; overflow-wrap: anywhere; color: #292929; font-size: 13px; white-space: pre-wrap; }
.portfolio-comment-card-close { width: 28px; height: 28px; margin-left: auto; border: 0; border-radius: 50%; background: transparent; color: #777; font-size: 20px; cursor: pointer; }
.portfolio-comment-card-close:hover { background: #f2f2f2; color: #171717; }

.portfolio-comment-composer textarea { display: block; width: 100%; min-height: 92px; padding: 10px; resize: vertical; border: 1px solid #dedede; border-radius: 9px; background: #fafafa; color: #171717; font: inherit; line-height: 1.4; outline: none; }
.portfolio-comment-composer textarea[aria-invalid="true"] { border-color: #b42318; }
.portfolio-comment-composer footer { display: flex; justify-content: flex-end; gap: 7px; margin-top: 10px; }
.portfolio-comment-composer button { min-height: 32px; padding: 0 12px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; }
.portfolio-comment-cancel { border: 1px solid #dedede; background: #fff; color: #444; }
.portfolio-comment-submit { border: 1px solid #171717; background: #171717; color: #fff; }
.portfolio-comment-submit:disabled { cursor: wait; opacity: .6; }
.portfolio-comment-form-error { min-height: 0; margin: 7px 0 0; color: #b42318; font-size: 11px; }
.portfolio-comment-form-error:empty { display: none; }
.portfolio-comment-field-label { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.portfolio-comment-honeypot { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; opacity: 0 !important; pointer-events: none !important; }

.portfolio-comment-toast { position: fixed; z-index: 248; right: 16px; bottom: 16px; max-width: calc(100vw - 32px); padding: 10px 14px; border-radius: 10px; background: #171717; color: #fff; box-shadow: 0 10px 32px rgba(0,0,0,.2); }
.portfolio-comment-toast.is-error { background: #b42318; }

@keyframes portfolio-comment-in { from { opacity: 0; transform: translateY(5px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes portfolio-comment-pulse { 50% { filter: drop-shadow(0 0 8px #ffad0d); scale: 1.18; } }

@media (max-width: 767px) {
  .portfolio-comment-launcher { top: 8px; right: 112px; width: 30px; padding: 0; justify-content: center; }
  .portfolio-comment-launcher > [data-comment-launcher-label] { display: none; }
  .portfolio-comment-count { position: absolute; top: -5px; right: -6px; min-width: 16px; height: 16px; margin: 0; padding: 0 4px; border: 1px solid #fff; font-size: 9px; }
  .portfolio-comment-hint { top: 48px; right: 8px; }
  .portfolio-comment-hint::before { right: 116px; }
  .portfolio-comment-mode-hint { top: auto; bottom: 72px; width: max-content; max-width: calc(100vw - 24px); }
  .portfolio-comment-mode-hint span { display: none; }
  .portfolio-comment-composer { top: auto !important; right: 8px; bottom: 8px; left: 8px !important; width: auto; border-radius: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .portfolio-comment-hint,
  .portfolio-comment-card,
  .portfolio-comment-composer,
  .portfolio-comment-pin { animation: none !important; transition: none !important; }
}
