@import url('https://fonts.googleapis.com/css2?family=Shippori+Mincho:wght@400;500;600;800&family=Zen+Kaku+Gothic+New:wght@300;400;500;700&display=swap');

:root {
  --washi: #EDE6D6;
  --washi-raised: #F7F2E6;
  --washi-deep: #E3DAC6;
  --ink: #2B2A28;
  --ink-soft: #625D52;
  --indigo: #2F4A5C;
  --indigo-deep: #1D323F;
  --shu: #B5442E;
  --shu-soft: #C97A61;
  --shadow-light: rgba(255, 253, 246, 0.95);
  --shadow-dark: rgba(150, 136, 104, 0.45);
  --shadow-dark-strong: rgba(120, 108, 82, 0.55);
  --radius-lg: 28px;
  --radius-md: 18px;
  --font-display: 'Shippori Mincho', serif;
  --font-body: 'Zen Kaku Gothic New', sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--washi);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.7;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--shu-soft);
  color: var(--washi-raised);
}

:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 3px;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 32px;
}

/* neumorphic surfaces */
.raised {
  background: var(--washi);
  box-shadow: 9px 9px 18px var(--shadow-dark), -9px -9px 18px var(--shadow-light);
  border-radius: var(--radius-md);
}

.pressed {
  background: var(--washi);
  box-shadow: inset 6px 6px 12px var(--shadow-dark), inset -6px -6px 12px var(--shadow-light);
  border-radius: var(--radius-md);
}

/* watermark kanji */
.kanji-mark {
  position: absolute;
  font-family: var(--font-display);
  color: var(--washi-deep);
  opacity: 0.6;
  pointer-events: none;
  z-index: 0;
  user-select: none;
}

/* seigaiha wave divider */
.wave-divider {
  height: 34px;
  width: 100%;
  background-image: radial-gradient(circle at 10px -6px, transparent 12px, var(--washi) 13px);
  background-size: 28px 20px;
  background-position: 0 0;
  background-color: var(--washi-deep);
  opacity: 0.9;
}

/* nav */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(237, 230, 214, 0.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(120, 108, 82, 0.18);
}

nav.wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand .seal {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--shu);
  color: var(--washi-raised);
  font-family: var(--font-display);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 2px 2px 5px var(--shadow-dark);
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-links a {
  font-size: 15px;
  padding: 10px 16px;
  border-radius: 12px;
  color: var(--ink-soft);
  transition: color 0.2s ease, box-shadow 0.2s ease;
}

.nav-links a:hover {
  color: var(--ink);
  box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
}

/* hero */
.hero {
  position: relative;
  padding: 96px 0 84px;
  overflow: hidden;
}

.hero .kanji-mark {
  right: -30px;
  top: 10px;
  font-size: 260px;
  line-height: 1;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.eyebrow-line {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 14px;
  margin-bottom: 22px;
}

.eyebrow-line .dash {
  width: 40px;
  height: 1px;
  background: var(--ink-soft);
}

h1.name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(42px, 6vw, 68px);
  line-height: 1.08;
  color: var(--ink);
  margin-bottom: 22px;
}

.hero p.tagline {
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 46ch;
  margin-bottom: 34px;
}

.cta-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  padding: 15px 30px;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  background: var(--washi);
  color: var(--ink);
  box-shadow: 7px 7px 14px var(--shadow-dark), -7px -7px 14px var(--shadow-light);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  box-shadow: inset 5px 5px 10px var(--shadow-dark), inset -5px -5px 10px var(--shadow-light);
  transform: translateY(0);
}

.btn.primary {
  background: var(--indigo);
  color: var(--washi-raised);
  box-shadow: 7px 7px 14px rgba(29, 50, 63, 0.45), -7px -7px 14px rgba(70, 96, 114, 0.25);
}

.btn.primary:active {
  box-shadow: inset 5px 5px 10px rgba(15, 26, 33, 0.5), inset -5px -5px 10px rgba(65, 90, 108, 0.25);
}

.profile-image-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-image {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 320px;
  height: auto;
  border-radius: 50%;
  border: 4px solid var(--washi-card);
  box-shadow:
    8px 8px 24px var(--shadow-dark),
    -8px -8px 24px var(--shadow-light);
  object-fit: cover;
  aspect-ratio: 1 / 1;
}

/* shurikens orbiting the profile photo */
.shuriken-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  z-index: 1;
  animation: shuriken-orbit-spin 14s linear infinite;
}

.shk {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
}

.shk-1 {
  transform: rotate(0deg) translateX(190px);
}

