:root {
  color-scheme: light;
  font-size: 18px;
}

* { box-sizing: border-box; }

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

body {
  font-family: "Atkinson Hyperlegible", "Segoe UI", sans-serif;
  line-height: 1.45;
  background: #f4f7fb;
  color: #0a1628;
}

img { max-width: 100%; }

a { color: #0672ba; }

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

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.75rem 1rem;
  border: 3px solid #00193d;
  border-radius: 12px;
  background: #00193d;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

button.secondary, .button.secondary {
  background: #fff;
  color: #00193d;
}

button.danger {
  background: #fff;
  color: #9f1239;
  border-color: #9f1239;
}

button.logout {
  min-height: 2.75rem;
  padding: 0.4rem 0.75rem;
  background: #fff;
  color: #00193d;
}

input, select, textarea {
  width: 100%;
  min-height: 3.25rem;
  border: 2px solid #00193d;
  border-radius: 12px;
  background: #fff;
  color: #0a1628;
  padding: 0.7rem 0.9rem;
}

textarea { min-height: 7rem; }

label {
  font-weight: 700;
}

button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid #0672ba;
  outline-offset: 2px;
}

.shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.top {
  flex-shrink: 0;
  background: #fff;
  border-bottom: 3px solid #00193d;
}

.top-row, .nav, .page {
  width: min(100%, 64rem);
  margin-inline: auto;
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem 0;
}

.logo-link { flex-shrink: 0; line-height: 0; }

.logo-link img, .login-logo {
  display: block;
  height: 54px;
  width: auto;
  max-width: 58vw;
}

.login-logo { height: 64px; margin-bottom: 1rem; }

.who {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.who-name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
}

.nav-link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem;
  border: 3px solid #00193d;
  border-radius: 12px;
  background: #fff;
  color: #00193d;
  font-weight: 700;
  text-decoration: none;
}

.nav-link.current {
  background: #00193d;
  color: #fff;
}

.main { flex: 1; }

.page { padding: 1rem 1rem 2.75rem; }

.page-title {
  margin: 0 0 0.35rem;
  font-size: 2rem;
  line-height: 1.15;
}

.lede, .hint {
  margin: 0 0 1.25rem;
  font-size: 1.2rem;
  color: #1a3358;
}

h2 {
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
}

.alert, .note, .empty {
  margin: 0 0 1rem;
  border: 3px solid #00193d;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font-weight: 700;
}

.alert { border-color: #9f1239; background: #ffe4e6; color: #881337; }
.note { border-color: #0d7a3f; background: #e5f8ef; color: #064e3b; }
.empty { background: #fff; font-size: 1.25rem; }

.tiles, .cards, .feed {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 700px) {
  .tiles { grid-template-columns: 1fr 1fr; }
}

.tile, .card, .panel, .feed li {
  border: 3px solid #00193d;
  border-radius: 16px;
  background: #fff;
  padding: 1rem;
}

.tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 10rem;
  color: inherit;
  text-decoration: none;
}

.tile-plain { min-height: 8rem; justify-content: center; }

.tile-title { font-size: 1.45rem; font-weight: 700; line-height: 1.2; }
.tile-meta, .meta { color: #1a3358; font-weight: 700; }

.count {
  width: 4rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  color: #fff;
  font-size: 1.7rem;
  font-weight: 700;
}

.count-open { background: #0672ba; }
.count-clear { background: #0d7a3f; }

.stack { display: grid; gap: 0.55rem; }
.stack.tight { margin-top: 0.75rem; }

.search { margin-bottom: 1rem; }
.search-row, .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.search-row input { flex: 1; min-width: 12rem; }

.card h3 { margin: 0.25rem 0 0.5rem; font-size: 1.4rem; }

.status {
  display: inline-block;
  margin: 0;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-weight: 700;
  color: #fff;
}

.status-open { background: #0672ba; }
.status-in_progress { background: #9a6700; }
.status-done { background: #0d7a3f; }

dl { margin: 0; }
dl div { margin-bottom: 0.45rem; }
dt { font-size: 0.95rem; color: #1a3358; }
dd { margin: 0; font-weight: 700; }

.thumb, .chat-photo {
  display: block;
  max-height: 12rem;
  border: 3px solid #00193d;
  border-radius: 12px;
  margin: 0.5rem 0;
}

.text-link { font-weight: 700; }

.check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.5rem;
}

.check input { width: 1.4rem; height: 1.4rem; min-height: 0; }

.login-screen {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}

.login-card {
  width: min(100%, 32rem);
}

.file-btn input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.file-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem;
  border: 3px solid #00193d;
  border-radius: 12px;
  background: #fff;
  color: #00193d;
  cursor: pointer;
}

body.chat-page {
  height: 100dvh;
  overflow: hidden;
}

body.chat-page .shell {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

body.chat-page .main {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-room {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.chat-head { flex-shrink: 0; padding: 1rem 1rem 0; }

.thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.5rem 1rem 0.75rem;
}

.bubble {
  margin: 0 1.5rem 0.75rem 0;
  border: 3px solid #00193d;
  border-radius: 16px;
  background: #fff;
  padding: 0.9rem 1rem;
}

.bubble.mine {
  margin: 0 0 0.75rem 1.5rem;
  background: #00193d;
  color: #fff;
}

.bubble-who { margin: 0; font-weight: 700; }
.bubble.mine .bubble-who { color: #d6e4f5; }
.bubble-body { margin: 0.35rem 0 0; font-size: 1.2rem; white-space: pre-wrap; }

.composer {
  flex-shrink: 0;
  display: grid;
  gap: 0.55rem;
  border-top: 3px solid #00193d;
  background: #f4f7fb;
  padding: 0.75rem 1rem max(0.75rem, env(safe-area-inset-bottom));
}

.file-name { margin: 0; font-weight: 700; }

.strong { margin: 0; font-weight: 700; font-size: 1.15rem; }
.feed { list-style: none; padding: 0; }
