:root {
  color-scheme: light;
  --bg: #f7f3ec;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --ink: #17202a;
  --muted: #68717b;
  --line: #ded6c8;
  --green: #18785b;
  --amber: #a96812;
  --red: #b33a3a;
  --blue: #245c73;
  --plum: #6f4565;
  --shadow: 0 16px 42px rgba(30, 34, 38, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-weight: 700;
}

button:active {
  transform: translateY(1px);
}

.login-view,
.app-shell {
  width: min(100%, 560px);
  min-height: 100dvh;
  margin: 0 auto;
}

.login-view {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  padding: 24px;
}

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

.brand-mark {
  width: 64px;
  height: 64px;
}

.top-mark {
  width: 38px;
  height: 38px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 1.7rem;
  line-height: 1.08;
}

h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
}

h3 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.login-form,
.upload-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  outline: none;
}

input,
select {
  min-height: 48px;
  padding: 0 12px;
}

textarea {
  min-height: 104px;
  padding: 12px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(36, 92, 115, 0.15);
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.app-shell {
  position: relative;
  padding: 16px 16px 92px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 16px;
  background: rgba(247, 243, 236, 0.94);
  backdrop-filter: blur(12px);
}

.icon-button {
  display: grid;
  width: 46px;
  min-height: 46px;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 1.18rem;
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 14px;
}

.soft-pill {
  max-width: 46%;
  overflow: hidden;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.status-tile,
.band,
.approval-item,
.message-bubble {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.status-tile {
  min-height: 148px;
  padding: 13px;
}

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

.status-label {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

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

.state-ok .status-dot {
  background: var(--green);
}

.state-warn .status-dot {
  background: var(--amber);
}

.state-problem .status-dot {
  background: var(--red);
}

.status-tile strong {
  display: block;
  margin: 18px 0 8px;
  font-size: 1.02rem;
  line-height: 1.18;
}

.status-tile p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.32;
}

.alert-stack {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.alert-item {
  padding: 12px;
  border-left: 5px solid var(--red);
  border-radius: 8px;
  background: #fff5f0;
}

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

.alert-item p {
  margin-bottom: 0;
  color: #67302c;
  font-size: 0.9rem;
  line-height: 1.35;
}

.band {
  margin-top: 14px;
  padding: 14px;
}

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

.quick-button {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: var(--surface-strong);
  color: var(--ink);
  border: 1px solid var(--line);
  text-align: center;
}

.quick-button:nth-child(2n) {
  border-color: rgba(36, 92, 115, 0.34);
}

.quick-button:nth-child(3n) {
  border-color: rgba(111, 69, 101, 0.34);
}

.list-stack,
.approval-list {
  display: grid;
  gap: 10px;
}

.empty-state {
  color: var(--muted);
  font-size: 0.92rem;
}

.list-item {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.list-item:first-child {
  border-top: 0;
}

.list-item strong {
  display: block;
  margin-bottom: 4px;
}

.list-item span,
.meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.approval-item {
  padding: 14px;
}

.approval-kicker {
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.approval-item h3 {
  margin-bottom: 8px;
}

.approval-item p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.38;
}

.approval-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.approval-actions button {
  min-height: 42px;
  padding: 0 8px;
  font-size: 0.86rem;
}

.approve {
  background: var(--green);
}

.edit {
  background: var(--blue);
}

.discard {
  background: var(--red);
}

.chat-view {
  min-height: calc(100dvh - 150px);
}

.chat-log {
  display: flex;
  min-height: calc(100dvh - 245px);
  flex-direction: column;
  gap: 10px;
  padding-bottom: 76px;
}

.message {
  display: flex;
  width: 100%;
  max-width: 92%;
  align-items: flex-end;
  gap: 8px;
}

.message-avatar {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(23, 32, 42, 0.12);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 6px 14px rgba(23, 32, 42, 0.14);
}

.message-bubble {
  width: fit-content;
  max-width: min(86%, 430px);
  padding: 11px 12px;
  line-height: 1.38;
}

.message.me {
  align-self: flex-end;
  justify-content: flex-end;
}

.message.me .message-bubble {
  background: var(--ink);
  color: white;
}

.message.alba {
  align-self: flex-start;
}

.composer {
  position: fixed;
  right: max(16px, calc((100vw - 560px) / 2 + 16px));
  bottom: 74px;
  left: max(16px, calc((100vw - 560px) / 2 + 16px));
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: var(--shadow);
}

.composer button {
  min-width: 76px;
}

.upload-drop {
  display: grid;
  min-height: 168px;
  place-items: center;
  padding: 18px;
  border: 1.5px dashed var(--blue);
  border-radius: 8px;
  background: #f3f8f9;
  color: var(--ink);
  text-align: center;
}

.upload-symbol {
  display: grid;
  width: 40px;
  height: 40px;
  margin-bottom: 8px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  font-size: 1.35rem;
  font-weight: 800;
}

#fileInput {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.bottom-nav {
  position: fixed;
  right: max(12px, calc((100vw - 560px) / 2 + 12px));
  bottom: 12px;
  left: max(12px, calc((100vw - 560px) / 2 + 12px));
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: var(--shadow);
}

.nav-button {
  min-height: 48px;
  padding: 0 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.nav-button.active {
  background: var(--ink);
  color: white;
}

@media (min-width: 720px) {
  .app-shell {
    padding-top: 24px;
  }

  .status-tile {
    min-height: 132px;
  }
}
