:root {
  --ink: #14241f;
  --muted: #68766f;
  --line: #dfe7e3;
  --paper: #f7faf8;
  --surface: #ffffff;
  --forest: #10261f;
  --forest-soft: #18372d;
  --green: #41d397;
  --green-dark: #147b53;
  --green-soft: #e1f7ee;
  --blue-soft: #e6f0ff;
  --amber-soft: #fff1d6;
  --rose-soft: #ffe8eb;
  --danger: #af3535;
  --danger-soft: #fff0f0;
  --shadow: 0 18px 48px rgba(16, 38, 31, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 18rem;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 90% 0, rgba(65, 211, 151, 0.15), transparent 28rem),
    var(--paper);
}

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

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

button,
summary,
a {
  touch-action: manipulation;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(65, 211, 151, 0.55);
  outline-offset: 2px;
}

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

h1,
h2 {
  letter-spacing: -0.035em;
}

.app-shell {
  min-height: 100dvh;
}

.side-rail {
  display: none;
}

.content-shell {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: calc(1rem + env(safe-area-inset-top)) 1rem 0.85rem;
}

.eyebrow {
  margin: 0 0 0.2rem;
  color: var(--green-dark);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.085em;
  text-transform: uppercase;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.35rem, 6vw, 1.85rem);
}

.profile-menu {
  position: relative;
  z-index: 35;
}

.profile-menu > summary {
  width: 3.15rem;
  height: 3.15rem;
  display: grid;
  place-items: center;
  border-radius: 1rem;
  background: var(--forest);
  color: white;
  font-size: 0.75rem;
  font-weight: 850;
  list-style: none;
  cursor: pointer;
}

.profile-menu > summary::-webkit-details-marker,
.entry-menu > summary::-webkit-details-marker {
  display: none;
}

.profile-popover {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: min(18rem, calc(100vw - 2rem));
  overflow: hidden;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: white;
  box-shadow: var(--shadow);
}

.profile-copy {
  display: grid;
  gap: 0.12rem;
  padding: 0.65rem 0.7rem 0.7rem;
  border-bottom: 1px solid var(--line);
}

.profile-copy strong {
  font-size: 0.85rem;
}

.profile-copy small,
.menu-label {
  color: var(--muted);
  font-size: 0.69rem;
}

.menu-label {
  margin: 0.7rem 0.7rem 0.25rem;
  font-weight: 750;
  text-transform: uppercase;
}

.menu-action {
  width: 100%;
  min-height: 2.9rem;
  display: flex;
  align-items: center;
  padding: 0 0.7rem;
  border: 0;
  border-radius: 0.72rem;
  background: white;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.menu-action:hover,
.menu-action.selected {
  background: #eef5f1;
}

.menu-action.selected::after {
  content: "✓";
  margin-left: auto;
  color: var(--green-dark);
  font-weight: 850;
}

.danger-text {
  color: var(--danger) !important;
}

.message-stack {
  position: fixed;
  z-index: 80;
  top: calc(0.75rem + env(safe-area-inset-top));
  left: 50%;
  width: min(90vw, 28rem);
  transform: translateX(-50%);
}

.message {
  padding: 0.9rem 1rem;
  border-radius: 0.9rem;
  background: var(--forest);
  color: white;
  box-shadow: 0 15px 40px rgba(16, 38, 31, 0.25);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.message.is-hiding {
  opacity: 0;
  transform: translateY(-0.6rem);
}

.page-content {
  width: min(100%, 58rem);
  margin-inline: auto;
  padding: 0 1rem calc(7.2rem + env(safe-area-inset-bottom));
}

.dashboard-grid {
  display: grid;
  gap: 0.8rem;
}

.open-hero {
  display: grid;
  gap: 1.05rem;
  overflow: hidden;
  padding: 1.3rem;
  border-radius: 1.55rem;
  background:
    radial-gradient(circle at 100% 0, rgba(65, 211, 151, 0.3), transparent 12rem),
    var(--forest);
  color: white;
  box-shadow: 0 20px 50px rgba(16, 38, 31, 0.18);
}

.open-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
  font-weight: 680;
}

.open-hero strong {
  display: block;
  margin: 0.3rem 0 0.15rem;
  font-size: clamp(2rem, 10vw, 2.9rem);
  letter-spacing: -0.06em;
  line-height: 1;
}

.open-hero div > span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.76rem;
}

.hero-action,
.primary-button,
.secondary-button,
.danger-button {
  min-height: 3.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0 1rem;
  border: 0;
  border-radius: 1rem;
  font-weight: 780;
  cursor: pointer;
}

