/* Appily Twentyseven — Member Folio account */

.ac27-folio {
  --ac27-wine: var(--ts-wine, #8B2942);
  --ac27-gold: var(--ts-gold, #C4A77D);
  --ac27-ink: var(--ts-ink, #111);
  --ac27-paper: var(--ts-paper, #fff);
  --ac27-surface: var(--ts-surface, #f5f5f5);
  --ac27-pale: var(--ts-gold-pale, #f3ede4);
  background: var(--ac27-paper);
}

/* Neutralize legacy store-chrome hooks if loaded elsewhere */
.ac27-folio .auth-split-panel,
.ac27-folio .auth-split-tab,
.ac27-folio .dash-nav-link,
.ac27-folio .dash-panel {
  opacity: 1;
  transform: none;
  box-shadow: none;
}
.ac27-folio .dash-nav-link {
  color: inherit;
  background: transparent;
  text-align: center;
  padding: 18px 16px;
}
.ac27-folio .dash-nav-link:hover,
.ac27-folio .dash-nav-link.is-active {
  background: transparent;
  color: inherit;
}
.ac27-folio .auth-split-tab {
  flex: unset;
  color: inherit;
  background: var(--ac27-surface);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 12px 22px;
}
.ac27-folio .auth-split-tab.is-active {
  color: var(--ac27-paper);
  background: var(--ac27-wine);
}
.ac27-folio .auth-split-panel {
  padding: 0;
  background: transparent;
  min-height: 0;
}
.ac27-folio .toast.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Hero */
.ac27-hero {
  background: var(--ac27-ink);
  color: var(--ac27-paper);
  padding: 40px 0 52px;
}
.ac27-hero-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}
.ac27-kicker {
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ac27-gold);
  margin: 0 0 10px;
}
.ac27-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 600;
  margin: 0;
  line-height: 1.1;
}
.ac27-title em {
  font-style: italic;
  color: var(--ac27-gold);
}
.ac27-emboss {
  font-family: ui-monospace, Consolas, monospace;
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  padding: 12px 16px;
  border: 1px solid rgba(196, 167, 125, .4);
  color: var(--ac27-gold);
  text-align: center;
  line-height: 1.5;
}

/* Stage */
.ac27-stage {
  padding: 0 0 72px;
}
.ac27-loading {
  margin-top: 32px;
  padding: 28px;
  text-align: center;
  background: var(--ac27-surface);
  border: 1px dashed var(--ts-line);
  font-size: .92rem;
  color: var(--ts-muted);
}

/* —— Logged out: folio gate —— */
.ac27-folio-gate {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) 12px minmax(0, 1.15fr);
  margin-top: -28px;
  position: relative;
  z-index: 2;
  min-height: 560px;
  box-shadow: var(--shadow);
}
.ac27-folio-cover {
  background: var(--ac27-pale);
  border: 1px solid var(--ts-line);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
}
.ac27-cover-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 12px;
  font-weight: 600;
  color: var(--ac27-ink);
}
.ac27-cover-lede {
  font-size: .9rem;
  color: var(--ts-muted);
  line-height: 1.65;
  margin: 0 0 28px;
  max-width: 36ch;
}
.ac27-stamps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: auto;
}
.ac27-stamp {
  padding: 14px 12px;
  border: 1px solid rgba(139, 41, 66, .2);
  background: var(--ac27-paper);
  font-size: .78rem;
  line-height: 1.4;
  color: var(--ac27-ink);
  position: relative;
}
.ac27-stamp-num {
  display: block;
  font-size: 8px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ac27-wine);
  font-weight: 700;
  margin-bottom: 6px;
}
.ac27-stamp::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 14px;
  height: 14px;
  border: 1px solid var(--ac27-gold);
  border-radius: 50%;
  opacity: .5;
}
.ac27-folio-spine {
  background: linear-gradient(90deg, #1a1a1a 0%, var(--ac27-wine) 50%, #1a1a1a 100%);
  position: relative;
}
.ac27-folio-spine::before {
  content: '';
  position: absolute;
  inset: 12px 4px;
  border-left: 1px dashed rgba(196, 167, 125, .35);
  border-right: 1px dashed rgba(196, 167, 125, .35);
}
.ac27-folio-pages {
  background: var(--ac27-paper);
  border: 1px solid var(--ts-line);
  border-left: 0;
  padding: 32px 36px 40px;
  position: relative;
}
.ac27-page-tabs {
  display: flex;
  justify-content: flex-end;
  gap: 0;
  margin: -32px -36px 28px 0;
}
.ac27-page-tab {
  padding: 12px 22px;
  border: 0;
  background: var(--ac27-surface);
  color: var(--ts-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%);
  transition: .2s;
}
.ac27-page-tab:first-child {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 8px 100%);
}
.ac27-page-tab.is-active {
  background: var(--ac27-wine);
  color: var(--ac27-paper);
}
.ac27-folio-panel {
  display: none;
}
.ac27-folio-panel.is-active {
  display: block;
  animation: ac27PageIn .35s ease;
}
@keyframes ac27PageIn {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}
.ac27-folio-panel h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  margin: 0 0 8px;
}
.ac27-folio-lede {
  font-size: .9rem;
  color: var(--ts-muted);
  margin: 0 0 24px;
  max-width: 42ch;
  line-height: 1.55;
}
.ac27-forgot {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px dashed var(--ts-line);
}
.ac27-forgot h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 16px;
}

