:root {
  color-scheme: dark;
  --bg: #101114;
  --panel: #191b20;
  --panel-2: #22252c;
  --text: #f4f0e8;
  --muted: #a8aab3;
  --line: #333740;
  --accent: #ff4057;
  --accent-2: #4dd6b2;
  --warning: #f5c542;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.32);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(120deg, rgba(255, 64, 87, 0.14), transparent 30%),
    radial-gradient(circle at 80% 0%, rgba(77, 214, 178, 0.12), transparent 30%),
    var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

.app {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  min-height: 100vh;
  padding: 18px;
}

.control-panel,
.feed-shell {
  border: 1px solid var(--line);
  background: rgba(25, 27, 32, 0.92);
  box-shadow: var(--shadow);
}

.control-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 22px;
  border-radius: 8px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 800;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.1;
}

.brand p,
.feed-header p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
}

label span {
  color: var(--muted);
  font-size: 13px;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #111318;
  color: var(--text);
  outline: none;
  padding: 0 12px;
}

input:focus,
select:focus {
  border-color: var(--accent-2);
}

.inline-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 700;
}

button:hover:not(:disabled) {
  filter: brightness(1.08);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

button.secondary,
.icon-button {
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.status-line {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: auto;
  color: var(--muted);
  font-size: 14px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
}

.dot.live {
  background: var(--accent-2);
  box-shadow: 0 0 0 5px rgba(77, 214, 178, 0.12);
}

.dot.error {
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(255, 64, 87, 0.12);
}

.dot.waiting {
  background: var(--warning);
}

.feed-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  overflow: hidden;
  border-radius: 8px;
}

.feed-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  min-height: 82px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.feed-header h2 {
  max-width: 70vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 20px;
  line-height: 1.25;
}

.icon-button {
  width: 72px;
  min-width: 72px;
}

.feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  margin: 0;
  padding: 16px;
  overflow: auto;
  list-style: none;
}

.message {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #15171d;
}

.avatar {
  width: 40px;
  height: 40px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--panel-2);
}

.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
}

.author {
  color: #ffffff;
  font-weight: 750;
}

.badge {
  border-radius: 4px;
  background: rgba(77, 214, 178, 0.14);
  color: var(--accent-2);
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.time {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.translated {
  color: var(--text);
  font-size: 16px;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.original {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(520px, 1fr);
  }

  .control-panel {
    gap: 18px;
  }

  .feed-header h2 {
    max-width: 54vw;
  }
}

@media (max-width: 520px) {
  .app {
    padding: 10px;
  }

  .inline-fields,
  .actions {
    grid-template-columns: 1fr;
  }

  .feed-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .feed-header h2 {
    max-width: 100%;
    white-space: normal;
  }

  .icon-button {
    width: 100%;
  }
}
