/* Guestbook: a handheld chat room. Only the guestbook page loads this file. */
.pc-page {
  --pc-shell: #eef0f3;
  --pc-shell-edge: #c9cdd4;
  --pc-page-bg: #d7dae0;
  --pc-bezel: #3a3d44;
  --pc-screen: #f4f7fa;
  --pc-dots: #dde3ea;
  --pc-panel: #ffffff;
  --pc-edge: #6e7680;
  --pc-text: #2f3237;
  --pc-muted: #6b6f77;
  --pc-bar-a: #eceff3;
  --pc-bar-b: #cdd3dc;
  --pc-bar-edge: #8b96a6;
  --pc-line: #c3d8ee;
  --pc-margin: #f0b9c4;
  --pc-system: #fff6c9;
  --pc-system-edge: #d9c46a;
  --pc-system-text: #5f5012;
  --pc-select: #2f6fb8;
  --pc-tag-0: #d4544a;
  --pc-tag-1: #d97a26;
  --pc-tag-2: #b38f12;
  --pc-tag-3: #3f9147;
  --pc-tag-4: #23879a;
  --pc-tag-5: #3f6fc4;
  --pc-tag-6: #7a55bd;
  --pc-tag-7: #c4507f;
  color-scheme: light;
  min-height: 100dvh;
  margin: 0;
  display: block;
  background: var(--pc-page-bg);
  color: var(--pc-text);
  font-family: var(--font-sans);
}
:root[data-theme="dark"] .pc-page {
  --pc-shell: #1c1d21;
  --pc-shell-edge: #33363d;
  --pc-page-bg: #0d0e11;
  --pc-bezel: #000000;
  --pc-screen: #1f2228;
  --pc-dots: #2b2f37;
  --pc-panel: #2a2e36;
  --pc-edge: #66707e;
  --pc-text: #e6e8ec;
  --pc-muted: #a5abb6;
  --pc-bar-a: #343842;
  --pc-bar-b: #23262d;
  --pc-bar-edge: #4b5260;
  --pc-line: #34465c;
  --pc-margin: #5a3440;
  --pc-system: #39331d;
  --pc-system-edge: #7a6a2a;
  --pc-system-text: #eadb98;
  --pc-select: #5aa2ee;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pc-page {
    --pc-shell: #1c1d21;
    --pc-shell-edge: #33363d;
    --pc-page-bg: #0d0e11;
    --pc-bezel: #000000;
    --pc-screen: #1f2228;
    --pc-dots: #2b2f37;
    --pc-panel: #2a2e36;
    --pc-edge: #66707e;
    --pc-text: #e6e8ec;
    --pc-muted: #a5abb6;
    --pc-bar-a: #343842;
    --pc-bar-b: #23262d;
    --pc-bar-edge: #4b5260;
    --pc-line: #34465c;
    --pc-margin: #5a3440;
    --pc-system: #39331d;
    --pc-system-edge: #7a6a2a;
    --pc-system-text: #eadb98;
    --pc-select: #5aa2ee;
    color-scheme: dark;
  }
}
.pc-page :focus-visible { outline: 3px solid var(--pc-select); outline-offset: 2px; }

/* Device: chat log and writing pad as two framed screens. */
.pc {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  width: min(100% - 32px, 640px);
  margin: 0 auto;
  padding: 24px 0;
}
.pc-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: clip;
  border: 3px solid var(--pc-bezel);
  border-radius: 4px;
  background-color: var(--pc-screen);
  background-image: radial-gradient(var(--pc-dots) 1.2px, transparent 1.4px);
  background-size: 12px 12px;
  box-shadow: 0 0 0 12px var(--pc-shell), 0 0 0 13px var(--pc-shell-edge), 0 18px 40px rgba(0, 0, 0, .28);
}
.pc-hinge { display: none; }

@media (min-width: 960px) {
  .pc {
    grid-template-columns: minmax(0, 1.35fr) 16px minmax(340px, 1fr);
    gap: 24px;
    width: min(100% - 64px, 1320px);
    height: 100dvh;
    padding: 36px 0;
  }
  .pc-page { height: 100dvh; overflow: hidden; }
  .pc-screen { height: 100%; overflow: hidden; }
  .pc-hinge {
    display: block;
    align-self: center;
    width: 12px;
    height: 46%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--pc-shell-edge), var(--pc-shell), var(--pc-shell-edge));
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
  }
  .pc-bar__write, .pc-topbar__back { display: none !important; }
  .pc-log { overflow-y: auto; }
}

