/* Presentation only. All existing actions, permissions and saved content stay intact. */

/* Gilt acanthus scrolls echo the notebook bindings without stretching their corners. */
.heritage-primary-actions > .btn.primary::before {
  content: "";
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  border: 30px solid transparent;
  border-image: url('/academic/plaque-frame-baroque.svg') 64 / 30px / 0 stretch;
  background: none;
  pointer-events: none;
}
@media (max-width: 700px) {
  .heritage-primary-actions > .btn.primary::before {
    border-width: 24px;
    border-image-width: 24px;
  }
}

/* Classical headings, comfortable interface and study text. Saved notebook fonts are excluded. */
body { font-family: var(--font-ui, Manrope, system-ui, sans-serif); }
.form :is(label, input, select, textarea),
.folder-import :is(p, label, input, textarea, .hint),
.summary-reader-document > :is(p, ul, ol, blockquote),
.study-page > :is(p, ul, ol),
.community-shell :is(p, small, input, textarea),
.professor-chat :is(p, small, input, textarea, li),
.heritage-welcome-copy > p:last-of-type,
.heritage-progress-title, .heritage-progress-track small,
.heritage-seal small, .heritage-resume-info small,
.heritage-resume-progress small, .nexo-section-head .link, .heritage-new-folder {
  font-family: var(--font-ui, Manrope, system-ui, sans-serif);
  letter-spacing: normal;
  line-height: 1.55;
}
.form :is(input, select, textarea), .community-compose textarea,
.community-comments input, .professor-compose textarea { font-size: 16px; line-height: 1.6; }

/* One clear primary action and two calm, accessible secondary actions. */
.heritage-primary-actions {
  grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(0, 1fr));
  align-items: stretch; gap: 14px; margin-bottom: 26px;
}
.heritage-primary-actions > .btn.primary {
  min-height: 62px; font-size: 19px; box-shadow: 0 4px 12px var(--heritage-shadow);
}
.heritage-primary-actions > .btn:not(.primary) {
  min-height: 54px; border: 1px solid var(--edge); border-radius: 7px !important;
  background: color-mix(in srgb, var(--panel) 72%, transparent); background-image: none;
  clip-path: none; filter: none; box-shadow: none; padding: 13px 18px; font-size: 16px;
}
.heritage-primary-actions > .btn:not(.primary)::before { content: none; }
.heritage-primary-actions > .btn:not(.primary):hover:not(:disabled) {
  border-color: var(--heritage-gold); background: var(--subtle);
}
.heritage-primary-actions > .btn:focus-visible {
  outline: 3px solid var(--accent-ink); outline-offset: 4px; clip-path: none;
}

/* The same binding proportions and reading area, with the approved artwork intact. */
.nexo-folder-cover.heritage-book, .folder-gallery .folder-cover.heritage-book {
  box-sizing: border-box; aspect-ratio: 4 / 5.4; height: auto; min-height: 0;
  width: 100%; padding: 12px 11px 14px 23px;
}
.nexo-folder-cover.heritage-book .heritage-book-face,
.folder-gallery .folder-cover.heritage-book .heritage-book-face {
  grid-template-rows: auto 0 minmax(24px, 1fr) auto auto; padding: 25px 5px 9px; gap: 7px;
}
.nexo-folder-cover.heritage-book .heritage-book-title,
.folder-gallery .folder-cover.heritage-book .heritage-book-title {
  font-family: var(--font-academic); font-size: clamp(16px, 1.35vw, 21px);
  line-height: 1.28; font-weight: 600; letter-spacing: .005em;
  min-height: 3.84em; max-height: 3.84em; -webkit-line-clamp: 3;
  color: #fff1d1; text-shadow: 0 1px 3px #000c;
  overflow-wrap: anywhere; text-wrap: balance;
}
.heritage-book-face .heritage-book-symbol { align-self: stretch; min-height: 0; }
.heritage-book-face .heritage-book-symbol svg {
  width: 70%; max-width: 80px; max-height: 86px; object-fit: contain;
}
.heritage-book-face .heritage-book-label { line-height: 1.5; }
.heritage-home .nexo-folder-grid { gap: 18px; align-items: stretch; }
.heritage-home .nexo-folder-grid .nexo-folder { align-self: start; }
.folder-gallery { align-items: stretch; }
.folder-gallery .folder-tile { display: flex; flex-direction: column; min-width: 0; }
.folder-gallery .folder-tile-body { flex: 1; }
.folder-gallery .folder-cover.heritage-book { flex: none; }
.folder-gallery .folder-cover.heritage-book .heritage-book-title { font-size: clamp(18px, 1.6vw, 24px); }

