:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-2: #edf4f1;
  --ink: #1f2528;
  --muted: #667076;
  --line: #dfe5e1;
  --green: #2f7d63;
  --green-dark: #1d5d4a;
  --blue: #3269a8;
  --yellow: #d89928;
  --red: #bd4d48;
  --shadow: 0 18px 45px rgba(24, 35, 31, 0.1);
}

* {
  box-sizing: border-box;
}

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

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

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px;
  background: #17211f;
  color: #eff6f2;
}

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

.brand strong {
  display: block;
  font-size: 19px;
}

.brand small,
.sidebar-panel small {
  display: block;
  color: #b8c8c2;
  line-height: 1.35;
  margin-top: 3px;
}

.version-label {
  margin-top: 10px;
  color: #dce8e3;
  font-weight: 800;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 7px;
  border-radius: 8px;
  background: #eff6f2;
}

.brand-mark span {
  border-radius: 3px;
  background: var(--green);
}

.brand-mark span:nth-child(2) {
  background: var(--yellow);
}

.brand-mark span:nth-child(3) {
  grid-column: span 2;
  background: var(--blue);
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  background: transparent;
  color: #cddbd6;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: #263633;
  color: #ffffff;
}

.icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  position: relative;
  flex: 0 0 auto;
}

.dashboard-icon {
  border: 2px solid currentColor;
  border-radius: 4px;
}

.dashboard-icon::before,
.dashboard-icon::after {
  content: "";
  position: absolute;
  background: currentColor;
}

.dashboard-icon::before {
  width: 2px;
  inset: 2px auto 2px 7px;
}

.dashboard-icon::after {
  height: 2px;
  left: 2px;
  right: 2px;
  top: 7px;
}

.tasks-icon {
  border: 2px solid currentColor;
  border-radius: 50%;
}

.tasks-icon::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 4px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  left: 4px;
  top: 5px;
}

.members-icon::before,
.members-icon::after {
  content: "";
  position: absolute;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.members-icon::before {
  width: 8px;
  height: 8px;
  left: 4px;
  top: 0;
}

.members-icon::after {
  width: 14px;
  height: 8px;
  left: 1px;
  bottom: 0;
  border-radius: 10px 10px 3px 3px;
}

.calendar-icon {
  border: 2px solid currentColor;
  border-radius: 4px;
}

.calendar-icon::before {
  content: "";
  position: absolute;
  height: 2px;
  left: 2px;
  right: 2px;
  top: 5px;
  background: currentColor;
}

.messages-icon {
  border: 2px solid currentColor;
  border-radius: 5px;
}

.messages-icon::after {
  content: "";
  position: absolute;
  left: 2px;
  bottom: -5px;
  border-width: 5px 5px 0 0;
  border-style: solid;
  border-color: currentColor transparent transparent transparent;
}

.docs-icon {
  border: 2px solid currentColor;
  border-radius: 3px;
}

.docs-icon::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 3px;
  right: 3px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor;
}

.finance-icon::before {
  content: "€";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.drinks-icon {
  border: 2px solid currentColor;
  border-radius: 4px 4px 7px 7px;
}

.drinks-icon::before,
.drinks-icon::after {
  content: "";
  position: absolute;
  background: currentColor;
}

.drinks-icon::before {
  width: 8px;
  height: 2px;
  top: -5px;
  left: 3px;
}

.drinks-icon::after {
  height: 7px;
  left: 3px;
  right: 3px;
  bottom: 3px;
  border-radius: 2px;
}

.sidebar-panel {
  margin-top: auto;
  display: flex;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.status-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: #6fd397;
  box-shadow: 0 0 0 5px rgba(111, 211, 151, 0.14);
  flex: 0 0 auto;
}

.main {
  min-width: 0;
  padding: 26px clamp(18px, 3vw, 40px) 48px;
}

.topbar,
.section-toolbar,
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  margin-bottom: 24px;
}

.topbar h1,
.section-toolbar h2,
.panel h2,
.hero-band h2 {
  margin: 0;
  line-height: 1.1;
}

.topbar h1 {
  font-size: clamp(28px, 4vw, 44px);
}

.section-toolbar {
  margin-bottom: 18px;
}

.section-toolbar h2 {
  font-size: clamp(24px, 3vw, 34px);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.topbar-actions,
.toolbar-actions,
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-button,
.ghost-button,
.text-button,
.time-button,
.close-button {
  border: 0;
  border-radius: 8px;
  min-height: 42px;
  padding: 10px 14px;
  font-weight: 800;
}

.primary-button {
  background: var(--green);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--green-dark);
}

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

.text-button {
  background: transparent;
  color: var(--green-dark);
}

.full-width {
  width: 100%;
}

.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 9px;
}

