:root {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #161616;
  background: #f6f6f2;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: #f6f6f2;
}

button, input { font: inherit; }
button { cursor: pointer; }

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

.topbar,
.section-heading,
.selected-case {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar { margin-bottom: 24px; }

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.65rem, 5vw, 2.2rem); margin-bottom: 0; }
h2 { font-size: 1.2rem; margin-bottom: 6px; }
h3 { margin-bottom: 4px; }

.eyebrow {
  margin-bottom: 4px;
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: .62;
}

.panel {
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 8px 26px rgba(0,0,0,.045);
}

.state-panel {
  min-height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
  align-content: center;
  gap: 14px;
}

.hidden { display: none !important; }

.icon-button,
.text-button {
  border: 0;
  background: transparent;
}

.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.35rem;
}

.icon-button:hover { background: rgba(0,0,0,.05); }

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 52px;
  border-radius: 14px;
  border: 0;
  font-weight: 700;
}

.primary-button {
  background: #161616;
  color: #fff;
}

.secondary-button {
  background: #ecece7;
  color: #161616;
}

.primary-button:disabled { opacity: .55; cursor: wait; }

.case-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.case-card {
  width: 100%;
  min-height: 74px;
  padding: 14px 16px;
  border: 1px solid rgba(0,0,0,.09);
  border-radius: 14px;
  background: #fff;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.case-card:hover,
.case-card:focus-visible {
  border-color: rgba(0,0,0,.28);
  outline: none;
}

.case-reference { font-weight: 750; font-size: 1.03rem; }
.case-meta { font-size: .9rem; opacity: .62; margin-top: 4px; }
.case-arrow { font-size: 1.2rem; opacity: .45; }

.account-label {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .85rem;
  opacity: .58;
}

.entry-panel { margin-top: 16px; }
.field-label {
  display: block;
  font-weight: 650;
  margin: 18px 0 7px;
}

.minutes-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
}

input[type="number"],
input[type="date"] {
  width: 100%;
  min-height: 52px;
  border: 1px solid rgba(0,0,0,.14);
  border-radius: 12px;
  background: #fff;
  padding: 0 14px;
  font-size: 1.05rem;
}

.minutes-row input { font-size: 1.35rem; font-weight: 700; }
.entry-panel .primary-button { margin-top: 22px; }

.muted { color: rgba(0,0,0,.58); }
.error-text { color: #8b1e1e; margin: 12px 0 0; }

.success-panel {
  margin-top: 16px;
  text-align: center;
}

.success-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e8f2e5;
  font-size: 1.7rem;
}

.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(0,0,0,.12);
  border-top-color: #161616;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 700px) {
  .app-shell { padding-left: 24px; padding-right: 24px; }
  .case-list { grid-template-columns: 1fr 1fr; }
}