/* Reserve ornament for the brand, plaques and bindings; give content a quiet single frame. */
.heritage-home .nexo-card, .library-import-panel, .study-resource-panel,
.community-shell .community-post, .community-shell .community-compose,
.community-shell .community-chats-list {
  box-shadow: none; background-image: none; border-color: var(--edge);
}
.heritage-home .nexo-card { padding: 22px; }
.heritage-home .nexo-section-head {
  padding-bottom: 14px; margin-bottom: 20px;
  border-bottom-color: color-mix(in srgb, var(--heritage-gold) 24%, transparent);
}
.heritage-home .heritage-dashboard { gap: 22px; }
.heritage-home .nexo-section-head .link { font-size: 12px; padding: 8px 4px; }
.heritage-home .heritage-new-folder { font-size: 12px; min-height: 38px; padding: 8px; }
.heritage-home .heritage-seal small { font-size: 12px; }

/* Academic headers surround readable conversations without ornament inside messages. */
.community-approved-feed .community-fixed-top, .professor-chat .professor-chat-head {
  background: linear-gradient(115deg, color-mix(in srgb, var(--accent) 6%, var(--panel)), var(--panel));
  border-bottom: 1px solid var(--heritage-gold-soft);
}
.community-approved-feed .community-head h1, .community-chats-list h2,
.professor-chat .professor-chat-head strong {
  font-family: var(--font-academic) !important; font-weight: 600; letter-spacing: -.02em;
}
.professor-chat .professor-chat-head { padding: 20px 24px; }
.professor-chat .professor-chat-head strong { font-size: 21px; margin-bottom: 4px; }
.professor-chat-head > .professor-avatar {
  flex: 0 0 46px; width: 46px; min-width: 46px; height: 46px; min-height: 46px;
  border: 1px solid var(--heritage-gold); box-shadow: inset 0 0 0 3px var(--accent);
  color: var(--on-accent);
}
.professor-chat .professor-conversation {
  background: color-mix(in srgb, var(--page) 75%, var(--panel)); padding: 26px; gap: 18px;
}
.professor-chat .professor-message, .community-shell .community-message {
  font-family: var(--font-ui); line-height: 1.75; font-size: 16px;
  box-shadow: none; background-image: none;
}
.professor-chat .professor-message { padding: 17px 20px; }
.professor-chat .professor-answer :is(p, ul, ol) { line-height: 1.75; }
.community-approved-feed .community-post { padding: 22px; border-radius: 12px; }
.community-approved-feed .community-text { line-height: 1.75; margin-block: 18px; }
.community-approved-feed .community-shortcuts > button { box-shadow: none; }
.community-shell :is(.community-chat-title, .community-chats-list) { background-image: none; }
.community-shell :is(.community-comments input, .community-compose textarea),
.professor-chat .professor-compose textarea {
  background: var(--field); border: 1px solid var(--edge); border-radius: 14px; padding: 12px 15px;
}
.professor-chat .professor-compose > .btn { box-shadow: none; border-radius: 50% !important; }
.professor-chat .professor-form { background: var(--panel); }

@media (min-width: 701px) and (max-width: 1100px) {
  .heritage-primary-actions { grid-template-columns: 1.25fr 1fr 1fr; gap: 10px; }
  .heritage-primary-actions > .btn.primary { font-size: 16px; padding-inline: 15px; }
  .heritage-primary-actions > .btn:not(.primary) { font-size: 14px; padding-inline: 12px; }
  .heritage-primary-actions > .btn > .heritage-ui-icon { width: 22px; height: 22px; }
}

