/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #dce9f5;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

/* ── Outer browser-chrome frame ── */
.browser {
  width: 100%;
  max-width: 680px;
  border: 2px solid #aac4de;
  border-radius: 8px;
  background: #eaf3fb;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(100,140,180,.25);
}

/* browser toolbar */
.toolbar {
  background: #d6e8f7;
  border-bottom: 1.5px solid #aac4de;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toolbar-icons {
  display: flex;
  gap: 6px;
  color: #7aaacf;
  font-size: 13px;
}
.toolbar-icons span { cursor: pointer; }
.toolbar-icons span:hover { color: #4480b0; }
.url-bar {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: #557ea0;
  font-weight: 600;
  letter-spacing: .3px;
}
.search-bar {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1.5px solid #aac4de;
  border-radius: 12px;
  padding: 2px 8px;
  gap: 4px;
  font-size: 11px;
  color: #99b8d0;
}
.search-bar input {
  border: none;
  outline: none;
  font-size: 11px;
  color: #557ea0;
  width: 80px;
  background: transparent;
}
.search-bar input::placeholder { color: #b0cde0; }

/* ── Site nav (below toolbar) ── */
.site-nav {
  background: #c8dff0;
  border-bottom: 1.5px solid #aac4de;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 0;
  font-size: 11px;
}
.site-nav a {
  display: inline-block;
  padding: 5px 10px;
  color: #3a6a90;
  text-decoration: none;
  font-weight: 700;
  border-right: 1px solid #aac4de;
  transition: background .15s;
}
.site-nav a:first-child { border-left: 1px solid #aac4de; }
.site-nav a:hover, .site-nav a.active { background: #afd2ed; color: #2a5a80; }
.site-nav .nav-title {
  margin-left: auto;
  font-size: 10px;
  color: #7aaacf;
  font-style: italic;
  padding: 5px 0;
}

/* ── Page content area ── */
.page-content {
  padding: 14px 16px;
  min-height: 300px;
}
.page-title {
  font-size: 15px;
  font-weight: 900;
  color: #2a5a80;
  font-style: italic;
  border-bottom: 1.5px dashed #aac4de;
  padding-bottom: 6px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.page-title .stars { font-style: normal; color: #7aaacf; font-size: 13px; }

/* ── Profile grid (unchanged) ── */
.profile-body {
  display: grid;
  grid-template-columns: 160px 1fr 150px;
  gap: 0;
  min-height: 280px;
}
.col-left {
  border-right: 1.5px solid #aac4de;
  display: flex;
  flex-direction: column;
}
.username-bar {
  background: #c8dff0;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  color: #3a6a90;
  border-bottom: 1.5px solid #aac4de;
}
.avatar-wrap {
  flex: 1;
  background: #d8ecf9;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 155px;
  position: relative;
}
.avatar-wrap svg { width: 100%; height: 100%; object-fit: cover; }
.action-buttons {
  display: flex;
  border-top: 1.5px solid #aac4de;
  border-bottom: 1.5px solid #aac4de;
}
.action-buttons button {
  flex: 1;
  background: #c8dff0;
  border: none;
  border-right: 1px solid #aac4de;
  padding: 5px 2px;
  font-size: 9.5px;
  color: #3a6a90;
  cursor: pointer;
  font-weight: 600;
  transition: background .15s;
}
.action-buttons button:last-child { border-right: none; }
.action-buttons button:hover { background: #afd2ed; }
.meta-table {
  padding: 6px 8px;
  font-size: 10px;
  color: #557ea0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.meta-row { display: flex; justify-content: space-between; }
.meta-row .label { font-weight: 700; color: #3a6a90; }
.meta-row .value { color: #557ea0; }
.col-center {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-right: 1.5px solid #aac4de;
}
.profile-title {
  font-size: 17px;
  font-weight: 900;
  color: #2a5a80;
  font-style: italic;
  border-bottom: 1.5px dashed #aac4de;
  padding-bottom: 4px;
}
.profile-title .stars { font-style: normal; color: #7aaacf; font-size: 14px; }
.bio { font-size: 10.5px; color: #446080; line-height: 1.55; }
.bio strong { color: #2a5a80; font-weight: 800; }
.bio em { font-style: normal; color: #5590b8; }
.btn-row { display: flex; gap: 6px; }
.pill-btn {
  flex: 1; padding: 4px 8px; border: none; border-radius: 4px;
  font-size: 10.5px; font-weight: 700; cursor: pointer; transition: opacity .15s;
}
.pill-btn:hover { opacity: .85; }
.btn-block { background: #7aaacf; color: #fff; }
.btn-report { background: #8fb8d8; color: #fff; }
.likes-dislikes {
  border: 1.5px solid #aac4de; border-radius: 5px; overflow: hidden;
  font-size: 10px; flex: 1;
}
.ld-row { padding: 5px 7px; line-height: 1.4; color: #446080; }
.ld-row:first-child { border-bottom: 1px solid #aac4de; }
.ld-header { font-weight: 800; color: #2a5a80; font-size: 10.5px; }
.ld-header .kaomoji { font-weight: 400; color: #7aaacf; }
.stats-bar {
  display: flex; gap: 10px; font-size: 10px; color: #557ea0;
  padding-top: 2px; border-top: 1.5px dashed #aac4de;
}
.stats-bar span { display: flex; align-items: center; gap: 2px; }
.stats-bar .icon { font-size: 11px; }
.col-right { display: flex; flex-direction: column; gap: 0; }
.widget-box { border-bottom: 1.5px solid #aac4de; padding: 6px 8px; }
.widget-title {
  text-align: center; font-size: 10px; font-weight: 700;
  color: #3a6a90; margin-bottom: 4px; letter-spacing: .3px;
}
.fav-list { list-style: none; font-size: 10px; color: #446080; line-height: 1.7; margin: 0 auto; width: fit-content; }
.fav-list li::before { content: '♡ '; color: #7aaacf; font-weight: 700; }
.find-me-btn {
  display: block; width: 100%; background: #7aaacf; border: none;
  border-radius: 4px; padding: 4px 6px; font-size: 10px; font-weight: 700;
  color: #fff; cursor: pointer; margin-top: 2px; transition: background .15s;
  text-align: center;
}
.find-me-btn:hover { background: #5a90b8; }
.social-icons {
  display: flex; gap: 6px; justify-content: center; padding: 6px 8px;
  border-top: 1.5px solid #aac4de; flex-wrap: wrap;
}
.social-icon {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; background: #c8dff0; color: #3a6a90;
  cursor: pointer; transition: background .15s; text-decoration: none;
}
.social-icon:hover { background: #afd2ed; }
.popsicle-area {
  flex: 1; display: flex; align-items: flex-end; justify-content: center;
  padding: 4px 6px 0; overflow: hidden;
}

/* ── Comments section ── */
.comments-section {
  border-top: 2px solid #aac4de;
  background: #eaf3fb;
  padding: 10px 14px 14px;
}
.comments-header {
  font-size: 12px; font-weight: 800; color: #2a5a80;
  margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
}
.comments-header .count {
  background: #7aaacf; color: #fff; border-radius: 8px;
  padding: 1px 6px; font-size: 10px; font-weight: 700;
}
.comment-form { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.comment-form-row { display: flex; gap: 6px; }
.comment-input-name {
  flex: 0 0 110px; padding: 5px 8px; border: 1.5px solid #aac4de;
  border-radius: 5px; font-size: 11px; color: #2a5a80; background: #fff;
  outline: none; font-family: inherit;
}
.comment-input-name:focus { border-color: #7aaacf; }
.comment-input-text {
  flex: 1; padding: 5px 8px; border: 1.5px solid #aac4de; border-radius: 5px;
  font-size: 11px; color: #2a5a80; background: #fff; outline: none;
  resize: vertical; min-height: 52px; font-family: inherit; line-height: 1.5;
}
.comment-input-text:focus { border-color: #7aaacf; }
.comment-submit {
  align-self: flex-end; background: #7aaacf; color: #fff; border: none;
  border-radius: 5px; padding: 5px 16px; font-size: 11px; font-weight: 700;
  cursor: pointer; transition: background .15s; font-family: inherit;
}
.comment-submit:hover { background: #5a90b8; }
.comment-submit:disabled { background: #b0cde0; cursor: default; }
.comment-list { display: flex; flex-direction: column; gap: 8px; }
.comment-item {
  background: #fff; border: 1.5px solid #aac4de; border-radius: 6px;
  padding: 7px 10px; font-size: 11px; color: #446080; line-height: 1.5;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.comment-meta { display: flex; align-items: baseline; gap: 6px; margin-bottom: 3px; }
.comment-author { font-weight: 800; color: #2a5a80; font-size: 11px; }
.comment-time { font-size: 9.5px; color: #99b8d0; }
.comment-delete {
  margin-left: auto; background: none; border: none; font-size: 10px;
  color: #b0cde0; cursor: pointer; padding: 0 2px; line-height: 1;
  transition: color .15s; font-family: inherit;
}
.comment-delete:hover { color: #c07080; }
.no-comments { font-size: 10.5px; color: #99b8d0; text-align: center; padding: 8px 0; font-style: italic; }

/* ── Bottom bar ── */
.bottom-bar {
  border-top: 1.5px solid #aac4de; background: #d6e8f7;
  display: flex; align-items: center; padding: 5px 12px;
  font-size: 11px; justify-content: space-between;
}
.bottom-nav a { color: #3a6a90; text-decoration: none; font-weight: 600; }
.bottom-nav a:hover { text-decoration: underline; }
.bottom-nav span { color: #7aaacf; margin: 0 3px; }
.bottom-kaomoji { font-size: 11px; color: #7aaacf; }
.bottom-actions { display: flex; gap: 6px; color: #7aaacf; font-size: 13px; }
.bottom-actions span { cursor: pointer; }
.bottom-actions span:hover { color: #4480b0; }

/* ── Shared form elements ── */
.form-field { display: flex; flex-direction: column; gap: 4px; }
.form-label { font-size: 10.5px; font-weight: 700; color: #3a6a90; }
.form-input, .form-textarea, .form-select {
  padding: 6px 9px; border: 1.5px solid #aac4de; border-radius: 5px;
  font-size: 11px; color: #2a5a80; background: #fff; outline: none;
  font-family: inherit;
}
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: #7aaacf; }
.form-textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.form-btn {
  background: #7aaacf; color: #fff; border: none; border-radius: 5px;
  padding: 6px 18px; font-size: 11px; font-weight: 700; cursor: pointer;
  transition: background .15s; font-family: inherit;
}
.form-btn:hover { background: #5a90b8; }
.form-btn:disabled { background: #b0cde0; cursor: default; }
.form-btn.secondary { background: #c8dff0; color: #3a6a90; }
.form-btn.secondary:hover { background: #afd2ed; }
.profile-save-notice {
  font-size: 10px; font-weight: 700; color: #3a8a50;
  background: #e6f4eb; border: 1px solid #a8d5b5;
  border-radius: 4px; padding: 3px 8px;
}
.profile-save-error {
  color: #a03030 !important; background: #fceaea; border-color: #d5a8a8;
}


/* ── Responsive ── */

/* Tablet / large phone (≤ 600px) */
@media (max-width: 600px) {
  body { padding: 0; align-items: flex-start; }

  .browser {
    max-width: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
    min-height: 100vh;
  }

  /* Toolbar: hide URL bar, expand search to fill */
  .url-bar { display: none; }
  .search-bar { flex: 1; }
  .search-bar input { width: 100%; min-width: 0; }

  /* Nav: allow wrapping, hide title on very small toolbars */
  .site-nav { flex-wrap: wrap; padding: 0 6px; gap: 0; }
  .site-nav a { font-size: 11px; padding: 6px 8px; }
  .site-nav .nav-title { display: none; }

  /* Profile grid: stack all columns vertically */
  .profile-body { grid-template-columns: 1fr; }

  /* col-left: vertical stack — avatar → button → meta */
  .col-left {
    border-right: none;
    border-bottom: 1.5px solid #aac4de;
    flex-direction: column;
  }
  .avatar-wrap { height: 220px; min-height: unset; flex: 0 0 auto; }
  .action-buttons {
    border-top: 1.5px solid #aac4de;
    flex-direction: row;
  }
  .action-buttons button {
    padding: 10px 4px;
    font-size: 11px;
  }
  .meta-table { font-size: 11px; }

  /* col-center: no side border needed */
  .col-center { border-right: none; }

  /* col-right: horizontal wrap of widgets */
  .col-right {
    grid-column: 1 / -1;
    border-top: 1.5px solid #aac4de;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .widget-box { flex: 1; min-width: 140px; }
  .popsicle-area { display: none; }

  /* Readable font sizes for content area */
  .bio { font-size: 11.5px; }
  .ld-row { font-size: 11px; }
  .meta-table { font-size: 11px; }
  .meta-row .label, .meta-row .value { font-size: 11px; }

  /* Blog cards: allow text to wrap fully */
  .post-card-body { flex-wrap: wrap; }
  .post-card-thumb,
  .post-card-thumb-placeholder { width: 100%; height: 120px; flex-shrink: 1; border-radius: 4px 4px 0 0; }
  .post-card-excerpt { font-size: 11.5px; }

  /* Comment form: stack name + text */
  .comment-form-row { flex-direction: column; }
  .comment-input-name { flex: none; width: 100%; }

  /* Bottom bar */
  .bottom-bar { flex-wrap: wrap; gap: 4px; padding: 6px 10px; }
  .bottom-kaomoji { display: none; }

  /* Dashboard: stack sidebar above panels */
  .dash-body { flex-direction: column; }
  .dash-sidebar {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1.5px solid #aac4de;
    width: 100%;
  }
  .dash-sidebar-item {
    border-right: 1.5px solid #aac4de;
    border-bottom: none;
    flex: 1;
    text-align: center;
  }
  .dash-sidebar-item.active { border-bottom: 2px solid #fff; margin-bottom: -2px; border-right: 1.5px solid #aac4de; margin-right: 0; }
  .dash-panel { max-height: none; }
}

/* Small phone (≤ 420px) */
@media (max-width: 420px) {

  /* col-right: vertical stack on very small screens */
  .col-right { flex-direction: column; }
  .widget-box { min-width: unset; }

  /* Gallery grid: 2 columns on very small screens */
  .gallery-grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* Page title: slightly smaller */
  .page-title { font-size: 14px; }

  /* Bottom bar: fully stacked */
  .bottom-bar { flex-direction: column; gap: 4px; padding: 8px 12px; text-align: center; }
  .bottom-kaomoji { display: block; }
  .bottom-actions { justify-content: center; }

  /* Forms: full-width social link rows */
  .pw-row { flex-direction: column; }

  /* Tag filter: wrap buttons legibly */
  .tag-filter-bar { gap: 4px; }
  .tag-filter-btn { padding: 4px 10px; font-size: 10.5px; }
}
