/* =========================================================
   GATE OPENER FULLSCREEN MODAL — Direction C
   ========================================================= */
.gate-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 15000;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  animation: gateModalIn 0.3s cubic-bezier(0.22,1,0.36,1);
  overflow: hidden;
}

@keyframes gateModalIn {
  from { opacity: 0; transform: translateY(100%); }
  to   { opacity: 1; transform: translateY(0); }
}
.gate-modal-overlay.gate-modal-closing      { animation: gateModalOut 0.25s cubic-bezier(0.55,0,1,0.45) forwards; }
.gate-modal-overlay.gate-modal-swipe-closing { animation: slideOutToRight 0.25s cubic-bezier(0.55,0,1,0.45) forwards; }

@keyframes slideOutToRight {
  from { transform: translateX(0); }
  to   { transform: translateX(100%); }
}
@keyframes gateModalOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(100%); }
}

.gate-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 12px) 16px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--line-1);
  flex-shrink: 0;
}
.gate-modal-header-left { display: flex; flex-direction: column; gap: 2px; }

.gate-modal-title {
  font-size: var(--t-16);
  font-weight: var(--w-semibold);
  color: var(--ink-1);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gate-modal-subtitle {
  font-size: var(--t-11);
  color: var(--ink-3);
  font-weight: var(--w-semibold);
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
  margin-top: 2px;
}

.gate-modal-close {
  background: var(--surface);
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-fast) var(--ease);
  font-size: 16px;
  font-weight: var(--w-medium);
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}
.gate-modal-close:hover  { background: var(--surface-2); }
.gate-modal-close:active { background: var(--surface-sunken); }

.gate-modal-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 14px calc(20px + var(--safe-bottom));
}

.gate-modal-body .card-group {
  background: var(--surface);
  border: 1px solid var(--line-1);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-1);
}

.gate-modal-body .card {
  opacity: 0;
  transform: translateY(6px);
  animation: cardIn 0.35s var(--ease-out) forwards;
}

.gate-modal-body .card-main { padding: 12px 14px; gap: 12px; }
.gate-modal-body .card-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  font-size: 18px;
  background: var(--surface-2);
  border: 1px solid var(--line-1);
}
.gate-modal-body .card-title { font-size: var(--t-15); font-weight: var(--w-semibold); }
.gate-modal-body .card-desc  { font-size: var(--t-12); margin-top: 2px; }
.gate-modal-body .btn-open {
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
}
.gate-modal-body .btn-icon  { font-size: 18px; }
.gate-modal-body .btn-label { font-size: 9px; }

.gate-modal-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--t-11);
  font-weight: var(--w-semibold);
  min-width: 24px;
  height: 22px;
  border-radius: var(--r-sm);
  padding: 0 8px;
  font-variant-numeric: tabular-nums;
}

.gate-modal-search {
  margin-bottom: 12px;
  position: relative;
}

.gate-modal-search input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px 10px 36px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  font-size: var(--t-13);
  font-family: inherit;
  font-weight: var(--w-regular);
  background: var(--surface);
  color: var(--ink-1);
  outline: none;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
  -webkit-appearance: none;
  height: 38px;
}
.gate-modal-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.gate-modal-search input::placeholder { color: var(--ink-4); }

.gate-modal-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--ink-4);
  pointer-events: none;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.gate-modal-empty {
  text-align: center;
  padding: 36px 20px;
  color: var(--ink-3);
  font-size: var(--t-13);
  font-weight: var(--w-medium);
}

@media (prefers-color-scheme: dark) {
  .gate-modal-overlay { background: var(--bg); }
  .gate-modal-header { background: var(--surface); border-bottom-color: var(--line-1); }
  .gate-modal-body .card-group { background: var(--surface); border-color: var(--line-1); }
  .gate-modal-body .card-icon { background: var(--surface-2); border-color: var(--line-1); }
  .gate-modal-search input { background: var(--surface); color: var(--ink-1); border-color: var(--line-2); }
}