.menu-button span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--ink);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 280px);
  align-items: stretch;
  gap: 18px;
  padding: clamp(22px, 4vw, 36px);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(47, 125, 99, 0.95), rgba(29, 93, 74, 0.95)),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.16) 0 8px, transparent 8px 18px);
  color: #ffffff;
  box-shadow: var(--shadow);
}

.hero-band .eyebrow,
.hero-band p {
  color: #e5f4ef;
}

.hero-band h2 {
  max-width: 760px;
  font-size: clamp(30px, 5vw, 58px);
}

.hero-band p {
  max-width: 640px;
  line-height: 1.6;
}

.time-button {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  background: #fff8df;
  color: #23302d;
  min-height: 170px;
  padding: 22px;
  border: 2px solid rgba(255, 255, 255, 0.55);
}

.time-button strong {
  font-size: clamp(28px, 4vw, 42px);
}

.time-button small {
  color: var(--muted);
  font-weight: 700;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.metric-card,
.panel,
.task-card,
.event-card,
.doc-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(25, 35, 31, 0.05);
}

.metric-card {
  padding: 16px;
}

.metric-card strong {
  display: block;
  font-size: 32px;
}

.metric-card span,
.muted {
  color: var(--muted);
}

.content-grid,
.finance-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
  margin-top: 18px;
}

