/* ============================================
   Memorit - Web App Styles
   Mobile-first design system
   ============================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --c-bg: #1e1e1e;
  --c-surface: #ffffff;
  --c-text: #1a1a1a;
  --c-text-2: #555;
  --c-text-3: #999;
  --c-border: #e5e5e5;
  --c-border-2: #d4d4d4;
  --c-primary: #1a1a1a;
  --c-primary-disabled: #c4c4c4;
  --c-secondary: #ffffff;
  --c-error: #e53935;
  --c-success: #2563eb;
  --c-overlay: rgba(0, 0, 0, .5);
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --shadow-1: 0 3px 16px rgba(0, 0, 0, .22);
  --max-w: 480px;
  --header-h: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0);
}

html,
body {
  height: 100%;
  background: #d0d0d0;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Helvetica Neue", Arial, sans-serif;
  color: var(--c-text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: 15px;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.app {
  position: relative;
  max-width: var(--max-w);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--c-bg);
  overflow: hidden;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  height: var(--header-h);
  padding: 0 12px;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
}

/* 랜딩 / 부고장 상세·미리보기: 헤더 다크 톤 + 흰 아이콘·타이틀 */
.app:has(.landing) .header,
.app:has(.obituary) .header {
  background: #202020;
  border-bottom-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.app:has(.landing) .logo-mark,
.app:has(.obituary) .logo-mark {
  filter: brightness(0) invert(1);
}

.header__back {
  width: 40px;
  height: 40px;
  font-size: 26px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header__back[hidden] {
  display: none;
}

.header__title {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  padding-left: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.logo-mark {
  height: 22px;
  width: auto;
  display: inline-block;
  vertical-align: middle;
}

.header__menu {
  width: 40px;
  height: 40px;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header__action {
  height: 32px;
  padding: 0 12px;
  font-size: 14px;
  background: transparent;
  border: none;
  color: var(--c-text);
  cursor: pointer;
}

.header__action[hidden] {
  display: none;
}

/* View */
.view {
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100dvh - var(--header-h));
  padding-bottom: calc(20px + var(--safe-bottom));
}

/* 부고장 만들기/수정/나의 부고장 관리/기타 폼 화면: 밝은 배경 */
.view:has(.create-page),
.view:has(.list),
.view:has(.ended),
.view:has(.policy) {
  background: #f5f5f5;
}
/* 부고장 상세/미리보기: --c-bg(#1e1e1e) 유지 — 별도 규칙 없음 */

/* ============ Landing (dark + 3D frame) ============ */
.landing {
  position: relative;
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-h));
  height: calc(100dvh - var(--header-h));
  padding: 14px 24px calc(24px + var(--safe-bottom));
  background: #202020;
  color: #fff;
  text-align: left;
  overflow: hidden;
}

.landing__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  min-height: 0;
}

.landing__stage {
  position: relative;
  flex: 0 0 auto;
  align-self: center;
  width: 78%;
  aspect-ratio: 816 / 1113;
  margin: 0 0 24px;
  background:
    url("image/acja.png") no-repeat center / 100% 100%;
  overflow: visible;
  z-index: 1;
}

.landing__sway {
  position: absolute;
  left: 18%;
  top: 78%;
  width: 64%;
  height: auto;
  transform-origin: 90% 100%;
  animation: landing-sway 3.6s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}

@keyframes landing-sway {
  0%, 100% { transform: rotate(-1.8deg); }
  50%      { transform: rotate(1.8deg); }
}

/* Falling petals across whole landing */
.landing__petals {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 3;
}

.petal {
  position: absolute;
  top: -24px;
  left: var(--x, 50%);
  width: var(--s, 8px);
  height: calc(var(--s, 8px) * 1.7);
  background: linear-gradient(160deg, #ffffff 0%, #d4d4d4 100%);
  border-radius: 60% 40% 50% 50% / 70% 60% 40% 30%;
  opacity: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
  animation: petal-fall var(--t, 10s) linear infinite;
  animation-delay: var(--d, 0s);
  will-change: transform, opacity;
}

@keyframes petal-fall {
  0%   { transform: translate(0, 0) rotate(0deg);                                                  opacity: 0; }
  8%   { opacity: 0.85; }
  50%  { transform: translate(var(--dx, 20px), 50vh) rotate(calc(var(--r, 360deg) * 0.5));         opacity: 0.85; }
  92%  { opacity: 0.7; }
  100% { transform: translate(calc(var(--dx, 20px) * -0.4), 110vh) rotate(var(--r, 360deg));      opacity: 0; }
}

.landing__sub {
  color: rgba(255, 255, 255, 0.55);
  font-size: 14px;
  margin-bottom: 8px;
  letter-spacing: 0.2px;
}

.landing__title {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #ffffff;
  margin-bottom: 10px;
}

.landing__desc {
  color: rgba(255, 255, 255, 0.65);
  font-size: 14px;
  line-height: 1.55;
}

.landing__cta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 24px;
}

