:root {
  font-family: 'Inter', 'SF Pro Display', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  
  /* ひよこのハジメテーマカラー */
  --bg: #FFF8E1; /* アイボリー - 優しく包み込む */
  --surface: #ffffff;
  --surface-alt: #FFF3E0; /* 明るいオレンジ系 */
  --text: #5D4037; /* 温かみのあるブラウン */
  --muted: #8D6E63; /* ミディアムブラウン */
  --accent: #FF8A65; /* サーモンピンク - メインカラー */
  --accent-strong: #FF6F3C; /* 濃いめのサーモン */
  --accent-yellow: #FFEB3B; /* レモンイエロー - アクセント */
  --danger: #f87171;
  --success: #4ade80;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 15%, rgba(255, 235, 59, 0.18), transparent 55%),
    radial-gradient(circle at 85% 10%, rgba(255, 138, 101, 0.22), transparent 50%),
    radial-gradient(circle at 50% 90%, rgba(255, 235, 59, 0.14), transparent 65%),
    linear-gradient(180deg, #fff9f0 0%, #fff3e3 35%, #fff0e0 70%, #ffe8d1 100%);
  color: var(--text);
  font-size: clamp(15px, 2vw, 16px);
  line-height: 1.6;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}

.hero {
  padding: 20px 14px 10px;
  position: relative;
}

.hero__inner {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 143, 171, 0.2);
  color: var(--accent-strong);
  margin-bottom: 12px;
}

h1 {
  margin: 0;
  font-size: clamp(24px, 5.6vw, 30px);
}

.tagline {
  margin-top: 4px;
  color: var(--muted);
}

main {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px calc(48px + env(safe-area-inset-bottom, 0));
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.search-summary {
  font-size: 14px;
  color: var(--muted);
  margin: 12px 0 0;
}

.search-panel .panel__header {
  align-items: flex-start;
  gap: 12px;
}

.post-cta {
  width: 100%;
}

.post-cta .ghost-btn {
  background: linear-gradient(135deg, var(--accent) 0%, #a5b4fc 100%);
  color: #fff;
  border: none;
  box-shadow: 0 8px 18px rgba(255, 143, 171, 0.25);
  width: 100%;
  justify-content: center;
  display: inline-flex;
  align-items: center;
}

.search-panel .panel__header .ghost-btn {
  background: linear-gradient(135deg, var(--accent) 0%, #a5b4fc 100%);
  color: #fff;
  border: none;
  box-shadow: 0 8px 18px rgba(255, 143, 171, 0.25);
  width: 100%;
  justify-content: center;
}

.panel {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 143, 171, 0.15);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 36px rgba(255, 93, 143, 0.14);
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.count {
  font-size: 14px;
  color: var(--muted);
}

.search-form {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.search-form input[type='search'] {
  flex: 1;
}

.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.category-filter-btn {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 143, 171, 0.3);
  background: rgba(255, 255, 255, 0.6);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s ease;
  cursor: pointer;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
}

.category-filter-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--accent);
}

.category-filter-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-yellow));
  color: white;
  border-color: var(--accent);
}

.ghost-btn {
  border: 1px solid rgba(46, 28, 43, 0.2);
  background: rgba(255, 255, 255, 0.6);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  min-height: 48px;
}

.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.9);
}

form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 600;
  margin-bottom: 18px;
}

input,
textarea {
  border-radius: 12px;
  border: 1px solid rgba(255, 143, 171, 0.3);
  padding: 15px 16px;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 48px;
}

input:focus,
textarea:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(255, 143, 171, 0.25);
}

.archive-form textarea {
  resize: vertical;
  min-height: 120px;
}

.form-actions {
  text-align: right;
}

button {
  border: none;
  background: linear-gradient(135deg, #ff8fab, #a5b4fc);
  color: #ffffff;
  font-weight: 700;
  padding: 14px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  min-height: 48px;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(255, 143, 171, 0.3);
}

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 14px;
}

.alert--error {
  background: rgba(248, 113, 113, 0.15);
  color: var(--danger);
}

.alert--success {
  background: rgba(74, 222, 128, 0.2);
  color: var(--success);
}

.empty {
  color: var(--muted);
  margin: 0;
}