/* Phones: the log, or the pad when #sign is opened. */
@media (max-width: 959px) {
  .pc-screen--pad { display: none; }
  #sign:target { display: flex; min-height: calc(100dvh - 48px); }
  .pc-page:has(#sign:target) .pc-screen--log { display: none; }
  .pc-bar { position: sticky; bottom: 0; z-index: 2; }
}

.pc-topbar {
  display: flex;
  align-items: center;
  min-height: 38px;
  border-bottom: 2px solid var(--pc-bar-edge);
  background: linear-gradient(var(--pc-bar-a), var(--pc-bar-b));
}
.pc-topbar > * { padding: 0 12px; }
.pc-topbar__title { flex: 1; margin: 0; font: 600 1.05rem/1 var(--font-display); color: var(--pc-text); }
.pc-topbar__count { border-left: 2px dotted var(--pc-bar-edge); font: 500 .95rem/1 var(--font-display); color: var(--pc-muted); white-space: nowrap; }
.pc-topbar__back {
  align-self: stretch;
  display: grid;
  place-items: center;
  border-left: 2px dotted var(--pc-bar-edge);
  color: var(--pc-text);
  font: 600 .95rem/1 var(--font-display);
  text-decoration: none;
}
.pc-topbar__sfx {
  align-self: stretch;
  width: 42px;
  border: 0;
  border-left: 2px dotted var(--pc-bar-edge);
  background: transparent;
  color: var(--pc-text);
  cursor: pointer;
}
.pc-topbar__sfx svg { display: block; width: 20px; height: 20px; margin: auto; }
.pc-topbar__sfx[aria-pressed="true"] .pc-sfx__mute,
.pc-topbar__sfx[aria-pressed="false"] .pc-sfx__wave { display: none; }

/* Chat log. */
.pc-log {
  flex: 1;
  min-height: 0;
  list-style: none;
  margin: 0;
  padding: 18px clamp(14px, 3vw, 28px) 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scrollbar-width: thin;
}
.pc-log:focus-visible { outline-offset: -3px; }
.pc-system {
  align-self: center;
  max-width: 100%;
  padding: 6px 14px;
  border: 2px solid var(--pc-system-edge);
  border-radius: 3px;
  background: var(--pc-system);
  color: var(--pc-system-text);
  font: 500 .95rem/1.3 var(--font-display);
  text-align: center;
}
.pc-system--quiet { opacity: .85; }
.pc-msg {
  position: relative;
  padding: 22px 16px 10px;
  border: 2px solid var(--pc-edge);
  border-radius: 6px;
  background: var(--pc-panel);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .08);
}
.pc-msg__tag {
  position: absolute;
  top: -13px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 0;
  max-width: calc(100% - 20px);
  margin: 0;
  border: 2px solid var(--pc-edge);
  border-radius: 3px;
  background: var(--tag, var(--pc-tag-5));
  color: #fff;
  font: 600 .92rem/1 var(--font-display);
}
.pc-msg__initial {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  background: rgba(0, 0, 0, .22);
}
.pc-msg__name { padding: 4px 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pc-msg__text { margin: 0; font-size: 1rem; line-height: 1.6; overflow-wrap: anywhere; }
.pc-msg__time { display: block; margin-top: 6px; text-align: right; font-size: .78rem; color: var(--pc-muted); }

/* Owner reply: tucked under the note with the brand tag. */
.pc-reply {
  position: relative;
  margin: 22px 0 4px 18px;
  padding: 18px 14px 8px;
  border: 2px dashed var(--pc-edge);
  border-radius: 5px;
}
.pc-msg__tag--owner { background: #2f3237; }
:root[data-theme="dark"] .pc-page .pc-msg__tag--owner { background: #0f1013; }

.pc-status {
  margin: 0 14px 10px;
  padding: 8px 12px;
  border: 2px solid var(--pc-system-edge);
  background: var(--pc-system);
  color: var(--pc-system-text);
  font: 500 .95rem/1.3 var(--font-display);
}

.pc-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-top: 2px solid var(--pc-bar-edge);
  background: linear-gradient(var(--pc-bar-a), var(--pc-bar-b));
}
.pc-bar__btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--pc-text);
  cursor: pointer;
}
.pc-bar__btn svg { width: 26px; height: 26px; }
.pc-bar__sun { color: #e2a400; }
.pc-bar__home { border: 2px solid var(--pc-edge); background: var(--pc-panel); }
.pc-bar__btn:hover { background: var(--pc-dots); }
.pc-bar__write {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-left: auto;
  padding: 0 18px 0 14px;
  border: 2px solid var(--pc-edge);
  border-radius: 999px;
  background: var(--pc-panel);
  color: var(--pc-text);
  font: 600 1rem/1 var(--font-display);
  text-decoration: none;
}
.pc-bar__write svg { width: 20px; height: 20px; }

/* Writing pad: name tag plus ruled lines with a margin, like the pad on the lower screen. */
.pc-pad { display: flex; flex-direction: column; gap: 14px; padding: 18px clamp(14px, 3vw, 24px) 6px; }
.pc-pad__sheet {
  border: 2px solid var(--pc-edge);
  border-radius: 6px;
  background: var(--pc-panel);
  overflow: hidden;
}
.pc-pad__name {
  display: flex;
  align-items: stretch;
  border-bottom: 2px solid var(--pc-edge);
}
.pc-pad__label {
  display: grid;
  place-items: center;
  padding: 0 12px;
  background: var(--pc-tag-5);
  color: #fff;
  font: 600 .92rem/1 var(--font-display);
}
.pc-pad__name input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--pc-text);
  font: 500 1rem var(--font-display);
}
.pc-pad__lines {
  display: block;
  width: 100%;
  min-height: 12.5rem;
  resize: vertical;
  padding: 2px 14px 2px 46px;
  border: 0;
  background:
    linear-gradient(90deg, transparent 34px, var(--pc-margin) 34px, var(--pc-margin) 36px, transparent 36px),
    repeating-linear-gradient(transparent 0 calc(1.75rem - 1px), var(--pc-line) calc(1.75rem - 1px) 1.75rem);
  background-attachment: local;
  color: var(--pc-text);
  font: 1rem/1.75rem var(--font-sans);
}
.pc-pad__name input:focus, .pc-pad__lines:focus { outline: 3px solid var(--pc-select); outline-offset: -3px; }
.pc-pad__actions { display: flex; justify-content: flex-end; gap: 12px; }
.pc-key {
  min-width: 7rem;
  min-height: 46px;
  padding: 0 18px;
  border: 2px solid var(--pc-edge);
  border-radius: 6px;
  background: linear-gradient(var(--pc-panel), var(--pc-dots));
  color: var(--pc-text);
  font: 600 1.05rem/1 var(--font-display);
  box-shadow: 0 3px 0 var(--pc-edge);
  cursor: pointer;
}
.pc-key:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--pc-edge); }
.pc-key--send { background: var(--pc-select); border-color: #1f4f88; color: #fff; box-shadow: 0 3px 0 #1f4f88; text-transform: uppercase; letter-spacing: .06em; }
.pc-pad__status { min-height: 1.4em; margin: 0; color: var(--pc-muted); font: 500 .95rem/1.4 var(--font-display); }
.pc-pad__note {
  margin: auto clamp(14px, 3vw, 24px) 18px;
  color: var(--pc-muted);
  font-size: .9rem;
  text-align: center;
}
.pc-pad__note a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--pc-select); font-weight: 600; }
.pc-pad__note svg { width: 18px; height: 18px; }