.landing .btn {
  height: 54px;
  border-radius: 14px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.landing .btn--secondary {
  background: #ffffff;
  border: 1px solid #ffffff;
  color: #1a1a1a;
}

.landing .btn--primary {
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4);
}

/* ============ Site Footer (랜딩 하단) ============ */
.site-footer {
  padding: 24px 24px calc(28px + var(--safe-bottom));
  background: var(--c-surface);
  color: var(--c-text-2);
  font-size: 13px;
  line-height: 1.6;
}

.site-footer__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 10px;
}

.site-footer__line {
  margin-bottom: 4px;
  color: var(--c-text-2);
}

.site-footer__links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 18px;
  border-top: 1px solid var(--c-border);
  padding-top: 14px;
}

.site-footer__links button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 0;
  font-size: 14px;
  color: var(--c-text);
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.site-footer__links button::after {
  content: '›';
  color: var(--c-text-3);
  font-size: 18px;
  font-weight: 400;
}

.site-footer__links button:hover {
  color: var(--c-text);
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 16px;
  font-size: 15px;
  font-weight: 500;
  border-radius: var(--r-md);
  transition: opacity .15s, background .15s;
}

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

.btn--primary:disabled {
  background: var(--c-primary-disabled);
  cursor: not-allowed;
}

.btn--secondary {
  background: var(--c-secondary);
  color: var(--c-text);
  border: 1px solid var(--c-border-2);
}

.btn--secondary:disabled {
  color: var(--c-text-3);
  border-color: var(--c-border);
  cursor: not-allowed;
}

.btn--block {
  width: 100%;
}

.btn--text {
  color: var(--c-text-2);
  text-decoration: underline;
  height: auto;
  padding: 4px 0;
}

.btn--icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* ============ Form fields ============ */
.field {
  margin-bottom: 18px;
}

.field__label {
  display: block;
  font-size: 13px;
  color: var(--c-text-2);
  margin-bottom: 6px;
  font-weight: 500;
}

.field__label .req,
.section__title .req {
  color: var(--c-error);
  margin-left: 2px;
}

.field__hint {
  font-size: 12px;
  color: var(--c-text-3);
  margin-top: 6px;
  align-items: baseline;
  gap: 6px;
}

.field__hint:not([hidden]) {
  display: flex;
}

.field__hint::before {
  content: "•";
  font-size: 11px;
  line-height: 1;
  color: currentColor;
  opacity: .9;
}

.field__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.field__footer .field__help,
.field__footer .field__counter {
  margin-top: 0;
}

.section__notice {
  background: #f3f3f3;
  color: var(--c-text-2);
  font-size: 13px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  margin-bottom: 14px;
}

.section__action {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  background: transparent;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  color: var(--c-text-2);
  cursor: pointer;
}

.fh-info {
  margin-top: 8px;
  padding: 10px 12px;
  background: #f8f8f8;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--c-text-2);
  margin-bottom: 14px;
}

.fh-info__row {
  display: flex;
  gap: 8px;
  line-height: 1.6;
}

.fh-info__label {
  min-width: 44px;
  color: var(--c-text-3);
}

.mourner-notice {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--c-border);
  font-size: 13px;
  color: var(--c-text-2);
  white-space: pre-line;
}

.field__hint--error {
  color: var(--c-error);
}

@keyframes shake-error {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(3px); }
}

.field--focus-error {
  animation: shake-error 0.4s ease;
}

.field--focus-error .input,
.field--focus-error .picker-input,
.field--focus-error .select-trigger {
  border-color: var(--c-error) !important;
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.15) !important;
}

.field__hint--success {
  color: var(--c-success);
}

.field__counter {
  font-size: 12px;
  color: var(--c-text-3);
  text-align: right;
  margin-top: 4px;
}

.input,
.textarea,
.select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  font-size: 15px;
  outline: none;
  transition: border-color .15s;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--c-primary);
}

.input--filled {
  background: #f3f3f3;
  border-color: #f3f3f3;
}

.input--filled:focus {
  background: var(--c-surface);
  border-color: var(--c-primary);
}

.input.is-error,
.textarea.is-error {
  border-color: var(--c-error);
}

.input:disabled,
.textarea:disabled,
.select:disabled {
  background: #f3f3f3;
  color: var(--c-text-3);
}

.textarea {
  height: auto;
  min-height: 96px;
  padding: 10px 12px;
  resize: vertical;
}

.select {
  appearance: none;
  background: var(--c-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23555' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  padding-right: 30px;
}

/* Select trigger (opens bottom sheet) */
.select-trigger {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  font-size: 15px;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  transition: border-color .15s;
}

.select-trigger:active,
.select-trigger:focus {
  border-color: var(--c-primary);
  outline: none;
}

.select-trigger.is-placeholder>span:first-child {
  color: var(--c-text-3);
}

.select-trigger .chev {
  color: var(--c-text-3);
  font-size: 11px;
}

.select-trigger.is-error {
  border-color: var(--c-error);
}

/* Input clear (x) */
.input-wrap {
  position: relative;
}

.input-wrap .input {
  padding-right: 34px;
}

.input-wrap .clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translate(0, -50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #d9d9d9;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
}

.input-wrap:focus-within .clear-btn.has-value {
  display: inline-flex;
}

/* Sheet content: option grid / list */
.sheet-section {
  margin-bottom: 12px;
}

.sheet-section__label {
  font-size: 13px;
  color: var(--c-text-2);
  margin-bottom: 8px;
}

.sheet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-height: 55vh;
  overflow-y: auto;
}