.entry-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.entry {
  border-radius: 16px;
  border: 1px solid rgba(255, 143, 171, 0.2);
  padding: 14px 12px 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 244, 251, 0.95));
  box-shadow: 0 12px 28px rgba(255, 93, 143, 0.12);
  position: relative;
  gap: 6px;
}

.entry-clickable {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.entry-clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(255, 93, 143, 0.15);
}

.entry__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.entry__host {
  font-weight: 600;
  color: var(--accent-strong);
}

.entry__author {
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 143, 171, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.entry__author-bottom {
  position: absolute;
  bottom: 12px;
  right: 16px;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 143, 171, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.delete-btn {
  border: 1px solid rgba(248, 113, 113, 0.3);
  background: rgba(248, 113, 113, 0.1);
  color: var(--danger);
  padding: 2px 8px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 11px;
  margin-top: 8px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.delete-btn:hover {
  background: rgba(248, 113, 113, 0.2);
  border-color: var(--danger);
}

.entry__link {
  color: var(--accent-strong);
  font-weight: 600;
  text-decoration: none;
  word-break: break-all;
  display: block;
  margin-bottom: 8px;
}

.entry__link:hover {
  text-decoration: underline;
}

.entry__content-split {
  display: flex;
  gap: 16px;
  align-items: stretch;
  min-height: 180px;
}

.entry__left {
  flex-shrink: 0;
  width: 500px;
  min-height: 180px;
}

.entry__right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 180px;
}

.tweet-embed {
  /* 右のエリアに合わせて微調整  */
  margin: -9px 0 0 0; 
  width: 100%;
  max-height: 180px;
  overflow: hidden;
}

.tweet-embed iframe {
  max-width: 100% !important;
}

.tweet-embed blockquote {
  margin: 0 !important;
  max-height: 180px;
  overflow-y: auto;
}

.entry__note {
  margin: 8px 0;
  color: #59425f;
  white-space: pre-wrap;
}

.entry__context {
  margin: 0 0 8px 0;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 143, 171, 0.08);
}

.entry__content-split .entry__context {
  margin: 0;
  height: 180px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.entry__content-split .entry__context p {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  line-height: 1.5;
}

.entry__context-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
  display: inline-block;
  margin-bottom: 4px;
}

.entry__slide {
  margin: 8px 0;
}

.entry__slide a {
  color: var(--accent-strong);
  font-weight: 600;
  text-decoration: none;
}

.entry__slide a:hover {
  text-decoration: underline;
}

.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0 0;
  margin: 0 0 8px 0;
}

.tag {
  background: linear-gradient(135deg, rgba(255, 235, 59, 0.3), rgba(255, 138, 101, 0.2));
  color: var(--text);
  padding: 5px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  border: 1.5px solid rgba(255, 138, 101, 0.3);
}

.modal {
  border: none;
  padding: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(16, 12, 29, 0.55);
  backdrop-filter: blur(2px);
}

.modal__surface {
  background: var(--surface);
  border-radius: 20px;
  padding: 24px;
  width: min(480px, 90vw);
  border: 1px solid rgba(255, 143, 171, 0.2);
  box-shadow: 0 25px 60px rgba(255, 93, 143, 0.25);
  max-height: 90vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.entry-detail {
  position: relative;
  padding-bottom: 44px;
}

.tweet-embed-large {
  margin: 16px 0;
  width: 100%;
}

.tweet-embed-large iframe {
  max-width: 100% !important;
}

.tweet-embed-large blockquote {
  margin: 0 !important;
}

.context-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.context-item {
  border-radius: 12px;
  border: 1px solid rgba(255, 143, 171, 0.2);
  padding: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 244, 251, 0.95));
  box-shadow: 0 5px 15px rgba(255, 93, 143, 0.06);
}

.context-item .entry__author {
  display: inline-block;
  margin-bottom: 8px;
}

.context-item .entry__context {
  margin: 0 0 8px 0;
  background: rgba(255, 143, 171, 0.08);
  border-radius: 8px;
  padding: 12px;
}

.context-item .entry__context p {
  margin: 0;
  white-space: pre-wrap;
}

.context-item .entry__slide {
  margin: 8px 0;
}

.context-item .entry__note {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 143, 171, 0.15);
}