/* Forms */
.ac27-form {
  display: grid;
  gap: 16px;
}
.ac27-form label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.ac27-form input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--ts-line);
  background: var(--ac27-paper);
  font: inherit;
}
.ac27-form input:focus {
  outline: 2px solid rgba(139, 41, 66, .2);
  border-color: var(--ac27-wine);
}
.ac27-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 24px;
  border: 2px solid var(--ac27-ink);
  background: var(--ac27-ink);
  color: var(--ac27-paper);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: .2s;
  text-decoration: none;
}
.ac27-btn:hover {
  background: var(--ac27-wine);
  border-color: var(--ac27-wine);
}
.ac27-btn-soft {
  background: var(--ac27-surface);
  color: var(--ac27-ink);
  border-color: var(--ts-line);
}
.ac27-btn-soft:hover {
  background: var(--ac27-pale);
  border-color: var(--ac27-wine);
  color: var(--ac27-wine);
}
.ac27-btn-ghost {
  background: transparent;
  color: var(--ac27-ink);
  border-color: var(--ac27-ink);
}
.ac27-btn-ghost:hover {
  background: var(--ac27-ink);
  color: var(--ac27-paper);
}
.ac27-btn-sm {
  padding: 9px 16px;
  font-size: 10px;
}

/* —— Logged in: member horizon —— */
.ac27-member-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: -24px;
  padding: 24px 28px;
  background: var(--ac27-wine);
  color: var(--ac27-paper);
  position: relative;
  z-index: 2;
}
.ac27-member-id {
  display: flex;
  align-items: center;
  gap: 16px;
}
.ac27-monogram {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--ac27-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--ac27-gold);
}
.ac27-member-meta span {
  display: block;
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: .7;
  margin-bottom: 4px;
}
.ac27-member-meta h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0;
  font-weight: 600;
}
.ac27-member-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.ac27-member-actions .ac27-btn-soft {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .25);
  color: var(--ac27-paper);
}
.ac27-member-actions .ac27-btn-soft:hover {
  background: var(--ac27-paper);
  color: var(--ac27-wine);
}
.ac27-member-actions .ac27-btn-ghost {
  border-color: rgba(255, 255, 255, .45);
  color: var(--ac27-paper);
}
.ac27-member-actions .ac27-btn-ghost:hover {
  background: var(--ac27-paper);
  color: var(--ac27-wine);
}

.ac27-horizon {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border: 1px solid var(--ts-line);
  border-top: 0;
  background: var(--ac27-paper);
  position: relative;
  z-index: 1;
}
.ac27-horizon::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 8%;
  right: 8%;
  height: 1px;
  background: var(--ts-line);
  z-index: 0;
}
.ac27-horizon-btn {
  flex: 1 1 auto;
  min-width: 120px;
  padding: 18px 16px;
  border: 0;
  background: transparent;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
  position: relative;
  z-index: 1;
  transition: .2s;
}
.ac27-horizon-btn strong {
  display: block;
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ts-muted);
  margin-bottom: 2px;
}
.ac27-horizon-btn small {
  display: block;
  font-size: .68rem;
  color: var(--ts-muted);
  opacity: .8;
}
.ac27-horizon-btn.is-active strong {
  color: var(--ac27-wine);
}
.ac27-horizon-btn.is-active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 3px;
  background: var(--ac27-wine);
}
.ac27-horizon-link {
  text-decoration: none;
  color: inherit;
}
.ac27-horizon-link:hover strong {
  color: var(--ac27-wine);
}