.sheet-grid--4 {
  grid-template-columns: repeat(4, 1fr);
  max-height: none;
}

.sheet-grid--3 {
  grid-template-columns: repeat(3, 1fr);
  max-height: none;
}

.sheet-grid__item {
  padding: 12px 8px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  text-align: center;
  font-size: 14px;
  background: var(--c-surface);
  color: var(--c-text);
}

.sheet-grid__item.is-selected {
  border-color: var(--c-primary);
  background: #fafafa;
  font-weight: 600;
}

.sheet-list {
  max-height: 55vh;
  overflow-y: auto;
}

.sheet-list__item {
  display: block;
  width: 100%;
  padding: 14px 8px;
  text-align: left;
  border-bottom: 1px solid var(--c-border);
  font-size: 14px;
  background: transparent;
}

.sheet-list__item.is-selected {
  color: var(--c-primary);
  font-weight: 600;
}

.sheet-confirm {
  margin-top: 14px;
}

/* Dropdown-style picker trigger (replaces native date/select for funeral schedule) */
.picker-input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 44px;
  padding: 0 12px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  font-size: 15px;
  color: var(--c-text);
  text-align: left;
  cursor: pointer;
}

.picker-input--placeholder {
  color: var(--c-text-3);
}

.picker-input--disabled {
  background: #f3f3f3;
  color: var(--c-text-3);
  cursor: not-allowed;
}

.picker-input__chevron {
  font-size: 12px;
  color: var(--c-text-3);
  transform: rotate(0deg);
  margin-left: 8px;
}

.picker-input--search {
  justify-content: flex-start;
  gap: 8px;
}

.picker-input--search .picker-input__icon {
  flex: 0 0 auto;
  color: var(--c-text-3);
}

.picker-input--search > span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field__help {
  margin-top: 6px;
  font-size: 12px;
  color: var(--c-text-3);
  align-items: baseline;
  gap: 6px;
}

.field__help:not([hidden]) {
  display: flex;
}

.field__help::before {
  content: "•";
  font-size: 11px;
  line-height: 1;
  color: currentColor;
  opacity: .9;
}

/* Calendar in bottom sheet */
.picker-section-label {
  font-size: 13px;
  color: var(--c-text-2);
  margin-bottom: 8px;
}

.calendar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  border: 1px dashed var(--c-border);
  border-radius: var(--r-sm);
  margin-bottom: 10px;
}

.calendar__nav {
  width: 28px;
  height: 28px;
  font-size: 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--c-text);
}

.calendar__nav:disabled {
  color: var(--c-text-3);
  cursor: not-allowed;
}

.calendar__title {
  font-size: 15px;
  font-weight: 600;
}

.calendar__weekdays,
.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.calendar__weekdays {
  margin-bottom: 4px;
}

.calendar__weekdays > div {
  text-align: center;
  font-size: 12px;
  color: var(--c-text-3);
  padding: 4px 0;
}

.calendar__day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  background: transparent;
  border: none;
  border-radius: 999px;
  color: var(--c-text);
  cursor: pointer;
}

.calendar__day:disabled,
.calendar__day--muted {
  color: var(--c-text-3);
  cursor: not-allowed;
}

.calendar__day.is-today {
  color: var(--c-text);
  font-weight: 700;
  position: relative;
}

.calendar__day.is-today::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--c-text);
}

.calendar__day.is-selected {
  background: var(--c-primary);
  color: var(--c-surface);
  font-weight: 600;
}

.calendar__day.is-selected.is-today {
  background: var(--c-primary);
  color: var(--c-surface);
}

.calendar__day.is-selected.is-today::after {
  background: var(--c-surface);
}

.time-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.time-picker__col label {
  display: block;
  font-size: 12px;
  color: var(--c-text-2);
  margin-bottom: 6px;
}

.time-picker .input:disabled {
  background: #f3f3f3;
  color: var(--c-text-3);
}

.sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

/* Donation row group */
.donation-row {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--c-border);
}

.donation-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 0;
}

.donation-row__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.donation-row__label {
  font-size: 13px;
  color: var(--c-text-2);
  font-weight: 500;
}

.donation-row__del {
  width: 32px;
  height: 32px;
  font-size: 16px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.field-row--3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background: #ccc;
  border-radius: 999px;
  transition: background .15s;
  display: inline-block;
  flex-shrink: 0;
}

.toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: left .15s;
}

.toggle.is-on {
  background: var(--c-primary);
}

.toggle.is-on::after {
  left: 22px;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--c-text-2);
  cursor: pointer;
}

