:root {
  --bg: #f4efe8;
  --paper: #fffaf2;
  --ink: #1f1c18;
  --muted: #74695c;
  --line: #d9c9b4;
  --accent: #e66a31;
  --accent-ink: #fff6ef;
  --card: #fffdf8;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Archivo", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 95% 0%, #ffe4c9 0, transparent 34%),
    radial-gradient(circle at 0% 100%, #f6d7b8 0, transparent 32%),
    var(--bg);
}

h1,
h2,
h3,
.tab,
.brand {
  font-family: "Outfit", sans-serif;
}

.app-shell {
  width: min(1320px, 94vw);
  margin: 0 auto;
  padding: 24px 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 14px;
}

.brand {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--accent);
}

h1 {
  margin: 6px 0 0;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(84px, 1fr));
  gap: 9px;
}

.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 7px 10px;
}

.stat span {
  display: block;
  font-weight: 800;
  font-size: 1.25rem;
}

.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.tab {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

.tab.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}

.view {
  display: none;
  min-height: calc(100vh - 180px);
}

.view.active {
  display: block;
}

.grid-two {
  display: grid;
  grid-template-columns: 0.9fr 1.3fr;
  gap: 14px;
  height: 100%;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 15px 30px rgba(30, 18, 8, 0.06);
}

.auth-panel,
.filters-panel {
  height: 100%;
}

.write-panel,
.stream-panel {
  min-height: 100%;
}

label {
  display: block;
  margin: 10px 0 6px;
  color: var(--muted);
  font-size: 0.93rem;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 10px 11px;
}

textarea {
  min-height: 190px;
  resize: vertical;
}

button {
  border: none;
  border-radius: 11px;
  padding: 9px 13px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  cursor: pointer;
}

button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

button.wide {
  width: 100%;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

#auth-status,
#form-status,
#watch-status {
  min-height: 1.2rem;
  color: var(--muted);
}

#auth-status.error,
#form-status.error,
#watch-status.error {
  color: var(--danger);
}

.accounts-list {
  margin-top: 8px;
  display: grid;
  gap: 8px;
  max-height: 48vh;
  overflow: auto;
  padding-right: 4px;
}

.account-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 9px;
  background: var(--card);
}

.stream {
  margin-top: 6px;
  display: grid;
  gap: 10px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 11px;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mood-pill {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 4px 9px;
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 700;
}

.target {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.content {
  margin: 8px 0;
}

.like-btn {
  background: transparent;
  color: var(--accent);
  border: 1px solid #efb08d;
}

@media (max-width: 980px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .view {
    min-height: auto;
  }

  .grid-two {
    grid-template-columns: 1fr;
  }
}