.hero-action,
.primary-button {
  background: var(--green);
  color: #09261b;
}

.hero-action b,
.compact-button b {
  font-size: 1.25rem;
  line-height: 1;
}

.secondary-button {
  border: 1px solid var(--line);
  background: #eef2f0;
  color: var(--ink);
}

.danger-button {
  background: var(--danger);
  color: white;
}

.compact-button {
  min-height: 3rem;
  flex: 0 0 auto;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.summary-card {
  min-width: 0;
  min-height: 5.15rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.92);
}

.summary-card.active {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(65, 211, 151, 0.12);
}

.summary-card i {
  width: 2.4rem;
  height: 2.4rem;
  flex: 0 0 2.4rem;
  display: grid;
  place-items: center;
  border-radius: 0.8rem;
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 850;
}

.sum-icon {
  background: var(--blue-soft);
  color: #356ebd;
}

.paid-icon {
  background: var(--green-soft);
  color: var(--green-dark);
}

.summary-card small,
.summary-card strong {
  display: block;
}

.summary-card small {
  margin-bottom: 0.18rem;
  color: var(--muted);
  font-size: 0.67rem;
}

.summary-card strong {
  overflow: hidden;
  font-size: clamp(0.94rem, 4vw, 1.16rem);
  letter-spacing: -0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel,
.form-card,
.confirm-card {
  border: 1px solid var(--line);
  border-radius: 1.35rem;
  background: rgba(255, 255, 255, 0.82);
}

.panel {
  padding: 0.95rem;
}

.section-heading,
.page-actions {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.75rem;
}

.section-heading {
  margin-bottom: 0.75rem;
}

.section-heading h2,
.page-actions h2 {
  margin: 0;
  font-size: 1.4rem;
}

.section-heading > span {
  flex: 0 0 auto;
  padding: 0.38rem 0.55rem;
  border-radius: 0.65rem;
  background: #edf2ef;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 720;
}

.customer-total-list,
.entry-list,
.tile-list {
  display: grid;
  gap: 0.58rem;
}

.customer-total-card {
  display: flex;
  align-items: center;
  gap: 0.68rem;
  padding: 0.72rem;
  border-radius: 1rem;
  background: white;
  box-shadow: 0 5px 20px rgba(17, 44, 35, 0.045);
}

.customer-avatar,
.member-avatar {
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 2.75rem;
  display: grid;
  place-items: center;
  border-radius: 0.88rem;
  background: var(--green-soft);
  color: #1e4f3e;
  font-size: 0.7rem;
  font-weight: 850;
}

.customer-avatar.blue {
  background: var(--blue-soft);
  color: #356ebd;
}

.customer-avatar.amber {
  background: var(--amber-soft);
  color: #91631d;
}

.customer-avatar.rose {
  background: var(--rose-soft);
  color: #a13f4c;
}

.customer-total-copy {
  min-width: 0;
  flex: 1;
}

.customer-total-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.customer-total-head strong {
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-total-head span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.64rem;
}

.amount-bar {
  height: 0.34rem;
  overflow: hidden;
  margin: 0.46rem 0 0.36rem;
  border-radius: 1rem;
  background: #f4dcae;
}

.amount-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.amount-split {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.6rem;
}

.amount-split span {
  display: flex;
  align-items: center;
  gap: 0.27rem;
}

.dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
}

.dot.open {
  background: #dba44c;
}

.dot.paid {
  background: var(--green);
}

.compact-empty {
  display: grid;
  gap: 0.28rem;
  padding: 0.9rem;
  border: 1px dashed #bfcec7;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.65);
}

.compact-empty strong {
  font-size: 0.84rem;
}

.compact-empty span {
  color: var(--muted);
  font-size: 0.72rem;
}

.activity-panel {
  min-width: 0;
  margin-top: 0.25rem;
}

.filter-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.32rem;
  padding: 0.28rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #edf2ef;
}

.filter-tabs a {
  min-height: 2.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  border-radius: 0.75rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.filter-tabs a.active {
  background: white;
  color: var(--ink);
  box-shadow: 0 3px 14px rgba(24, 61, 49, 0.08);
}

.filter-tabs span {
  min-width: 1.2rem;
  padding: 0.06rem 0.25rem;
  border-radius: 0.4rem;
  background: rgba(20, 36, 31, 0.08);
  font-size: 0.62rem;
  text-align: center;
}

.entry-list {
  margin-top: 0.68rem;
}

.entry-card {
  position: relative;
  min-width: 0;
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.95);
}

.entry-main {
  min-width: 0;
  flex: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.68rem;
  padding: 0.86rem 0.25rem 0.86rem 0.75rem;
}