.checkbox input {
  display: none;
}

.checkbox__box {
  width: 18px;
  height: 18px;
  border: 1px solid var(--c-border-2);
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: transparent;
}

.checkbox input:checked+.checkbox__box {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
}

.checkbox input:checked+.checkbox__box::before {
  content: "✓";
}

/* ============ Cards (form sections) ============ */
.section {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  padding: 18px 16px;
  margin: 12px;
  box-shadow: var(--shadow-1);
}

.section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
}

.section__title .icon-bullet {
  display: inline-flex;
  align-items: center;
  font-size: 15px;
  color: rgba(202, 151, 24, 0.9);
  margin-right: 2px;
}

.section__optional {
  font-size: 12px;
  color: var(--c-text-3);
}

.builder-notice {
  margin: 0 12px 12px;   /* margin-top 제거 — padding-top으로 대체 */
  padding: 12px 14px;
  background: #fff3e0;
  color: #8a4b00;
  border-radius: var(--r-md);
  font-size: 13px;
}

.builder-notice .req {
  color: var(--c-error);
  font-weight: 600;
}

/* ============ Editor pages ============ */
.create-page {
  padding-top: 12px;     /* 마진 상쇄 방지 — 갭이 부모 안에서 #f5f5f5로 표시됨 */
  padding-bottom: 100px;
  background: #f5f5f5;
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100dvh - var(--header-h));
}

.tab-bar {
  display: flex;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: var(--header-h);
  z-index: 40;
}

.tab-bar__item {
  flex: 1;
  padding: 12px 0;
  font-size: 14px;
  color: var(--c-text-3);
  border-bottom: 2px solid transparent;
}

.tab-bar__item.is-active {
  color: var(--c-text);
  border-color: var(--c-primary);
  font-weight: 600;
}

.bottom-cta {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-w);
  padding: 12px 16px calc(12px + var(--safe-bottom));
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  display: grid;
  gap: 8px;
  z-index: 40;
}

/* 부고장 상세/미리보기: 하단 버튼 다크 톤 — 랜딩·히어로와 통일 */
.view:has(.obituary) .bottom-cta {
  background: #202020;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.view:has(.obituary) .bottom-cta .btn--secondary {
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), inset 0 -1px 0 rgba(0,0,0,.4);
}
.view:has(.obituary) .bottom-cta .btn--primary {
  background: #fff;
  color: #1a1a1a;
}

.bottom-cta--two {
  grid-template-columns: 1fr 1fr;
}

/* Photo upload */
.photo-upload {
  border: 1.5px dashed var(--c-border-2);
  border-radius: var(--r-md);
  padding: 24px;
  text-align: center;
  background: #fafafa;
  margin-bottom: 8px;
}

.photo-upload__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--c-border-2);
  border-radius: var(--r-sm);
  font-size: 13px;
}

.photo-upload__hint {
  font-size: 12px;
  color: var(--c-text-3);
  margin-top: 12px;
}

.photo-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: var(--r-md);
  overflow: hidden;
  background: #eee;
  margin-bottom: 12px;
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-preview.is-bw img {
  filter: grayscale(100%);
}

.photo-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px;
  gap: 12px;
}

.photo-controls .toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

/* My obituaries list */
.list {
  padding: 12px;
  background: #f5f5f5;
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100dvh - var(--header-h));
}

.list__card {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-1);
}

.list__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.list__name {
  font-size: 15px;
  font-weight: 600;
}

.list__name-date {
  font-size: 13px;
  font-weight: 400;
  color: var(--c-text-2);
  margin-left: 8px;
}

.list__date {
  font-size: 12px;
  color: var(--c-text-3);
}

.list__status {
  font-size: 12px;
  color: var(--c-text-2);
  padding: 2px 8px;
  background: #f3f3f3;
  border-radius: 999px;
}

.list__status--draft {
  background: #fff3e0;
  color: #8a4b00;
}

.list__status--ended {
  background: #e8eaf6;
  color: #3949ab;
}

.list__meta {
  font-size: 13px;
  color: var(--c-text-2);
  margin-bottom: 12px;
}

.list__meta .label {
  color: var(--c-text-3);
  margin-right: 6px;
}

.list__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.list__btn {
  height: 38px;
  border-radius: var(--r-sm);
  font-size: 13px;
  border: 1px solid var(--c-border-2);
  background: var(--c-surface);
}

.list__empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--c-text-3);
}

/* ============ Obituary view (preview & detail) ============ */
.obituary {
  background: var(--c-surface);
  min-height: 100%;
}

.obituary__hero {
  position: relative;
  padding: 28px 24px 48px;
  background: #202020;
  color: #fff;
  overflow: hidden;
}

.obituary__hero > *:not(.hero__petals) {
  position: relative;
  z-index: 2;
}

.hero__petals {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero__stage {
  width: 62%;
  aspect-ratio: 1 / 1;
  margin: 12px 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__sway {
  width: 100%;
  height: auto;
  transform-origin: 50% 90%;
  animation: landing-sway 3.6s ease-in-out infinite;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.4));
}

