* { box-sizing: border-box; }
body {
  margin: 0;
  background: #d8dfea;
  font-family: "Lucida Grande", Tahoma, Verdana, Arial, sans-serif;
  font-size: 11px;
  color: #333;
}

/* ---- Top bar ---- */
.topbar {
  background: #3b5998;
  border-bottom: 1px solid #29447e;
  padding: 6px 12px;
  color: #fff;
  font-size: 12px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 34px;
}
.topbar .navlinks a {
  color: #d8dfea;
  text-decoration: none;
  margin-left: 14px;
  font-size: 11px;
}
.topbar .navlinks a:hover { text-decoration: underline; color: #fff; }

/* ---- Page shell ---- */
.page {
  max-width: 780px;
  margin: 0 auto;
  padding: 10px 10px 40px;
}

.headline {
  background: #fff;
  border: 1px solid #b7b7b7;
  border-top: none;
  padding: 8px 10px;
  font-size: 18px;
  font-weight: bold;
  color: #333;
  font-family: Georgia, serif;
}
.headline .sub {
  font-size: 11px;
  font-weight: normal;
  color: #777;
  font-family: "Lucida Grande", Tahoma, sans-serif;
  margin-top: 2px;
}

.columns {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  align-items: flex-start;
}

/* ---- Left column ---- */
.left-col { width: 220px; flex-shrink: 0; }

.profile-pic-box {
  background: #fff;
  border: 1px solid #b7b7b7;
  padding: 5px;
  text-align: center;
}
.profile-pic-box img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border: 1px solid #d8dfea;
  display: block;
}
.profile-pic-box .caption {
  margin-top: 4px;
  color: #3b5998;
  font-size: 11px;
}