@media (max-width: 700px) {
  .heritage-home { padding-top: 0; }
  .heritage-welcome {
    grid-template-columns: 86px minmax(0, 1fr); gap: 12px; min-height: 128px; padding: 3px 0 12px;
  }
  .heritage-welcome .nexo-companion, .heritage-welcome .nexo-mascot-button { width: 86px; max-width: 86px; }
  .heritage-welcome .nexo-mascot { width: 86px; height: 100px; }
  .heritage-welcome h1 { font-size: 25px; line-height: 1.12; margin-bottom: 6px; }
  .heritage-welcome .heritage-greeting { font-size: 14px; margin-bottom: 5px; }
  .heritage-welcome-copy > p:last-of-type { font-size: 12px; line-height: 1.5; }
  .heritage-welcome .heritage-divider { margin-top: 6px; height: 10px; }
  .heritage-primary-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 20px; }
  .heritage-primary-actions > .btn:first-child { grid-column: 1 / -1; }
  .heritage-primary-actions > .btn.primary { min-height: 56px; font-size: 18px; }
  .heritage-primary-actions > .btn:not(.primary) { min-height: 48px; padding: 10px 8px; font-size: 14px; }
  .heritage-primary-actions > .btn > .heritage-ui-icon { width: 23px; height: 23px; }
  .heritage-home .nexo-card { padding: 17px 14px; }
  .heritage-home .heritage-dashboard { gap: 18px; }
  .heritage-home .nexo-section-head { padding-bottom: 11px; margin-bottom: 15px; gap: 8px; }
  .heritage-home .nexo-section-head h2 { font-size: 21px; gap: 8px; }
  .heritage-home .nexo-section-head .link { min-height: 38px; display: inline-flex; align-items: center; }
  .heritage-home .nexo-folder-grid { gap: 14px; }
  .nexo-folder-cover.heritage-book { padding: 10px 8px 12px 18px; }
  .nexo-folder-cover.heritage-book .heritage-book-face { padding: 23px 3px 7px; gap: 6px; }
  .nexo-folder-cover.heritage-book .heritage-book-title { font-size: 16px; line-height: 1.25; min-height: 3.75em; max-height: 3.75em; }
  .nexo-folder-cover.heritage-book .heritage-book-symbol svg { max-width: 62px; max-height: 64px; }
  .heritage-home .heritage-seal small { font-size: 11px; }
  .heritage-home .nexo-resume .nexo-section-head h2 { font-size: 19px; }
  .heritage-home .heritage-resume-info h3 { font-size: 16px; line-height: 1.35; }
  .heritage-home .heritage-resume-info small { font-size: 12px; }
  .heritage-home .heritage-resume-progress small { font-size: 11px; }
  .community-approved-feed .community-fixed-top { padding-top: 16px; }
  .community-approved-feed .community-post { padding: 17px 15px; }
  .community-approved-feed .community-text { font-size: 16px; line-height: 1.7; }
  .community-approved-feed .community-post-menu > summary { min-width: 40px; min-height: 44px; }
  .professor-chat .professor-chat-head { padding: 16px; gap: 12px; }
  .professor-chat .professor-chat-head strong { font-size: 19px; }
  .professor-chat .professor-chat-head small { font-size: 12px; line-height: 1.6; }
  .professor-chat .professor-conversation { padding: 18px 12px; gap: 15px; }
  .professor-chat .professor-message { padding: 14px; font-size: 16px; line-height: 1.7; }
  .professor-chat .professor-compose textarea { padding: 10px 12px; }
}
@media (max-width: 359px) {
  .heritage-welcome { grid-template-columns: 72px minmax(0, 1fr); gap: 9px; }
  .heritage-welcome .nexo-companion, .heritage-welcome .nexo-mascot-button { width: 72px; max-width: 72px; }
  .heritage-welcome .nexo-mascot { width: 72px; height: 88px; }
  .heritage-welcome h1 { font-size: 22px; }
  .heritage-primary-actions > .btn:not(.primary) { font-size: 13px; gap: 6px; }
  .heritage-home .nexo-card { padding: 15px 11px; }
  .heritage-home .nexo-folder-grid { gap: 10px; }
  .nexo-folder-cover.heritage-book .heritage-book-title { font-size: 15px; }
  .nexo-folder-cover.heritage-book .heritage-book-face { padding-top: 20px; gap: 5px; }
  .nexo-folder-cover.heritage-book .heritage-book-symbol svg { max-width: 48px; max-height: 48px; }
}