.hero__flower-badge {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: 999px;
  font-size: 12px;
  color: rgba(253, 224, 160, 0.92);
  z-index: 3;
  backdrop-filter: blur(4px);
}

.hero__flower-icon {
  font-size: 12px;
  color: rgba(251, 191, 36, 0.85);
}

.hero__flower-count {
  font-weight: 600;
  color: #fde68a;
  margin-left: 2px;
}

.hero__title {
  font-family: "Nanum Myeongjo", "Noto Serif KR", "Batang", "Apple SD Gothic Neo", serif;
  font-size: 26px;
  line-height: 1.5;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
  text-align: center;
}

.hero__notice {
  margin-top: 28px;
  padding-top: 22px;
  text-align: center;
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.hero__name {
  font-family: "Nanum Myeongjo", "Noto Serif KR", "Batang", serif;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 10px;
  letter-spacing: -0.2px;
}

.hero__sub {
  font-size: 13px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.65);
}

.obituary__hero .ribbon {
  font-size: 28px;
}

.obituary__hero .head-title {
  margin: 12px 0 4px;
  font-family: "Nanum Myeongjo", "Batang", serif;
  font-size: 30px;
  line-height: 1.3;
  font-weight: 700;
}

.obituary__hero .head-sub {
  font-size: 13px;
  color: #6b5942;
  margin-top: 6px;
}

.obituary__body {
  padding: 16px 16px 80px;
  background: var(--c-bg);
}

.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 16px;
  margin-bottom: 12px;
}

.card__title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--c-text-2);
  margin-bottom: 12px;
}

.card__title .ico {
  font-size: 14px;
  color: rgba(202, 151, 24, 0.9);
}

.deceased {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 28px;
  align-items: center;
}

.deceased__photo {
  position: relative;
  width: 100px;
  height: 125px;
  background: #eee;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 0 0 2px #1a1a1a;
}

.deceased__photo img {
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.deceased__photo.is-bw img {
  filter: grayscale(100%);
}

.deceased__name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.deceased__meta {
  font-size: 12px;
  color: var(--c-text-2);
}

.deceased__roles {
  font-size: 12px;
  color: var(--c-text-3);
  margin-top: 6px;
}

.def-list {
  font-size: 13px;
}

.def-list dt {
  color: var(--c-text-3);
  width: 70px;
  display: inline-block;
}

.def-list dd {
  display: inline;
}

.def-list .row {
  padding: 4px 0;
}

.message-block {
  font-size: 14px;
  color: var(--c-text-2);
  white-space: pre-wrap;
}

.venue {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0 10px;
}

.venue__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text);
}

.venue__addr {
  font-size: 13px;
  color: var(--c-text-2);
  line-height: 1.5;
}

.venue__tel {
  font-size: 13px;
  color: var(--c-text-2);
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}

.venue__link {
  display: inline-block;
  width: auto;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--c-border-2);
  font-family: inherit;
}

.venue__link:hover {
  color: var(--c-text);
  text-decoration-color: var(--c-text-2);
}

.venue__row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.card__action {
  height: 28px;
  padding: 0 12px;
  font-size: 12px;
  background: transparent;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  color: var(--c-text);
  cursor: pointer;
}

.card__action:hover {
  background: #f9f9f9;
}

.icon-btn {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--c-text-2);
  cursor: pointer;
  padding: 0;
}

.icon-btn:hover {
  color: var(--c-text);
}

.donation-item {
  padding: 10px 0;
}

.donation-item:first-child {
  padding-top: 4px;
}

.donation-item:last-child {
  padding-bottom: 0;
}

.donation-item + .donation-item {
  border-top: 1px solid var(--c-border);
}

.donation-item__row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--c-text);
}

.donation-item__row--account {
  margin-top: 6px;
  gap: 8px;
}

.donation-item__label {
  color: var(--c-text-2);
}

.donation-item__value {
  color: var(--c-text);
}

.donation-item__bank {
  color: var(--c-text);
}

.donation-item__account {
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
}

.venue__hp a {
  font-size: 12px;
  color: var(--c-text-3);
  text-decoration: underline;
}

.venue__map {
  width: 100%;
  height: 200px;
  margin-top: 12px;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f3f3;
  position: relative;
}

.venue__map-msg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text-3);
  font-size: 12px;
}


.copy-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--c-text-2);
}

.copy-row .label {
  color: var(--c-text-3);
}

.copy-row button {
  text-decoration: underline;
  font-size: 12px;
}

.text-btn {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--c-text);
  text-decoration: underline;
  font-size: 13px;
  cursor: pointer;
}

.text-btn--inline {
  font-size: 14px;
  color: var(--c-text);
}

.qr-box {
  width: 120px;
  height: 120px;
  margin: 8px 0;
  background: #f3f3f3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--c-text-3);
  border-radius: 6px;
}

.message-list-item {
  border-bottom: 1px solid var(--c-border);
  padding: 12px 0;
}

.message-list-item:last-child {
  border-bottom: 0;
}

