/* ==========================================================================
   Recci — shared styles
   ========================================================================== */

:root {
  --paper: #d6d3ca;
  --paper-card: #f1eee5;
  --paper-inset: #e2dfd6;
  --ink: #252a2c;
  --ink-soft: #62655f;
  --orange: #667783;
  --orange-dark: #34434c;
  --green: #777d69;
  --green-dark: #4c5242;
  --line: #aaa79d;
  --line-dark: #686d6b;
  --link: #36546a;

  --border-thick: 1px;
  --border-thin: 1px;
  --radius: 0;

  --font-ui: Verdana, Geneva, Tahoma, Arial, sans-serif;
  --font-heading: Georgia, 'Times New Roman', Times, serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--paper);
  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(37, 42, 44, 0.025) 0,
      rgba(37, 42, 44, 0.025) 1px,
      transparent 1px,
      transparent 4px
    );
  color: var(--ink);
  font-family: var(--font-ui);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 28px 16px 60px;
}

.sheet {
  width: 100%;
  max-width: 920px;
  background: var(--paper-card);
  border: var(--border-thick) solid var(--orange);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 3px 3px 0 rgba(37, 42, 44, 0.18);
}

/* ---------- Header ---------- */

.brand-bar {
  padding: 22px 26px 14px;
  border-bottom: var(--border-thick) solid var(--line-dark);
  background-color: var(--orange-dark);
  background-image:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.025) 0,
      rgba(255, 255, 255, 0.025) 1px,
      transparent 1px,
      transparent 5px
    );
}

.brand-bar h1 {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 1.6rem;
  color: #f3f0e7;
  margin: 0;
  letter-spacing: 0.025em;
}

/* ---------- Nav ---------- */

nav.tabs {
  display: flex;
  border-bottom: var(--border-thick) solid var(--orange);
  background: #cbc8be;
}

nav.tabs a {
  flex: 1;
  text-align: center;
  padding: 14px 8px;
  text-decoration: none;
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--orange-dark);
  border-right: var(--border-thin) solid var(--line);
  transition: background 0.15s ease, color 0.15s ease;
}

nav.tabs a:last-child {
  border-right: none;
}

nav.tabs a:hover {
  background: #dedbd2;
}

nav.tabs a.active {
  background: var(--orange);
  color: #f6f3ea;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

/* ---------- Content area ---------- */

.content {
  padding: 26px;
}

.rec-panel {
  border: var(--border-thick) solid var(--orange);
  border-radius: var(--radius);
  margin-bottom: 34px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.panel-title {
  border-bottom: var(--border-thin) solid var(--line);
  padding: 14px 18px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--paper-inset);
}

.panel-title h2 {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--ink);
  margin: 0;
  white-space: nowrap;
}

.panel-title input[type="text"] {
  flex: 1;
  min-width: 120px;
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--ink);
  border: none;
  border-bottom: var(--border-thin) solid var(--line);
  background: transparent;
  padding: 2px 4px;
  outline: none;
}

.panel-title input[type="text"]::placeholder {
  color: rgba(37, 42, 44, 0.42);
}

/* ---------- Card ---------- */

.card {
  padding: 20px;
}

.card-row {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 16px;
  margin-bottom: 20px;
  align-items: stretch;
}

@media (max-width: 480px) {
  .card-row {
    grid-template-columns: 130px 1fr;
  }
}

.image-drop {
  border: var(--border-thin) solid var(--line);
  border-radius: var(--radius);
  width: 100%;
  height: 100%;
  min-height: 200px;
  background-color: var(--paper-inset);
  background-image:
    linear-gradient(45deg, rgba(52, 67, 76, 0.035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(52, 67, 76, 0.035) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(52, 67, 76, 0.035) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(52, 67, 76, 0.035) 75%);
  background-size: 8px 8px;
  background-position: 0 0, 0 4px, 4px -4px, -4px 0;
}

.field-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 100%;
}

.field {
  border: var(--border-thin) solid var(--orange);
  border-radius: var(--radius);
  padding: 10px 14px;
  background: var(--paper-card);
  box-shadow: inset 1px 1px 0 rgba(37, 42, 44, 0.06);
}

.field label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 3px;
}

.field select,
.field input[type="text"] {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--ink);
  padding: 2px 0;
  appearance: none;
}

.field.select-field {
  position: relative;
}

.field.select-field::after {
  content: "▾";
  position: absolute;
  right: 14px;
  bottom: 12px;
  color: var(--orange);
  pointer-events: none;
}

.message-field {
  border: var(--border-thin) solid var(--orange);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
  background: var(--paper-card);
  box-shadow: inset 1px 1px 0 rgba(37, 42, 44, 0.06);
}

.message-field label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.message-field textarea {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--ink);
  min-height: 70px;
  line-height: 1.5;
}