@media (max-width: 420px) {
  .pc { width: calc(100% - 28px); padding: 18px 0; }
  .pc-screen { box-shadow: 0 0 0 7px var(--pc-shell), 0 0 0 8px var(--pc-shell-edge), 0 12px 28px rgba(0, 0, 0, .25); }
}

/*
 * Private message popup, restyled as a chat-room screen on this page: device
 * frame, gradient title bar, name-tag labels, ruled message lines, blue Send.
 * The shared popup rules pin it between Home's rails, so it is re-centred here.
 */
.pc-page .directory-popup {
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: 32px 20px;
}
.pc-page .directory-popup__backdrop { background: rgba(8, 10, 14, .62); }
.pc-page .contact-popup__window {
  width: min(36rem, 100%);
  max-height: min(88dvh, calc(100% - 24px));
  gap: 0;
  padding: 0;
  overflow: hidden auto;
  border: 3px solid var(--pc-bezel);
  border-radius: 4px;
  background-color: var(--pc-screen);
  background-image: radial-gradient(var(--pc-dots) 1.2px, transparent 1.4px);
  background-size: 12px 12px;
  color: var(--pc-text);
  box-shadow: 0 0 0 10px var(--pc-shell), 0 0 0 11px var(--pc-shell-edge), 0 18px 44px rgba(0, 0, 0, .4);
}
.pc-page .contact-popup__window .directory-popup__header {
  position: sticky;
  top: 0;
  z-index: 1;
  min-height: 42px;
  padding: 0 0 0 14px;
  border-bottom: 2px solid var(--pc-bar-edge);
  background: linear-gradient(var(--pc-bar-a), var(--pc-bar-b));
}
.pc-page .contact-popup__window .directory-popup__title {
  font: 600 1.1rem/1 var(--font-display);
  letter-spacing: 0;
  color: var(--pc-text);
}
.pc-page .contact-popup__window .directory-popup__close {
  align-self: stretch;
  min-width: 64px;
  border: 0;
  border-left: 2px dotted var(--pc-bar-edge);
  background: transparent;
  color: var(--pc-text);
  font: 600 .95rem/1 var(--font-display);
}
.pc-page .contact-popup__window .directory-popup__rule { display: none; }
.pc-page .contact-body { gap: 12px; padding: 18px 20px 22px; }
.pc-page .contact-intro { color: var(--pc-text); }
.pc-page .contact-note { color: var(--pc-muted); }
.pc-page .contact-form { gap: 6px; }
/* Field labels become name tags sitting on the field below. */
.pc-page .contact-form label {
  justify-self: start;
  margin-top: 8px;
  padding: 4px 10px;
  border: 2px solid var(--pc-edge);
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
  background: var(--pc-tag-5);
  color: #fff;
  font: 600 .85rem/1 var(--font-display);
  letter-spacing: 0;
  text-transform: none;
}
.pc-page .contact-form label span { color: rgba(255, 255, 255, .78); font-size: .78rem; }
.pc-page .contact-form input,
.pc-page .contact-form textarea {
  margin-top: -6px;
  border: 2px solid var(--pc-edge);
  border-radius: 0 6px 6px 6px;
  background: var(--pc-panel);
  color: var(--pc-text);
}
.pc-page .contact-form textarea {
  min-height: 9rem;
  padding: 2px 14px 2px 46px;
  background:
    linear-gradient(90deg, transparent 34px, var(--pc-margin) 34px, var(--pc-margin) 36px, transparent 36px),
    repeating-linear-gradient(transparent 0 calc(1.75rem - 1px), var(--pc-line) calc(1.75rem - 1px) 1.75rem),
    var(--pc-panel);
  background-attachment: local;
  line-height: 1.75rem;
}
.pc-page .contact-form input:focus-visible,
.pc-page .contact-form textarea:focus-visible { outline: 3px solid var(--pc-select); outline-offset: -3px; }
.pc-page .contact-submit {
  justify-self: end;
  min-width: 8rem;
  min-height: 46px;
  margin-top: 12px;
  padding: 0 20px;
  border: 2px solid #1f4f88;
  border-radius: 6px;
  background: var(--pc-select);
  color: #fff;
  font: 600 1.05rem/1 var(--font-display);
  letter-spacing: .06em;
  text-transform: uppercase;
  box-shadow: 0 3px 0 #1f4f88;
}
.pc-page .contact-submit:active { transform: translateY(2px); box-shadow: 0 1px 0 #1f4f88; }
.pc-page .contact-status { color: var(--pc-muted); font: 500 .95rem/1.4 var(--font-display); }
@media (max-width: 49.9375rem) {
  .pc-page .directory-popup { padding: 0; }
  .pc-page .contact-popup__window { width: 100%; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
}
