:root {
  color-scheme: light;
  --bg: #f2f0ff;
  --ink: #14121f;
  --panel: #ffffff;
  --yellow: #ffd400;
  --pink: #ff5da2;
  --blue: #2f6bff;
  --green: #00c07f;
  --orange: #ff7a1a;
  --good: #00c07f;
  --planned: #ffd400;
  --warn: #ff4317;
  --shadow-lg: 8px 8px 0 var(--ink);
  --shadow-md: 6px 6px 0 var(--ink);
  --shadow-sm: 4px 4px 0 var(--ink);
  --shadow-xs: 3px 3px 0 var(--ink);
  font-family: "Archivo", ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

h1,
h2,
h3 {
  font-family: "Archivo Black", "Archivo", sans-serif;
  margin: 0;
  text-transform: uppercase;
}

p {
  margin-top: 0;
}

/* ---------- Header ---------- */

.app-header {
  align-items: flex-start;
  background: var(--blue);
  border-bottom: 4px solid var(--ink);
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  overflow: hidden;
  padding: 26px clamp(18px, 4vw, 52px) 30px;
  position: relative;
}

.header-copy {
  position: relative;
  z-index: 1;
}

.badge {
  background: var(--yellow);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-sm);
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  margin-bottom: 14px;
  padding: 6px 14px;
  text-transform: uppercase;
  transform: rotate(-2deg);
}

.app-header h1 {
  color: #fff;
  font-size: clamp(2rem, 6vw, 4.2rem);
  line-height: 0.95;
  max-width: 15ch;
  -webkit-text-stroke: 2px var(--ink);
  text-shadow: 5px 5px 0 var(--ink);
}

.tagline {
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  margin: 14px 0 0;
}

.header-actions {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-self: end;
  min-width: 0;
  width: 100%;
  position: relative;
  z-index: 2;
}

.auth-panel {
  align-items: center;
  background: #fff;
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  justify-content: stretch;
  width: 100%;
  padding: 10px;
}

.auth-panel span {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
  min-width: 0;
}

.install {
  background: var(--yellow);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-sm);
  font-family: "Archivo Black", sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  padding: 12px 18px;
  position: relative;
  text-transform: uppercase;
  white-space: nowrap;
  transition: transform 0.1s, box-shadow 0.1s;
}

.install:hover {
  box-shadow: var(--shadow-md);
  transform: translate(-2px, -2px);
}

.header-actions > .install {
  text-align: center;
  width: 100%;
}

/* ---------- Event strip ---------- */

.event-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 26px clamp(18px, 4vw, 52px) 0;
}

.event-list {
  display: contents;
}

.chip {
  background: var(--panel);
  border: 4px solid var(--ink);
  box-shadow: var(--shadow-md);
  color: var(--ink);
  display: grid;
  gap: 4px;
  min-width: 190px;
  padding: 14px 20px;
  text-align: left;
  transition: transform 0.1s, box-shadow 0.1s;
}

.chip:hover {
  box-shadow: var(--shadow-lg);
  transform: translate(-2px, -2px);
}

.chip:active {
  box-shadow: 2px 2px 0 var(--ink);
  transform: translate(3px, 3px);
}

.event-title {
  font-family: "Archivo Black", sans-serif;
  font-size: 1.02rem;
  text-transform: uppercase;
}

.event-meta {
  font-size: 0.78rem;
  font-weight: 700;
}

.event-button.active {
  background: var(--pink);
  color: #fff;
}

.event-button.active .event-meta {
  color: #ffe3f0;
}

.chip-new {
  align-items: center;
  background: var(--yellow);
  display: grid;
  font-family: "Archivo Black", sans-serif;
  font-size: 0.92rem;
  justify-items: center;
  min-width: 150px;
  text-transform: uppercase;
}

/* ---------- Panels & forms ---------- */

.panel {
  background: var(--panel);
  border: 4px solid var(--ink);
  box-shadow: var(--shadow-lg);
  padding: 20px 22px;
}

.event-form-panel {
  margin: 26px clamp(18px, 4vw, 52px) 0;
  max-width: 720px;
}

