/* Retro-style chat: customize colors and dimensions as you like. */
.side-chat {
  box-sizing: border-box;
  width: 100%;
  max-width: 480px;
  padding: 12px;
  border: 2px solid #222;
  box-shadow: 4px 4px 0 #222;
  background: #f5f2e9;
  color: #222;
  font: 14px/1.4 "Courier New", monospace;
}
.side-chat * { box-sizing: border-box; }
.side-chat .chat-title { font-weight: bold; margin-bottom: 9px; }
#chat-log {
  height: 300px;
  overflow-y: auto;
  overflow-wrap: anywhere;
  background: #fff;
  border: 1px solid #777;
  padding: 8px;
}
.chat-message { margin-bottom: 9px; }
.chat-message strong { color: #483d8b; }
.chat-message small { color: #777; }
.chat-content { white-space: pre-wrap; }
#chat-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; margin-top: 9px; }
#chat-form > * { min-width: 0; }
.chat-verification {
  padding: 6px;
  border: 1px dashed #777;
  background: #e5e0cd;
}
.chat-verification[hidden] { display: none; }
.chat-verification-label { display: block; margin-bottom: 6px; font-size: 11px; }
.chat-verification .cf-turnstile { display: flex; justify-content: center; }
#chat-form input,
#chat-form textarea {
  width: 100%;
  padding: 7px;
  border: 1px solid #777;
  background: white;
  color: #222;
  font: inherit;
}
#chat-form textarea { min-height: 65px; resize: vertical; }
#chat-send,
#chat-older {
  padding: 6px 10px;
  border: 1px solid #222;
  background: #e5e0cd;
  color: #222;
  font: inherit;
  cursor: pointer;
}
#chat-older { margin-bottom: 7px; }
#chat-send:disabled, #chat-older:disabled { opacity: .6; cursor: wait; }
#chat-status { min-height: 1em; margin: 8px 0 0; font-size: 12px; }

/* The shell stays centered; chat uses only the left viewport margin. */
.home-layout { display: flex; flex-direction: column; }
.home-layout .shell { order: 0; }
.home-layout .side-chat {
  order: 1;
  width: calc(100% - 48px);
  max-width: 480px;
  margin: 0 auto 60px;
}
@media (min-width: 1280px) {
  .home-layout .side-chat {
    position: absolute;
    top: 110px;
    left: 24px;
    width: calc((100% - 740px) / 2 - 48px);
    max-width: 300px;
    margin: 0;
  }
}
@media (max-width: 640px) {
  .home-layout .side-chat { width: calc(100% - 36px); }
}

/* Currently hyperfixated widget */

#currently-side fieldset {
  min-width: 0;
}

#currently-side .fixation-topic {
  font-weight: bold;
  margin: 0 0 10px;
}

#currently-side .fixation-note {
  font-size: 12px;
  line-height: 1.5;
  margin: 0 0 14px;
}

#currently-side .fixation-small {
  font-size: 11px;
  color: #8f765b;
  border-top: 1px dashed #b7ac9b;
  padding-top: 8px;
}

#currently-side .fixation-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 14px;
  font-size: 12px;
}

#currently-side .fixation-list li::before {
  content: "[ ] ";
  color: #8f765b;
}

#currently-side .fixation-list li.done::before {
  content: "[x] ";
}

#currently-side .fixation-list li.done {
  text-decoration: line-through;
  opacity: 0.65;
}

/* Replace the old top: 1000px rule with this */

.home-layout .side-chat#currently-side {
  position: static;
  top: auto;
}

@media (min-width: 1280px) {
  .home-layout .side-chat#currently-side {
    position: absolute;
    top: 110px;
    left: auto;
    right: 24px;
  }
}


/* Temporary styling study: warm paper and quieter edges. */
.home-layout .side-chat {
 background: #d8c9ac;
 color: #352820;
 border: 1px solid #92775e;
 box-shadow: 3px 4px 2px #100c0966;
 padding: 12px;
}
.side-chat a { color: #395b50; }
.side-chat a:hover, .side-chat a:focus-visible { color: #853f2b; }
.side-chat .chat-title { color: #493629; font-size: 13px; border-bottom: 1px dashed #a28c70; padding-bottom: 9px; }
#chat-log { background: #e8dcc3; border-color: #a28c70; }
#chat-form input, #chat-form textarea { background: #f0e6d3; color: #352820; border-color: #a28c70; }
#chat-form input::placeholder, #chat-form textarea::placeholder { color: #6d5a49; opacity: 1; }
.chat-verification, #chat-send, #chat-older { background: #c8b899; border-color: #92775e; color: #352820; }
#currently-side fieldset {
 background: #dfd2b9 !important;
 border: 1px solid #a28c70 !important;
 box-shadow: 2px 3px 0 #49362950 !important;
 margin: 2px !important;
 padding: 12px 10px !important;
}
#currently-side legend {
 background: #d2c19f !important;
 border-color: #92775e !important;
 box-shadow: 1px 2px 0 #49362930 !important;
 line-height: 1.5;
}
#currently-side .fixation-small, #currently-side .fixation-list li::before { color: #68533e; }
#currently-side .fixation-list li.done { opacity: .8; }
@media (min-width:1280px) {
 .home-layout .side-chat { top: 142px; }
 .home-layout .side-chat#currently-side { top: 158px; transform: rotate(-.5deg); }
}