.message-field textarea::placeholder {
  color: rgba(37, 42, 44, 0.42);
}

.char-count {
  text-align: right;
  font-size: 0.75rem;
  color: var(--ink-soft);
  font-family: var(--font-ui);
  margin-top: 4px;
}

.char-count.limit {
  color: var(--orange-dark);
  font-weight: 600;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  padding: 11px 26px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.5),
    inset -1px -1px 0 rgba(37, 42, 44, 0.2);
}

.btn:active {
  transform: translateY(1px);
}

.btn-outline {
  background: var(--paper-card);
  border: var(--border-thick) solid var(--green);
  color: var(--green-dark);
}

.btn-outline:hover {
  background: #e1dfd5;
}

.btn-solid {
  background: var(--orange);
  border: var(--border-thick) solid var(--orange);
  color: #fff;
}

.btn-solid:hover {
  background: var(--orange-dark);
  border-color: var(--orange-dark);
}

/* ---------- Lower sections ---------- */

.section-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 34px;
}

@media (max-width: 560px) {
  .section-row {
    grid-template-columns: 1fr;
  }
}

.section-panel {
  border: var(--border-thin) solid var(--line);
  border-radius: var(--radius);
  min-height: 160px;
}

.section-panel h3 {
  margin: 0;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: var(--font-heading);
  font-weight: 400;
  border-bottom: var(--border-thin) solid var(--line);
  background: var(--paper-inset);
}

.board-preview {
  border: var(--border-thin) solid var(--line);
  border-radius: var(--radius);
  min-height: 200px;
}

.board-preview h3 {
  margin: 0;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: var(--font-heading);
  font-weight: 400;
  border-bottom: var(--border-thin) solid var(--line);
  background: var(--paper-inset);
}

.placeholder-panel {
  border: var(--border-thin) solid var(--line);
  border-radius: var(--radius);
  padding: 60px 20px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 1rem;
}

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 20px;
  border: var(--border-thin) solid #111617;
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 0.88rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Profile Page ---------- */

.profile-card {
  border: var(--border-thick) solid var(--orange);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 500px;
  margin: 0 auto;
}

.profile-card h2 {
  margin-top: 0;
  margin-bottom: 20px;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--orange-dark);
  border-bottom: var(--border-thin) solid var(--line);
  padding-bottom: 10px;
}

.profile-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}

.profile-field .label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.profile-field .value {
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
}

/* ---------- Friends Page ---------- */

.friends-container {
  max-width: 600px;
  margin: 0 auto;
}

.add-friend-box {
  border: var(--border-thick) solid var(--orange);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 24px;
}

.add-friend-box h3 {
  margin: 0 0 12px 0;
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 1rem;
}

.search-row {
  display: flex;
  gap: 10px;
}

.search-row input {
  flex: 1;
  padding: 8px 12px;
  border: var(--border-thin) solid var(--orange);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: var(--font-ui);
  background: var(--paper-card);
  color: var(--ink);
  outline: none;
}

.feedback-msg {
  font-size: 0.85rem;
  margin: 8px 0 0 0;
}

.sub-tabs {
  display: flex;
  border-bottom: var(--border-thick) solid var(--line);
  margin-bottom: 16px;
}

.sub-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 10px;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  font-family: var(--font-ui);
}

.sub-tab.active {
  color: var(--orange-dark);
  border-bottom-color: var(--orange-dark);
  background: var(--paper-inset);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.user-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border: var(--border-thin) solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.action-gap {
  display: flex;
  gap: 8px;
}

.empty-msg {
  color: var(--ink-soft);
  font-style: italic;
  padding: 12px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  font-family: var(--font-ui);
}

.btn-danger {
  background: transparent;
  border: var(--border-thin) solid #80564f;
  color: #70443e;
}

.btn-danger:hover {
  background: #e7d9d4;
}

/* ---------- Chat Section ---------- */

.chat-section {
  margin-top: 32px;
  border-top: var(--border-thick) solid var(--line);
  padding-top: 24px;
}

.chat-section h3 {
  margin-top: 0;
  margin-bottom: 16px;
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 1.1rem;
}

.chat-container {
  display: flex;
  border: var(--border-thin) solid var(--line);
  border-radius: var(--radius);
  min-height: 300px;
  background: var(--paper-card);
  overflow: hidden;
}

.chat-sidebar {
  width: 260px;
  border-right: var(--border-thin) solid var(--line);
  background: var(--paper);
  overflow-y: auto;
}

.chat-friends-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.chat-friend-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: var(--border-thin) solid var(--line);
  cursor: pointer;
  transition: background 0.15s ease;
}

.chat-friend-card:hover {
  background: #d8d6cd;
}

.chat-friend-card.active {
  background: #cccac0;
}