.message-list-item .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--c-text-3);
  margin-bottom: 4px;
}

.message-list-item .name {
  color: var(--c-text);
  font-weight: 500;
}

.message-list-item .body {
  font-size: 14px;
  color: var(--c-text-2);
}

.fab {
  position: fixed;
  bottom: calc(24px + var(--safe-bottom));
  right: 50%;
  transform: translateX(min(220px, 50vw - 24px));
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--c-primary);
  color: #fff;
  font-size: 26px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}

/* ============ Slide menu ============ */
.slide-menu {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  overflow: hidden;
}

.slide-menu[aria-hidden="false"] {
  pointer-events: auto;
}

.slide-menu__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .3);
  opacity: 0;
  transition: opacity .2s;
  z-index: 1;
}

.slide-menu[aria-hidden="false"] .slide-menu__backdrop {
  opacity: 1;
}

.slide-menu__panel {
  position: absolute;
  top: 0;
  right: max(0px, calc((100vw - var(--max-w)) / 2));
  width: min(78%, calc(var(--max-w) * 0.78));
  height: 100%;
  background: var(--c-surface);
  transform: translateX(calc(100% + max(0px, (100vw - var(--max-w)) / 2)));
  transition: transform .25s;
  display: flex;
  flex-direction: column;
  padding-top: 50px;
  z-index: 2;
}

.slide-menu[aria-hidden="false"] .slide-menu__panel {
  transform: translateX(0);
}

.slide-menu__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  font-size: 26px;
}

.slide-menu__nav {
  padding: 16px 20px;
  flex: 1;
}

.slide-menu__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 0;
  font-size: 15px;
}

.slide-menu__footer {
  padding: 16px 20px calc(20px + var(--safe-bottom));
  display: flex;
  gap: 16px;
  border-top: 1px solid var(--c-border);
}

.slide-menu__link {
  font-size: 12px;
  color: var(--c-text-2);
  text-decoration: underline;
}

/* ============ Bottom sheet ============ */
.bottom-sheet {
  position: fixed;
  inset: 0;
  z-index: 140;
  pointer-events: none;
  max-width: var(--max-w);
  margin: 0 auto;
}

.bottom-sheet[aria-hidden="false"] {
  pointer-events: auto;
}

.bottom-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: var(--c-overlay);
  opacity: 0;
  transition: opacity .2s;
}

.bottom-sheet[aria-hidden="false"] .bottom-sheet__backdrop {
  opacity: 1;
}

.bottom-sheet__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--c-surface);
  border-radius: 16px 16px 0 0;
  padding: 18px 18px calc(18px + var(--safe-bottom));
  transform: translateY(100%);
  transition: transform .25s, bottom .15s ease-out, max-height .15s ease-out;
  max-height: 80vh;       /* fallback */
  max-height: 80dvh;      /* 실제 가시 영역 기준 (iOS URL bar 포함) */
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.bottom-sheet[aria-hidden="false"] .bottom-sheet__panel {
  transform: translateY(0);
}

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

.sheet-title {
  font-size: 16px;
  font-weight: 600;
}

.sheet-close {
  width: 32px;
  height: 32px;
  font-size: 20px;
}

/* Share buttons */
.share-url {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: #fafafa;
}

.share-url__text {
  flex: 1;
  font-size: 12px;
  color: var(--c-text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  cursor: pointer;
}

.share-url__btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  background: var(--c-text);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}

.share-url__btn:hover {
  background: #333;
}

.share-url__btn.is-done {
  background: var(--c-success);
}

.share-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.share-list button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 12px;
  border-radius: var(--r-md);
  background: #f7f7f7;
  font-size: 14px;
  text-align: left;
}

.share-list .icon {
  font-size: 20px;
  width: 24px;
}

/* ============ Modal ============ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
  max-width: var(--max-w);
  margin: 0 auto;
}

.modal[aria-hidden="false"] {
  pointer-events: auto;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: var(--c-overlay);
  opacity: 0;
  transition: opacity .15s;
}

.modal[aria-hidden="false"] .modal__backdrop {
  opacity: 1;
}

.modal__panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 48px);
  max-width: 360px;
  background: var(--c-surface);
  border-radius: var(--r-lg);
  padding: 22px 20px 16px;
  opacity: 0;
  transition: opacity .15s;
}

.modal[aria-hidden="false"] .modal__panel {
  opacity: 1;
}

.modal__title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.modal__desc {
  font-size: 13px;
  color: var(--c-text-2);
  margin-bottom: 18px;
  white-space: pre-line;
}

.modal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.modal__actions--single {
  grid-template-columns: 1fr;
}

.modal__actions .btn {
  height: 42px;
}

/* ============ Full popup (photo editor, etc.) ============ */
.full-popup {
  position: fixed;
  inset: 0;
  z-index: 130;
  pointer-events: none;
  max-width: var(--max-w);
  margin: 0 auto;
  background: var(--c-bg);
  transform: translateY(100%);
  transition: transform .25s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.full-popup[aria-hidden="false"] {
  pointer-events: auto;
  transform: translateY(0);
}

.full-popup__panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fp-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 8px 0 16px;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  z-index: 2;
  flex-shrink: 0;
}