@media (max-width: 600px) {
  body {
    font-size: 16px;
  }

  main {
    width: 100%;
    max-width: 100%;
    padding: 0 16px calc(48px + env(safe-area-inset-bottom, 0));
    gap: 18px;
  }

  .hero {
    padding: 28px 16px 10px;
  }

  .hero__inner {
    text-align: left;
  }

  .badge {
    font-size: 11px;
    padding: 3px 10px;
  }

  .panel {
    padding: 18px;
  }

  .search-form {
    flex-direction: column;
  }

  .search-form button {
    width: 100%;
  }

  .ghost-btn {
    width: 100%;
    text-align: center;
  }

  .panel__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  input,
  textarea {
    font-size: 16px;
  }

  button {
    width: 100%;
  }

  .panel__actions {
    width: 100%;
    gap: 8px;
  }

  .entry {
    padding: 14px 12px 22px;
  }

  .entry__content-split {
    flex-direction: column;
    gap: 12px;
    min-height: auto;
  }

  .entry__left {
    width: 100%;
    min-height: auto;
  }

  .entry__right {
    min-height: auto;
  }

  .tweet-embed {
    margin: 0;
    max-height: none;
  }

  .tweet-embed blockquote {
    max-height: none;
  }

  .entry__content-split .entry__context {
    height: auto;
    max-height: none;
  }

  .entry__content-split .entry__context p {
    display: block;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
  }

  .entry__meta {
    font-size: 12px;
  }

  .entry__author-bottom {
    bottom: 8px;
    right: 12px;
    font-size: 11px;
  }

  .context-item {
    padding: 12px;
  }

  .tag-list {
    gap: 6px;
  }

  .tag {
    font-size: 12px;
    padding: 3px 8px;
  }
}

@media (max-width: 480px) {
  main {
    width: 100%;
    max-width: 100%;
    padding: 0 14px calc(44px + env(safe-area-inset-bottom, 0));
    gap: 16px;
  }

  .hero {
    padding: 26px 14px 12px;
  }

  h1 {
    font-size: clamp(26px, 9vw, 32px);
  }

  .panel {
    padding: 14px;
  }

  .panel__header {
    gap: 8px;
    width: 100%;
  }

  .category-filter {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 4px;
    margin: 12px -4px 0;
    padding-left: 4px;
    padding-right: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .category-filter-btn {
    flex: 0 0 auto;
    font-size: 13px;
    padding: 8px 12px;
    min-width: 44px;
    justify-content: center;
  }

  .entry {
    padding: 12px;
    padding-bottom: 20px;
  }

  .experience-title {
    font-size: 17px;
  }

  .experience-actions {
    flex-wrap: wrap;
    gap: 10px;
  }

  .action-btn,
  .comment-count {
    padding: 6px 10px;
  }

  .entry__author-bottom {
    position: static;
    margin-top: 6px;
  }

  .modal__surface {
    width: 100%;
    border-radius: 14px;
    padding: 16px;
  }

  .modal__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .modal__actions button,
  .ghost-btn {
    width: 100%;
  }

  .experience-images {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .experience-image img {
    height: 160px;
  }

  .experience-images-preview {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  }
}

@media (max-width: 360px) {
  .experience-title {
    font-size: 16px;
  }

  .experience-content {
    font-size: 14px;
  }

  .category-filter-btn {
    padding: 7px 10px;
    min-height: 42px;
  }
}

/* Experience-specific styles */
.experience-header {
  margin-bottom: 12px;
}

.experience-title {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: var(--text);
  line-height: 1.4;
}

.experience-title-large {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 16px 0;
  color: var(--text);
  line-height: 1.3;
}

.experience-content {
  margin: 12px 0;
  color: var(--text);
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.experience-content-large {
  margin: 16px 0;
  color: var(--text);
  line-height: 1.8;
  font-size: 16px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.share-buttons {
  margin: 8px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.share-label {
  font-weight: 700;
  color: var(--text);
}

.share-buttons__list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 16px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border: 1px solid rgba(46, 28, 43, 0.15);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(255, 143, 171, 0.12);
  transition: transform 0.1s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.share-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(255, 143, 171, 0.18);
  background: rgba(255, 255, 255, 0.95);
}

.share-btn-x {
  background: #0f1419;
  color: #fff;
  border-color: #0f1419;
}

.share-btn-x:hover {
  background: #1a232c;
}

.experience-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
  min-height: 40px;
}

.action-btn:hover {
  background: var(--surface-alt);
  color: var(--text);
}

.like-btn[data-liked="true"] .like-icon {
  animation: heartbeat 0.3s ease;
}

.like-btn-large {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
  min-height: 44px;
}

.like-btn-large:hover {
  background: var(--surface-alt);
  color: var(--text);
}

.like-btn-large[data-liked="true"] .like-icon {
  animation: heartbeat 0.3s ease;
}

@keyframes heartbeat {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
}

.like-icon {
  font-size: 18px;
  line-height: 1;
}

.like-count,
.comment-count {
  font-weight: 500;
}

.comment-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.experience-detail {
  padding: 20px 0;
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment-item {
  padding: 16px;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--muted);
}

.comment-author {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text);
}

.comment-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.comment-content {
  margin: 0;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--surface-alt);
  border-radius: 12px;
}

.comment-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 500;
  font-size: 14px;
  color: var(--text);
}