.panel-head {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel-head h2 {
  font-size: 1.2rem;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.event-form {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: 1.6fr 1fr 1fr auto;
}

label {
  display: grid;
  font-size: 0.74rem;
  font-weight: 800;
  gap: 6px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.check-field {
  align-items: center;
  display: flex;
  min-height: 46px;
}

.check-field input {
  accent-color: var(--pink);
  height: 20px;
  width: 20px;
}

input,
select,
textarea {
  background: #ffffff;
  border: 3px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  font-weight: 600;
  min-width: 0;
  padding: 11px 12px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

/* ---------- Buttons ---------- */

.primary,
.ghost,
.danger,
.filter {
  border: 3px solid var(--ink);
  border-radius: 0;
  box-shadow: var(--shadow-xs);
  font-weight: 800;
  letter-spacing: 0.06em;
  min-height: 44px;
  padding: 0 16px;
  text-transform: uppercase;
  transition: transform 0.1s, box-shadow 0.1s;
}

.primary:hover,
.ghost:hover,
.danger:hover,
.filter:hover {
  box-shadow: 5px 5px 0 var(--ink);
  transform: translate(-1px, -1px);
}

.primary:active,
.ghost:active,
.danger:active,
.filter:active {
  box-shadow: 1px 1px 0 var(--ink);
  transform: translate(2px, 2px);
}

.primary {
  background: var(--pink);
  color: #fff;
}

.ghost,
.filter {
  background: #fff;
  color: var(--ink);
}

.danger {
  background: var(--warn);
  color: #fff;
}

.icon-button {
  align-items: center;
  background: var(--ink);
  border: 3px solid var(--ink);
  color: var(--yellow);
  display: inline-flex;
  flex: 0 0 auto;
  font-family: "Archivo Black", sans-serif;
  font-size: 1.1rem;
  height: 40px;
  justify-content: center;
  line-height: 1;
  width: 40px;
}

.icon-button:hover {
  background: var(--pink);
  border-color: var(--ink);
  color: #fff;
}

.button-icon {
  display: block;
  fill: currentColor;
  height: 22px;
  width: 22px;
}

/* ---------- Layout ---------- */

.layout {
  padding: 26px clamp(18px, 4vw, 52px) 60px;
}

#eventView {
  display: grid;
  gap: 26px;
}

.empty-state {
  align-items: center;
  background: var(--panel);
  border: 4px solid var(--ink);
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: clamp(24px, 5vw, 56px);
  grid-template-columns: minmax(0, 1fr) minmax(190px, 300px);
  overflow: hidden;
  padding: clamp(28px, 6vw, 72px);
  position: relative;
}

.empty-state::before {
  background: var(--yellow);
  border: 4px solid var(--ink);
  bottom: -58px;
  content: "";
  height: 158px;
  position: absolute;
  right: clamp(18px, 7vw, 96px);
  transform: rotate(-7deg);
  width: 210px;
  z-index: 0;
}

.empty-state-copy,
.empty-state-illustration {
  position: relative;
  z-index: 1;
}

.empty-state h2 {
  font-size: clamp(1.7rem, 4vw, 3.2rem);
  line-height: 1;
  margin-bottom: 14px;
}

.empty-state p {
  font-size: 1.05rem;
  font-weight: 600;
  max-width: 560px;
}

.empty-state-illustration {
  filter: drop-shadow(6px 6px 0 var(--ink));
  justify-self: end;
  max-width: 300px;
  width: 100%;
}

.gift-box {
  transform-origin: 130px 130px;
}

.gift-shadow {
  fill: rgba(20, 18, 31, 0.16);
}

.gift-base {
  fill: var(--pink);
}

.gift-lid {
  fill: var(--blue);
}

.gift-ribbon-h,
.gift-ribbon-v,
.gift-bow-knot {
  fill: var(--yellow);
}

.gift-bow {
  fill: var(--green);
}

.gift-edge {
  fill: none;
}

.gift-edge,
.gift-lid,
.gift-base,
.gift-ribbon-h,
.gift-ribbon-v,
.gift-bow,
.gift-bow-knot {
  stroke: var(--ink);
  stroke-linejoin: round;
  stroke-width: 6;
}

.gift-burst {
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 6;
}

.burst-one {
  stroke: var(--orange);
}

.burst-two {
  stroke: var(--pink);
}

.burst-three {
  stroke: var(--blue);
}

.gift-dot {
  fill: var(--yellow);
  stroke: var(--ink);
  stroke-width: 5;
}

.dot-two {
  fill: var(--green);
}

.dot-three {
  fill: var(--orange);
}

/* ---------- Event summary ---------- */

.event-summary {
  display: grid;
  gap: 22px;
}

.summary-title {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
}

.eyebrow {
  background: var(--ink);
  color: var(--yellow);
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  margin: 0 0 10px;
  padding: 5px 12px;
  text-transform: uppercase;
  transform: rotate(-1deg);
}

.summary-title h2 {
  font-size: clamp(1.7rem, 4vw, 3.2rem);
  line-height: 0.98;
  overflow-wrap: anywhere;
}

.summary-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
}

.stat {
  animation: pop 0.4s ease both;
  border: 4px solid var(--ink);
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 8px;
  padding: 18px 20px;
}

.stat:nth-child(2) { animation-delay: 0.06s; }
.stat:nth-child(3) { animation-delay: 0.12s; }
.stat:nth-child(4) { animation-delay: 0.18s; }
.stat:nth-child(5) { animation-delay: 0.24s; }

@keyframes pop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: none; }
}

