:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --ink: #171412;
  --muted: #6d665e;
  --line: #ded8cf;
  --red: #c91521;
  --red-dark: #9e111a;
  --yellow: #ffc72c;
  --green: #14734f;
  --blue: #275f8f;
  --shadow: 0 20px 45px rgba(45, 32, 18, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

.app {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 18px;
}

.header,
.toolbar,
.sectionTitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.header {
  padding: 10px 0 18px;
}

.kicker {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 0.78rem;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 11em;
  font-size: clamp(1.45rem, 7vw, 2.55rem);
  line-height: 1.05;
}

h2 {
  font-size: 1.08rem;
}

.dateBadge {
  flex: 0 0 auto;
  max-width: 138px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 9px 10px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: right;
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: stretch;
}

.heroCopy,
.loginCard,
.ownerPanel,
.accountCard,
.queue {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.heroCopy {
  min-height: 190px;
  display: flex;
  align-items: end;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(201, 21, 33, 0.93), rgba(154, 20, 29, 0.84)),
    linear-gradient(45deg, var(--yellow), #fff2b0);
  color: #fff;
  line-height: 1.55;
}

.loginCard,
.ownerPanel,
.queue {
  padding: 16px;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

input,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(201, 21, 33, 0.12);
}

button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--red-dark);
}

button:disabled {
  background: #c9c1b7;
  cursor: not-allowed;
}

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

.ghost:hover {
  background: #f1eee8;
}

.workspace {
  margin-top: 18px;
}

.toolbar {
  margin-bottom: 12px;
}

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

.accountCard {
  overflow: hidden;
}

.accountMain {
  padding: 15px;
}

.accountMeta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.pill {
  border-radius: 999px;
  padding: 6px 9px;
  background: #f2eee7;
  color: var(--muted);
  font-size: 0.8rem;
}

.quota {
  height: 8px;
  margin: 14px 0 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #eee8df;
}

.quota span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--green);
}

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

.requestNote {
  min-height: 70px;
}

.queue {
  margin-top: 14px;
}

.requestList {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.requestItem {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fffdf8;
}

.requestItem strong {
  display: block;
  margin-bottom: 5px;
}

.requestItem p {
  color: var(--muted);
  line-height: 1.45;
}

.ownerPanel {
  margin: 16px 0 28px;
  line-height: 1.55;
}

.ownerPanel h2 {
  margin-bottom: 8px;
}

.messageAccess {
  display: flex;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}

.messageAccess label {
  flex: 1;
  margin-bottom: 0;
}

.messageStatus {
  min-height: 1.4em;
  margin-top: 10px;
  color: var(--muted);
}

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

.messageItem p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 520px) {
  .messageAccess {
    display: grid;
    align-items: stretch;
  }
}

@media (min-width: 760px) {
  .app {
    padding: 28px;
  }

  h1 {
    max-width: none;
  }

  .hero {
    grid-template-columns: 1.2fr 0.8fr;
  }

  .accountGrid {
    grid-template-columns: repeat(3, 1fr);
  }
}