.comment-form textarea {
  padding: 12px;
  border-radius: 8px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  background: var(--surface);
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.2s ease;
}

.comment-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

@media (max-width: 640px) {
  .experience-title {
    font-size: 16px;
  }

  .experience-title-large {
    font-size: 20px;
  }

  .experience-content-large {
    font-size: 15px;
  }

  .action-btn,
  .comment-count {
    font-size: 13px;
  }

  .like-btn-large {
    font-size: 15px;
  }
}

/* Authentication styles */
.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-bottom: 12px;
}

.user-email {
  font-size: 14px;
  color: var(--accent-strong);
  font-weight: 600;
}

.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 16px;
}

.btn-primary:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.login-form {
  padding: 20px;
}

.login-description {
  margin: 0 0 20px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.login-message {
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.login-message--success {
  background: rgba(74, 222, 128, 0.1);
  color: #16a34a;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.login-message--error {
  background: rgba(248, 113, 113, 0.1);
  color: #dc2626;
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.login-message a {
  color: inherit;
  text-decoration: underline;
  font-weight: 600;
}

/* User profile styles */
.user-profile-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  transition: opacity 0.2s ease;
}

.user-profile-link:hover {
  opacity: 0.8;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 20px 0;
}

.profile-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: var(--surface-alt);
  border-radius: 12px;
}

.profile-avatar-large {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
}

.profile-email {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

.profile-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 500;
}

.profile-form input[type="text"] {
  padding: 12px 16px;
  border-radius: 8px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  background: var(--surface);
  font-family: inherit;
  font-size: 16px;
  transition: border-color 0.2s ease;
}

.profile-form input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}

.input-hint {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
  margin-top: -4px;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
}

/* Entry author avatar */
.entry__author-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 6px;
  vertical-align: middle;
  border: 1px solid rgba(255, 143, 171, 0.3);
}

.entry__author-bottom {
  display: inline-flex;
  align-items: center;
}

/* Experience edit form */
.experience-edit-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 0;
}

.experience-edit-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 500;
}

.experience-edit-form input[type="text"],
.experience-edit-form textarea {
  padding: 12px 16px;
  border-radius: 8px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  background: var(--surface);
  font-family: inherit;
  font-size: 16px;
  transition: border-color 0.2s ease;
}

.experience-edit-form input[type="text"]:focus,
.experience-edit-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.experience-edit-form textarea {
  resize: vertical;
  min-height: 200px;
}

/* Panel actions */
.panel__actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.btn-danger {
  color: #dc2626 !important;
}

.btn-danger:hover {
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c !important;
}