.stat span {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stat strong {
  font-family: "Archivo Black", sans-serif;
  font-size: clamp(1.4rem, 2.6vw, 2.1rem);
  overflow-wrap: anywhere;
}

.s1 { background: #fff; }
.s2 { background: var(--yellow); }
.s3 { background: var(--green); color: #fff; }
.s3 span { color: #dcfff1; }
.s4 { background: var(--ink); color: var(--yellow); }
.s4 span { color: #fff; }
.s5 { background: var(--blue); color: #fff; }
.s5 span { color: #dce6ff; }

/* ---------- Budget meter ---------- */

.meter-block {
  background: #fff;
  border: 4px solid var(--ink);
  box-shadow: var(--shadow-lg);
  padding: 18px 22px;
}

.meter-label {
  display: flex;
  font-size: 0.78rem;
  font-weight: 800;
  justify-content: space-between;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.budget-meter {
  background: #efeef8;
  border: 4px solid var(--ink);
  display: flex;
  height: 32px;
  overflow: hidden;
}

.budget-meter span {
  display: block;
  height: 100%;
  transition: width 180ms ease, background 180ms ease;
  width: 0%;
}

.meter-bought {
  background: var(--good);
}

.meter-planned {
  background: var(--planned);
}

.meter-legend {
  display: flex;
  gap: 18px;
  margin-top: 10px;
}

.legend-item {
  align-items: center;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 800;
  gap: 7px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.legend-dot {
  border: 2px solid var(--ink);
  display: inline-block;
  height: 12px;
  width: 12px;
}

.dot-bought {
  background: var(--good);
}

.dot-planned {
  background: var(--planned);
}

.dot-picked {
  background: var(--blue);
}

/* ---------- Gift form ---------- */

.gift-form {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(180px, 1.4fr) minmax(110px, 0.7fr) minmax(190px, 1.3fr);
  margin-top: 4px;
}

.gift-form .notes {
  grid-column: 1 / span 2;
}

.form-actions {
  align-items: end;
  display: flex;
  gap: 10px;
}

.gift-form .primary,
.gift-form .ghost {
  min-width: 130px;
}

/* ---------- Toolbar & filters ---------- */

.toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 20px;
}

.toolbar h2 {
  font-size: 1.5rem;
}

.filters {
  display: flex;
  gap: 10px;
}

.toolbar-controls {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.sort-control {
  min-width: 190px;
}

.sort-control select {
  background: #fff;
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-xs);
  color: var(--ink);
  font-weight: 800;
  min-height: 40px;
  padding: 0 36px 0 12px;
  text-transform: uppercase;
}

.filter {
  font-size: 0.74rem;
  min-height: 40px;
}

.filter.active {
  background: var(--ink);
  color: var(--yellow);
}

/* ---------- Gift cards ---------- */

.gift-list {
  display: grid;
  gap: 26px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.empty-copy {
  font-size: 1rem;
  font-weight: 700;
  grid-column: 1 / -1;
}

.gift-card {
  background: var(--panel);
  border: 4px solid var(--ink);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.12s;
}

.gift-card:hover {
  transform: translate(-2px, -2px) rotate(-0.5deg);
}

.gift-card.pickable {
  cursor: pointer;
}

.gift-card.pickable:hover {
  border-color: var(--blue);
}

.gift-card.bought::after {
  background: var(--green);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-xs);
  color: #fff;
  content: "Bought!";
  font-family: "Archivo Black", sans-serif;
  font-size: 0.7rem;
  padding: 7px 12px;
  position: absolute;
  right: -12px;
  text-transform: uppercase;
  top: -14px;
  transform: rotate(6deg);
  z-index: 2;
}

.gift-card.picked::after {
  background: var(--blue);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-xs);
  color: #fff;
  content: "Picked";
  font-family: "Archivo Black", sans-serif;
  font-size: 0.7rem;
  padding: 7px 12px;
  position: absolute;
  right: -12px;
  text-transform: uppercase;
  top: -14px;
  transform: rotate(6deg);
  z-index: 2;
}

.gift-card.bought .gift-title {
  text-decoration: line-through;
  text-decoration-color: var(--pink);
  text-decoration-thickness: 4px;
}

.gift-card.bought .gift-photo {
  filter: grayscale(0.45);
}

.check-wrap {
  left: 12px;
  position: absolute;
  top: 12px;
  z-index: 2;
}

.check-wrap input {
  height: 0;
  opacity: 0;
  position: absolute;
  width: 0;
}

.check-face {
  align-items: center;
  background: #fff;
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-xs);
  color: transparent;
  cursor: pointer;
  display: flex;
  font-family: "Archivo Black", sans-serif;
  font-size: 1rem;
  height: 32px;
  justify-content: center;
  transition: transform 0.1s;
  width: 32px;
}

.check-wrap:hover .check-face {
  transform: translate(-1px, -1px);
}

.check-wrap input:checked + .check-face {
  background: var(--green);
  color: #fff;
}

.check-wrap input:focus-visible + .check-face {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.gift-photo {
  aspect-ratio: 1.8;
  background: repeating-linear-gradient(45deg, #e5ecff, #e5ecff 14px, #d4dfff 14px, #d4dfff 28px);
  border-bottom: 4px solid var(--ink);
  object-fit: contain;
  padding: 8px;
  width: 100%;
}

.gift-details {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 16px 18px 18px;
}

.gift-title-row {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.gift-title {
  font-size: 1.02rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.gift-price {
  background: var(--yellow);
  border: 3px solid var(--ink);
  flex: 0 0 auto;
  font-family: "Archivo Black", sans-serif;
  font-size: 1.05rem;
  padding: 3px 10px;
  transform: rotate(-1.5deg);
  white-space: nowrap;
}

.gift-notes {
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
  overflow-wrap: anywhere;
}

.gift-notes:empty {
  display: none;
}

.purchase-details {
  background: #dcfff1;
  border: 2px solid var(--green);
  font-size: 0.8rem;
  font-weight: 800;
  margin: 0;
  overflow-wrap: anywhere;
  padding: 8px 10px;
}

.picked-details {
  background: #fff5a6;
  border: 2px solid var(--yellow);
  font-size: 0.8rem;
  font-weight: 800;
  margin: 0;
  overflow-wrap: anywhere;
  padding: 8px 10px;
}

.gift-link {
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration-thickness: 3px;
  text-transform: uppercase;
}

.gift-link .ad-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0;
  opacity: 0.75;
  text-transform: none;
}

.gift-link-search {
  color: var(--ink);
}

.app-footer {
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.75;
  padding: 24px 16px 32px;
  text-align: center;
}

.app-footer p {
  margin: 0 auto;
  max-width: 60ch;
}

.gift-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}

.gift-actions .ghost {
  flex: 1;
  font-size: 0.72rem;
  min-height: 40px;
  padding: 0 6px;
}

.gift-actions .purchase-gift {
  background: var(--pink);
  color: #fff;
}

.gift-actions .pick-gift {
  background: var(--yellow);
}

.delete-gift {
  background: #fff;
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-xs);
  color: var(--warn);
  flex: 0 0 auto;
  font-family: "Archivo Black", sans-serif;
  font-size: 1rem;
  min-height: 40px;
  transition: transform 0.1s, box-shadow 0.1s;
  width: 40px;
}

.delete-gift:hover {
  background: var(--warn);
  box-shadow: 5px 5px 0 var(--ink);
  color: #fff;
  transform: translate(-1px, -1px);
}

/* ---------- Modals ---------- */

.modal-backdrop {
  align-items: center;
  background: rgba(20, 18, 31, 0.66);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
  z-index: 10;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-backdrop.hidden {
  display: flex !important; /* Override global .hidden */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal {
  background: var(--panel);
  border: 4px solid var(--ink);
  box-shadow: 10px 10px 0 var(--ink);
  display: grid;
  gap: 16px;
  max-width: 520px;
  padding: 22px;
  width: min(100%, 520px);
  transform: scale(1) translateY(0);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-backdrop.hidden .modal {
  transform: scale(0.95) translateY(10px);
}

.modal .panel-head {
  margin-bottom: 0;
}

.modal-copy {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

.auth-modal {
  gap: 14px;
}

.auth-provider-grid {
  display: grid;
  gap: 10px;
}

.auth-provider {
  align-items: center;
  background: #fff;
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  color: var(--ink);
  display: flex;
  font-size: 0.95rem;
  font-weight: 900;
  gap: 10px;
  justify-content: center;
  min-height: 46px;
  padding: 10px 14px;
}

.auth-provider:hover {
  transform: translate(-1px, -1px);
}

.provider-mark {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.82rem;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.google-mark {
  color: #1a73e8;
}

.apple-mark {
  background: var(--ink);
  color: #fff;
}

.auth-divider {
  align-items: center;
  color: var(--muted);
  display: grid;
  font-size: 0.78rem;
  font-weight: 900;
  gap: 10px;
  grid-template-columns: 1fr auto 1fr;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  background: var(--ink);
  content: "";
  height: 2px;
}

.auth-error {
  color: var(--warn);
  font-size: 0.88rem;
  font-weight: 800;
  min-height: 1.2em;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ---------- Responsive ---------- */

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

  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }

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

  .gift-form .notes {
    grid-column: 1 / -1;
  }

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

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

  .header-actions,
  .auth-panel {
    align-items: stretch;
    width: 100%;
  }

  .event-strip {
    flex-direction: column;
  }

  .chip {
    min-width: 0;
    width: 100%;
  }

  .summary-grid,
  .gift-form,
  .event-form,
  .gift-list {
    grid-template-columns: 1fr;
  }

  .empty-state {
    grid-template-columns: 1fr;
    padding-bottom: 34px;
  }

  .empty-state::before {
    bottom: -76px;
    right: -24px;
  }

  .empty-state-illustration {
    justify-self: center;
    max-width: 230px;
  }

  .panel-head,
  .toolbar,
  .summary-title {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-controls,
  .filters,
  .sort-control {
    align-items: stretch;
    width: 100%;
  }

  .sort-control select {
    width: 100%;
  }

  .filters .filter {
    flex: 1;
  }

  .form-actions,
  .modal-actions {
    flex-direction: column;
  }

  .form-actions .primary,
  .form-actions .ghost,
  .modal-actions .primary,
  .modal-actions .ghost {
    width: 100%;
  }
}

/* ---------- Share modal: who has access ---------- */

#shareModal .modal {
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
}

.share-access {
  display: grid;
  gap: 8px;
}

.share-access:empty {
  display: none;
}

.share-access-title {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  margin: 6px 0 0;
  text-transform: uppercase;
}

.share-access-list {
  display: grid;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.share-access-row {
  align-items: center;
  border: 3px solid var(--ink);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 6px 6px 6px 10px;
}

.share-access-row span {
  font-weight: 700;
  min-width: 0;
  overflow-wrap: anywhere;
}

.share-access-row small {
  font-weight: 600;
  opacity: 0.7;
}

.share-access-row button {
  flex-shrink: 0;
  padding: 6px 10px;
}

.share-access-empty,
.share-access-help {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0;
  opacity: 0.75;
}