.ac27-sheet {
  border: 1px solid var(--ts-line);
  border-top: 0;
  padding: 36px 32px 44px;
  position: relative;
  background: var(--ac27-paper);
}
.ac27-sheet::before,
.ac27-sheet::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-color: var(--ac27-gold);
  border-style: solid;
  opacity: .45;
  pointer-events: none;
}
.ac27-sheet::before {
  top: 12px;
  left: 12px;
  border-width: 1px 0 0 1px;
}
.ac27-sheet::after {
  bottom: 12px;
  right: 12px;
  border-width: 0 1px 1px 0;
}
.ac27-panel-kicker {
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ac27-wine);
  font-weight: 700;
  margin: 0 0 6px;
}
.ac27-panel-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 22px;
}
.ac27-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

/* JS-driven panels & profile */
.ac27-folio .dash-panel {
  display: none;
}
.ac27-folio .dash-panel.is-active {
  display: block;
}
.ac27-folio .profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.ac27-folio .profile-item {
  padding: 16px 18px;
  background: var(--ac27-surface);
  border: 1px solid var(--ts-line);
}
.ac27-folio .profile-item .k {
  display: block;
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ts-muted);
  margin-bottom: 6px;
}
.ac27-folio .profile-item .v {
  display: block;
  font-weight: 600;
  font-size: .92rem;
  word-break: break-word;
}
.ac27-folio .profile-item .v.mono {
  font-family: ui-monospace, Consolas, monospace;
  font-size: .78rem;
  font-weight: 500;
}
.ac27-folio .order-list {
  display: grid;
  gap: 12px;
}
.ac27-folio .order-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--ts-line);
  background: var(--ac27-surface);
}
.ac27-folio .order-row .btn,
.ac27-folio .order-row .ac27-btn {
  flex-shrink: 0;
}
.ac27-folio .order-row .btn.btn-soft {
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  border: 1px solid var(--ts-line);
  background: var(--ac27-paper);
  color: var(--ac27-ink);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: .2s;
}
.ac27-folio .order-row .btn.btn-soft:hover {
  background: var(--ac27-wine);
  border-color: var(--ac27-wine);
  color: var(--ac27-paper);
}
.ac27-folio .mini-copy {
  font-size: .85rem;
  color: var(--ts-muted);
  margin: 4px 0 0;
}
.ac27-folio .notice {
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: .88rem;
  border: 1px solid var(--ts-line);
}
.ac27-folio .notice.success {
  background: #f0fdf4;
  border-color: #b8e0c8;
  color: #1e5631;
}
.ac27-folio .notice.warning {
  background: var(--ac27-pale);
  border-color: #e8d4a8;
  color: #6b4f1d;
}
.ac27-folio .toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: 360px;
  padding: 14px 18px;
  background: var(--ac27-ink);
  color: var(--ac27-paper);
  font-size: .88rem;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
  z-index: 200;
}
.ac27-folio .toast.visible {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 900px) {
  .ac27-folio-gate {
    grid-template-columns: 1fr;
    margin-top: 0;
  }
  .ac27-folio-spine {
    height: 10px;
  }
  .ac27-folio-spine::before {
    inset: 3px 12px;
    border-left: 0;
    border-right: 0;
    border-top: 1px dashed rgba(196, 167, 125, .35);
    border-bottom: 1px dashed rgba(196, 167, 125, .35);
  }
  .ac27-folio-pages {
    border-left: 1px solid var(--ts-line);
  }
  .ac27-stamps {
    grid-template-columns: 1fr;
  }
  .ac27-horizon::before {
    display: none;
  }
  .ac27-horizon-btn {
    min-width: 50%;
  }
}

@media (max-width: 520px) {
  .ac27-folio-cover,
  .ac27-folio-pages,
  .ac27-sheet {
    padding: 24px 18px 28px;
  }
  .ac27-page-tabs {
    margin: -24px -18px 20px 0;
  }
  .ac27-member-strip {
    padding: 20px 18px;
  }
  .ac27-folio .order-row {
    flex-direction: column;
  }
}
