:root {
  --ink: #18332f;
  --ink-soft: #4d625f;
  --paper: #f7f1e6;
  --paper-deep: #eadfcd;
  --cream: #fffdf8;
  --teal: #174d47;
  --teal-2: #236a61;
  --gold: #c48b3c;
  --gold-soft: #ead2a9;
  --terracotta: #b85f42;
  --line: rgba(24, 51, 47, .14);
  --shadow: 0 24px 70px rgba(41, 47, 43, .13);
  --shadow-sm: 0 10px 30px rgba(41, 47, 43, .10);
  --radius: 24px;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--paper); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 8% 8%, rgba(196,139,60,.17), transparent 27rem),
    radial-gradient(circle at 95% 20%, rgba(35,106,97,.14), transparent 30rem),
    var(--paper);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
}

a { color: inherit; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.shell { width: min(1180px, calc(100% - 36px)); margin: 0 auto; position: relative; }

.nav {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { width: 38px; height: 38px; border-radius: 13px 13px 18px 18px; display: grid; place-items: center; color: #fff; background: var(--teal); box-shadow: 0 8px 22px rgba(23,77,71,.25); }
.brand-mark svg { width: 20px; height: 20px; }
.brand small { display: block; color: var(--ink-soft); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-link { padding: 10px 14px; border-radius: 999px; color: var(--ink-soft); text-decoration: none; font-weight: 700; font-size: 14px; }
.nav-link:hover { background: rgba(255,255,255,.65); color: var(--ink); }

.btn {
  border: 0;
  border-radius: 14px;
  padding: 13px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: wait; transform: none; }
.btn-primary { background: var(--teal); color: #fff; box-shadow: 0 10px 24px rgba(23,77,71,.22); }
.btn-primary:hover { background: #103e39; }
.btn-secondary { background: rgba(255,255,255,.72); border: 1px solid var(--line); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--teal); border: 1px solid rgba(23,77,71,.22); }
.btn-danger { background: #fff1ed; color: #8e3e28; border: 1px solid #efc6bb; }
.btn svg { width: 18px; height: 18px; }

.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--teal); font-size: 12px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--gold); border-radius: 2px; }

.hero { min-height: calc(100vh - 78px); padding: 54px 0 80px; display: grid; grid-template-columns: 1.08fr .92fr; gap: 70px; align-items: center; }
.hero h1 { margin: 18px 0 18px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(50px, 6.2vw, 92px); line-height: .95; letter-spacing: -.055em; font-weight: 500; }
.hero h1 em { color: var(--teal-2); font-style: italic; }
.hero-copy > p { max-width: 620px; margin: 0; color: var(--ink-soft); line-height: 1.75; font-size: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.microcopy { margin-top: 20px; color: #687975; font-size: 13px; display: flex; gap: 16px; flex-wrap: wrap; }
.microcopy span { display: inline-flex; align-items: center; gap: 6px; }
.microcopy span::before { content: "✓"; color: var(--teal); font-weight: 900; }

.hero-visual { position: relative; min-height: 540px; }
.arch { position: absolute; inset: 0 10px 0 60px; border-radius: 230px 230px 30px 30px; overflow: hidden; box-shadow: var(--shadow); background: var(--teal); }
.arch img { width: 100%; height: 100%; object-fit: cover; }
.arch::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(9,41,37,.62), transparent 50%); }
.visual-quote { position: absolute; left: 22px; bottom: 40px; width: 270px; padding: 22px; border-radius: 20px; color: #fff; background: rgba(18,55,51,.9); backdrop-filter: blur(12px); box-shadow: var(--shadow-sm); z-index: 2; }
.visual-quote p { margin: 0 0 10px; font-family: Georgia, serif; font-size: 21px; line-height: 1.35; }
.visual-quote small { color: #d9e7e3; }
.spark { position: absolute; top: 50px; right: -6px; width: 90px; height: 90px; border-radius: 50%; background: var(--gold-soft); display: grid; place-items: center; color: var(--teal); box-shadow: var(--shadow-sm); z-index: 2; }
.spark svg { width: 38px; height: 38px; }

.page-head { padding: 36px 0 30px; }
.page-head h1 { margin: 8px 0 8px; font-family: Georgia, serif; font-weight: 500; font-size: clamp(36px, 5vw, 58px); letter-spacing: -.035em; }
.page-head p { margin: 0; color: var(--ink-soft); line-height: 1.6; }

.chat-layout { width: min(1120px, calc(100% - 28px)); margin: 8px auto 36px; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; min-height: calc(100vh - 122px); }
.chat-card { min-height: 720px; height: calc(100vh - 140px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(255,255,255,.8); background: rgba(255,253,248,.86); backdrop-filter: blur(18px); border-radius: 28px; box-shadow: var(--shadow); }
.chat-header { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; background: rgba(255,255,255,.52); }
.assistant-id { display: flex; align-items: center; gap: 12px; }
.avatar { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50% 50% 46% 54%; background: var(--teal); color: #fff; position: relative; }
.avatar::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #72c596; border: 2px solid var(--cream); position: absolute; right: -1px; bottom: 0; }
.avatar svg { width: 22px; }
.assistant-id strong { display: block; }
.assistant-id small { color: var(--ink-soft); }
.chat-reset { padding: 8px 11px; border: 1px solid rgba(23,77,71,.18); border-radius: 999px; color: var(--teal); background: rgba(255,255,255,.65); cursor: pointer; font: inherit; font-size: 11px; font-weight: 800; transition: .2s ease; }
.chat-reset:hover { border-color: var(--teal); background: #fff; }

.messages { flex: 1; min-height: 0; overflow-y: auto; padding: 26px 24px 18px; scroll-behavior: smooth; }
.message-row { display: flex; margin-bottom: 16px; animation: rise .32s ease both; }
.message-row.assistant + .message-row.assistant { margin-top: -8px; }
.message-row.user { justify-content: flex-end; }
.bubble { max-width: min(78%, 650px); padding: 14px 17px; border-radius: 20px 20px 20px 7px; background: #fff; color: #263a37; box-shadow: 0 5px 18px rgba(42,53,49,.07); line-height: 1.58; white-space: pre-wrap; }
.message-row.user .bubble { color: #fff; background: var(--teal); border-radius: 20px 20px 7px 20px; box-shadow: 0 8px 22px rgba(23,77,71,.18); }
.chat-starters { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 20px; }
.chat-starters button { padding: 9px 12px; border: 1px solid rgba(23,77,71,.2); border-radius: 999px; color: var(--teal); background: rgba(255,255,255,.72); cursor: pointer; font: inherit; font-size: 12px; transition: .2s ease; }
.chat-starters button:hover { border-color: var(--teal); background: #fff; transform: translateY(-1px); }
.typing { display: inline-flex; gap: 5px; align-items: center; min-height: 23px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #7e918d; animation: bounce 1.1s infinite; }
.typing i:nth-child(2) { animation-delay: .16s; }
.typing i:nth-child(3) { animation-delay: .32s; }

.recommend-card { max-width: 670px; margin: 4px 0 20px; padding: 12px; border: 1px solid rgba(196,139,60,.34); background: #fffaf0; border-radius: 22px; display: grid; grid-template-columns: 92px 1fr; gap: 15px; box-shadow: var(--shadow-sm); animation: rise .4s ease both; }
.recommend-cover { aspect-ratio: 2/3; width: 92px; border-radius: 13px; overflow: hidden; position: relative; background: var(--teal); }
.recommend-cover img { width: 100%; height: 100%; object-fit: cover; }
.recommend-body { min-width: 0; padding: 4px 5px 4px 0; }
.recommend-kicker { color: #8a622a; font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.recommend-body h3 { margin: 5px 0 6px; font-family: Georgia, serif; font-size: 23px; font-weight: 600; }
.recommend-body p { color: var(--ink-soft); margin: 0 0 12px; font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.composer { padding: 14px 18px 18px; border-top: 1px solid var(--line); background: rgba(255,255,255,.62); }
.composer-box { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; padding: 8px 8px 8px 16px; border: 1px solid rgba(23,77,71,.18); border-radius: 19px; background: #fff; box-shadow: 0 5px 20px rgba(27,50,46,.06); }
.composer textarea { width: 100%; max-height: 130px; min-height: 44px; resize: none; padding: 10px 0; border: 0; outline: 0; color: var(--ink); background: transparent; line-height: 1.45; }
.send-btn { width: 44px; height: 44px; padding: 0; border-radius: 14px; }
.composer-note { margin: 8px 4px 0; text-align: center; color: #7a8b87; font-size: 11px; }

.chat-aside { display: flex; flex-direction: column; gap: 14px; }
.aside-card { border: 1px solid rgba(255,255,255,.75); border-radius: 22px; padding: 20px; background: rgba(255,253,248,.72); box-shadow: var(--shadow-sm); }
.aside-card h3 { margin: 0 0 10px; font-family: Georgia, serif; font-size: 22px; }
.aside-card p { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.values { display: grid; gap: 12px; margin-top: 15px; }
.value { display: flex; gap: 10px; color: var(--ink-soft); font-size: 13px; line-height: 1.4; }
.value b { width: 24px; height: 24px; flex: 0 0 24px; display: grid; place-items: center; border-radius: 8px; color: var(--teal); background: #dfece8; }

.admin-wrap { padding-bottom: 70px; }
.login-panel { width: min(460px, 100%); margin: 50px auto; padding: 30px; border-radius: 26px; background: rgba(255,253,248,.9); box-shadow: var(--shadow); border: 1px solid #fff; }
.login-panel h2 { margin: 0 0 8px; font-family: Georgia, serif; font-size: 32px; font-weight: 500; }
.login-panel p { color: var(--ink-soft); line-height: 1.55; }
.field { display: grid; gap: 7px; margin-bottom: 15px; }
.field label { color: #445d58; font-size: 12px; font-weight: 800; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid rgba(23,77,71,.18); border-radius: 12px; padding: 12px 13px; outline: 0; background: rgba(255,255,255,.88); color: var(--ink); }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--teal-2); box-shadow: 0 0 0 3px rgba(35,106,97,.1); }
.field textarea { min-height: 100px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.checks { display: flex; gap: 18px; flex-wrap: wrap; margin: 8px 0 18px; }
.checks label { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.error { min-height: 20px; color: #9d3e2e; font-size: 13px; margin: 8px 0; }

.admin-panel[hidden], .login-panel[hidden], .modal[hidden], .order-form[hidden], .success-box[hidden] { display: none; }
.admin-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.product-admin-card { display: grid; grid-template-columns: 105px 1fr; gap: 18px; padding: 16px; border-radius: 22px; background: rgba(255,253,248,.86); border: 1px solid #fff; box-shadow: var(--shadow-sm); }
.product-admin-card img { width: 105px; aspect-ratio: 2/3; object-fit: cover; border-radius: 14px; background: var(--paper-deep); }
.product-admin-card h3 { margin: 4px 0 5px; font-family: Georgia, serif; font-size: 24px; }
.product-admin-card p { margin: 0 0 12px; color: var(--ink-soft); font-size: 13px; line-height: 1.45; }
.tag { display: inline-flex; padding: 5px 8px; border-radius: 999px; background: #e2eee9; color: #2d665d; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.tag.off { background: #eee8df; color: #766e62; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.card-actions .btn { padding: 9px 12px; font-size: 12px; }

.modal { position: fixed; inset: 0; z-index: 20; padding: 28px 16px; display: grid; place-items: center; background: rgba(16,38,34,.56); backdrop-filter: blur(7px); overflow-y: auto; }
.modal-card { width: min(760px, 100%); max-height: calc(100vh - 56px); overflow-y: auto; padding: 26px; border-radius: 26px; background: var(--cream); box-shadow: 0 30px 100px rgba(9,29,26,.35); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 20px; }
.modal-head h2 { margin: 0; font-family: Georgia, serif; font-size: 31px; font-weight: 500; }
.icon-btn { width: 38px; height: 38px; border: 0; border-radius: 12px; cursor: pointer; background: #eee8df; color: var(--ink); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.product-layout { display: grid; grid-template-columns: minmax(280px, .72fr) 1.28fr; gap: 64px; align-items: center; padding: 42px 0 80px; min-height: calc(100vh - 78px); }
.book-stage { position: relative; display: grid; place-items: center; min-height: 610px; }
.book-stage::before { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; background: #e3d1af; filter: blur(1px); opacity: .65; }
.book-cover { width: min(360px, 78vw); aspect-ratio: 2/3; position: relative; overflow: hidden; border-radius: 6px 18px 18px 6px; box-shadow: -14px 18px 0 #d4c4a9, 0 34px 65px rgba(37,44,40,.24); transform: perspective(1100px) rotateY(8deg); background: var(--teal); }
.book-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-overlay { position: absolute; inset: 0; padding: 38px 30px; display: flex; flex-direction: column; justify-content: flex-end; color: #fff; background: linear-gradient(to top, rgba(8,35,32,.88), rgba(8,35,32,0) 66%); }
.book-overlay h2 { margin: 0; font-family: Georgia, serif; font-size: clamp(36px, 4vw, 54px); line-height: .98; }
.book-overlay small { margin-top: 10px; color: #ecf2ef; }
.product-copy h1 { margin: 10px 0 12px; font-family: Georgia, serif; font-size: clamp(42px, 5vw, 66px); line-height: 1; font-weight: 500; letter-spacing: -.04em; }
.product-copy > p { color: var(--ink-soft); font-size: 17px; line-height: 1.7; }
.price { margin: 24px 0; color: var(--teal); font-family: Georgia, serif; font-size: 34px; }
.preview-box { margin: 22px 0; padding: 20px 22px; border-left: 3px solid var(--gold); border-radius: 0 16px 16px 0; background: rgba(255,255,255,.58); }
.preview-box small { display: block; margin-bottom: 7px; color: #8a622a; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.preview-box p { margin: 0; color: #435a56; font-family: Georgia, serif; font-size: 18px; line-height: 1.6; font-style: italic; }
.purchase-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.continue-actions { margin-top: 16px; }
.demo-note { margin-top: 14px; color: #73837f; font-size: 12px; }
.order-form { margin-top: 20px; padding: 22px; border-radius: 20px; background: rgba(255,255,255,.66); border: 1px solid var(--line); }
.success-box { margin-top: 20px; padding: 22px; border-radius: 20px; background: #e5f1eb; border: 1px solid #b9d9ca; }
.success-box h3 { margin: 0 0 8px; }
.success-box p { color: #47645a; }
.folio { display: inline-block; padding: 7px 10px; border-radius: 8px; background: #fff; font-family: ui-monospace, monospace; font-weight: 900; }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 30; max-width: 360px; padding: 14px 17px; border-radius: 14px; color: #fff; background: #18332f; box-shadow: var(--shadow); opacity: 0; transform: translateY(15px); pointer-events: none; transition: .25s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@keyframes rise { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 45px; padding-top: 36px; }
  .hero-visual { min-height: 500px; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-aside { display: none; }
  .chat-card { height: calc(100vh - 98px); min-height: 620px; }
  .product-grid { grid-template-columns: 1fr; }
  .product-layout { grid-template-columns: 1fr; gap: 22px; }
  .book-stage { min-height: 510px; }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 24px, 1180px); }
  .nav { min-height: 68px; }
  .nav-link.hide-mobile { display: none; }
  .brand small { display: none; }
  .hero { padding: 40px 0 50px; min-height: auto; }
  .hero h1 { font-size: 50px; }
  .hero-copy > p { font-size: 16px; }
  .hero-actions .btn { width: 100%; }
  .hero-visual { min-height: 440px; }
  .arch { inset-left: 28px; }
  .visual-quote { left: 0; width: 240px; }
  .chat-layout { width: 100%; margin: 0; }
  .chat-card { height: calc(100dvh - 68px); min-height: 560px; border-radius: 0; border-inline: 0; }
  .messages { padding: 20px 14px 14px; }
  .bubble { max-width: 88%; }
  .recommend-card { grid-template-columns: 76px 1fr; margin-right: 4px; }
  .recommend-cover { width: 76px; }
  .recommend-body h3 { font-size: 20px; }
  .composer { padding: 10px; }
  .chat-reset { padding: 7px 9px; font-size: 10px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .product-admin-card { grid-template-columns: 78px 1fr; gap: 12px; }
  .product-admin-card img { width: 78px; }
  .book-stage { min-height: 450px; }
  .product-layout { padding-top: 15px; }
  .purchase-actions .btn { width: 100%; }
}