.box {
  background: #fff;
  border: 1px solid #b7b7b7;
  margin-top: 10px;
}
.box-title {
  background: #d8dfea;
  background: linear-gradient(#eef1f7, #d8dfea);
  border-bottom: 1px solid #b7b7b7;
  padding: 4px 8px;
  font-weight: bold;
  color: #3b5998;
  font-size: 11px;
}
.box-body { padding: 8px; line-height: 1.6; }
.box-body .row { margin-bottom: 4px; }
.box-body .label { color: #777; }

.friends-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 8px;
}
.friend {
  text-align: center;
  font-size: 10px;
  min-width: 0;
}
.friend .fpic {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  background: #d8dfea;
  border: 1px solid #b7b7b7;
  display: block;
  margin-bottom: 2px;
}
.friend .fname { color: #3b5998; display: block; }

/* ---- Right column / Wall ---- */
.right-col { flex: 1; min-width: 0; }

.wall-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.wall-count { color: #777; font-weight: normal; }

.status-box { padding: 8px; }
.status-box textarea {
  width: 100%;
  height: 40px;
  resize: none;
  font-family: inherit;
  font-size: 11px;
  border: 1px solid #b7b7b7;
  padding: 5px;
}
.status-box input[type="text"] {
  font-family: inherit;
  font-size: 11px;
  border: 1px solid #b7b7b7;
  padding: 4px;
  width: 150px;
  margin-top: 6px;
}
.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.captcha-row {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #555;
}
.captcha-row input[type="text"] {
  width: 50px;
  margin-top: 0;
}
.post-error {
  color: #a33;
  margin-top: 4px;
}
.status-actions {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.fb-btn {
  background: #f7f7f7;
  background: linear-gradient(#fefefe, #eee);
  border: 1px solid #bebebe;
  border-radius: 3px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
}
.fb-btn:hover { background: #eee; }
.fb-btn.primary {
  background: #3b5998;
  background: linear-gradient(#4e69a2, #3b5998);
  color: #fff;
  border-color: #29447e;
}
.fb-btn.primary:hover { background: #34508c; }

.wall-posts { border-top: 1px solid #e5e5e5; }
.post {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid #e5e5e5;
}
.post:last-child { border-bottom: none; }
.post .avatar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: #d8dfea;
  border: 1px solid #b7b7b7;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7f96c4;
  font-weight: bold;
  font-size: 13px;
}
.post .content { flex: 1; min-width: 0; }
.post .author {
  color: #3b5998;
  font-weight: bold;
  text-decoration: none;
}
.post .message { margin-top: 2px; word-wrap: break-word; }
.post .meta {
  margin-top: 4px;
  color: #a3a3a3;
  font-size: 10px;
}
.post .meta a { color: #3b5998; text-decoration: none; }
.post .meta a:hover { text-decoration: underline; }

.replies {
  margin-top: 8px;
  padding-left: 12px;
  border-left: 2px solid #e5e5e5;
}
.reply {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.reply .avatar {
  width: 22px;
  height: 22px;
  font-size: 10px;
}
.reply .content { flex: 1; min-width: 0; }
.reply .author { color: #3b5998; font-weight: bold; text-decoration: none; font-size: 11px; }
.reply .message { margin-top: 1px; word-wrap: break-word; }
.reply .meta { margin-top: 2px; color: #a3a3a3; font-size: 10px; }

.reply-form {
  display: none;
  margin-top: 8px;
}
.reply-form.open { display: block; }
.reply-form input[type="text"] {
  font-family: inherit;
  font-size: 11px;
  border: 1px solid #b7b7b7;
  padding: 3px;
  width: 120px;
  margin-right: 4px;
}
.reply-form textarea {
  width: 100%;
  height: 28px;
  resize: none;
  font-family: inherit;
  font-size: 11px;
  border: 1px solid #b7b7b7;
  padding: 4px;
  margin-top: 4px;
}
.reply-form .reply-actions {
  margin-top: 4px;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
.reply-form .fb-btn { padding: 2px 8px; font-size: 10px; }
.reply-form .captcha-row { margin-top: 4px; font-size: 10px; }
.reply-form .captcha-row input[type="text"] { width: 44px; margin-top: 0; }
.reply-error {
  color: #a33;
  font-size: 10px;
  margin-top: 4px;
}

.empty-wall {
  padding: 20px 10px;
  text-align: center;
  color: #999;
}

.footer {
  text-align: center;
  color: #a3b1cc;
  font-size: 10px;
  margin-top: 16px;
}

/* ---- Additions for the served site ---- */

/* Buttons and links share the .fb-btn chrome, so anchors need the reset that
   <button> gets for free. */
a.fb-btn {
  display: inline-block;
  text-decoration: none;
  line-height: 1.4;
}
.fb-btn.danger { color: #a33; }
.box-title-count { font-weight: normal; color: #777; }
.hint { color: #999; }
.hint a { color: #3b5998; }

/* Cookie notice: sits under the top bar until the visitor dismisses it. */
.cookie-notice {
  background: #fff9d7;
  border-bottom: 1px solid #e2c822;
  padding: 6px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  color: #5f5320;
}
.cookie-notice a { color: #3b5998; }
.cookie-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* Wall extras the static sketch had no need for. */
.wall-closed {
  padding: 14px 10px;
  text-align: center;
  color: #a33;
  background: #fff4f4;
  border-bottom: 1px solid #e5e5e5;
}
.captcha-row label { color: #555; }
.status-box textarea { display: block; }

.votes { white-space: nowrap; }
.vote-form { display: inline; }
.vote-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: #3b5998;
  cursor: pointer;
}
.vote-btn:hover { text-decoration: underline; }
.vote-btn.on { font-weight: bold; }
.vote-count { color: #a3a3a3; }

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-top: 1px solid #e5e5e5;
  background: #f7f7f7;
}
.pager a { color: #3b5998; text-decoration: none; }
.pager a:hover { text-decoration: underline; }
.pager-pos { color: #999; }

/* Credits: the licence table, and the link to it under the friends grid. */
.friends-foot {
  border-top: 1px solid #eee;
  padding: 4px 8px;
  text-align: right;
}
/* Deliberately faint: the licences oblige the site to carry this link, but it
   is housekeeping, not something a visitor came here to read. It comes up to
   full contrast on hover and on keyboard focus. */
.friends-foot a {
  color: #ccced5;
  text-decoration: none;
  font-size: 10px;
}
.friends-foot a:hover,
.friends-foot a:focus {
  color: #3b5998;
  text-decoration: underline;
}

.credits {
  border-collapse: collapse;
  width: 100%;
  margin: 0 0 10px;
}
.credits th,
.credits td {
  border-bottom: 1px solid #e5e5e5;
  padding: 5px 6px;
  text-align: left;
  vertical-align: middle;
}
.credits th {
  background: #f1f3f8;
  color: #3b5998;
  font-size: 10px;
}
.credit-pic {
  display: block;
  width: 40px;
  height: 40px;
  border: 1px solid #b7b7b7;
}

/* Pages without the two-column profile layout: privacy, credits, admin. */
.single-col { margin-top: 10px; }
.single-col.narrow { max-width: 320px; }
.prose { line-height: 1.7; }
.prose p { margin: 0 0 10px; }
.prose ul { margin: 0 0 10px; padding-left: 18px; }
.prose li { margin-bottom: 6px; }
.prose code {
  background: #f1f3f8;
  border: 1px solid #dfe3ee;
  padding: 0 3px;
  font-size: 11px;
}
.prose a { color: #3b5998; }

.login-form label { display: block; margin-bottom: 4px; color: #555; }
.login-form input[type="password"] {
  width: 100%;
  font-family: inherit;
  font-size: 11px;
  border: 1px solid #b7b7b7;
  padding: 4px;
}

.flash {
  background: #eff6dd;
  border: 1px solid #c3d68a;
  padding: 5px 8px;
  margin-bottom: 8px;
  color: #4a5b23;
}
.admin-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.admin-row {
  border-top: 1px solid #e5e5e5;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.admin-row:first-child { border-top: none; }
.admin-row.deleted { opacity: 0.65; }
.admin-row-head { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.admin-row-body { word-wrap: break-word; max-width: 100%; }
.admin-meta { color: #a3a3a3; font-size: 10px; }
.tag {
  background: #d8dfea;
  color: #3b5998;
  padding: 0 4px;
  font-size: 10px;
}

/* Narrow screens: the sidebar stacks above the wall rather than squeezing it. */
@media (max-width: 640px) {
  .columns { flex-direction: column; }
  .left-col { width: 100%; }
  .profile-pic-box img { width: 100%; height: auto; max-width: 200px; margin: 0 auto; }
  .friends-grid { grid-template-columns: repeat(4, 1fr); }
}
