/* Zethea additions on top of the knowledge-base theme. */

/* Sign-in: one narrow column, one path at a time, every control the same height. */
.zethea-auth { max-width: 22rem; margin: clamp(2rem, 10vh, 6rem) auto 4rem; padding: 0 1rem; --zethea-control: 2.75rem; }
.zethea-auth__title { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 1.75rem; }
.zethea-auth__google button, .zethea-auth__primary { display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%; min-height: var(--zethea-control); font: inherit; font-weight: 500; border-radius: 8px; cursor: pointer; }
.zethea-auth__google button { background: var(--bg, #fff); color: var(--text, #111); border: 1px solid var(--border, #d4d4d8); }
.zethea-auth__google button:hover { border-color: var(--text, #111); }
.zethea-auth__google button[disabled] { opacity: .5; cursor: default; }
.zethea-auth__or { display: flex; align-items: center; gap: .75rem; margin: 1.25rem 0; color: var(--muted, #71717a); font-size: .85rem; }
.zethea-auth__or::before, .zethea-auth__or::after { content: ""; flex: 1; border-top: 1px solid var(--border-light, #e4e4e7); }
.zethea-auth__form { display: grid; gap: 1rem; }
.zethea-auth__field { display: grid; gap: .35rem; }
.zethea-auth__label { display: flex; justify-content: space-between; align-items: baseline; font-size: .85rem; font-weight: 500; color: var(--text-secondary, #3f3f46); }
.zethea-auth__field input { width: 100%; box-sizing: border-box; min-height: var(--zethea-control); padding: 0 .8rem; font: inherit; font-size: 1rem; color: inherit; background: var(--bg, #fff); border: 1px solid var(--border, #d4d4d8); border-radius: 8px; }
.zethea-auth__field input:focus-visible { outline: none; border-color: var(--accent, #2563eb); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #2563eb) 20%, transparent); }
.zethea-auth__hint { font-size: .8rem; color: var(--muted, #71717a); }
.zethea-auth__primary { background: var(--accent, #2563eb); color: #fff; border: 1px solid var(--accent, #2563eb); margin-top: .25rem; }
.zethea-auth__primary:hover { filter: brightness(.95); }
.zethea-auth__primary[disabled] { opacity: .6; cursor: default; }
.zethea-auth__link, .zethea-auth__forgot { font: inherit; background: none; border: 0; padding: 0; color: var(--accent, #2563eb); cursor: pointer; text-decoration: none; }
.zethea-auth__link:hover, .zethea-auth__forgot:hover { text-decoration: underline; }
.zethea-auth__forgot { font-size: .8rem; font-weight: 400; }
.zethea-auth__error { margin: 0; font-size: .9rem; color: #b91c1c; }
.zethea-auth__error--ok { color: #15803d; }
.zethea-auth__switch { margin: 1.5rem 0 0; font-size: .9rem; color: var(--text-secondary, #3f3f46); }
.zethea-auth__who { font-size: 1rem; margin: 0 0 .75rem; }
.zethea-auth__row { display: flex; gap: 1.25rem; margin: 0 0 1rem; }
.zethea-auth__note { font-size: .9rem; color: var(--muted, #71717a); margin: 0; }
.zethea-auth button:focus-visible { outline: 2px solid var(--accent, #2563eb); outline-offset: 2px; }

/* Shared controls */
.zethea-input { font: inherit; font-size: 1rem; color: inherit; background: var(--bg, #fff); border: 1px solid var(--border, #d4d4d8); border-radius: 8px; min-height: 2.75rem; padding: 0 .8rem; box-sizing: border-box; }
.zethea-input:focus-visible { outline: none; border-color: var(--accent, #2563eb); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #2563eb) 20%, transparent); }
.zethea-button { font: inherit; font-weight: 500; color: #fff; background: var(--accent, #2563eb); border: 1px solid var(--accent, #2563eb); border-radius: 8px; min-height: 2.75rem; padding: 0 1rem; cursor: pointer; }
.zethea-button:hover { filter: brightness(.95); }

/* Landing page */
.zethea-home, .zethea-courses { max-width: 46rem; margin: 0 auto; padding: clamp(1.5rem, 5vh, 3.5rem) 1rem 4rem; }
.zethea-hero { margin: 0 0 2.5rem; }
.zethea-hero__claim { font-size: clamp(1.45rem, 1rem + 1.8vw, 2.1rem); font-weight: 600; line-height: 1.25; letter-spacing: -0.015em; margin: 0 0 1rem; max-width: 40rem; }
.zethea-hero__facts { margin: 0; color: var(--muted, #71717a); font-size: .95rem; }
.zethea-home__all { margin: 2.5rem 0 0; font-weight: 600; }
.zethea-home__all a::after { content: " →"; }

/* Continue line */
.zethea-continue { margin: 0 0 1.5rem; font-size: 1.05rem; }
.zethea-continue__link { font-weight: 600; }
.zethea-continue__link::after { content: " →"; }

/* Goal chooser */
.zethea-start { margin: 0 0 3rem; }
.zethea-start__title { font-size: 1.15rem; font-weight: 600; margin: 0 0 .5rem; }
.zethea-goals { border-top: 1px solid var(--border, #e7e5e4); }
.zethea-goal { border-bottom: 1px solid var(--border, #e7e5e4); }
.zethea-goal__summary { display: flex; align-items: center; gap: .75rem; min-height: 3rem; padding: .35rem 0; font-size: 1.05rem; font-weight: 500; cursor: pointer; list-style: none; }
.zethea-goal__summary::-webkit-details-marker { display: none; }
.zethea-goal__summary::before { content: ""; flex: none; width: .5rem; height: .5rem; border-right: 1.5px solid var(--muted, #78716c); border-bottom: 1.5px solid var(--muted, #78716c); transform: rotate(-45deg); transition: transform .15s; margin-left: .15rem; }
.zethea-goal[open] > .zethea-goal__summary::before { transform: rotate(45deg); }
.zethea-goal[open] > .zethea-goal__summary { font-weight: 600; }
.zethea-goal__summary:hover { color: var(--accent, #2563eb); }
.zethea-goal__summary:focus-visible { outline: 2px solid var(--accent, #2563eb); outline-offset: -2px; }
.zethea-goal__outcome { margin: 0 0 1rem 1.4rem; color: var(--text-secondary, #44403c); }
.zethea-steps { list-style: none; counter-reset: step; margin: 0 0 1.25rem 1.4rem; padding: 0; }
.zethea-step { position: relative; display: grid; gap: .2rem; padding: .6rem 0 .6rem 2rem; border-top: 1px solid var(--border-light, #f0efed); counter-increment: step; }
.zethea-step::before { content: counter(step); position: absolute; left: 0; top: .6rem; width: 1.5rem; color: var(--muted, #78716c); font-variant-numeric: tabular-nums; font-size: .9rem; line-height: 1.7; }
.zethea-step__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; }
.zethea-step__name { font-weight: 600; }
.zethea-step__facts, .zethea-course__facts { color: var(--muted, #78716c); font-size: .85rem; white-space: nowrap; }
.zethea-step__line, .zethea-course__line { color: var(--text-secondary, #44403c); font-size: .95rem; }
.zethea-step__actions { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem; font-size: .9rem; }
.zethea-step__start { font-weight: 600; }
.zethea-step__start::after { content: " →"; }
.zethea-step--missing { color: var(--muted, #78716c); padding: .6rem 0 .6rem 2rem; }
.zethea-progress:empty { display: none; }
.zethea-progress { font-size: .85rem; white-space: nowrap; }
.zethea-progress[data-state="read"] { color: var(--callout-tip, #16a34a); font-weight: 600; }
.zethea-progress[data-state="started"] { color: var(--accent, #2563eb); }

/* Something else */
.zethea-wish { display: flex; gap: .5rem; margin: .25rem 0 .75rem 1.4rem; }
.zethea-wish .zethea-input { flex: 1; min-width: 0; }
.zethea-wish__result { margin: 0 0 1rem 1.4rem; }
.zethea-wish__matches { list-style: none; margin: 0; padding: 0; }
.zethea-wish__matches li { display: grid; gap: .1rem; padding: .5rem 0; border-top: 1px solid var(--border-light, #f0efed); }
.zethea-wish__name { font-weight: 600; }
.zethea-wish__line { color: var(--text-secondary, #44403c); font-size: .95rem; }
.zethea-wish__none { margin: 0; color: var(--text-secondary, #44403c); }

/* Excerpt */
.zethea-sample { margin: 0 0 3rem; }
.zethea-sample__title { font-size: 1.15rem; font-weight: 600; margin: 0 0 .25rem; }
.zethea-sample__from { margin: 0 0 1rem; color: var(--muted, #78716c); font-size: .9rem; }
.zethea-sample__body { padding-left: 1.25rem; border-left: 2px solid var(--border, #e7e5e4); }
.zethea-sample__body .kb-statement { margin-top: 0; }
.zethea-sample__exercises { margin: 1rem 0 0; padding-left: 1.5rem; }
.zethea-sample__exercises > li > p:first-child { margin-top: 0; }
.zethea-sample__exercises .kb-check { display: none; }

/* Claims */
.zethea-claims { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border, #e7e5e4); }
.zethea-claims li { padding: .75rem 0; border-bottom: 1px solid var(--border, #e7e5e4); }
.zethea-claims a { color: inherit; }
.zethea-claims a:hover { color: var(--accent, #2563eb); text-decoration: none; }

/* Courses page */
.zethea-courses__title { font-size: 2rem; margin: 0 0 1.5rem; letter-spacing: -0.01em; }
.zethea-library__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; margin: 0 0 .5rem; }
.zethea-library__title { font-size: 1.15rem; font-weight: 600; margin: 0; }
.zethea-filter { width: min(100%, 18rem); }
.zethea-area { margin: 1.5rem 0 0; }
.zethea-area__title { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted, #78716c); margin: 0 0 .25rem; }
.zethea-course-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border, #e7e5e4); }
.zethea-course { display: grid; gap: .15rem; padding: .7rem 0; border-bottom: 1px solid var(--border, #e7e5e4); }
.zethea-course__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; }
.zethea-course__name { font-weight: 600; font-size: 1.05rem; }
.zethea-course__meta { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .85rem; color: var(--muted, #78716c); }
.zethea-course__meta:empty { display: none; }
.zethea-library__none { margin: 1rem 0; color: var(--text-secondary, #44403c); }
.zethea-map { margin: 2.5rem 0 0; border-top: 1px solid var(--border, #e7e5e4); }
.zethea-map__summary { min-height: 3rem; display: flex; align-items: center; font-weight: 600; cursor: pointer; }
.zethea-map .kb-levels { margin-top: 0; }

/* Sign-in page: what this browser holds */
.zethea-auth__kept { margin: 0 0 1.5rem; }
.zethea-auth__kept-title { margin: 0 0 .25rem; font-size: .85rem; font-weight: 500; color: var(--text-secondary, #44403c); }
.zethea-auth__kept-list { list-style: none; margin: 0; padding: 0; font-size: .95rem; }
.zethea-auth__kept-list li { padding: .35rem 0; border-top: 1px solid var(--border-light, #f0efed); }
.zethea-auth__kept-list li:last-child { border-bottom: 1px solid var(--border-light, #f0efed); }

@media (max-width: 600px) {
  .zethea-step { padding-left: 1.6rem; }
  .zethea-steps, .zethea-goal__outcome, .zethea-wish, .zethea-wish__result { margin-left: 0; }
  .zethea-step__facts, .zethea-course__facts, .zethea-progress { white-space: normal; }
}

.zethea-sync { font-size: .9rem; color: var(--text-muted, #555); margin: .25rem 0 1rem; }
.zethea-sync[data-kind="ok"]::before { content: "✓ "; color: #15803d; }
.zethea-sync[data-kind="warn"] { color: #92400e; }
/* Editing mode */
.zethea-edit-trigger { font: inherit; cursor: pointer; border: 1px solid var(--border, #ccc); background: transparent; color: inherit; border-radius: 6px; padding: .3rem .7rem; margin-right: .5rem; }
.zethea-editor { margin: 0 0 1.5rem; border-top: 1px solid var(--border, #ccc); border-bottom: 1px solid var(--border, #ccc); background: var(--bg, #fff); overflow: hidden; }
.zethea-editor__bar { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; padding: .5rem .75rem; border-bottom: 1px solid var(--border, #ccc); font-size: .9rem; }
.zethea-editor__path { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text-muted, #555); }
.zethea-editor__status[data-kind="error"] { color: #b91c1c; }
.zethea-editor__status[data-kind="ok"] { color: #15803d; }
.zethea-editor__spacer { flex: 1; }
.zethea-editor__bar button { font: inherit; cursor: pointer; border-radius: 6px; padding: .35rem .8rem; border: 1px solid var(--accent, #2563eb); background: var(--accent, #2563eb); color: #fff; }
.zethea-editor__bar button.zethea-secondary { background: transparent; color: var(--accent, #2563eb); }
.zethea-editor__warn { margin: 0; padding: .35rem .75rem; color: #92400e; font-size: .9rem; }
.zethea-editor__body { display: grid; grid-template-columns: 1fr; min-height: 60vh; }
.zethea-editor--split .zethea-editor__body { grid-template-columns: 1fr 1fr; }
.zethea-editor__text { width: 100%; min-height: 60vh; resize: vertical; border: 0; padding: 1rem; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; tab-size: 4; background: transparent; color: inherit; outline: none; }
.zethea-editor__text:focus-visible { box-shadow: inset 0 0 0 2px var(--accent, #2563eb); }
.zethea-editor__preview { padding: 1rem 1.25rem; border-left: 1px solid var(--border, #ccc); overflow: auto; max-height: 80vh; }
@media (max-width: 800px) { .zethea-editor--split .zethea-editor__body { grid-template-columns: 1fr; } .zethea-editor__preview { border-left: 0; border-top: 1px solid var(--border, #ccc); } }
/* Ask on a passage */
.zethea-ask-pill { position: absolute; z-index: 60; font: inherit; font-size: .85rem; padding: .25rem .7rem; border-radius: 999px; border: 1px solid var(--accent, #2563eb); background: var(--accent, #2563eb); color: #fff; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.zethea-ask { position: fixed; top: 64px; right: 0; bottom: 0; width: min(420px, 100vw); z-index: 55; background: var(--bg, #fff); border-left: 1px solid var(--border, #ccc); box-shadow: -4px 0 16px rgba(0,0,0,.08); display: flex; flex-direction: column; overflow: auto; padding: .75rem 1rem 1.5rem; font-size: .95rem; }
.zethea-ask__bar { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.zethea-ask__spacer { flex: 1; }
.zethea-ask .zethea-link { background: none; border: 0; color: var(--accent, #2563eb); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.zethea-ask__quote { margin: 0 0 .75rem; padding: 0 .75rem; border-left: 2px solid var(--accent, #2563eb); font-size: .9rem; max-height: 9rem; overflow: auto; }
.zethea-ask__modes { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .5rem; }
.zethea-ask__modes button { font: inherit; font-size: .85rem; padding: .2rem .6rem; border-radius: 999px; border: 1px solid var(--border, #ccc); background: transparent; color: inherit; cursor: pointer; }
.zethea-ask__modes button[aria-checked="true"] { border-color: var(--accent, #2563eb); background: var(--accent, #2563eb); color: #fff; }
.zethea-ask textarea { width: 100%; font: inherit; padding: .5rem .6rem; border: 1px solid var(--border, #ccc); border-radius: 6px; background: var(--bg, #fff); color: inherit; resize: vertical; }
.zethea-ask__actions { display: flex; align-items: center; gap: .75rem; margin: .5rem 0 1rem; }
.zethea-ask__actions button { font: inherit; padding: .4rem .9rem; border-radius: 6px; border: 1px solid var(--accent, #2563eb); background: var(--accent, #2563eb); color: #fff; cursor: pointer; }
.zethea-ask__actions button[disabled] { opacity: .55; }
.zethea-ask__status[data-kind="error"] { color: #b91c1c; }
.zethea-ask__card { border-top: 1px solid var(--border, #ccc); padding: .75rem 0; }
.zethea-ask__q { font-weight: 600; margin: 0 0 .4rem; }
.zethea-ask__a p { margin: 0 0 .5rem; }
.zethea-ask__meta { font-size: .85rem; color: var(--text-muted, #555); margin: .25rem 0 .5rem; }
.zethea-ask__layer { margin: .35rem 0; }
.zethea-ask__layer summary { cursor: pointer; font-weight: 600; }
.zethea-ask__limit { font-size: .85rem; color: #92400e; }
.zethea-ask__cardactions { display: flex; gap: 1rem; font-size: .85rem; margin: .5rem 0 0; }
@media (max-width: 800px) { .zethea-ask { top: auto; left: 0; width: 100%; max-height: 70vh; border-left: 0; border-top: 1px solid var(--border, #ccc); border-radius: 12px 12px 0 0; } }
@media (prefers-reduced-motion: reduce) { .zethea-ask * { scroll-behavior: auto; } }
/* Library review */
.zethea-review { max-width: 48rem; margin: 2rem auto; padding: 0 1rem; }
.zethea-review__summary { color: var(--text-secondary, #3f3f46); margin: 0 0 1rem; }
.zethea-review__actions { display: flex; gap: .75rem; flex-wrap: wrap; margin: 0 0 1.5rem; }
.zethea-review__course { font-size: 1.1rem; margin: 1.5rem 0 .25rem; padding-top: 1rem; border-top: 1px solid var(--border-light, #e4e4e7); }
.zethea-review__course a { color: inherit; text-decoration: none; }
.zethea-review__meta, .zethea-review__chapter { color: var(--muted, #71717a); font-weight: 400; font-size: .9rem; }
.zethea-review__cards { list-style: none; margin: 0; padding: 0; }
.zethea-review__cards li { padding: .3rem 0; font-size: .95rem; }
.zethea-review__when { font-size: .8rem; color: var(--muted, #71717a); margin-left: .25rem; }
.zethea-review__more { color: var(--muted, #71717a); }