.fp-header__title {
  font-size: 16px;
  font-weight: 600;
}

.fp-header__menu,
.fp-header__close,
.fp-header__back {
  width: 40px;
  height: 40px;
  font-size: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fp-header__back {
  font-size: 26px;
  line-height: 1;
}

.fp-header--simple {
  justify-content: flex-start;
  padding: 0 8px;
  gap: 4px;
}

.fp-header--simple .fp-header__title {
  font-weight: 600;
}

.fp-header--title-x {
  justify-content: space-between;
  padding: 0 8px 0 16px;
}

.fp-header--title-x .fp-header__title {
  flex: 1;
  font-weight: 600;
}

.fp-body {
  flex: 1;
  padding: 16px;
  background: var(--c-surface);
  overflow-y: auto;
}

.fp-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 16px calc(12px + var(--safe-bottom));
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  flex-shrink: 0;
}

.photo-editor__dropzone {
  border: 1.5px dashed var(--c-border-2);
  border-radius: var(--r-md);
  padding: 40px 20px;
  text-align: center;
  background: #fafafa;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.photo-editor__dropzone .hint {
  font-size: 12px;
  color: var(--c-text-3);
  margin-top: 12px;
  line-height: 1.6;
}

.photo-editor__stage {
  position: relative;
  aspect-ratio: 4/5;
  background: #1a1a1a;
  border-radius: var(--r-md);
  overflow: hidden;
  touch-action: none;
  user-select: none;
  cursor: grab;
}

.photo-editor__stage.is-dragging {
  cursor: grabbing;
}

.photo-editor__stage.is-bw img {
  filter: grayscale(100%);
}

.photo-editor__stage img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
  max-width: none;
}

.photo-editor__crop {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 85%;
  aspect-ratio: 3/4;
  border: 2px solid var(--c-success);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  z-index: 2;
}

.photo-editor__stage.is-bw img {
  filter: grayscale(100%);
}

.photo-editor__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .5) 1px, transparent 1px);
  background-size: 33.33% 33.33%;
  pointer-events: none;
}

.photo-editor__zoom {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 4px 4px;
}

.photo-editor__zoom input[type=range] {
  flex: 1;
}

.photo-editor__bw {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px;
  font-size: 13px;
  color: var(--c-text-2);
}

.photo-combobox {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.photo-combobox button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px;
  border-radius: var(--r-md);
  background: #f7f7f7;
  font-size: 14px;
}

.photo-combobox .ico {
  font-size: 18px;
  color: var(--c-text-2);
}

.photo-filled {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  align-items: center;
  background: #fafafa;
  padding: 12px;
  border-radius: var(--r-md);
}

.photo-filled__thumb {
  position: relative;
  width: 96px;
  height: 120px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
}

.photo-filled__thumb img {
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.photo-filled.is-bw .photo-filled__thumb img {
  filter: grayscale(100%);
}

.photo-filled__meta {
  font-size: 13px;
  color: var(--c-text-2);
}

.photo-filled__meta .title {
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 4px;
}

.photo-filled__actions {
  margin-top: 10px;
  display: flex;
  gap: 6px;
}

.photo-filled__actions .btn {
  height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

/* ============ Light particles (헌화 인터랙션) ============ */
.light-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  overflow: hidden;
}

.light-particle {
  position: absolute;
  width: var(--size, 10px);
  height: var(--size, 10px);
  margin-left: calc(var(--size, 10px) / -2);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%,
    rgba(255, 250, 220, 1) 0%,
    rgba(255, 224, 150, 0.95) 35%,
    rgba(255, 200, 110, 0) 75%);
  box-shadow:
    0 0 8px rgba(255, 230, 160, 0.9),
    0 0 16px rgba(255, 210, 130, 0.55);
  opacity: 0;
  will-change: transform, opacity;
  animation: light-rise var(--duration, 2400ms) ease-out var(--delay, 0ms) forwards;
}

@keyframes light-rise {
  0%   { transform: translate(0, 0) scale(0.6); opacity: 0; }
  10%  { opacity: 1; transform: translate(0, -10px) scale(1); }
  55%  { opacity: 0.95; }
  100% { transform: translate(var(--drift, 30px), -260px) scale(0.6); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .light-particle { animation: none; opacity: 0; }
}

/* ============ Toast ============ */
.toast {
  position: fixed;
  bottom: calc(40px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: #2a2a2a;
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  max-width: calc(100% - 40px);
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
}

.toast.is-show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(-4px);
}

.toast__msg {
  flex: 1;
  text-align: left;
}

.toast__close {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  color: #fff;
  opacity: .85;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.toast__close:hover {
  opacity: 1;
}

/* ============ Address / Bank search ============ */
.search-input {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.search-input .input {
  flex: 1;
}

.search-input--icon {
  position: relative;
  align-items: center;
  justify-content: center;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.search-input--icon .search-input__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-text-3);
  pointer-events: none;
}

.search-input--icon .input {
  padding-left: 40px;
  text-align: left;
}

.search-results {
  max-height: 50vh;
  overflow-y: auto;
}

.search-results .item {
  width: 100%;
  padding: 12px;
  border-bottom: 1px solid var(--c-border);
  text-align: left;
  font-size: 14px;
}

.search-results .item {
  display: block;
  background: #fff;
  cursor: pointer;
}

.search-results .item:hover {
  background: #f9f9f9;
}

.search-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--c-border);
  cursor: pointer;
}

