/* ============================================================
   SHINWA MEMBER OS  ―  Screen layouts (Ver.2.0 Premium)
   ============================================================ */

/* ---------- App header ---------- */
.appbar { display: flex; align-items: center; justify-content: space-between; padding: 8px var(--pad) 6px; }
.appbar__greet { font-size: 12px; color: var(--text-2); font-weight: 700; letter-spacing: .01em; }
.appbar__name { font-size: var(--fs-20); font-weight: 900; letter-spacing: .01em; margin-top: 1px; }
.appbar__name b { color: var(--primary-deep); }
.appbar__actions { display: flex; gap: 10px; }
.dotbadge::after { content:""; position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-error); box-shadow: 0 0 0 2px var(--surface); }

/* ---------- Sub header ---------- */
.subbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 10px var(--pad); background: var(--nav-bg); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); }
.subbar__title { font-size: var(--fs-18); font-weight: 800; flex: 1; }

/* ---------- Daily bonus ---------- */
.daily { margin: 4px var(--pad) 0; border-radius: var(--r-card); padding: 14px 16px; background: var(--grad-gold); color: #3a2c05; display: flex; align-items: center; gap: 12px; box-shadow: var(--sh-gold); }
.daily__ico { width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.34); display: flex; align-items: center; justify-content: center; }
.daily__t { font-weight: 900; font-size: 15px; }
.daily__s { font-size: 12px; font-weight: 700; opacity: .82; margin-top: 1px; }
.daily .btn--sm { background: #3a2c05; color: var(--brand-gold-lt); box-shadow: none; }

/* streak */
.streak { display: flex; gap: 6px; margin: 16px var(--pad) 0; }
.streak__d { flex: 1; text-align: center; padding: 10px 0; border-radius: 12px; background: var(--surface); box-shadow: var(--sh-sm); font-size: 11px; color: var(--text-3); font-weight: 700; }
.streak__d.on { background: var(--green-soft); color: var(--brand-green-deep); }
.streak__d .n { display: flex; align-items: center; justify-content: center; height: 20px; margin-bottom: 3px; }

/* horizontal scroll */
.hscroll { display: flex; gap: 14px; overflow-x: auto; padding: 2px var(--pad) 8px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hcoupon { flex: 0 0 252px; }
.hstore { flex: 0 0 132px; }
.hstore__img { width: 132px; height: 92px; border-radius: 14px; object-fit: cover; box-shadow: var(--sh-card); background: var(--surface-2); }
.hstore__name { font-size: 13px; font-weight: 800; margin-top: 9px; }
.hstore__meta { font-size: 11.5px; color: var(--text-2); display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.hstore__meta .ic { color: var(--text-3); }

/* campaign banner */
.banner { margin: 0 var(--pad); border-radius: var(--r-card); overflow: hidden; position: relative; box-shadow: var(--sh-card); aspect-ratio: 2/1; }
.banner img { width: 100%; height: 100%; object-fit: cover; }
.banner__ov { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(14,18,28,.74) 0%, rgba(14,18,28,.12) 72%); display: flex; flex-direction: column; justify-content: center; padding: 0 22px; color: #fff; }
.banner__k { font-size: 11px; font-weight: 800; letter-spacing: .16em; color: var(--brand-gold-lt); }
.banner__t { font-size: 20px; font-weight: 900; line-height: 1.3; margin-top: 5px; max-width: 72%; }

.dot-unread { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-green); flex: 0 0 8px; }

/* ---------- Coupon detail ---------- */
.detail__hero { position: relative; aspect-ratio: 4/3; background: var(--surface-2); }
.detail__hero img { width: 100%; height: 100%; object-fit: cover; }
.detail__hero .coupon__badges { top: 64px; left: 20px; }
.detail__topbar { position: absolute; top: 0; left: 0; right: 0; z-index: 5; display: flex; align-items: center; padding: 10px var(--pad); }
.detail__card { position: relative; margin-top: -28px; background: var(--surface); border-radius: 26px 26px 0 0; padding: 22px var(--pad) 20px; }
.detail__store { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.detail__store img { width: 44px; height: 44px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--border); }
.detail__title { font-size: 22px; font-weight: 900; line-height: 1.4; letter-spacing: .004em; }
.priceblock { display: flex; align-items: baseline; gap: 12px; margin: 16px 0; padding: 18px; background: var(--green-soft); border-radius: var(--r-md); }
.priceblock .v { font-family: var(--num); font-size: 44px; font-weight: 900; color: var(--brand-green-deep); line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.priceblock .w { font-size: 14px; color: var(--text-3); text-decoration: line-through; }
.spec { display: grid; grid-template-columns: 96px 1fr; margin-top: 8px; }
.spec dt { font-size: 13px; color: var(--text-2); padding: 13px 0; border-bottom: 1px solid var(--border-2); font-weight: 700; }
.spec dd { font-size: 14px; font-weight: 700; padding: 13px 0; border-bottom: 1px solid var(--border-2); }
.spec dt:last-of-type, .spec dd:last-of-type { border-bottom: none; }
.notice { background: var(--gold-soft); border: 1px solid rgba(201,162,77,.32); border-radius: var(--r-md); padding: 14px 16px; margin-top: 18px; }
.notice h4 { font-size: 13px; font-weight: 800; color: var(--brand-gold); margin-bottom: 7px; display: flex; align-items: center; gap: 7px; }
.notice li { font-size: 12.5px; color: var(--text-2); line-height: 1.7; list-style: none; padding-left: 15px; position: relative; }
.notice li::before { content:""; position: absolute; left: 3px; top: 9px; width: 4px; height: 4px; border-radius: 50%; background: var(--brand-gold); }

/* sticky action bar */
.actionbar { position: sticky; bottom: 0; background: var(--nav-bg); backdrop-filter: blur(16px); border-top: 1px solid var(--border); padding: 12px var(--pad) 16px; display: flex; gap: 12px; align-items: center; z-index: 20; }
.actionbar .iconbtn { flex: 0 0 54px; width: 54px; height: 54px; box-shadow: inset 0 0 0 1.5px var(--border); }

/* ---------- Use / confirm / scan ---------- */
.usewrap { padding: 8px var(--pad) 20px; text-align: center; }
.usewrap h2 { font-size: 22px; font-weight: 900; margin: 6px 0; }
.qrbox { width: 236px; height: 236px; margin: 22px auto; border-radius: 24px; background: #fff; box-shadow: var(--sh-card); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; box-shadow: var(--sh-card), inset 0 0 0 1px var(--border); }
.qrbox img { width: 196px; height: 196px; }
.qrbox__scan { position: absolute; left: 18px; right: 18px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--brand-green), transparent); box-shadow: 0 0 14px var(--brand-green); animation: scan 2.4s var(--ease) infinite; }
@keyframes scan { 0%{top:22px} 50%{top:210px} 100%{top:22px} }
.timerpill { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: var(--r-pill); background: var(--brand-navy); color: #fff; font-weight: 800; font-size: 14px; }
.timerpill b { color: var(--brand-gold-lt); font-variant-numeric: tabular-nums; }
.usecode { font-family: var(--num); font-size: 34px; font-weight: 900; letter-spacing: .3em; color: var(--text); font-variant-numeric: tabular-nums; margin: 8px 0; }
.securehint { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); font-weight: 700; margin-top: 10px; }
.securehint .ic { color: var(--brand-green-deep); }
.confirmcard { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--sh-card); padding: 18px; margin: 14px var(--pad); text-align: left; }
.confirmcard .ttl { font-size: 16px; font-weight: 800; }
.confirmcard .amt { font-family: var(--num); font-size: 30px; font-weight: 900; color: var(--brand-green-deep); margin: 4px 0 2px; letter-spacing: -.02em; }

/* ---------- Member card ---------- */
.memberscreen { padding: 4px var(--pad) 20px; }
.membercard { border-radius: 26px; padding: 24px 22px; color: #fff; position: relative; overflow: hidden; background: var(--grad-member); box-shadow: var(--sh-md); }
.membercard::before { content:""; position: absolute; top: -40%; right: -20%; width: 70%; height: 120%; background: radial-gradient(circle, rgba(201,162,77,.34), transparent 62%); }
.membercard::after { content:""; position: absolute; inset: 0; border-radius: 26px; border: 1px solid rgba(255,255,255,.22); pointer-events: none; }
.membercard > * { position: relative; z-index: 1; }
.membercard__top { display: flex; justify-content: space-between; align-items: flex-start; }
.membercard__brand { font-size: 12px; letter-spacing: .2em; font-weight: 800; color: #FFEFD6; }
.membercard__sub { font-size: 11px; color: rgba(255,255,255,.55); margin-top: 3px; }
.membercard__qr { width: 172px; height: 172px; background: #fff; border-radius: 18px; margin: 20px auto 8px; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 20px rgba(0,0,0,.2); }
.membercard__qr img { width: 152px; height: 152px; }
.membercard__no { text-align: center; font-family: var(--num); font-size: 15px; letter-spacing: .26em; font-weight: 800; color: rgba(255,255,255,.92); font-variant-numeric: tabular-nums; }
.membercard__name { text-align: center; font-size: 13px; color: rgba(255,255,255,.6); margin-top: 5px; }
.membercard__foot { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.12); }
.membercard__foot .lbl { font-size: 11px; color: rgba(255,255,255,.55); }
.membercard__foot .val { font-size: 17px; font-weight: 900; font-variant-numeric: tabular-nums; }
.membercard__foot .val.gold { color: #fff; }
.barcode { height: 54px; margin: 16px auto 0; display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 10px; padding: 6px 10px; }
.member-refresh { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 16px auto 0; font-size: 12px; color: var(--text-2); font-weight: 700; }
.member-refresh .ic { color: var(--text-3); }

.tiles { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: 18px; }
.tile { background: var(--surface); border-radius: var(--r-md); padding: 16px 8px; text-align: center; box-shadow: var(--sh-sm); }
.tile__ico { color: var(--primary-deep); margin: 0 auto 8px; display: flex; justify-content: center; }
:root[data-theme="dark"] .tile__ico { color: var(--primary); }
.tile__n { font-size: 18px; font-weight: 900; }
.tile__l { font-size: 11px; color: var(--text-2); font-weight: 700; margin-top: 2px; }

/* ---------- My page ---------- */
.profile { display: flex; align-items: center; gap: 14px; padding: 12px var(--pad) 18px; }
.avatar { width: 64px; height: 64px; border-radius: var(--r-pill); background: var(--grad-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 900; flex: 0 0 64px; box-shadow: var(--sh-sm); }
.profile__name { font-size: 19px; font-weight: 900; }
.profile__id { font-size: 12px; color: var(--text-2); margin-top: 3px; font-variant-numeric: tabular-nums; }
.mini-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 0 var(--pad) 6px; }
.mini { background: var(--surface); border-radius: var(--r-md); padding: 16px 6px; text-align: center; box-shadow: var(--sh-sm); }
.mini .n { font-size: 20px; font-weight: 900; color: var(--text); font-variant-numeric: tabular-nums; }
.mini .n.green { color: var(--brand-green-deep); }
.mini .l { font-size: 11px; color: var(--text-2); font-weight: 700; margin-top: 3px; }

/* ---------- Admin ---------- */
.admin { background: var(--bg); min-height: 100%; padding-bottom: 24px; }
.adminbar { background: var(--grad-navy); color: #fff; padding: 10px var(--pad) 22px; }
.adminbar__row { display: flex; align-items: flex-start; justify-content: space-between; }
.adminbar__store { font-size: 12px; color: rgba(255,255,255,.6); font-weight: 700; }
.adminbar__name { font-size: 18px; font-weight: 900; margin-top: 2px; }
.adminbar__ai { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--brand-gold-lt); font-weight: 800; margin-top: 3px; }
.kpi { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: -16px var(--pad) 0; }
.kpi__c { background: var(--surface); border-radius: var(--r-card); padding: 16px; box-shadow: var(--sh-card); }
.kpi__l { font-size: 12px; color: var(--text-2); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.kpi__l .ic { color: var(--text-3); }
.kpi__n { font-size: 28px; font-weight: 900; margin-top: 8px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi__d { font-size: 12px; font-weight: 800; margin-top: 3px; display: flex; align-items: center; gap: 4px; }
.kpi__d.up { color: var(--brand-green-deep); }
.kpi__d.down { color: var(--brand-error); }
.quickgrid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin: 20px var(--pad) 0; }
.quick { background: var(--surface); border-radius: var(--r-md); padding: 14px 4px; text-align: center; box-shadow: var(--sh-sm); transition: transform var(--dur-1) var(--ease); }
.quick:active { transform: scale(.95); }
.quick__ico { width: 40px; height: 40px; border-radius: 12px; background: var(--grad-navy); color: #fff; display: flex; align-items: center; justify-content: center; margin: 0 auto 8px; }
.quick__l { font-size: 11px; font-weight: 700; color: var(--text); line-height: 1.3; }
.aicard { margin: 0 var(--pad); border-radius: var(--r-card); padding: 16px; background: var(--green-soft); border: 1px solid rgba(18,197,107,.2); }
.aicard__h { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; color: var(--brand-green-deep); }
.aicard__t { font-size: 14px; font-weight: 600; line-height: 1.65; margin-top: 9px; color: var(--text); }
.perfcard { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--sh-card); padding: 16px; margin: 0 var(--pad); }
.miniperf { display: flex; align-items: flex-end; gap: 7px; height: 76px; }
.miniperf .bar { flex: 1; background: var(--grad-green); border-radius: 6px 6px 3px 3px; opacity: .9; transition: height .6s var(--ease); }
.miniperf .bar.peak { opacity: 1; }
.perfcard__wd { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-3); margin-top: 8px; font-weight: 700; }
.perfcard__wd span { flex: 1; text-align: center; }

/* ============================================================
   加盟店：クーポン作成（音声・写真）
   ============================================================ */
.createwrap { padding: 16px var(--pad) 20px; }
.create-h { font-size: 12px; font-weight: 800; color: var(--text-2); margin: 22px 0 10px; letter-spacing: .02em; display:flex; align-items:center; gap:7px; }
.create-h .step { width: 20px; height: 20px; border-radius: 50%; background: var(--blue-deep); color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; font-weight: 900; }

/* 音声パネル */
.voicecard { border-radius: var(--r-card); padding: 22px 18px; background: var(--grad-blue); color: #fff; text-align: center; position: relative; overflow: hidden; box-shadow: var(--sh-blue); }
.voicecard::after { content:""; position:absolute; inset:0; background: radial-gradient(300px 160px at 50% -10%, rgba(255,255,255,.22), transparent 60%); }
.voicecard > * { position: relative; z-index: 1; }
.mic { width: 84px; height: 84px; margin: 6px auto 14px; border-radius: 50%; background: var(--grad-primary); color: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--sh-gold); transition: transform var(--dur-2) var(--ease); }
.mic:active { transform: scale(.93); }
.mic.rec { background: var(--grad-green); color: #fff; }
.mic.rec::before { content:""; position: absolute; width: 84px; height: 84px; border-radius: 50%; border: 2px solid var(--brand-green); animation: micpulse 1.4s var(--ease-soft) infinite; }
@keyframes micpulse { 0%{transform:scale(1);opacity:.7} 100%{transform:scale(1.5);opacity:0} }
.voicecard__status { font-size: 14px; font-weight: 800; }
.voicecard__hint { font-size: 12px; color: rgba(255,255,255,.6); margin-top: 4px; }
.transcript { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: var(--r-md);
  padding: 12px 14px; margin-top: 16px; font-size: 13.5px; line-height: 1.6; text-align: left; min-height: 44px; color: rgba(255,255,255,.94); }
.transcript.empty { color: rgba(255,255,255,.4); }
.transcript .cursor { display: inline-block; width: 2px; height: 15px; background: var(--brand-gold-lt); vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.voicecard .btn { margin-top: 14px; }
.voicecard .btn--gold { background: #fff; color: var(--brand-navy); }

/* 写真アップロード */
.uploader { display: block; border: 2px dashed var(--border); border-radius: var(--r-card); padding: 26px 16px; text-align: center; color: var(--text-3); background: var(--surface); transition: border-color var(--dur-2), background var(--dur-2); }
.uploader:active { background: var(--surface-2); }
.uploader__ico { width: 52px; height: 52px; border-radius: 16px; background: var(--surface-2); color: var(--brand-navy); display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
:root[data-theme="dark"] .uploader__ico { color: var(--brand-gold-lt); }
.uploader__t { font-size: 14px; font-weight: 800; color: var(--text); }
.uploader__s { font-size: 12px; margin-top: 4px; }
.photo-preview { position: relative; border-radius: var(--r-card); overflow: hidden; aspect-ratio: 16/9; box-shadow: var(--sh-card); }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview__rm { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; background: rgba(16,20,32,.6); backdrop-filter: blur(6px); color: #fff; display: flex; align-items: center; justify-content: center; }
.samples { display: flex; gap: 8px; margin-top: 10px; }
.samples button { flex: 1; aspect-ratio: 1; border-radius: 12px; overflow: hidden; box-shadow: var(--sh-sm); }
.samples img { width: 100%; height: 100%; object-fit: cover; }

/* セグメント */
.seg { display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; background: var(--surface-3); border-radius: var(--r-md); padding: 5px; }
.seg button { height: 40px; border-radius: 10px; font-size: 12.5px; font-weight: 800; color: var(--text-2); transition: all var(--dur-2) var(--ease); }
.seg button.on { background: var(--surface); color: var(--brand-green-deep); box-shadow: var(--sh-sm); }

/* 期限チップ */
.mini-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.mini-chip { height: 38px; padding: 0 15px; border-radius: var(--r-pill); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--border); font-size: 13px; font-weight: 700; color: var(--text-2); display: inline-flex; align-items: center; gap:6px; }
.mini-chip.on { background: var(--brand-navy); color: #fff; box-shadow: none; }

/* テキストエリア */
.field textarea { width: 100%; min-height: 84px; padding: 12px 14px; border-radius: var(--r-md); font-size: 14px; line-height: 1.6;
  color: var(--text); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--border); font-family: inherit; resize: none; }
.field textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--brand-green), var(--ring); }

/* ライブプレビュー */
.preview-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; color: var(--brand-green-deep); background: var(--green-soft); padding: 5px 11px; border-radius: var(--r-pill); }
.preview-frame { margin-top: 12px; padding: 16px; border-radius: var(--r-lg); background: var(--bg); box-shadow: inset 0 0 0 1px var(--border); }
