:root {
  --ink: #202a24;
  --muted: #727a72;
  --line: #e7e9e2;
  --paper: #f7f8f4;
  --green: #315944;
  --green2: #496f58;
  --lime: #dce8cf;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: 'DM Sans', Arial, sans-serif;
  --display: 'Manrope', 'DM Sans', Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px var(--sans); }
.app-shell { max-width: 1216px; margin: auto; padding: 0 42px; }
.hidden { display: none !important; }
main { min-height: calc(100vh - 142px); }

.topbar { height: 82px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font: 800 23px var(--display); letter-spacing: -1.3px; }
.brand-mark { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 11px; background: var(--green); color: #fff; font: 700 19px var(--serif); }
.brand-dot { color: #91a86c; }
.topbar-right { display: flex; align-items: center; gap: 28px; }
.top-note { color: #899087; font-size: 13px; }
.account { display: flex; align-items: center; gap: 10px; color: #59635b; font-size: 13px; }
.account img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.account button { border: 0; background: none; color: var(--green); cursor: pointer; font: 600 13px var(--sans); }

.auth-view { min-height: 660px; padding: 58px 3.5%; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 50px; }
.auth-copy { max-width: 510px; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: #687867; font-size: 11px; font-weight: 700; letter-spacing: 1.65px; }
.eyebrow-line { width: 25px; height: 1px; background: #9ab183; }
.auth-copy h1 { margin: 24px 0 20px; font: 600 clamp(44px, 5.2vw, 66px)/1.1 var(--display); letter-spacing: -3.2px; }
.auth-copy h1 em { color: var(--green2); font: italic 500 1.04em var(--serif); letter-spacing: -2.5px; }
.auth-copy > p { max-width: 410px; margin-bottom: 29px; color: var(--muted); font-size: 16px; line-height: 1.75; }
.auth-copy .auth-footnote { margin-top: 16px; color: #91978d; font-size: 12px; }
.button { min-height: 48px; padding: 0 21px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; border: 0; border-radius: 7px; cursor: pointer; font: 600 14px var(--sans); transition: transform .18s, filter .18s; }
.button:hover { transform: translateY(-1px); filter: brightness(1.04); }
.button-dark { background: var(--green); color: #fff; }
.google-g { color: #fff; font: bold 18px Arial, sans-serif; }
.button-light { background: #eef2e9; color: #365841; }
.button-outline { border: 1px solid #dfe3da; background: #fff; color: #556158; }
.button-danger { background: #fff2ee; color: #9d513e; }
.button-small { min-height: 34px; padding: 0 12px; font-size: 12px; }

.auth-art { height: 430px; position: relative; display: grid; place-items: center; overflow: hidden; border-radius: 190px 190px 16px 16px; background: #e7ecdf; }
.auth-art::before { position: absolute; top: 54px; left: 50%; width: 310px; height: 310px; border-radius: 50%; background: #d9e2d0; content: ''; transform: translateX(-50%); }
.art-orbit { position: absolute; top: 21px; left: 50%; width: 380px; height: 380px; border: 1px solid #c9d4c2; border-radius: 50%; transform: translateX(-50%); }
.orbit-two { top: -17px; width: 455px; height: 455px; border-color: #d6ded0; }
.gift { position: absolute; background: #bc7558; box-shadow: 0 24px 42px #6e61442b; }
.gift-large { top: 166px; left: calc(50% - 110px); width: 190px; height: 156px; border-radius: 5px; background: #b46d51; transform: rotate(-8deg); }
.gift-large::before { position: absolute; left: 77px; width: 36px; height: 100%; background: #d8a26e; content: ''; }
.gift-large::after { position: absolute; top: 57px; width: 100%; height: 25px; background: #d8a26e; content: ''; }
.gift-bow::before, .gift-bow::after { position: absolute; z-index: 2; top: -14px; left: 67px; width: 37px; height: 22px; border: 7px solid #d8a26e; border-radius: 50% 50% 0 50%; content: ''; transform: rotate(30deg); }
.gift-bow::after { left: 89px; transform: scaleX(-1) rotate(30deg); }
.gift-small { top: 269px; left: calc(50% + 17px); width: 114px; height: 96px; border-radius: 4px; background: #d9b26c; box-shadow: 0 18px 30px #6e61442b; transform: rotate(8deg); }
.gift-small::before { position: absolute; left: 46px; width: 22px; height: 100%; background: #f1d49c; content: ''; }
.gift-small::after { position: absolute; top: 35px; width: 100%; height: 19px; background: #f1d49c; content: ''; }
.art-spark { position: absolute; color: #9aaf7e; font-size: 29px; }
.spark-one { top: 118px; left: 25%; }
.spark-two { top: 203px; right: 18%; font-size: 22px; }
.art-note { position: absolute; right: 10%; bottom: 38px; color: #63715d; font: italic 15px/1.3 var(--serif); text-align: center; transform: rotate(-6deg); }
.art-note strong { font-size: 23px; }

.welcome-row { padding: 49px 0 32px; display: flex; align-items: flex-end; justify-content: space-between; }
.page-title { margin: 14px 0 7px; font: 600 clamp(33px, 4vw, 46px)/1.15 var(--display); letter-spacing: -1.9px; }
.page-subtitle { margin: 0; color: var(--muted); font-size: 15px; }
.season-badge { padding: 11px 15px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcf9; color: #737c70; font-size: 10px; line-height: 1.5; letter-spacing: .65px; }
.season-badge b { color: #405b45; font-size: 10px; letter-spacing: .9px; }
.season-icon { color: #91a86c; font-size: 26px; }
.tabs { display: flex; gap: 34px; border-bottom: 1px solid var(--line); }
.tab { position: relative; padding: 0 0 15px; border: 0; background: none; color: #898f86; cursor: pointer; font: 500 14px var(--sans); }
.tab.active { color: var(--green); font-weight: 700; }
.tab.active::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--green); content: ''; }
.page-panel { padding: 27px 0 55px; }

.section-heading { margin: 0 0 18px; display: flex; align-items: center; justify-content: space-between; }
.section-heading h2 { margin: 0; font: 700 17px var(--display); letter-spacing: -.3px; }
.section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.member-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.member-card { min-height: 88px; padding: 20px; display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-align: left; cursor: pointer; transition: .2s; }
.member-card:hover, .member-card.selected { border-color: #a8bb9b; box-shadow: 0 5px 20px #3c584512; transform: translateY(-1px); }
.avatar { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--lime); color: #47654e; font: 600 16px var(--display); }
.member-card:nth-child(3n+2) .avatar { background: #f2e1d3; color: #96654d; }
.member-card:nth-child(3n) .avatar { background: #e5e5f0; color: #666884; }
.member-meta { min-width: 0; flex: 1; }
.member-name { overflow: hidden; display: block; font: 700 14px var(--display); text-overflow: ellipsis; white-space: nowrap; }
.member-count { margin-top: 4px; color: #858b82; font-size: 12px; }
.member-chevron { color: #a2a99f; font-size: 19px; }
.gift-area { margin-top: 37px; }
.gift-area-top { margin-bottom: 17px; display: flex; align-items: center; justify-content: space-between; }
.gift-area-top h2 { margin: 0; font: 700 18px var(--display); }
.gift-area-top p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.gift-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.gift-card { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.gift-image { height: 155px; display: grid; place-items: center; overflow: hidden; background: #f0f1ec; color: #a2a89f; }
.gift-image img { width: 100%; height: 100%; object-fit: contain; background: #f4f5f0; }
.gift-image .placeholder { color: #a1b397; font-size: 30px; }
.gift-image.is-desaturated img { filter: grayscale(1); opacity: .46; }
.gift-content { padding: 15px 16px 17px; }
.gift-category { color: #84917c; font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.gift-name { margin: 7px 0 5px; font: 700 15px/1.4 var(--display); overflow-wrap: anywhere; }
.gift-price { margin-bottom: 12px; color: var(--green); font: 600 14px var(--display); }
.gift-actions { display: flex; align-items: center; justify-content: flex-start; gap: 9px; flex-wrap: wrap; }
.gift-link { padding-bottom: 2px; border-bottom: 1px solid #b8c6b0; color: var(--green); font-size: 12px; font-weight: 600; text-decoration: none; }
.gift-actions .button { min-height: 32px; }
.reservation-status { margin: -5px 0 11px; color: #7d6751; font-size: 12px; font-weight: 600; }
.empty-state { padding: 45px 20px; border: 1px dashed #d9ded4; border-radius: 10px; background: #fbfcf9; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 5px; color: var(--ink); font: 700 15px var(--display); }
.empty-icon { margin-bottom: 11px; color: #91a86c; font-size: 26px; }

.mine-head, .admin-head { margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; }
.mine-head h2, .admin-head h2 { margin: 0; font: 700 18px var(--display); }
.mine-head p, .admin-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.name-setting { margin-bottom: 25px; padding: 18px 20px; display: flex; align-items: center; gap: 16px; border-radius: 9px; background: #edf1e8; }
.name-setting label { font-size: 13px; font-weight: 700; white-space: nowrap; }
.name-setting input { max-width: 310px; }
.field { width: 100%; height: 43px; padding: 0 12px; border: 1px solid #dfe3da; border-radius: 6px; outline: none; background: #fff; color: var(--ink); font: 14px var(--sans); }
.field:focus { border-color: #91a886; box-shadow: 0 0 0 3px #91a88624; }
.form-card { max-width: 100%; margin-top: 25px; padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.form-card h3 { margin: 0 0 17px; font: 700 16px var(--display); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 600; }
.form-group.full { grid-column: 1 / -1; }
.form-help { display: block; margin-top: 6px; color: #929990; font-size: 11px; }
.image-preview { width: 120px; height: 100px; margin-top: 10px; display: grid; place-items: center; overflow: hidden; border-radius: 6px; background: #f0f1ec; color: #9faa96; }
.image-preview img { width: 100%; height: 100%; object-fit: contain; background: #f4f5f0; }
.form-actions { margin-top: 17px; display: flex; justify-content: flex-end; gap: 9px; }
.my-list-heading { margin: 31px 0 14px; }
.my-list-heading h2 { margin: 0; font: 700 18px var(--display); }
.my-list-heading p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.gift-row { margin-bottom: 10px; padding: 11px 14px; display: grid; grid-template-columns: 90px minmax(0, 1fr) 30px auto; align-items: center; gap: 16px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.row-thumb { width: 90px; height: 68px; display: grid; place-items: center; overflow: hidden; border-radius: 5px; background: #f0f1ec; color: #9faa96; }
.row-thumb img { width: 100%; height: 100%; object-fit: contain; background: #f4f5f0; }
.row-info { min-width: 0; overflow: hidden; }
.row-title { overflow: hidden; font: 700 14px var(--display); text-overflow: ellipsis; white-space: nowrap; }
.row-price { margin-top: 5px; color: var(--green); font-size: 13px; }
.row-link { width: 100%; min-width: 0; max-width: 100%; margin-top: 4px; display: block; overflow: hidden; color: #788379; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.drag-handle { padding: 6px; border: 0; background: transparent; color: #889184; cursor: grab; font-size: 22px; line-height: 1; touch-action: none; }
.drag-handle:active { cursor: grabbing; }
.gift-row.is-dragging { opacity: .45; }
.gift-row.drop-target { border-color: #87a27b; background: #f8fbf5; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.admin-box { max-width: 740px; padding: 22px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.admin-entry { display: flex; gap: 10px; }
.admin-list { margin-top: 18px; border-top: 1px solid var(--line); }
.admin-person { padding: 13px 1px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.admin-person > span { min-width: 0; overflow-wrap: anywhere; color: #39483d; }
.hint-box { margin-top: 17px; padding: 13px 15px; border-radius: 6px; background: #f4f6f0; color: #687467; font-size: 12px; line-height: 1.55; }

.modal-backdrop { position: fixed; z-index: 5; inset: 0; padding: 24px; display: grid; place-items: center; overflow-y: auto; background: #16231db3; }
.modal { position: relative; width: min(500px, 100%); padding: 24px; border-radius: 12px; background: #fff; box-shadow: 0 22px 65px #10201640; }
.modal-close { position: absolute; top: 14px; right: 16px; border: 0; background: none; color: #899087; cursor: pointer; font-size: 24px; }
.modal h2 { margin: 0 34px 18px 0; font: 700 20px var(--display); }
.preview-gift { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; }
.preview-gift .gift-image { height: 210px; }
.preview-gift .gift-content { padding: 18px; }
.preview-link { margin-top: 6px; display: inline-block; color: var(--green); font-size: 13px; font-weight: 600; }
.modal-buttons { margin-top: 19px; display: flex; justify-content: flex-end; gap: 9px; }
.toast { position: fixed; z-index: 10; bottom: 22px; left: 50%; max-width: calc(100% - 30px); padding: 12px 17px; transform: translate(-50%, 15px); border-radius: 7px; background: #253b2e; color: #fff; font-size: 13px; opacity: 0; pointer-events: none; transition: .2s; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
footer { height: 60px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: #8b9188; font-size: 11px; }
footer span:first-child { color: #5a685b; font: 800 14px var(--display); letter-spacing: -.5px; }

@media (max-width: 780px) {
  .app-shell { padding: 0 23px; }
  .auth-view { min-height: 0; padding: 51px 2%; grid-template-columns: 1fr; gap: 24px; }
  .auth-art { width: 100%; max-width: 480px; height: 300px; margin: 0 auto; }
  .gift-large { top: 105px; }
  .gift-small { top: 205px; }
  .auth-art::before { top: 10px; }
  .art-orbit { top: -20px; }
  .orbit-two { top: -60px; }
  .welcome-row { padding-top: 37px; }
  .season-badge { display: none; }
  .member-grid, .gift-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .member-card { padding: 14px; gap: 10px; }
  .tabs { gap: 24px; }
  .tab { font-size: 13px; }
  .gift-row { grid-template-columns: 63px minmax(0, 1fr) 28px; gap: 11px; padding: 9px; }
  .row-thumb { width: 63px; height: 58px; grid-column: 1; grid-row: 1; }
  .row-info { grid-column: 2; grid-row: 1; }
  .gift-row .drag-handle { grid-column: 3; grid-row: 1; }
  .row-actions { grid-column: 1 / -1; justify-content: flex-end; }
}
@media (max-width: 520px) {
  .app-shell { padding: 0 17px; }
  .topbar { height: 69px; }
  .top-note { display: none; }
  .auth-copy h1 { font-size: 46px; }
  .auth-art { height: 260px; }
  .welcome-row { padding: 32px 0 25px; }
  .page-title { font-size: 34px; }
  .tabs { gap: 18px; }
  .tab { font-size: 12px; }
  .member-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .member-card { min-height: 78px; padding: 10px; }
  .avatar { width: 37px; height: 37px; }
  .member-name { font-size: 12px; }
  .member-count { font-size: 11px; }
  .member-chevron { display: none; }
  .gift-grid { grid-template-columns: 1fr; }
  .gift-image { height: 190px; }
  .name-setting { align-items: flex-start; flex-direction: column; gap: 9px; }
  .name-setting input { max-width: 100%; }
  .row-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group.full { grid-column: auto; }
  .admin-entry { flex-direction: column; }
  .admin-entry .button { width: 100%; }
  .admin-person { align-items: flex-start; flex-direction: column; }
  footer { font-size: 10px; }
}