.embedded-app-shell {
  height: min(920px, calc(100vh - 180px));
  min-height: 640px;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.embedded-app-shell iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

.panel {
  padding: 18px;
}

.wide-panel {
  min-width: 0;
}

.task-list,
.task-board,
.event-list,
.admin-feed,
.news-list,
.payment-list,
.match-results {
  display: grid;
  gap: 12px;
}

.task-board {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.task-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.task-card.taken {
  background: #f1f5f4;
}

.task-card.done {
  background: #f7f2df;
}

.task-title-row,
.meta-row,
.card-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.task-card h3,
.event-card h3,
.doc-card h3 {
  margin: 0;
  font-size: 18px;
}

.task-card p,
.event-card p,
.doc-card p,
.news-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.doc-card {
  min-width: 0;
  overflow: hidden;
}

.doc-card h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-description {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.doc-preview {
  min-height: 52px;
  max-height: 74px;
  overflow: hidden;
  padding: 10px;
  border-radius: 8px;
  background: #f7f9f8;
  font-size: 13px;
}

.file-tag {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-grid.drag-over {
  outline: 2px dashed var(--green);
  outline-offset: 8px;
  border-radius: 8px;
}

.docs-main.drag-over {
  outline: 2px dashed var(--green);
  outline-offset: 10px;
  border-radius: 8px;
  background: rgba(47, 125, 99, 0.04);
}

#docs.drag-over .docs-main {
  outline: 2px dashed var(--green);
  outline-offset: 10px;
  border-radius: 8px;
  background: rgba(47, 125, 99, 0.04);
}

.doc-card.drag-over {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  background: #eef5fb;
}

.doc-card.dragging {
  opacity: 0.55;
}

.attachment-list {
  display: grid;
  gap: 8px;
}

.attachment-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.attachment-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.attachment-item small {
  color: var(--muted);
  font-weight: 800;
}

.attachment-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.attachment-versions {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.attachment-versions summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 800;
}

.attachment-version-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 6px 0;
}

.attachment-version-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.search-snippet {
  padding: 10px;
  border-left: 3px solid var(--blue);
  background: #eef5fb;
  font-size: 13px;
}

.pdf-preview,
.version-history {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.pdf-inline-frame {
  width: 100%;
  min-height: 360px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.pdf-fallback-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.version-history h2 {
  margin: 0 0 12px;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-item {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.history-item span,
.history-item small {
  color: var(--muted);
}

.pill,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--surface-2);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.tag.blue {
  background: #e7eff9;
  color: var(--blue);
}

.tag.yellow {
  background: #fbf0d7;
  color: #875c12;
}

.tag.red {
  background: #f8e3e1;
  color: var(--red);
}

.meta-row {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.card-action-row {
  align-items: stretch;
  flex-wrap: wrap;
}

.card-action-row button {
  flex: 1 1 120px;
  min-width: 0;
}

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.segmented button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 7px 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.segmented button.active {
  background: var(--green);
  color: #ffffff;
}

.table-shell {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.person-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--green-dark);
  font-weight: 900;
}

.event-grid,
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.event-card,
.doc-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.event-date {
  display: grid;
  place-items: center;
  align-content: center;
  width: 62px;
  height: 62px;
  border-radius: 8px;
  background: #e7eff9;
  color: var(--blue);
  font-weight: 900;
}

.event-date span {
  font-size: 22px;
  line-height: 1;
}

.event-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

.message-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.15fr);
  gap: 18px;
}

.docs-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.folder-panel {
  position: sticky;
  top: 20px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.folder-panel h2 {
  margin: 0;
  font-size: 18px;
}

.folder-list {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.folder-item {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  padding-left: calc(10px + var(--depth, 0) * 18px);
  background: transparent;
  text-align: left;
}

.folder-item.active,
.folder-item:hover {
  background: var(--surface-2);
}

.folder-item.drag-over {
  background: #e7eff9;
  outline: 2px solid var(--blue);
}

.folder-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.folder-title span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-toggle,
.folder-spacer {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 5px;
}

.folder-toggle {
  background: rgba(47, 125, 99, 0.1);
  color: var(--green-dark);
}

.folder-toggle:hover {
  background: rgba(47, 125, 99, 0.18);
}

.folder-title,
.folder-item > span {
  font-weight: 900;
}

.folder-item small {
  color: var(--muted);
}

.breadcrumb {
  margin-bottom: 12px;
  color: var(--green-dark);
  font-weight: 900;
}

.smart-match {
  margin-bottom: 16px;
}

.matcher-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.filter-row {
  margin-bottom: 16px;
}

.filter-row label {
  max-width: 520px;
  margin-top: 0;
}

.member-filter-grid {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(150px, 1fr));
  gap: 12px;
}

.member-filter-grid label {
  max-width: none;
}

.member-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.mini-stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.mini-stat strong {
  display: block;
  font-size: 1.6rem;
  line-height: 1;
}

.mini-stat span,
.mini-stat small {
  display: block;
}

.mini-stat small {
  color: var(--muted);
  margin-top: 4px;
}

.full-span {
  grid-column: 1 / -1;
}

.consent-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.consent-box legend {
  padding: 0 6px;
  font-weight: 900;
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
}

.drop-empty {
  min-height: 150px;
  display: grid;
  place-items: center;
  text-align: center;
}

label {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 11px 12px;
}

textarea {
  resize: vertical;
}

.checkbox-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.checkbox-row input {
  width: auto;
}

.news-item,
.feed-item,
.payment-item,
.compact-task,
.doc-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.news-item strong,
.feed-item strong,
.payment-item strong,
.compact-task strong {
  display: block;
  margin-bottom: 4px;
}

.impact-chart {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.impact-chart div {
  position: relative;
  min-height: 34px;
  border-radius: 8px;
  background: #edf1ef;
  overflow: hidden;
}

.impact-chart div::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--value) * 1%);
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.impact-chart span {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding-left: 12px;
  color: #ffffff;
  font-weight: 800;
}

.donut {
  width: min(220px, 70vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: 16px auto;
  border-radius: 50%;
  background: conic-gradient(var(--green) 0 87%, #e5eae7 87% 100%);
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: var(--surface);
}

.donut span {
  position: relative;
  z-index: 1;
  font-size: 34px;
  font-weight: 900;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 22, 20, 0.48);
  z-index: 20;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(620px, 100%);
  max-height: 92vh;
  overflow: auto;
  position: relative;
  border-radius: 8px;
  padding: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.large-modal {
  width: min(900px, 100%);
}

.modal h2 {
  margin-top: 0;
}

.close-button {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  min-height: 38px;
  padding: 0;
  background: var(--surface-2);
}

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

.document-editor {
  min-height: 120px;
  max-height: 170px;
  font-family: "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  line-height: 1.55;
}

.file-info {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9f8;
  color: var(--muted);
  font-weight: 700;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100vw - 40px));
  padding: 13px 15px;
  border-radius: 8px;
  background: #17211f;
  color: #ffffff;
  box-shadow: var(--shadow);
  transform: translateY(24px);
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
  z-index: 30;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1120px) {
  .task-board,
  .event-grid,
  .doc-grid,
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid,
  .finance-grid,
  .message-layout,
  .docs-layout,
  .member-filter-grid,
  .matcher-grid {
    grid-template-columns: 1fr;
  }

  .folder-panel {
    position: static;
  }
}

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

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(320px, 86vw);
    transform: translateX(-105%);
    transition: transform 180ms ease;
    z-index: 15;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .menu-button {
    display: block;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar-actions {
    justify-content: flex-end;
  }

  .hero-band {
    grid-template-columns: 1fr;
  }

  .time-button {
    min-height: 130px;
  }
}

@media (max-width: 640px) {
  .main {
    padding: 18px 14px 32px;
  }

  .topbar,
  .section-toolbar,
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .toolbar-actions,
  .segmented {
    width: 100%;
  }

  .topbar-actions button,
  .toolbar-actions button,
  .segmented button {
    flex: 1;
  }

  .metric-grid,
  .member-stats,
  .task-board,
  .event-grid,
  .doc-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .segmented {
    overflow-x: auto;
  }

  .card-action-row {
    flex-direction: column;
  }
}