/* ひよこのハジメ キャラクター */
.hero__character {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.character-hajime {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.chick-body {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #FFEB3B 0%, #FDD835 100%);
  border-radius: 50% 50% 45% 45%;
  position: relative;
  box-shadow: 0 4px 12px rgba(253, 216, 53, 0.3);
}

.chick-face {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.chick-eye {
  font-size: 20px;
  color: #5D4037;
  font-weight: bold;
}

.chick-eye-left {
  position: absolute;
  left: -15px;
  top: -5px;
}

.chick-eye-right {
  position: absolute;
  right: -15px;
  top: -5px;
}

.chick-beak {
  font-size: 16px;
  color: #FF6F00;
  margin-top: 8px;
}

.chick-legs {
  display: flex;
  gap: 20px;
  margin-top: -5px;
}

.chick-leg {
  width: 3px;
  height: 12px;
  background: #FF6F00;
  border-radius: 2px;
}

.character-message {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.chick-hair {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 3px;
  min-height: 20px;
  pointer-events: none;
}

.hair-strand {
  display: block;
  width: 4px;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, #FFF59D 0%, #FBC02D 100%);
  box-shadow: 0 1px 3px rgba(253, 216, 53, 0.35);
  --strand-index: 0;
  --strand-row: 0;
  --strand-rotate: calc(var(--strand-index) * 4deg);
  --strand-translate: calc(var(--strand-row) * 2px);
  transform: translateY(var(--strand-translate)) rotate(var(--strand-rotate));
  transform-origin: bottom center;
  animation: hair-wave 2s ease-in-out infinite;
}

@keyframes hair-wave {
  0%, 100% {
    transform: translateY(var(--strand-translate)) rotate(var(--strand-rotate));
  }
  50% {
    transform: translateY(calc(var(--strand-translate) - 1px)) rotate(calc(var(--strand-rotate) + 4deg));
  }
}

/* テーマカラーの適用 */
h1 {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-yellow) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  font-weight: 800;
  margin: 16px 0 12px;
  letter-spacing: -0.02em;
}

.badge {
  background: linear-gradient(135deg, rgba(255, 138, 101, 0.2), rgba(255, 235, 59, 0.2));
  color: var(--accent-strong);
  border: 2px solid rgba(255, 138, 101, 0.3);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  box-shadow: 0 4px 12px rgba(255, 138, 101, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-strong) 0%, var(--accent) 100%);
  box-shadow: 0 6px 16px rgba(255, 138, 101, 0.4);
}

.tag {
  background: linear-gradient(135deg, rgba(255, 235, 59, 0.3), rgba(255, 138, 101, 0.2));
  color: var(--text);
  border: 1.5px solid rgba(255, 138, 101, 0.3);
}

.tag:hover {
  background: linear-gradient(135deg, rgba(255, 235, 59, 0.4), rgba(255, 138, 101, 0.3));
  border-color: var(--accent);
}

/* Image upload and preview */
input[type="file"] {
  padding: 12px;
  border: 2px dashed var(--accent);
  border-radius: 8px;
  background: var(--surface-alt);
  cursor: pointer;
  transition: all 0.2s ease;
}

input[type="file"]:hover {
  border-color: var(--accent-strong);
  background: rgba(255, 138, 101, 0.1);
}

.image-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.image-preview-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  background: var(--surface-alt);
  border: 2px solid rgba(255, 138, 101, 0.2);
}

.image-preview-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
}

.image-preview-filename {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.experience-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.experience-image {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.experience-image:hover {
  transform: scale(1.02);
}

.experience-image img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

/* Experience images preview in list */
.experience-images-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.experience-image-preview {
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--surface-alt);
}

.experience-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* User info top-right */
.user-info-topright {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.95);
  padding: 8px 16px;
  border-radius: 999px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

/* Login button top-right */
.login-btn-topright {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
}

.ghost-btn-small {
  font-size: 13px;
  padding: 6px 12px;
}

@media (max-width: 768px) {
  .user-info-topright {
    position: static;
    margin: 0 auto 16px;
    justify-content: center;
  }
  
  .login-btn-topright {
    position: static;
    margin: 0 auto 16px;
    text-align: center;
  }

  .search-panel .panel__header {
    align-items: stretch;
  }

  .search-panel .panel__header .ghost-btn {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }
}

@media (max-width: 820px) {
  body {
    font-size: 16px;
  }

  main {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 14px calc(52px + env(safe-area-inset-bottom, 0));
    gap: 12px;
  }

  .hero {
    padding: 20px 14px 8px;
  }

  .hero__inner {
    max-width: 100%;
  }

  .panel {
    padding: 12px;
    border-radius: 14px;
  }

  .panel__header {
    align-items: stretch;
    gap: 10px;
  }

  .category-filter {
    gap: 8px;
  }

  .category-filter-btn {
    font-size: 14px;
    padding: 9px 12px;
    min-height: 42px;
  }

  .entry {
    padding: 12px 12px 18px;
    border-radius: 14px;
  }

  .experience-title {
    font-size: 19px;
  }

  .entry__meta {
    font-size: 13.5px;
  }
}

@media (max-width: 540px) {
  body {
    font-size: 15px;
  }

  main {
    width: 100%;
    max-width: 100%;
    padding: 0 16px calc(56px + env(safe-area-inset-bottom, 0));
    gap: 10px;
  }

  .hero {
    padding: 18px 14px 8px;
  }

  .hero__inner {
    max-width: 100%;
  }

  .panel {
    border-radius: 14px;
    padding: 11px;
  }

  .panel__header {
    gap: 10px;
  }

  .panel__actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
  }

  .ghost-btn,
  .action-btn {
    font-size: 13.5px;
    padding: 9px 12px;
  }

  .category-filter {
    gap: 6px;
    margin-top: 8px;
  }

  .category-filter-btn {
    padding: 8px 11px;
    font-size: 13.5px;
  }

  .entry {
    padding: 11px;
  }

  .experience-title {
    font-size: 16px;
  }

  .experience-title-large {
    font-size: 21px;
  }

  .experience-content,
  .experience-content-large {
    font-size: 15px;
  }

  .share-btn {
    padding: 7px 11px;
    border-radius: 14px;
    font-size: 13px;
  }
}