.avatar-placeholder {
  width: 40px;
  height: 40px;
  background-color: #b9b7ae;
  background-image: repeating-linear-gradient(
    45deg,
    transparent 0,
    transparent 3px,
    rgba(52, 67, 76, 0.08) 3px,
    rgba(52, 67, 76, 0.08) 4px
  );
  border-radius: var(--radius);
  flex-shrink: 0;
}

.chat-friend-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-friend-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-friend-subtext {
  font-size: 0.72rem;
  color: var(--ink-soft);
  margin-top: 2px;
}

.chat-window {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.chat-placeholder {
  color: var(--ink-soft);
  font-style: italic;
  font-size: 0.95rem;
  text-align: center;
}

.req-star {
  color: var(--orange-dark);
  font-weight: bold;
}

.opt-tag {
  font-size: 0.62rem;
  color: var(--ink-soft);
  font-weight: normal;
  text-transform: lowercase;
  opacity: 0.8;
}

.recipient-select-container {
  flex: 1;
  min-width: 180px;
  position: relative;
  border: var(--border-thin) solid var(--orange);
  border-radius: var(--radius);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  cursor: text;
  background: var(--paper-card);
  box-shadow: inset 1px 1px 0 rgba(37, 42, 44, 0.06);
}

.recipient-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.recipient-tag {
  background: var(--paper);
  border: var(--border-thin) solid var(--orange);
  color: var(--ink);
  padding: 2px 6px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.recipient-tag .tag-remove {
  cursor: pointer;
  color: var(--orange-dark);
  font-weight: bold;
}

.recipient-select-container input[type="text"] {
  flex: 1;
  min-width: 80px;
  border: none !important;
  background: transparent;
  outline: none;
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--ink);
  padding: 2px 0;
}

.custom-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--paper-card);
  border: var(--border-thick) solid var(--orange);
  border-radius: var(--radius);
  box-shadow: 2px 2px 0 rgba(37, 42, 44, 0.18);
  max-height: 180px;
  overflow-y: auto;
  z-index: 100;
  margin-top: 4px;
}

.custom-dropdown.open {
  display: block;
}

.dropdown-item {
  padding: 8px 12px;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--ink);
  border-bottom: var(--border-thin) solid var(--line);
  transition: background 0.1s ease;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover,
.dropdown-item.selected {
  background: #d9d7ce;
  color: var(--orange-dark);
}

.italic-option {
  font-style: italic;
  font-weight: 600;
}

.field select.custom-select {
  background: var(--paper-card);
  border: none;
  outline: none;
  cursor: pointer;
}

/* ==========================================================================
   Board Feed Styles
   ========================================================================== */

.board-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.rec-board-card {
  border: var(--border-thick) solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-card);
  padding: 14px 16px;
  width: fit-content;
  max-width: 85%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  box-shadow: none;
}

.rec-board-card.rec-sent {
  align-self: flex-end;
  border-color: var(--orange);
}

.rec-board-card.rec-received {
  align-self: flex-start;
  border-color: var(--green);
}

.rec-headline-header {
  margin-bottom: 8px;
}

.rec-headline {
  font-size: 0.85rem;
  color: var(--ink);
  line-height: 1.3;
}

.rec-divider {
  border: none;
  border-top: var(--border-thin) solid var(--line);
  margin: 6px 0 10px 0;
}

.rec-type-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--paper-inset);
  color: var(--orange-dark);
  border: var(--border-thin) solid var(--orange);
  padding: 2px 6px;
  border-radius: var(--radius);
  margin-bottom: 6px;
}

.rec-title {
  margin: 0 0 6px 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
}

.rec-link-container {
  margin-bottom: 8px;
}

.rec-link {
  font-size: 0.8rem;
  color: var(--link);
  text-decoration: underline;
  word-break: break-all;
}

.rec-image-container {
  width: 100%;
  margin: 8px 0;
  border: var(--border-thin) solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
}

.rec-image {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  display: block;
}

.rec-description {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 4px 0 8px 0;
  line-height: 1.4;
}

.rec-message {
  margin: 6px 0 8px 0;
  padding: 6px 10px;
  font-style: italic;
  font-size: 0.85rem;
  color: var(--ink);
  background: #e4e1d7;
  border-left: 3px solid var(--orange);
  border-radius: var(--radius);
}

/* ---------- Shared old-board details ---------- */

a {
  color: var(--link);
}

button,
input,
select,
textarea {
  border-radius: 0;
}

input:focus,
select:focus,
textarea:focus,
.recipient-select-container:focus-within {
  outline: 1px dotted var(--orange-dark);
  outline-offset: 2px;
}

::selection {
  background: var(--orange-dark);
  color: #f6f3ea;
}

.rec-date-bottom {
  font-size: 0.7rem;
  color: var(--ink-soft);
  text-align: right;
  margin-top: 6px;
}
