:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f7fbfb;
  color: #172126;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(120deg, rgba(22, 102, 111, 0.12), transparent 42%), #f7fbfb;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  width: min(100%, 960px);
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
}

.app-home {
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 22px;
}

.app-home__hero {
  display: grid;
  justify-items: start;
  gap: 16px;
  padding-block: 36px 16px;
}

.app-home__logo {
  width: 86px;
  height: 86px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(28, 47, 52, 0.1);
}

.app-home__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.app-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 800;
}

.app-button--primary {
  background: #16666f;
  color: #fff;
}

.app-button--muted {
  border: 1px solid #b8c9cc;
  background: #fff;
  color: #172126;
}

.app-home__status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.app-home__status article {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid #d8e5e7;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.app-home__status span {
  color: #4a5f65;
  line-height: 1.4;
}

.app-shell__hero {
  min-height: 38vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
  padding-block: 44px 28px;
}

.app-shell__eyebrow,
.app-shell__lead,
.app-shell__tile small {
  margin: 0;
  color: #4a5f65;
}

.app-shell__eyebrow {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.app-shell h1 {
  margin: 0;
  font-size: 3.2rem;
  line-height: 1;
}

.app-shell__lead {
  max-width: 36rem;
  font-size: 1.08rem;
  line-height: 1.55;
}

.app-shell__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.app-shell__tile {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  border: 1px solid #d8e5e7;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 32px rgba(28, 47, 52, 0.08);
}

.app-shell__tile:focus-visible {
  outline: 3px solid #16666f;
  outline-offset: 3px;
}

.app-shell__tile span {
  font-size: 1.08rem;
  font-weight: 750;
}

.app-shell__tile small {
  line-height: 1.45;
}

.app-flow {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
}

.app-card {
  width: min(100%, 34rem);
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid #d8e5e7;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 40px rgba(28, 47, 52, 0.1);
}

.app-card h1 {
  font-size: 2.2rem;
}

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

.app-form label {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

.app-form input,
.app-form select,
.app-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #b8c9cc;
  border-radius: 6px;
  font: inherit;
  background: #fff;
  color: #172126;
}

.app-form input,
.app-form select {
  min-height: 46px;
}

.app-form textarea {
  min-height: 112px;
  resize: vertical;
  line-height: 1.45;
}

.app-form input:focus,
.app-form select:focus,
.app-form textarea:focus {
  outline: 3px solid rgba(22, 102, 111, 0.24);
  border-color: #16666f;
}

.app-form button {
  min-height: 46px;
  padding: 10px 16px;
  border: 0;
  border-radius: 6px;
  background: #16666f;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.app-dev-login {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #a8c8d0;
  border-radius: 8px;
  background: #eef7f8;
}

.app-dev-login button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: #124f58;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.app-dev-login p {
  margin: 0;
  color: #4a5f65;
  font-size: 0.92rem;
}

.app-form__hint {
  margin: 0;
  color: #4a5f65;
  line-height: 1.45;
}

.app-notice {
  margin: 0;
  padding: 12px 14px;
  border-radius: 6px;
  line-height: 1.45;
}

.app-notice--error {
  border: 1px solid #e2a7a7;
  background: #fff1f1;
  color: #7d1b1b;
}

.app-notice--success {
  border: 1px solid #9dc6b3;
  background: #effaf4;
  color: #174d31;
}

.app-account {
  display: grid;
  gap: 12px;
  margin: 0;
}

.app-account div {
  display: grid;
  gap: 4px;
}

.app-account dt {
  color: #4a5f65;
  font-size: 0.88rem;
  font-weight: 700;
}

.app-account dd {
  margin: 0;
  font-weight: 800;
}

.app-request-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-request-list li {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #d8e5e7;
  border-radius: 6px;
  background: #f8fbfb;
}

.app-request-list__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.app-request-list__header span,
.app-request-list small {
  color: #4a5f65;
  font-size: 0.9rem;
}

.app-request-list p {
  margin: 0;
  line-height: 1.45;
}

.app-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.app-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid #d8e5e7;
  border-radius: 6px;
  background: #fff;
  color: #4a5f65;
  font-weight: 800;
}

.app-tabs a[aria-current="page"] {
  border-color: #16666f;
  background: #16666f;
  color: #fff;
}

.app-chat-page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.app-chat {
  min-height: min(76vh, 760px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid #d8e5e7;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 40px rgba(28, 47, 52, 0.1);
}

.app-chat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid #d8e5e7;
  background: #fff;
}

.app-chat__header h1 {
  margin: 3px 0 0;
  font-size: 1.45rem;
  line-height: 1.15;
}

.app-chat__header span {
  color: #4a5f65;
  font-size: 0.92rem;
  font-weight: 700;
}

.app-chat__messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 18px;
  background: #eef5f6;
}

.chat-bubble {
  width: fit-content;
  max-width: min(76%, 34rem);
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border-radius: 8px 8px 8px 2px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(28, 47, 52, 0.08);
}

.chat-bubble--own {
  align-self: flex-end;
  border-radius: 8px 8px 2px;
  background: #d9f2e6;
}

.chat-bubble p {
  margin: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.chat-attachments {
  display: grid;
  gap: 6px;
}

.chat-attachments a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(22, 102, 111, 0.1);
  color: #124f58;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.chat-bubble small {
  color: #61777d;
  font-size: 0.78rem;
  text-align: right;
}

.app-chat__composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid #d8e5e7;
  background: #fff;
}

.app-chat__composer textarea {
  min-height: 46px;
  max-height: 130px;
  padding: 10px 12px;
  border: 1px solid #b8c9cc;
  border-radius: 6px;
  resize: vertical;
  font: inherit;
}

.app-chat__composer button {
  min-height: 46px;
  padding: 10px 16px;
  border: 0;
  border-radius: 6px;
  background: #16666f;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.app-chat__file {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: end;
  position: relative;
  padding: 10px 14px;
  border: 1px solid #b8c9cc;
  border-radius: 6px;
  background: #fff;
  color: #172126;
  font-weight: 800;
  cursor: pointer;
}

.app-chat__file input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

@media (max-width: 720px) {
  .app-home__status {
    grid-template-columns: 1fr;
  }

  .app-shell__grid {
    grid-template-columns: 1fr;
  }

  .app-shell__hero {
    min-height: 34vh;
  }

  .app-shell h1 {
    font-size: 2.5rem;
  }

  .app-chat__composer {
    grid-template-columns: 1fr;
  }

  .chat-bubble {
    max-width: 92%;
  }
}
