.author-demo { --demo-ink: #214534; }
.demo-skip { position: fixed; top: -80px; left: 16px; z-index: 100; padding: 12px 18px; background: white; color: var(--primary-dark); }
.demo-skip:focus { top: 12px; }
.demo-banner { display: flex; align-items: center; gap: .75rem; padding: .65rem max(1.25rem, calc((100vw - 1420px) / 2)); background: #eee5c9; color: #3e422b; font-size: .78rem; }
.demo-banner strong { padding: .1rem .5rem; background: #2d5040; color: white; border-radius: 4px; text-transform: uppercase; letter-spacing: .09em; font-size: .65rem; }
.demo-banner a { margin-left: auto; color: inherit; text-underline-offset: 3px; }
.demo-header { position: relative; padding: 1.2rem max(1.25rem, calc((100vw - 1420px) / 2)); }
.demo-header .admin-brand { font-size: 1.22rem; }
.demo-account { display: flex; align-items: center; gap: .75rem; font-size: .83rem; }
.demo-pill { display: inline-block; padding: .2rem .6rem; background: #efe9d5; border-radius: 5px; color: #554c30; font-size: .7rem; line-height: 1.5; white-space: nowrap; font-weight: 500; }
.demo-header .demo-pill { background: #ffffff16; color: #f3ebd0; }
.demo-header .demo-invitation { margin-left: auto; border-radius: 7px; padding: .6rem .9rem; background: #efe5c6; color: #183b2a; font-weight: 600; font-size: .78rem; }
.demo-header .demo-invitation:hover { background: white; }
.demo-shell { max-width: 1460px; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 2.5rem; margin: 0 auto; padding: 2.3rem 1.25rem; }
.demo-sidebar { align-self: start; }
.demo-nav-label { font-size: .65rem; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: .55rem 0 1rem .6rem; }
.demo-sidebar nav { display: grid; gap: .2rem; }
.demo-sidebar nav a { display: flex; align-items: center; justify-content: space-between; gap: .7rem; padding: .8rem .7rem; border-radius: 7px; color: #3d4c40; text-decoration: none; font-size: .83rem; }
.demo-sidebar nav a span { opacity: 0; }
.demo-sidebar nav a:hover { background: #e9eee6; }
.demo-sidebar nav a[aria-current] { background: #dfe8dc; color: #224330; font-weight: 600; }
.demo-sidebar nav a[aria-current] span { opacity: 1; }
.demo-sidebar-note { border-top: 1px solid var(--border); margin-top: 1.5rem; padding: 1rem .6rem 0; font-size: .76rem; color: var(--muted); line-height: 1.7; }
.demo-main.admin-main { margin: 0; padding: 0; max-width: none; width: 100%; min-width: 0; }
.demo-breadcrumb { color: var(--muted); font-size: .7rem; margin: .5rem 0 .8rem; }
.demo-breadcrumb span { color: #b1ab9a; margin: 0 .5rem; }
.demo-main h1 { font-size: clamp(1.65rem, 2.2vw, 2.05rem); margin-bottom: 1.05rem; }
.demo-main h1::after { margin-top: .6rem; height: 2px; width: 38px; }
.demo-main h2 { font-size: 1.05rem; margin-bottom: .8rem; line-height: 1.45; }
.demo-lead { color: var(--muted); font-size: .91rem; max-width: 760px; margin-bottom: 1.4rem; }
.demo-notice { padding: .9rem 1rem; background: #eef1e8; border: 1px solid #dce4d2; border-radius: 8px; color: #41523d; font-size: .8rem; margin-bottom: 1.35rem; }
.demo-notice strong { color: var(--primary); }
.demo-kpis.kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.demo-kpis .kpi { padding: 1.15rem; }
.demo-kpis .kpi-label { font-size: .62rem; }
.demo-kpis .kpi-value { font-size: 1.8rem; }
.demo-kpis .kpi-foot { color: #677258; font-size: .7rem; }
.demo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 1.2rem; }
.demo-grid--wide { grid-template-columns: minmax(0, 1.7fr) minmax(220px, 1fr); }
.demo-card { padding: 1.35rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); margin-bottom: 1.2rem; min-width: 0; }
.demo-card p { font-size: .85rem; color: #56604f; line-height: 1.75; }
.demo-card-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.demo-card-heading h2 { margin-bottom: 0; }
.demo-chart { width: 100%; display: block; margin: .8rem 0 0; }
.demo-tasks { list-style: none; }
.demo-tasks li + li { border-top: 1px solid var(--border-soft); margin-top: .7rem; padding-top: .7rem; }
.demo-tasks a { display: block; font-size: .81rem; }
.demo-tasks span { display: block; font-size: .75rem; color: var(--muted); margin-top: .2rem; }
.demo-tour .demo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.demo-tour a { display: grid; gap: .3rem; padding-top: .5rem; }
.demo-tour a strong { font-size: .84rem; }
.demo-tour a > span:last-child { color: var(--muted); font-size: .76rem; }
.demo-step { font-family: 'Cinzel', Georgia, serif; color: #a4873b; font-size: 1.5rem; }
.demo-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1.4rem 0 1rem; font-size: .8rem; color: var(--muted); }
.author-demo button:disabled { opacity: .6; cursor: not-allowed; }
.author-demo .admin-table-wrap { position: relative; }
.author-demo .admin-table { min-width: 690px; box-shadow: none; }
.author-demo .admin-table small { display: block; font-size: .7rem; margin-top: .2rem; }
.author-demo .admin-table th { font-size: .64rem; }
.author-demo .admin-table td { font-size: .8rem; }
.demo-book-cell { display: flex; align-items: center; gap: .8rem; min-width: 190px; }
.demo-book-cover { flex-shrink: 0; display: flex; align-items: center; justify-content: center; width: 40px; height: 57px; border-radius: 2px 4px 4px 2px; box-shadow: inset 3px 0 0 #0002, 2px 3px 4px #0001; font-family: 'Cinzel', Georgia, serif; font-size: .62rem; color: #fcf0cf; background: #35533b; }
.demo-book-cover--clay { background: #ac7155; color: #fff4da; }
.demo-main .demo-low-stock { color: #965114; }
.demo-after { margin-top: 1.25rem; }
.demo-main a.demo-text-link { display: inline-block; margin-top: .55rem; font-size: .8rem; text-decoration: underline; text-underline-offset: 3px; }
.demo-book-heading { display: flex; align-items: center; gap: 1.5rem; margin: 1.3rem 0 1.8rem; }
.demo-book-cover--large { width: 107px; min-height: 150px; padding: 1rem .8rem; flex-direction: column; justify-content: space-between; text-align: center; }
.demo-book-cover--large span { font-size: .42rem; }
.demo-book-cover--large strong { font-size: .85rem; line-height: 1.5; }
.demo-book-heading p { font-size: .88rem; color: var(--muted); margin: .3rem 0 .8rem; }
.demo-book-heading .demo-eyebrow, .demo-eyebrow { font-size: .65rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; }
.demo-subnav { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.2rem 0; }
.demo-subnav a { border: 1px solid var(--border); background: #fff; border-radius: 5px; padding: .45rem .7rem; font-size: .76rem; }
.demo-fields { margin-top: 1.6rem; border: 1px solid var(--border); scroll-margin-top: 1.5rem; }
.demo-fields legend { padding: 0 .5rem; font-family: 'Cinzel', Georgia, serif; color: var(--primary-dark); font-size: 1.05rem; font-weight: 600; }
.demo-fields label { display: block; color: #475640; font-size: .8rem; font-weight: 500; margin-bottom: .95rem; }
.demo-fields input:not([type="checkbox"]), .demo-fields textarea, .demo-fields select { display: block; margin-top: .4rem; width: 100%; max-width: 100%; background: #f8f8f2; border: 1px solid #e1e4d8; border-radius: 6px; padding: .6rem .75rem; font: inherit; font-weight: 400; color: #445140; opacity: 1; -webkit-text-fill-color: #445140; cursor: not-allowed; }
.demo-fields textarea { resize: none; line-height: 1.65; }
.demo-fields .demo-check { display: flex; align-items: center; gap: .6rem; font-size: .8rem; }
.demo-fields input[type="checkbox"] { accent-color: var(--primary); width: 17px; height: 17px; }
.demo-card .demo-field-help { font-size: .75rem; color: var(--muted); margin-top: .65rem; }
.demo-readonly-note { color: var(--muted); font-size: .78rem; margin-bottom: 1rem; }
.demo-status { display: inline-block; border-radius: 4px; padding: .2rem .5rem; font-size: .7rem; background: #e8f0e8; color: #275337; white-space: nowrap; }
.demo-status--pending { color: #795819; background: #f6eed7; }
.demo-status--neutral { color: #575b68; background: #edeef2; }
.demo-palette { display: flex; gap: .6rem; margin: .5rem 0 1.2rem; flex-wrap: wrap; }
.demo-color { padding: .9rem 1rem; border-radius: 7px; font-size: .7rem; min-width: 90px; border: 1px solid #0001; }
.demo-color--forest { background: #2d5040; color: #fff; }
.demo-color--cream { background: #f8f4ec; color: #47533e; }
.demo-color--gold { background: #c9a227; color: #31280e; }
.demo-card .demo-stripe-state { color: #2e5b3e; font-weight: 600; font-size: 1rem; margin-bottom: .75rem; }
.demo-stripe-state span { display: inline-flex; align-items: center; justify-content: center; width: 27px; height: 27px; border-radius: 50%; background: #e4efdf; margin-right: .35rem; }
.demo-plan { background: #f8f7f1; border: 1px solid var(--border); padding: 1.2rem; border-radius: 8px; }
.demo-plan > strong { display: block; color: var(--primary-dark); font-size: 1.6rem; margin: .4rem 0 .75rem; }
.demo-plan .demo-eyebrow { font-size: .63rem; }
.demo-plan--premium { background: #edf2e9; border-color: #d8e2d2; }
.demo-domain { overflow-wrap: anywhere; }
.demo-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; padding: 1.5rem 0 .5rem; border-top: 1px solid var(--border); color: var(--muted); font-size: .73rem; margin-top: 1.5rem; }
@media (max-width: 1120px) {
    .demo-shell { grid-template-columns: 190px minmax(0, 1fr); gap: 1.5rem; }
    .demo-account .demo-pill { display: none; }
    .demo-grid--wide { grid-template-columns: minmax(0, 1fr); }
    .demo-tasks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
    .demo-tasks li + li { border: 0; margin: 0; padding: 0; }
    .demo-kpis .kpi { padding: .85rem; }
    .demo-kpis .kpi-value { font-size: 1.6rem; }
}
@media (max-width: 800px) {
    .demo-shell { display: block; padding-top: 1rem; }
    .demo-sidebar { margin-bottom: 1.5rem; }
    .demo-sidebar nav { display: flex; overflow-x: auto; padding-bottom: .5rem; gap: .45rem; }
    .demo-sidebar nav a { flex: 0 0 auto; white-space: nowrap; border: 1px solid var(--border); padding: .6rem .8rem; font-size: .75rem; background: #fff; }
    .demo-sidebar nav a span, .demo-sidebar-note { display: none; }
    .demo-nav-label { margin: 0 0 .6rem; }
    .demo-header .admin-brand { border-right: 0; padding-right: 0; margin-right: 0; }
    .demo-account { margin-left: auto; font-size: .75rem; }
    .demo-header .demo-invitation { width: 100%; text-align: center; margin: 0; }
    .demo-header { gap: .75rem; }
    .demo-tour .demo-grid { grid-template-columns: 1fr; gap: 1rem; }
    .demo-tour a { grid-template-columns: 34px 1fr; gap: .1rem .7rem; }
    .demo-tour .demo-step { grid-row: 1 / 3; align-self: center; }
    .demo-tour a > span:last-child { grid-column: 2; }
}
@media (max-width: 520px) {
    .demo-banner { font-size: .66rem; gap: .4rem; flex-wrap: wrap; }
    .demo-banner a { font-size: .65rem; }
    .demo-shell { padding-left: 1rem; padding-right: 1rem; }
    .demo-header { padding: 1rem; }
    .demo-header .admin-brand { font-size: 1.05rem; gap: .45rem; }
    .demo-header .admin-brand img { width: 27px; height: 27px; }
    .demo-account { font-size: .65rem; }
    .demo-kpis.kpi-grid { grid-template-columns: 1fr; gap: .65rem; }
    .demo-kpis .kpi { display: grid; grid-template-columns: 1fr auto; padding: .85rem 1rem; gap: .2rem; }
    .demo-kpis .kpi-value { grid-column: 2; grid-row: 1 / 3; align-self: center; font-size: 1.5rem; margin: 0; }
    .demo-kpis .kpi-label, .demo-kpis .kpi-foot { margin: 0; }
    .demo-tasks { grid-template-columns: 1fr; gap: .8rem; }
    .demo-tasks li + li { border-top: 1px solid var(--border-soft); padding-top: .8rem; }
    .demo-card { padding: 1rem; }
    .demo-toolbar { align-items: flex-start; font-size: .7rem; }
    .demo-toolbar .btn { white-space: nowrap; font-size: .7rem; padding: .55rem .7rem; }
    .demo-book-heading { gap: 1rem; }
    .demo-book-cover--large { width: 90px; min-height: 132px; }
    .demo-book-heading p { font-size: .76rem; }
    .demo-book-heading h2 { font-size: 1.05rem; }
    .demo-banner a { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .author-demo *, .author-demo *::before, .author-demo *::after { transition: none !important; animation: none !important; }
}

/* Actual admin templates: the outer tour navigation moves above their own tabs. */
.demo-shell--editor{display:block;max-width:1500px}
.demo-shell--editor>.demo-sidebar{margin-bottom:1.5rem;min-width:0}
.demo-shell--editor .demo-sidebar nav{display:flex;overflow-x:auto;gap:.4rem;padding-bottom:.4rem}
.demo-shell--editor .demo-sidebar nav a{flex:0 0 auto;border:1px solid var(--border);font-size:.75rem;white-space:nowrap;background:#fff}
.demo-shell--editor .demo-sidebar nav a[aria-current]{background:#dfe8dc}
.demo-shell--editor .demo-sidebar nav a span,.demo-shell--editor .demo-sidebar-note{display:none}
.demo-shell--editor .demo-nav-label{margin:0 0 .6rem}
.demo-real-notice{display:flex;justify-content:space-between;align-items:center;gap:1.5rem}
.demo-real-notice>a{white-space:nowrap;text-decoration:underline!important;text-underline-offset:3px}
.demo-real-editor{min-width:0}
.demo-real-editor .settings-layout{grid-template-columns:235px minmax(0,1fr)}
.demo-real-editor .settings-content,.demo-real-editor .settings-layout>form{min-width:0}
.demo-real-editor .settings-pane{scroll-margin-top:20px}
.demo-real-editor .settings-tab.is-active{color:var(--bg)!important}
.demo-real-editor [disabled],.demo-section-dialog [disabled]{opacity:.8;cursor:not-allowed}
.demo-real-editor input:disabled,.demo-real-editor textarea:disabled,.demo-real-editor select:disabled,.demo-section-dialog input:disabled,.demo-section-dialog textarea:disabled{opacity:1;color:#45523f;-webkit-text-fill-color:#45523f;background-color:#f5f6f0}
.demo-real-editor input[type=color]:disabled{padding:3px;background:#fff}
.demo-real-editor .file-dropzone__input:disabled{opacity:0}
.demo-real-editor [hidden],.demo-section-dialog [hidden]{display:none!important}
.demo-real-editor a[aria-disabled=true]{opacity:.6;cursor:not-allowed}
.demo-real-editor .section-item__handle{cursor:default}
.demo-real-editor .page-builder{grid-template-columns:minmax(0,1fr) minmax(260px,.85fr)}
.demo-real-editor .page-builder__preview-col{min-width:0}
.demo-real-editor .page-builder__preview-iframe{max-width:100%}
.demo-section-dialog,.demo-fullscreen-dialog{margin:auto;padding:0;border:0;border-radius:12px;color:var(--text);background:var(--surface);box-shadow:0 25px 90px #172c2860;max-width:calc(100vw - 28px);max-height:calc(100dvh - 28px)}
.demo-section-dialog{width:680px}
.demo-section-dialog .section-modal__panel{width:100%;max-height:none;box-shadow:none}
.demo-section-dialog::backdrop,.demo-fullscreen-dialog::backdrop{background:#142b26b0}
.demo-fullscreen-dialog{width:calc(100vw - 28px);height:calc(100dvh - 28px)}
.demo-fullscreen-dialog[open]{display:flex;flex-direction:column}
.demo-fullscreen-dialog .page-builder-fullscreen__body{flex:1;min-height:0}
.demo-fullscreen-dialog iframe{height:100%;width:100%;border:0}
@media(max-width:1200px){.demo-real-editor .page-builder{grid-template-columns:1fr}.demo-real-editor .page-builder__preview-col{position:static}.demo-real-editor .settings-pane{padding:1.2rem}}
@media(max-width:800px){.demo-real-editor .settings-layout{grid-template-columns:minmax(0,1fr)}.demo-real-editor .settings-tabs{position:static}.demo-real-notice{align-items:flex-start;flex-direction:column;gap:.7rem}.demo-real-editor .settings-pane{padding:1rem}.demo-real-editor h1{overflow-wrap:anywhere}.demo-real-editor .settings-tab{font-size:.85rem}.demo-real-editor .section-item__actions{flex-wrap:wrap}.demo-fullscreen-dialog .page-builder-fullscreen__header{gap:.5rem}.demo-fullscreen-dialog .page-builder-fullscreen__header h3{font-size:.9rem}}
.demo-real-editor .settings-tab{transition:none!important}
.demo-fullscreen-dialog .page-builder-fullscreen__header{flex:0 0 auto;margin:0;padding:.8rem 1rem;background:var(--primary)}
.demo-fullscreen-dialog .page-builder-fullscreen__close{position:static;flex:0 0 auto}
.demo-fullscreen-dialog .page-builder-fullscreen__body{border-radius:0}
@media(max-width:800px){.demo-real-editor .settings-tabs__sep{flex-basis:100%;margin-top:.6rem}.demo-real-editor .settings-tab{flex:1 0 calc(50% - .5rem);width:auto}}
@media(max-width:520px){
    .demo-real-editor .section-item{grid-template-columns:auto auto minmax(0,1fr);gap:.5rem}
    .demo-real-editor .section-item__title{white-space:normal;overflow-wrap:anywhere}
    .demo-real-editor .section-item__actions{grid-column:3;justify-self:start}
    .demo-real-editor .file-dropzone__text strong{white-space:normal;overflow-wrap:anywhere}
    .demo-real-editor .palette-grid{grid-template-columns:minmax(0,1fr)}
    .demo-real-editor .palette-row{grid-template-columns:36px minmax(0,1fr)}
    .demo-real-editor .palette-row__source{grid-column:2;justify-self:start}
    .demo-real-editor .palette-row__reset{grid-column:1;grid-row:2}
    .demo-real-editor .book-preview__frame{padding:1.25rem 1rem}
}