.search-item:hover {
  background: #f9f9f9;
}

.search-item__info {
  flex: 1;
  min-width: 0;
}

.search-item__btn {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 14px;
  background: transparent;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--c-text);
  cursor: pointer;
}

.search-item .addr-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-item .road {
  font-size: 13px;
  color: var(--c-text-2);
  margin-top: 2px;
}

.search-item .jibun {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--c-text-3);
  margin-top: 4px;
}

.search-item .jibun .tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--c-border);
  color: var(--c-text-3);
  font-size: 11px;
}

.search-item .zip-chip {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: #f0f0f0;
  color: var(--c-text-3);
  font-size: 11px;
  line-height: 1.6;
}

.search-results .item .addr-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 4px;
}

.search-results .item .road {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--c-text-2);
  margin-top: 2px;
}

.search-results .item .road .zip-chip {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: #f0f0f0;
  color: var(--c-text-3);
  font-size: 11px;
  line-height: 1.6;
  flex: 0 0 auto;
}

.search-results .item .jibun {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--c-text-3);
  margin-top: 4px;
}

.search-results .item .jibun .tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--c-border);
  color: var(--c-text-3);
  font-size: 11px;
  line-height: 1.6;
  flex: 0 0 auto;
}

.search-empty {
  padding: 40px 12px;
  text-align: center;
  color: var(--c-text-3);
  font-size: 13px;
  line-height: 1.6;
}

.search-summary {
  padding: 8px 4px 10px;
  font-size: 12px;
  color: var(--c-text-3);
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 16px 0 8px;
}

.pagination__btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--c-border);
  background: #fff;
  border-radius: 6px;
  font-size: 13px;
  color: var(--c-text-2);
  cursor: pointer;
}

.pagination__btn:hover:not(:disabled) {
  background: #f5f5f5;
}

.pagination__btn.is-on {
  background: var(--c-text);
  color: #fff;
  border-color: var(--c-text);
  font-weight: 600;
}

.pagination__btn:disabled {
  opacity: 0.35;
  cursor: default;
}

/* Tag chips for relations */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: #f0f0f0;
  font-size: 13px;
  color: var(--c-text-2);
  border: 1px solid transparent;
}

.chip.is-on {
  background: var(--c-primary);
  color: #fff;
}

/* Privacy/Terms */
.policy {
  padding: 20px 18px 32px;
  background: var(--c-surface);
  min-height: 100%;
  font-size: 13px;
  color: var(--c-text-2);
  line-height: 1.75;
}

.policy p {
  margin-bottom: 12px;
}

.policy__intro {
  background: #f7f7f7;
  border-left: 3px solid var(--c-text-3);
  padding: 12px 14px;
  margin-bottom: 22px;
  color: var(--c-text);
  font-size: 13px;
  line-height: 1.7;
}

.policy h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--c-text);
  margin: 22px 0 10px;
  padding-top: 4px;
}

.policy h3:first-of-type {
  margin-top: 0;
}

.policy ol,
.policy ul {
  padding-left: 18px;
  margin-bottom: 12px;
}

.policy ol > li,
.policy ul > li {
  margin-bottom: 6px;
}

.policy ol ul,
.policy ul ul {
  margin-top: 4px;
  margin-bottom: 0;
  padding-left: 16px;
  list-style: disc;
  color: var(--c-text-3);
}

.policy ol ul li,
.policy ul ul li {
  margin-bottom: 2px;
  font-size: 12.5px;
}

.policy__footer {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--c-border);
  font-size: 12px;
  color: var(--c-text-3);
  line-height: 1.6;
}

/* End page */
.ended {
  padding: 40px 24px;
  background: var(--c-surface);
  text-align: left;
  min-height: 100%;
}

.ended .ribbon {
  font-size: 36px;
  margin-bottom: 18px;
}

.ended .label {
  font-size: 12px;
  color: var(--c-text-3);
  margin-bottom: 6px;
}

.ended h2 {
  font-size: 22px;
  margin-bottom: 14px;
}

.ended p {
  font-size: 14px;
  color: var(--c-text-2);
  line-height: 1.8;
}

/* Helpers */
.text-center {
  text-align: center;
}

.muted {
  color: var(--c-text-3);
}

.divider {
  height: 1px;
  background: var(--c-border);
  margin: 12px 0;
}

.spacer-12 {
  height: 12px;
}

.spacer-20 {
  height: 20px;
}