/* Category badge */
.category-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent-yellow) 0%, var(--accent) 100%);
  color: var(--text);
  margin-bottom: 8px;
  box-shadow: 0 2px 4px rgba(255, 138, 101, 0.2);
}

.category-badge-large {
  font-size: 14px;
  padding: 6px 16px;
  margin-bottom: 12px;
}

.experience-title-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Required/Optional labels */
.required {
  color: #dc2626;
  font-size: 12px;
  font-weight: 600;
  margin-left: 4px;
}

.optional {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  margin-left: 4px;
}

.first-time-wrapper {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 8px 0 16px;
}

.first-time-wrapper span {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 600;
  color: #754c24;
}

.first-time-wrapper input[type="checkbox"] {
  margin-top: 4px;
  width: 18px;
  height: 18px;
}

.first-time-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(255, 138, 101, 0.15);
  color: #d84315;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.first-time-pill::before {
  content: '🌟';
  font-size: 12px;
}

.first-time-pill-large {
  margin-left: 8px;
  font-size: 13px;
  padding: 4px 14px;
}

/* Select dropdown */
select {
  padding: 12px 16px;
  border-radius: 8px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  background: var(--surface);
  font-family: inherit;
  font-size: 16px;
  transition: border-color 0.2s ease;
  cursor: pointer;
}

select:focus {
  outline: none;
  border-color: var(--accent);
}

select:required:invalid {
  color: var(--muted);
}

select option {
  color: var(--text);
}

/* User points display */
.user-points {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-strong);
  background: linear-gradient(135deg, rgba(255, 235, 59, 0.3), rgba(255, 138, 101, 0.2));
  padding: 4px 12px;
  border-radius: 12px;
  margin-left: 8px;
}

/* Optional section collapsible */
.optional-section {
  margin: 16px 0;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 4px 0;
  background: var(--surface-alt);
}

.optional-toggle {
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
}

.optional-toggle::before {
  content: '▶';
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.2s ease;
  font-size: 12px;
}

.optional-section[open] .optional-toggle::before {
  transform: rotate(90deg);
}

.optional-content {
  padding: 0 18px 18px;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Radar chart panel */
.radar-chart-panel {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 248, 225, 0.9));
  border: 2px solid rgba(255, 138, 101, 0.2);
  position: relative;
}

.radar-chart-panel .panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.radar-chart-body {
  margin-top: 8px;
}

.radar-toggle-btn {
  border: 1px solid rgba(255, 138, 101, 0.4);
  background: #fff8e1;
  color: #d26c4d;
  font-weight: 600;
  border-radius: 999px;
  padding: 6px 16px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.radar-toggle-btn:hover {
  background: #ffe0c7;
}

.radar-toggle-btn:focus-visible {
  outline: 2px solid #ff8a65;
  outline-offset: 2px;
}

.radar-chart-empty {
  margin: 0 auto 8px;
  max-width: 480px;
  text-align: center;
  color: #a66f5f;
  font-size: 0.9rem;
}

.radar-chart-container {
  max-width: 500px;
  margin: 24px auto 0;
  padding: 16px;
}

.radar-chart-container canvas {
  max-width: 100%;
  height: auto !important;
}

@media (max-width: 768px) {
  .radar-chart-container {
    max-width: 100%;
    padding: 8px;
  }
}