.shk-2 {
  transform: rotate(120deg) translateX(190px);
}

.shk-3 {
  transform: rotate(240deg) translateX(190px);
}

.shuriken {
  position: absolute;
  top: -18px;
  left: -18px;
  width: 36px;
  height: 36px;
  fill: var(--shu);
  filter: drop-shadow(2px 2px 3px var(--shadow-dark-strong));
  animation: shuriken-spin 2.4s linear infinite;
}

.shk-2 .shuriken {
  animation-duration: 3s;
  animation-direction: reverse;
}

.shk-3 .shuriken {
  animation-duration: 1.9s;
}

@keyframes shuriken-orbit-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shuriken-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {

  .shuriken-orbit,
  .shuriken {
    animation: none;
  }
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* vertical strip */
.vertical-strip {
  writing-mode: vertical-rl;
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.28em;
  color: var(--ink-soft);
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.8;
}

/* section base */
section {
  position: relative;
  padding: 88px 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 46px;
}

.section-head .jp {
  font-family: var(--font-display);
  font-size: 30px;
  color: var(--shu);
}

.section-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 32px;
  color: var(--ink);
}

.section-head .sub {
  color: var(--ink-soft);
  font-size: 15px;
  margin-left: auto;
}

/* about */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.about-card {
  padding: 40px;
  position: relative;
}

.about-card .kanji-mark {
  font-size: 150px;
  right: 6px;
  bottom: -20px;
  opacity: 0.5;
}

.about-card p {
  font-size: 16px;
  color: var(--ink-soft);
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.about-facts {
  display: grid;
  gap: 16px;
}

.fact {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.fact .mark {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--indigo);
  width: 34px;
  text-align: center;
}

.fact .label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.fact .value {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}

/* projects */
#projects-status {
  color: var(--ink-soft);
  font-size: 15px;
  margin-bottom: 24px;
}

.projects-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  gap: 16px;
  flex-wrap: wrap;
}

.refresh-btn {
  font-family: var(--font-body);
  font-size: 14px;
  padding: 12px 22px;
  border-radius: 14px;
  border: none;
  background: var(--washi);
  color: var(--indigo);
  cursor: pointer;
  box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
}

.refresh-btn:active {
  box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 26px;
}

.project-card {
  display: block;
  padding: 28px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 11px 11px 20px var(--shadow-dark-strong), -11px -11px 20px var(--shadow-light);
}

.project-lang {
  display: inline-block;
  font-size: 12px;
  color: var(--indigo);
  background: var(--washi-deep);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 14px;
}

.project-card h3 {
  font-family: var(--font-display);
  font-size: 19px;
  color: var(--ink);
  margin-bottom: 10px;
  word-break: break-word;
}

.project-card p {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 18px;
  min-height: 42px;
}

.project-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-soft);
  border-top: 1px solid rgba(120, 108, 82, 0.22);
  padding-top: 14px;
}

.skeleton {
  height: 180px;
}

.skeleton .bar {
  height: 12px;
  border-radius: 6px;
  background: var(--washi-deep);
  margin-bottom: 12px;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 0.9;
  }
}

/* skills */
.skills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.skill-pill {
  padding: 12px 22px;
  font-size: 14px;
  color: var(--ink);
}

/* contact */
.contact-card {
  padding: 48px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 30px;
  align-items: center;
  position: relative;
}

.contact-card h2 {
  font-family: var(--font-display);
  font-size: 30px;
  margin-bottom: 14px;
}

.contact-card p {
  color: var(--ink-soft);
  max-width: 42ch;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Expandable contact-link pills ─────────────────────── */
.contact-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  /* Compact default width — just enough for the label */
  width: 110px;
  padding: 14px 20px;
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  border-radius: var(--radius-lg, 12px);
  transition:
    width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.2s ease;
  /* Prevent layout shift in the flex column */
  flex-shrink: 0;
  align-self: flex-end;
  /* buttons stack to the right */
}

.contact-link-label,
.contact-link-detail {
  position: absolute;
  left: 20px;
  right: 20px;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  font-size: 14px;
  font-weight: 500;
}

/* Label visible in default state */
.contact-link-label {
  opacity: 1;
  transform: translateX(0);
}