/* Study comes first; every detailed progress control remains in this disclosure. */
.study-reading-layout .coach-progress-compact { display:block; padding:0; margin:10px 0; }
.coach-progress-details > summary { display:flex; align-items:center; justify-content:space-between; gap:14px; cursor:pointer; padding:12px 16px; min-height:48px; }
.coach-progress-details > summary > span:first-child { display:flex; align-items:baseline; flex-wrap:wrap; gap:6px 14px; }
.coach-progress-details > summary small { font:12px/1.5 var(--font-ui); color:var(--muted); }
.coach-progress-stage { font:12px/1.4 var(--font-ui); color:var(--accent-ink); white-space:nowrap; }
.coach-progress-stage::after { content:'⌄'; margin-left:10px; }
.coach-progress-details[open] .coach-progress-stage::after { content:'⌃'; }
.coach-progress-body { padding:4px 16px 16px; }
.study-reading-layout .study-reading-options { margin-block:8px; }
.study-reading-layout .study-reading-options > summary { padding-block:7px; font-size:13px; }
.study-reading-layout .study-tools { margin-block:10px; }
.study-reading-layout .study-journey { margin-block:10px 16px; }
.study-reading-layout .study-journey > button { padding:9px 13px; min-height:48px; }
.study-reading-layout .study-journey > button small { font-size:11px; }
.heritage-primary-actions.heritage-study-actions { grid-template-columns:repeat(2,minmax(0,1fr)); }
.heritage-study-actions > :only-child { grid-column:1/-1; }
.heritage-home .heritage-library-first { grid-template-columns:minmax(0,1fr); }
.heritage-library-first .nexo-folder-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.generation-checkpoints { grid-template-columns:repeat(3,minmax(0,1fr)); }
.generation-checkpoints li { min-width:0; }
.generation-phase { font-weight:600; }
@media(max-width:700px){
 .study-reading-layout .coach-progress-details > summary { padding:10px 12px; gap:8px; }
 .coach-progress-details > summary > span:first-child { display:block; }
 .coach-progress-details > summary small { display:block; font-size:11px; margin-top:3px; }
 .coach-progress-body { padding:6px 12px 14px; }
 .study-reading-layout .study-tools .actions { gap:7px; }
 .study-reading-layout .study-tools .btn { min-height:42px; padding:9px 11px; font-size:12px; }
 .study-reading-layout .study-journey { gap:5px; }
 .study-reading-layout .study-journey > button { padding:7px; min-width:0; gap:5px; }
 .study-reading-layout .study-journey > button strong { font-size:12px; }
 .study-reading-layout .study-journey > button small { display:none; }
 .heritage-primary-actions.heritage-study-actions > .btn { grid-column:auto; font-size:15px; padding:12px 9px; min-height:54px; }
 .heritage-primary-actions.heritage-study-actions > :only-child { grid-column:1/-1; }
 .heritage-study-actions > .btn > .heritage-ui-icon { width:21px;height:21px; }
 .heritage-library-first .nexo-folder-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .generation-checkpoints { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .generation-checkpoints li small { overflow-wrap:anywhere; }
}

/* Gilded cartouche joins the mobile navigation rule around its central flourish. */
@media(max-width:700px){
 .mobile-nav{border-top-color:var(--heritage-gold);padding-top:17px}
 .mobile-nav::before{
  box-sizing:border-box;top:-13px;left:50%;transform:translateX(-50%);
  width:66px;height:28px;border:1px solid var(--heritage-gold);
  border-radius:9px 9px 50% 50% / 8px 8px 18px 18px;
  background-color:var(--panel);background-size:36px 15px;background-position:center;background-clip:padding-box;
  box-shadow:0 1px 3px var(--heritage-shadow),inset 0 0 0 2px var(--panel),inset 0 0 0 3px var(--heritage-gold-soft);
  pointer-events:none;z-index:1;
 }
}