.entry-copy {
  min-width: 0;
}

.entry-copy small,
.entry-copy strong,
.entry-copy em {
  display: block;
}

.entry-copy small,
.entry-copy em {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.66rem;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-copy strong {
  overflow: hidden;
  margin: 0.15rem 0;
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-amount {
  text-align: right;
}

.entry-amount strong,
.entry-amount small {
  display: block;
  white-space: nowrap;
}

.entry-amount strong {
  font-size: 0.88rem;
}

.entry-amount small,
.state-pill {
  margin-top: 0.28rem;
  font-size: 0.6rem;
  font-weight: 760;
}

.entry-amount small.open {
  color: #99681e;
}

.entry-amount small.paid,
.state-pill.paid {
  color: var(--green-dark);
}

.entry-menu {
  position: relative;
  z-index: 8;
  flex: 0 0 3rem;
}

.entry-menu > summary {
  width: 100%;
  height: 100%;
  min-height: 4.75rem;
  display: grid;
  place-items: center;
  border-radius: 0 1.2rem 1.2rem 0;
  color: var(--muted);
  font-size: 1.3rem;
  list-style: none;
  cursor: pointer;
}

.entry-popover {
  position: absolute;
  top: calc(100% - 0.35rem);
  right: 0.35rem;
  width: min(16.5rem, calc(100vw - 2rem));
  overflow: hidden;
  padding: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  background: white;
  box-shadow: var(--shadow);
}

.entry-popover a,
.entry-popover button {
  width: 100%;
  min-height: 3rem;
  display: flex;
  align-items: center;
  padding: 0 0.7rem;
  border: 0;
  border-radius: 0.68rem;
  background: white;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.entry-popover a:hover,
.entry-popover button:hover {
  background: #eef5f1;
}

.empty-state {
  display: grid;
  gap: 0.38rem;
  justify-items: start;
  padding: 1.3rem;
  border: 1px dashed #bfcec7;
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.72);
}

.empty-state h2 {
  margin: 0;
  font-size: 1.1rem;
}

.empty-state p {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.inline-empty {
  grid-column: 1 / -1;
}

.success-mark,
.warning-mark {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  margin-bottom: 0.45rem;
  border-radius: 1rem;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 1.25rem;
  font-weight: 850;
}

.warning-mark {
  background: var(--danger-soft);
  color: var(--danger);
}

.mobile-nav {
  position: fixed;
  z-index: 25;
  right: 0.7rem;
  bottom: calc(0.65rem + env(safe-area-inset-bottom));
  left: 0.7rem;
  padding: 0.34rem;
  border: 1px solid rgba(223, 231, 227, 0.9);
  border-radius: 1.3rem;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 50px rgba(17, 44, 35, 0.14);
  backdrop-filter: blur(18px);
}

.navigation {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.navigation a {
  min-height: 3.55rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  border-radius: 1rem;
  color: #7e8d86;
  font-size: 0.6rem;
  font-weight: 720;
}

.navigation a.active {
  background: var(--green-soft);
  color: var(--green-dark);
}

.nav-icon {
  font-size: 1.08rem;
  line-height: 1;
}

.navigation .nav-add {
  color: var(--ink);
}

.navigation .nav-add .nav-icon {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 0.68rem;
  background: var(--green);
}

.list-page {
  display: grid;
  gap: 1rem;
}

.page-actions {
  align-items: center;
  padding: 0.25rem 0;
}

.directory-card {
  min-width: 0;
  min-height: 4.7rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  background: rgba(255, 255, 255, 0.94);
}

.directory-copy {
  min-width: 0;
}

.directory-copy strong,
.directory-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory-copy strong {
  margin-bottom: 0.2rem;
  font-size: 0.88rem;
}

.directory-copy small {
  color: var(--muted);
  font-size: 0.68rem;
}

.member-avatar {
  background: var(--forest);
  color: var(--green);
}

.state-pill {
  margin: 0;
  padding: 0.35rem 0.5rem;
  border-radius: 0.55rem;
  background: var(--green-soft);
}

.state-pill.inactive {
  background: #edf0ee;
  color: var(--muted);
}

.chevron {
  color: #9aaaa2;
  font-size: 1.35rem;
}

.security-note {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px solid #cbe9dc;
  border-radius: 1rem;
  background: var(--green-soft);
}

.security-note > span {
  width: 2.45rem;
  height: 2.45rem;
  flex: 0 0 2.45rem;
  display: grid;
  place-items: center;
  border-radius: 0.78rem;
  background: white;
  color: var(--green-dark);
  font-weight: 850;
}

.security-note p {
  display: grid;
  gap: 0.14rem;
  margin: 0;
}

.security-note strong {
  font-size: 0.78rem;
}

.security-note small {
  color: #3d6b59;
  font-size: 0.67rem;
  line-height: 1.4;
}

.form-card,
.confirm-card {
  padding: 1rem;
}

.narrow-card {
  width: min(100%, 38rem);
  margin-inline: auto;
}

.entry-form,
.stack-form {
  display: grid;
  gap: 0.85rem;
}

.form-intro {
  margin: -0.15rem 0 1rem;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

.field label {
  display: block;
  margin: 0 0 0.38rem 0.1rem;
  color: #4d5d56;
  font-size: 0.72rem;
  font-weight: 740;
}

.field input:not([type="checkbox"]),
.field select,
.field textarea {
  width: 100%;
  min-height: 3.35rem;
  padding: 0.72rem 0.85rem;
  border: 1px solid #cbd8d2;
  border-radius: 0.92rem;
  background: #fafcfb;
  color: var(--ink);
  font-size: max(1rem, 16px);
}

.field textarea {
  min-height: 5.25rem;
  resize: vertical;
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--danger);
}

.field-error {
  display: block;
  margin: 0.3rem 0.1rem 0;
  color: var(--danger);
  font-size: 0.68rem;
  font-weight: 680;
}

.help-text {
  display: block;
  margin: 0.35rem 0.1rem 0;
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.45;
}

.help-text ul {
  margin: 0.3rem 0 0;
  padding-left: 1.1rem;
}

.checkbox-field {
  min-height: 3.35rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid #cbd8d2;
  border-radius: 0.92rem;
  background: #fafcfb;
}

.checkbox-field input {
  width: 1.35rem;
  height: 1.35rem;
  accent-color: var(--green-dark);
}

.checkbox-field label {
  margin: 0;
  font-size: 0.82rem;
}

.form-alert {
  padding: 0.8rem 0.9rem;
  border: 1px solid #f0c5c5;
  border-radius: 0.85rem;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.75rem;
  line-height: 1.45;
}

.form-alert p {
  margin: 0;
}

.price-fields {
  display: grid;
  grid-template-columns: 0.75fr 0.75fr 1.2fr;
  gap: 0.55rem;
}

[data-price-group][hidden] {
  display: none !important;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 0.6rem;
  margin-top: 0.25rem;
}

.confirm-card {
  display: grid;
  justify-items: start;
  padding: 1.3rem;
}

.confirm-card h2 {
  margin: 0 0 0.45rem;
  font-size: 1.3rem;
}

.confirm-card > p:not(.eyebrow) {
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.confirm-card .form-actions {
  width: 100%;
}

.auth-page {
  display: grid;
  place-items: center;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 85% 10%, rgba(65, 211, 151, 0.23), transparent 24rem),
    var(--forest);
}

.auth-shell {
  width: min(100%, 27rem);
}

.login-card {
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1.5rem;
  background: white;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.24);
}

.login-brand,
.wordmark {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.login-brand > span,
.wordmark > span:first-child {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border-radius: 1rem;
  background: var(--green);
  color: var(--forest);
  font-weight: 900;
  letter-spacing: -0.08em;
}

.login-brand strong,
.login-brand small,
.wordmark strong,
.wordmark small {
  display: block;
}

.login-brand small,
.wordmark small {
  margin-top: 0.08rem;
  color: var(--muted);
  font-size: 0.7rem;
}

.login-heading {
  margin: 2.2rem 0 1.2rem;
}

.login-heading h1 {
  margin: 0;
  font-size: 1.75rem;
}

.login-heading > p:last-child {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.login-note {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.5;
  text-align: center;
}

@media (min-width: 720px) {
  .topbar,
  .page-content {
    width: min(100%, 58rem);
    margin-inline: auto;
  }

  .open-hero {
    grid-template-columns: 1fr auto;
    align-items: end;
  }

  .hero-action {
    min-width: 13rem;
  }

  .customer-total-list,
  .entry-list,
  .tile-list {
    grid-template-columns: 1fr 1fr;
  }

  .entry-form {
    grid-template-columns: 1fr 1fr;
  }

  .form-wide {
    grid-column: 1 / -1;
  }

  .entry-form-card {
    padding: 1.2rem;
  }
}

@media (min-width: 1024px) {
  .app-shell {
    display: grid;
    grid-template-columns: 15rem 1fr;
  }

  .side-rail {
    position: sticky;
    top: 0;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 1.35rem 1rem;
    background: var(--forest);
    color: white;
  }

  .wordmark {
    margin-bottom: 2rem;
  }

  .wordmark small {
    color: rgba(255, 255, 255, 0.5);
  }

  .side-rail .navigation {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .side-rail .navigation a {
    min-height: 3.2rem;
    flex-direction: row;
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 0 0.8rem;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.78rem;
  }

  .side-rail .navigation a.active {
    background: rgba(65, 211, 151, 0.13);
    color: var(--green);
  }

  .side-rail .navigation .nav-add {
    color: white;
  }

  .side-rail .navigation .nav-add .nav-icon {
    width: auto;
    height: auto;
    background: transparent;
  }

  .rail-profile {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: auto;
    padding: 0.7rem;
    border-radius: 0.95rem;
    background: rgba(255, 255, 255, 0.06);
  }

  .mini-avatar {
    width: 2.3rem;
    height: 2.3rem;
    flex: 0 0 2.3rem;
    display: grid;
    place-items: center;
    border-radius: 0.72rem;
    background: rgba(65, 211, 151, 0.16);
    color: var(--green);
    font-size: 0.68rem;
    font-weight: 850;
  }

  .rail-profile > span:last-child {
    min-width: 0;
  }

  .rail-profile strong,
  .rail-profile small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .rail-profile strong {
    font-size: 0.76rem;
  }

  .rail-profile small {
    margin-top: 0.08rem;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.62rem;
  }

  .mobile-nav {
    display: none;
  }

  .page-content {
    padding-bottom: 3rem;
  }
}

@media (orientation: landscape) and (max-height: 620px) and (max-width: 1023px) {
  .app-shell {
    display: grid;
    grid-template-columns: 5.2rem 1fr;
    height: 100dvh;
    overflow: hidden;
  }

  .mobile-nav {
    position: static;
    grid-column: 1;
    grid-row: 1;
    height: 100dvh;
    padding: calc(0.45rem + env(safe-area-inset-top)) 0.4rem calc(0.45rem + env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
    background: var(--forest);
    box-shadow: none;
  }

  .mobile-nav .navigation {
    height: 100%;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 1fr);
    gap: 0.2rem;
  }

  .mobile-nav .navigation a {
    min-height: 0;
    color: rgba(255, 255, 255, 0.58);
  }

  .mobile-nav .navigation a.active {
    background: rgba(65, 211, 151, 0.15);
    color: var(--green);
  }

  .mobile-nav .navigation .nav-add {
    color: white;
  }

  .content-shell {
    grid-column: 2;
    grid-row: 1;
    height: 100dvh;
    overflow: auto;
  }

  .topbar {
    padding: calc(0.55rem + env(safe-area-inset-top)) 1rem 0.5rem;
  }

  .topbar h1 {
    font-size: 1.15rem;
  }

  .profile-menu > summary {
    width: 2.65rem;
    height: 2.65rem;
  }

  .page-content {
    padding: 0 1rem calc(1rem + env(safe-area-inset-bottom));
  }

  .dashboard-grid {
    grid-template-columns: minmax(15rem, 0.8fr) minmax(21rem, 1.2fr);
    align-items: start;
  }

  .open-hero {
    grid-column: 1;
    gap: 0.65rem;
    padding: 1rem;
  }

  .open-hero strong {
    font-size: 1.9rem;
  }

  .hero-action {
    min-height: 3rem;
  }

  .summary-grid {
    grid-column: 1;
  }

  .summary-card {
    min-height: 4.35rem;
  }

  .customer-panel {
    grid-column: 2;
    grid-row: 1;
  }

  .activity-panel {
    grid-column: 2;
    grid-row: 2 / span 2;
    margin-top: 0;
  }

  .customer-total-list,
  .entry-list,
  .tile-list {
    grid-template-columns: 1fr;
  }

  .form-card,
  .confirm-card {
    margin-bottom: 1rem;
  }
}

@media (max-width: 390px) {
  .summary-card {
    gap: 0.45rem;
    padding: 0.65rem;
  }

  .summary-card i {
    width: 2.1rem;
    height: 2.1rem;
    flex-basis: 2.1rem;
  }

  .price-fields {
    grid-template-columns: 1fr 1fr;
  }

  .rate-field {
    grid-column: 1 / -1;
  }

  .directory-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .directory-card .state-pill {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* FIX: mobiles Kontextmenü */
@media (max-width: 1023px) {
  .entry-menu[open] {
    z-index: 40;
  }

  .entry-card:nth-last-child(-n + 2) .entry-popover {
    top: auto;
    bottom: calc(100% - 0.35rem);
    max-height: calc(100dvh - 7rem);
    overflow-y: auto;
  }
}