/* Detail hidden in default state */
.contact-link-detail {
  opacity: 0;
  transform: translateX(8px);
  font-size: 12px;
  font-weight: 400;
  color: var(--shu, #8b3c2e);
}

/* Expanded state on hover / focus */
.contact-link:hover,
.contact-link:focus-visible {
  width: 260px;
  outline: none;
  box-shadow:
    6px 6px 14px rgba(150, 136, 104, 0.45),
    -6px -6px 14px rgba(255, 253, 246, 0.95),
    0 0 0 2px rgba(139, 60, 46, 0.25);
}

.contact-link:hover .contact-link-label,
.contact-link:focus-visible .contact-link-label {
  opacity: 0;
  transform: translateX(-6px);
}

.contact-link:hover .contact-link-detail,
.contact-link:focus-visible .contact-link-detail {
  opacity: 1;
  transform: translateX(0);
}

footer {
  padding: 40px 0 60px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
}

footer .jp-line {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--shu);
  margin-bottom: 8px;
}

@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .profile-image-wrap {
    order: -1;
    max-width: 240px;
    margin: 0 auto 20px;
  }

  .shk-1 {
    transform: rotate(0deg) translateX(135px);
  }

  .shk-2 {
    transform: rotate(120deg) translateX(135px);
  }

  .shk-3 {
    transform: rotate(240deg) translateX(135px);
  }

  .shuriken {
    width: 26px;
    height: 26px;
    top: -13px;
    left: -13px;
  }

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

  .contact-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .contact-links {
    align-items: center;
  }

  /* On mobile/touch: show details always (no hover) */
  .contact-link {
    width: 260px;
  }

  .contact-link .contact-link-label {
    opacity: 0;
    transform: translateX(-6px);
  }

  .contact-link .contact-link-detail {
    opacity: 1;
    transform: translateX(0);
  }

  .vertical-strip {
    display: none;
  }

  .kanji-mark {
    display: none;
  }

  .nav-links {
    display: none;
  }
}

/* ── certificates fan carousel ────────────────────────────── */
#certificates {
  overflow: hidden;
  padding: 88px 0;
}

.cert-hint {
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
  margin-bottom: 40px;
  opacity: 0.8;
}

.cert-scene {
  position: relative;
  width: 100%;
  height: 380px;
  /* deep perspective so tilt looks natural, not warped */
  perspective: 2800px;
  perspective-origin: 50% 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: visible;
}

/* The carousel container — NO preserve-3d so each card composites at full DPR */
.cert-carousel {
  position: relative;
  width: 380px;
  height: 270px;
  /* transform-style intentionally NOT preserve-3d:
     Each child card gets its own GPU layer, rasterized at native device
     pixel ratio — this is what fixes the blurriness at 100% zoom.
     translateZ depth is replaced by scale() in JS instead. */
}

/* Each cert card is absolutely placed, JS drives ALL animation — no CSS transitions */
.cert-item {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-radius: var(--radius-md);
  /* NO transition here: rAF updates every frame, CSS transitions would fight it */
}

.cert-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  display: block;
  /* promote to GPU layer for crisp sub-pixel rendering */
  transform: translateZ(0);
  /* no blur, no opacity filter, no crisp-edges (which can pixelate at angles) */
}

@media (max-width: 860px) {
  .cert-scene {
    height: 280px;
  }

  .cert-carousel {
    width: 280px;
    height: 200px;
  }
}

/* ── Certificate Tabs & Sections ────────────────────────────── */
.cert-tabs {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 32px;
}

.cert-tab {
  background: var(--washi-card);
  border: none;
  padding: 10px 24px;
  border-radius: 20px;
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  box-shadow:
    4px 4px 10px var(--shadow-dark),
    -4px -4px 10px var(--shadow-light);
  transition: all 0.2s ease;
}

.cert-tab:hover {
  color: var(--ink);
}

.cert-tab.active {
  color: var(--shu);
  box-shadow:
    inset 4px 4px 8px var(--shadow-dark),
    inset -4px -4px 8px var(--shadow-light);
}

.cert-section {
  display: none;
  animation: fadeIn 0.4s ease;
}

.cert-section.active {
  display: block;
}

/* ── Organisation Grid ────────────────────────────── */
.org-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.org-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.org-card img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: contain;
}

.org-card h3 {
  font-size: 18px;
  color: var(--ink);
}

.org-card .org-meta {
  font-size: 14px;
  color: var(--ink-soft);
}

.org-card .org-desc {
  font-size: 15px;
  line-height: 1.5;
}

.org-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.empty-state {
  text-align: center;
  color: var(--ink-soft);
  padding: 40px;
  font-style: italic;
  width: 100%;
}

/* ── Experience Card ────────────────────────────── */
.exp-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

.exp-card {
  width: 100%;
  max-width: 600px;
  padding: 32px;
  position: relative;
  transition: opacity 0.5s ease;
}

.exp-card.fade-out {
  opacity: 0;
}

.exp-card h3 {
  font-size: 22px;
  color: var(--ink);
  margin-bottom: 4px;
}

.exp-card .exp-meta {
  font-size: 15px;
  color: var(--shu);
  margin-bottom: 16px;
  font-weight: 500;
}

.exp-card .exp-desc {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 20px;
}

.exp-nav {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
}

.exp-nav button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 20px;
}

.exp-nav button:hover {
  color: var(--shu);
}

.experience-image {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md, 8px);
  margin-bottom: 16px;
  object-fit: contain;
  max-height: 200px;
}

/* ── Community Work ────────────────────────────── */
.community-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.comm-card {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--washi-card);
  border-radius: var(--radius-lg, 12px);
}

.comm-card h3 {
  font-size: 22px;
  color: var(--ink);
}

.comm-card .comm-meta {
  font-size: 15px;
  color: var(--shu);
  font-weight: 500;
}

.comm-card .comm-desc {
  font-size: 16px;
  line-height: 1.6;
}

.comm-card img {
  width: 100%;
  max-width: 300px;
  border-radius: 8px;
  object-fit: contain;
}


/* ── Hobbies ────────────────────────────────── */
.hobbies-container {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.hobby-block h3 {
  margin-bottom: 24px;
  font-size: 24px;
  color: var(--ink);
}

.spotify-embed-wrapper {
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
  box-shadow: 8px 8px 16px rgba(150, 136, 104, 0.4), -8px -8px 16px rgba(255, 253, 246, 0.95);
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}

.game-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
  background: var(--washi-card);
  padding: 0;
  transition: transform 0.2s ease;
}

.game-card:hover {
  transform: translateY(-4px);
}

.game-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  background-color: #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fallback-cover span {
  font-size: 48px;
  color: #999;
  font-weight: bold;
}

.game-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.game-title {
  font-size: 16px;
  margin: 0;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-meta {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: var(--shu);
  align-items: center;
}

.game-status {
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
}


/* ── Portfolio Assistant (Chatbot) ──────────────────────── */
.chat-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  font-size: 24px;
  cursor: pointer;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--washi-card, #f5f2eb);
  color: var(--ink, #1a1a1a);
  transition: transform 0.2s ease;
}

.chat-fab:hover {
  transform: scale(1.08);
}

.chat-panel {
  position: fixed;
  bottom: 96px;
  right: 28px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 120px);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 999;
  background: var(--washi-card, #f5f2eb);
  box-shadow: 10px 10px 24px rgba(150, 136, 104, 0.45), -10px -10px 24px rgba(255, 253, 246, 0.95);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.chat-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(150, 136, 104, 0.2);
  flex-shrink: 0;
}

.chat-header-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink, #1a1a1a);
}

.chat-jp {
  font-family: 'Noto Serif JP', serif;
  color: var(--shu, #8b3c2e);
  font-size: 20px;
}

.chat-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--ink, #1a1a1a);
  padding: 4px 8px;
  border-radius: 6px;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.chat-close:hover {
  opacity: 1;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-message {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}

.chat-user {
  align-self: flex-end;
  background: var(--shu, #8b3c2e);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-assistant {
  align-self: flex-start;
  background: rgba(150, 136, 104, 0.12);
  color: var(--ink, #1a1a1a);
  border-bottom-left-radius: 4px;
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px;
  border-top: 1px solid rgba(150, 136, 104, 0.15);
  flex-shrink: 0;
}

.chat-chip {
  background: none;
  border: 1px solid rgba(150, 136, 104, 0.4);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  color: var(--ink, #1a1a1a);
  transition: background 0.15s, color 0.15s;
  text-align: left;
}

.chat-chip:hover {
  background: var(--shu, #8b3c2e);
  color: #fff;
  border-color: var(--shu, #8b3c2e);
}

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(150, 136, 104, 0.2);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  border: none;
  background: rgba(150, 136, 104, 0.1);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  color: var(--ink, #1a1a1a);
  outline: none;
  font-family: inherit;
}

.chat-input:focus {
  box-shadow: 0 0 0 2px rgba(139, 60, 46, 0.3);
}

.chat-send {
  padding: 9px 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  color: var(--shu, #8b3c2e);
  background: var(--washi-card, #f5f2eb);
  transition: transform 0.15s;
}

.chat-send:hover {
  transform: scale(1.1);
}

@media (max-width: 480px) {
  .chat-panel {
    right: 12px;
    bottom: 82px;
    width: calc(100vw - 24px);
  }

  .chat-fab {
    bottom: 20px;
    right: 16px;
  }
}