/* Writing Studio inherits the same Cift tokens as the plan calendar. */
html.cift-ui .writing-shell { height: 100vh; height: 100dvh; min-height: 0; display: block; overflow: hidden; }
html.cift-ui .writing-shell > .main-area { display: flex; flex-direction: column; height: 100%; min-width: 0; min-height: 0; }
html.cift-ui .writing-shell .topbar { flex: none; min-height: 64px; padding: 10px 28px; }
.writing-shell #writing-workbench-host { flex: 1; min-height: 0; min-width: 0; }
.ww, .ww * { box-sizing: border-box; }
.ww { height: 100%; min-height: 0; display: flex; flex-direction: column; padding: 0 24px; color: var(--cift-ink); font-family: var(--cift-font-ui); font-size: 13px; line-height: 1.55; }
.ww h1, .ww h2, .ww h3, .ww p { margin: 0; }
.ww h1 { font-size: 26px; font-weight: 620; line-height: 1.3; letter-spacing: -.8px; }
.ww h2 { font-size: 16px; font-weight: 620; line-height: 1.5; }
.ww h3 { font-size: 14px; font-weight: 600; }
.ww small { font-size: 11px; }
.ww button, .ww input, .ww select, .ww textarea { font: inherit; }
.ww button { cursor: pointer; }
.ww button:disabled { opacity: .5; cursor: not-allowed; }
.ww svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ww :is(button,input,select,textarea,summary):focus-visible { outline: 2px solid var(--cift-sage-ink); outline-offset: 3px; }
.ww-toolbar { min-width: 0; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 24px 4px 22px; }
.ww-toolbar > div:first-child { min-width: 0; }
.ww-kicker { display: block; font-size: 10px; font-weight: 600; letter-spacing: .16em; color: var(--cift-muted); margin-bottom: 5px; }
.ww-toolbar p { color: var(--cift-muted); font-size: 12px; margin-top: 7px; }
.ww-toolbar-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.ww-save-state, .ww-save-status { color: var(--cift-muted); font-size: 11px; margin-right: 6px; }
.ww-layout { flex: 1; min-width: 0; min-height: 0; display: grid; grid-template-columns: 234px minmax(0,1fr) 290px; gap: 16px; }
.ww-library, .ww-editor, .ww-materials { min-height: 0; min-width: 0; overflow: hidden; border: 1px solid var(--cift-line); border-radius: var(--cift-radius-md); background: var(--cift-surface); }
.ww-library, .ww-materials { display: flex; flex-direction: column; background: color-mix(in srgb, var(--cift-surface) 42%, var(--cift-bg)); border-color: color-mix(in srgb, var(--cift-line) 65%, transparent); }
.ww-editor { display: flex; flex-direction: column; box-shadow: 0 4px 24px rgb(37 58 76 / .035); }
.ww-editor-heading .ww-kicker, .ww-library .ww-panel-heading .ww-kicker { color: var(--brand-blue-ink); }
.ww-materials .ww-panel-heading .ww-kicker { color: var(--brand-rose-ink); }
.ww-materials > .ww-segmented button.is-active { background: var(--brand-rose-soft); color: var(--brand-rose-ink); box-shadow: none; }
.ww-panel-head, .ww-editor-head, .ww-library-head, .ww-materials-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 20px 20px 16px; }
.ww-panel-head > div, .ww-editor-head > div { min-width: 0; }
.ww-panel-head p, .ww-editor-head p { color: var(--cift-muted); font-size: 11px; margin-top: 4px; }
.ww-count, .ww-badge { padding: 3px 8px; border-radius: 999px; font-size: 10px; font-variant-numeric: tabular-nums; background: var(--cift-surface-muted); color: var(--cift-muted); white-space: nowrap; }
.ww :is(.ww-button,.ww-chip,.ww-icon-button) { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 999px; padding: 8px 13px; background: var(--cift-control); color: var(--cift-ink); white-space: nowrap; font-size: 12px; font-weight: 500; transition: background-color var(--cift-duration-fast), color var(--cift-duration-fast), box-shadow var(--cift-duration-fast); }
.ww .ww-button:hover, .ww .ww-chip:hover, .ww .ww-icon-button:hover { background: var(--cift-control-hover); }
.ww .ww-primary { background: var(--cift-accent); color: var(--cift-on-accent); }
.ww .ww-primary:hover { background: var(--cift-accent-hover); }
.ww .ww-icon-button { width: 38px; padding: 8px; flex: none; }
.ww .ww-quiet { background: transparent; color: var(--cift-muted); }
.ww .ww-danger { color: var(--cift-danger); }
.ww .ww-chip { min-height: 32px; padding: 5px 10px; font-size: 11px; }
.ww .ww-chip.is-active { background: var(--cift-sage); color: var(--cift-sage-ink); }
.ww-segmented { display: flex; gap: 3px; padding: 4px; border-radius: 999px; background: var(--cift-control); }
.ww-segmented button { flex: 1; min-height: 34px; border: 0; border-radius: 999px; padding: 7px 12px; background: transparent; color: var(--cift-muted); font-size: 12px; white-space: nowrap; transition: background-color 200ms, color 200ms, box-shadow 200ms; }
.ww-segmented button.is-active, .ww-segmented button[aria-selected=true], .ww-segmented button[aria-pressed=true] { background: var(--cift-surface); color: var(--cift-ink); box-shadow: var(--cift-shadow-soft); }
.ww-filters { display: grid; gap: 12px; padding: 0 16px 16px; border-bottom: 1px solid var(--cift-line); }
.ww-filter-row, .ww-part-filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ww label { display: grid; gap: 7px; color: var(--cift-muted); font-size: 12px; }
html.cift-ui .main-area .ww :is(input,select,textarea) { width: 100%; min-width: 0; border: 1px solid var(--cift-line); border-radius: 10px; padding: 10px 12px; background: var(--cift-surface); color: var(--cift-ink); }
.ww input::placeholder, .ww textarea::placeholder { color: var(--cift-muted); opacity: .72; }
.ww-prompt-list { min-height: 0; overflow-y: auto; padding: 10px; scrollbar-width: thin; scrollbar-color: var(--cift-scrollbar) transparent; }
.ww-prompt-card { display: grid; width: 100%; gap: 5px; text-align: left; border: 1px solid transparent; border-radius: 13px; padding: 12px; background: transparent; color: var(--cift-ink); margin-bottom: 4px; transition: background-color 160ms, border-color 160ms; }
.ww-prompt-card:hover { background: var(--cift-surface-muted); }
.ww-prompt-card.is-active { background: var(--cift-sage); border-color: color-mix(in srgb,var(--cift-sage-ink) 12%,transparent); }
.ww-prompt-card > span, .ww-prompt-meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.ww-prompt-card strong { font-size: 14px; font-weight: 650; }
.ww-prompt-card small { color: var(--cift-muted); }
.ww-prompt-card.is-active small { color: var(--cift-sage-ink); }
.ww-prompt-title { font-size: 12px; line-height: 1.6; }
.ww-pending { color: var(--cift-muted); padding: 12px; border-radius: 12px; border: 1px dashed var(--cift-line); margin: 6px 0; font-size: 12px; }
.ww-library-foot { padding: 10px 16px; font-size: 10px; color: var(--cift-muted); border-top: 1px solid var(--cift-line); }
.ww-editor-head { border-bottom: 1px solid var(--cift-line); padding: 18px 24px; }
.ww-editor-head h2 { font-size: 17px; letter-spacing: -.3px; }
.ww-word-count { white-space: nowrap; text-align: right; color: var(--cift-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.ww-word-count strong { font-size: 22px; font-weight: 500; color: var(--cift-ink); }
.ww-editor-tabs { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 12px 24px; border-bottom: 1px solid var(--cift-line); }
.ww-editor-tabs .ww-segmented { width: max-content; }
.ww-editor-scroll, .ww-editor-body { min-height: 0; overflow-y: auto; padding: 20px 24px 28px; scrollbar-width: thin; scrollbar-color: var(--cift-scrollbar) transparent; }
.ww-source { border: 1px solid var(--cift-line); border-radius: 14px; background: var(--cift-surface-soft); margin-bottom: 22px; }
.ww-source > summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; padding: 13px 16px; font-size: 12px; font-weight: 550; list-style: none; }
.ww-source > summary::-webkit-details-marker { display: none; }
.ww-source > summary::after { content: '+'; font-size: 18px; color: var(--cift-muted); }
.ww-source[open] > summary::after { content: '−'; }
.ww-source-body { border-top: 1px solid var(--cift-line); padding: 16px; }
.ww-source-body > p, .ww-source-text { font-family: var(--cift-font-reading); font-size: 14px; line-height: 1.85; margin-bottom: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ww-source-image { display: block; width: 100%; border: 0; padding: 8px; border-radius: 8px; background: #fff; margin: 12px auto; cursor: zoom-in; }
.ww-source-image img { display: block; max-width: 100%; max-height: 290px; height: auto; width: auto; margin: auto; object-fit: contain; }
.ww-source-caption { font-size: 12px; color: var(--cift-muted); text-align: center; margin-block: 8px; }
.ww-source-foot, .ww-source-origin { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--cift-line); color: var(--cift-muted); font-size: 10px; overflow-wrap: anywhere; }
.ww-source-issues, .ww-source-note { border-radius: 9px; padding: 10px 12px; background: var(--cift-peach); color: var(--cift-peach-ink); font-size: 12px; margin-top: 12px; }
.ww-source table { width: 100%; border-collapse: collapse; margin-block: 12px; font-size: 12px; }
.ww-source :is(th,td) { border: 1px solid var(--cift-line); padding: 7px; overflow-wrap: anywhere; }
.ww-paragraph { position: relative; margin-bottom: 20px; padding: 18px; border: 1px solid var(--cift-line); border-radius: 16px; background: var(--cift-surface); transition: border-color 160ms, box-shadow 160ms; }
.ww-paragraph.is-active, .ww-paragraph:focus-within { border-color: color-mix(in srgb,var(--cift-sage-ink) 40%,var(--cift-line)); box-shadow: 0 0 0 3px color-mix(in srgb,var(--cift-sage) 45%,transparent); }
.ww-paragraph.is-dragover { background: var(--cift-surface-soft); border-style: dashed; }
.ww-paragraph-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.ww-paragraph-top > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ww-paragraph-title { font-size: 12px; font-weight: 600; }
.ww-paragraph-number { width: 24px; height: 24px; display: inline-grid; place-items: center; border-radius: 7px; color: var(--cift-sage-ink); background: var(--cift-sage); font-size: 11px; }
html.cift-ui .main-area .ww textarea.ww-english { display: block; font-family: var(--cift-font-reading); min-height: 106px; resize: vertical; font-size: 17px; line-height: 1.9; padding: 4px 0; border: 0; border-radius: 0; background: transparent; outline-offset: 6px; }
html.cift-ui .main-area .ww textarea.ww-notes { display: block; min-height: 65px; resize: vertical; font-size: 12px; line-height: 1.75; background: var(--cift-surface-soft); margin-top: 8px; color: var(--cift-muted); }
.ww-paragraph-hint { font-size: 10px; color: var(--cift-muted); margin-top: 9px; }
.ww-add-paragraph { width: 100%; border: 1px dashed var(--cift-line) !important; background: transparent !important; }
.ww-editor-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 24px; flex: none; border-top: 1px solid var(--cift-line); }
.ww-preview { min-height: 260px; }
.ww-preview p { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--cift-font-reading); font-size: 18px; line-height: 2; margin-bottom: 22px; }
.ww-preview .ww-preview-notes { font-family: var(--cift-font-ui); font-size: 12px; color: var(--cift-muted); }
.ww-material-tabs { padding: 0 16px 16px; border-bottom: 1px solid var(--cift-line); }
.ww-material-body, .ww-material-scroll { padding: 18px; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--cift-scrollbar) transparent; }
.ww-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px 12px; gap: 12px; color: var(--cift-muted); }
.ww-empty > svg { width: 32px; height: 32px; color: var(--cift-muted); }
.ww-empty h3 { color: var(--cift-ink); font-size: 14px; }
.ww-empty p { max-width: 240px; font-size: 12px; line-height: 1.8; }
.ww-empty-icon { display: grid; place-items: center; width: 54px; height: 54px; border: 1px solid var(--cift-line); background: var(--cift-surface-soft); border-radius: 16px; margin-bottom: 2px; }
.ww-form { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--cift-line); border-radius: 14px; margin-bottom: 18px; background: var(--cift-surface-soft); }
.ww-form h3 { margin-bottom: 2px; }
.ww-form textarea { resize: vertical; min-height: 85px; }
.ww-form .ww-button { width: 100%; }
.ww-form-actions { display: flex; gap: 8px; }
.ww-sentence-card, .ww-template-card { border: 1px solid color-mix(in srgb, var(--cift-line) 70%, transparent); border-radius: 16px; padding: 16px; margin-top: 12px; background: var(--cift-surface); overflow-wrap: anywhere; box-shadow: 0 2px 7px rgb(37 58 76 / .025); }
.ww-sentence-card[draggable=true], .ww-template-card[draggable=true] { cursor: grab; user-select: none; -webkit-user-select: none; transition: transform 180ms ease, opacity 180ms ease, box-shadow 180ms ease; }
.ww-sentence-card[draggable=true]:active, .ww-template-card[draggable=true]:active, .ww-sentence-card.is-dragging, .ww-template-card.is-dragging { cursor: grabbing; opacity: .64; transform: scale(.985); box-shadow: 0 12px 28px rgb(37 58 76 / .12); }
.ww-drag-preview { position: fixed; z-index: 100000; pointer-events: none; display: grid; gap: 7px; width: 220px; max-height: 106px; overflow: hidden; padding: 13px 34px 13px 15px; border: 1px solid color-mix(in srgb,var(--cift-line) 80%,transparent); border-radius: 16px; color: var(--cift-ink); background: color-mix(in srgb,var(--cift-surface) 95%,transparent); box-shadow: 0 18px 44px rgb(24 38 62 / .18),0 3px 9px rgb(24 38 62 / .08); backdrop-filter: blur(20px); transform: rotate(-2deg); user-select: none; }
.ww-drag-preview-label { font: 600 10px/1.3 var(--cift-font-ui); letter-spacing: .07em; color: var(--cift-muted); }
.ww-drag-preview-copy { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font: 500 14px/1.55 var(--cift-font-reading); }
.ww-drag-preview-plus { position: absolute; right: 11px; top: 13px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: var(--cift-surface); background: var(--cift-ink); font: 500 14px/1 system-ui,sans-serif; }
.ww-material-drag-handle { display: none; }
.ww.is-phone .ww-sheet-content :is(.ww-sentence-card,.ww-template-card) { position: relative; padding-right: 42px; }
.ww.is-phone .ww-material-drag-handle { position: absolute; top: 10px; right: 7px; display: grid; place-items: center; width: 32px; height: 38px; min-width: 32px; min-height: 38px; padding: 8px; border: 0; border-radius: 12px; background: transparent; color: var(--cift-muted); cursor: grab; touch-action: none; user-select: none; -webkit-touch-callout: none; }
.ww.is-phone .ww-material-drag-handle svg { width: 18px; height: 22px; fill: currentColor; stroke: none; }
.ww.is-phone .ww-material-drag-handle:active { color: var(--cift-ink); background: var(--cift-control); }
.ww.is-phone .ww-sheet-dialog.is-material-dragging { pointer-events: none; z-index: 80; }
.ww.is-phone .ww-sheet-dialog.is-material-dragging .ww-sheet-frame { transform: translateY(calc(100% - 76px)); opacity: .88; transition: transform 260ms cubic-bezier(.22,1,.36,1),opacity 220ms ease; }
.ww.is-phone.has-material-drag .ww-sheet-heading::before { content: '拖到段落后松开'; font-size: 12px; color: var(--cift-muted); }
.ww.is-phone.has-material-drag .ww-sheet-heading > * { visibility: hidden; }
.ww.is-phone.has-material-drag .ww-drag-preview { width: 192px; max-height: 112px; }
.ww-paragraph.is-drag-over { outline: 2px solid color-mix(in srgb,var(--cift-sage-ink) 38%,transparent); outline-offset: 5px; background: color-mix(in srgb,var(--cift-surface-soft) 70%,var(--cift-surface)); transition: outline-color 160ms ease,background-color 160ms ease; }
.ww-sentence-card > p { font-family: var(--cift-font-reading); font-size: 14px; line-height: 1.8; white-space: pre-wrap; }
.ww-sentence-card .ww-sentence-notes { font-family: var(--cift-font-ui); font-size: 11px; color: var(--cift-muted); margin-top: 8px; }
.ww-card-actions { display: flex; align-items: center; gap: 8px; justify-content: space-between; margin-top: 12px; }
.ww-template-card p { color: var(--cift-muted); font-size: 11px; margin-top: 6px; }
.ww-section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ww-hint { color: var(--cift-muted); font-size: 11px; line-height: 1.8; }
.ww-notice { background: var(--cift-surface-muted); color: var(--cift-muted); border-radius: 12px; padding: 12px; font-size: 11px; margin-block: 12px; }
.ww-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 4px max(10px,env(safe-area-inset-bottom)); font-size: 10px; color: var(--cift-muted); grid-row: 4; }
.ww-footer p { font-size: 10px; }
.ww-error { color: var(--cift-danger); background: var(--cift-danger-bg); border-radius: 12px; padding: 12px; font-size: 12px; }
.ww-mobile-tabs { display: none; }
.ww-dialog { max-width: min(660px,calc(100vw - 32px)); max-height: calc(100dvh - 40px); padding: 24px; border: 1px solid var(--cift-line); border-radius: 22px; color: var(--cift-ink); background: var(--cift-surface); box-shadow: var(--cift-shadow-float); overflow-y: auto; font-family: var(--cift-font-ui); }
.ww-dialog::backdrop { background: var(--cift-scrim); backdrop-filter: blur(4px); }
.ww-dialog h2 { font-size: 19px; margin-bottom: 12px; }
.ww-dialog p { color: var(--cift-muted); margin-block: 12px; line-height: 1.8; }
.ww-dialog img { display: block; max-width: 100%; max-height: 70dvh; margin: 14px auto; background: #fff; border-radius: 10px; }
.ww-dialog-head, .ww-dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ww-dialog-actions { justify-content: flex-end; margin-top: 22px; }
.ww-toast { position: fixed; bottom: 36px; left: 50%; transform: translateX(-50%); z-index: 100; max-width: calc(100vw - 32px); padding: 10px 18px; border-radius: 999px; background: var(--cift-accent); color: var(--cift-on-accent); box-shadow: var(--cift-shadow-float); font-size: 12px; pointer-events: none; }
.ww [hidden] { display: none !important; }
html.cift-ui .home-page .home-workbench:has(.home-writing-entry) { display: block; margin-block: 20px; }
html.cift-ui .home-page .home-writing-entry { display: flex; width: 100%; align-items: center; gap: 18px; text-align: left; border: 1px solid var(--cift-line); border-radius: 20px !important; padding: 20px 24px; background: var(--cift-surface); color: var(--cift-ink); }
.home-writing-entry > span:nth-child(2) { flex: 1; display: grid; gap: 3px; }
.home-writing-entry small { color: var(--cift-muted); font-size: 10px; letter-spacing: .12em; }
.home-writing-entry strong { font-size: 18px; font-weight: 600; }
.home-writing-entry em { font-style: normal; font-size: 12px; color: var(--cift-muted); }
.home-writing-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--brand-blue-soft); color: var(--brand-blue-ink); }
.home-writing-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
@media (min-width: 1550px) { .ww { padding-inline: 40px; } .ww-layout { grid-template-columns: 260px minmax(0,1fr) 320px; gap: 20px; } .ww-editor-scroll,.ww-editor-body { padding-inline: clamp(28px,4vw,64px); } }
@media (max-width: 1179px) and (min-width: 1040px) { .ww { padding-inline: 16px; } .ww-layout { grid-template-columns: 208px minmax(0,1fr) 258px; gap: 10px; } .ww-editor-head,.ww-editor-tabs,.ww-editor-scroll,.ww-editor-body,.ww-editor-foot { padding-inline: 18px; } }
@media (max-width: 1039px) {
  .ww { padding-inline: 20px; }
  .ww-toolbar { padding-block: 20px 16px; }
  .ww-toolbar h1 { font-size: 24px; }
  .ww-mobile-tabs { display: flex; margin-bottom: 14px; padding: 4px; gap: 4px; border-radius: 999px; background: var(--cift-control); width: 100%; }
  .ww-mobile-tabs button { min-height: 40px; flex: 1; border: 0; border-radius: 999px; background: transparent; color: var(--cift-muted); font-size: 13px; transition: background-color 200ms,color 200ms; }
  .ww-mobile-tabs button.is-active, .ww-mobile-tabs button[aria-selected=true], .ww-mobile-tabs button[aria-pressed=true] { background: var(--cift-surface); color: var(--cift-ink); box-shadow: var(--cift-shadow-soft); }
  .ww-layout { grid-template-columns: minmax(0,1fr); }
  .ww-layout > [data-panel] { display: none; }
  .ww[data-active-panel=library] .ww-library, .ww[data-active-panel=editor] .ww-editor, .ww[data-active-panel=materials] .ww-materials,
  .ww[data-panel=library] .ww-library, .ww[data-panel=editor] .ww-editor, .ww[data-panel=materials] .ww-materials,
  .ww-layout > [data-panel].is-visible, .ww-layout > [data-panel].is-mobile-active { display: flex; }
  .ww-prompt-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-content: start; gap: 6px; }
  .ww-filters { grid-template-columns: 1fr 1fr; align-items: end; }
  .ww-source-image img { max-height: 320px; }
  .ww-material-body,.ww-material-scroll { width: 100%; max-width: 640px; margin-inline: auto; }
}
@media (max-width: 600px) {
  html.cift-ui .writing-shell .topbar { min-height: 56px; padding: 6px 12px; gap: 8px; }
  .writing-shell .topbar .crumb,.writing-shell .topbar .feedback-trigger,.writing-shell .topbar .exam-countdown,.writing-shell .topbar .account-text { display: none; }
  .writing-shell .topbar-actions,.writing-shell .topbar .account-menu { gap: 6px; }
  .writing-shell .topbar .button { min-height: 38px; padding-inline: 12px; }
  .ww { padding-inline: 10px; }
  .ww-toolbar { padding: 16px 4px 12px; gap: 8px; }
  .ww-toolbar h1 { font-size: 22px; }
  .ww-kicker { font-size: 9px; letter-spacing: .12em; }
  .ww-toolbar p { font-size: 11px; max-width: 25em; }
  .ww-toolbar-actions { gap: 5px; }
  .ww-save-state,.ww-save-status { display: none; }
  .ww-toolbar-actions .ww-button { font-size: 11px; padding-inline: 10px; }
  .ww-mobile-tabs { margin-bottom: 10px; }
  .ww :is(.ww-button,.ww-icon-button) { min-height: 44px; }
  .ww .ww-icon-button { min-width: 44px; }
  .ww-layout > * { border-radius: 16px; }
  .ww-editor-head { padding: 15px 16px; }
  .ww-editor-head h2 { font-size: 15px; }
  .ww-editor-tabs { padding: 10px 14px; }
  .ww-editor-scroll,.ww-editor-body { padding: 16px 14px; }
  .ww-source-body { padding: 13px; }
  .ww-source-body > p,.ww-source-text { font-size: 14px; }
  .ww-paragraph { padding: 13px; }
  html.cift-ui .main-area .ww :is(input,select,textarea) { font-size: 16px; }
  html.cift-ui .main-area .ww textarea.ww-notes { font-size: 16px; }
  .ww-filters { grid-template-columns: 1fr; gap: 10px; }
  .ww-prompt-list { grid-template-columns: 1fr; }
  .ww-editor-foot { padding: 10px 14px; flex-wrap: wrap; }
  .ww-footer { gap: 6px; padding-block: 8px max(8px,env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .ww-footer > :last-child { font-size: 9px; }
}
@media (max-height: 570px) { .ww-toolbar { padding-block: 10px; } .ww-toolbar p,.ww-kicker { display: none; } .ww-footer { padding-block: 5px; } }
/* Panel internals keep independent scrolling, with stable editor controls. */
.ww-toolbar,.ww-footer,.ww-mobile-tabs { flex: none; }
.ww-panel-heading { padding: 24px 18px 20px; flex: none; }
.ww-panel-heading h2 { font-size: 17px; }
.ww-panel-heading p { font-size: 11px; color: var(--cift-muted); margin-top: 5px; }
.ww-library > .ww-segmented,.ww-materials > .ww-segmented { flex: none; margin: 0 16px 16px; }
.ww-library > .ww-filter-row { padding: 0 16px; display: grid; gap: 12px; }
.ww-part-filter { display: flex; gap: 4px; }
.ww-year-label { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; }
html.cift-ui .main-area .ww .ww-year-label select { width: 128px; font-size: 12px; padding-block: 7px; }
.ww-library-caption { padding: 14px 18px 7px; font-size: 10px; color: var(--cift-muted); }
.ww-prompt-list { flex: 1; }
.ww-prompt-meta { color: var(--cift-muted); font-size: 12px; }
.ww-prompt-meta > span:first-child { font-variant-numeric: tabular-nums; font-weight: 550; }
.ww-prompt-kind { font-size: 10px; padding: 1px 6px; border-radius: 5px; background: var(--cift-surface-muted); }
.ww-prompt-card.is-active .ww-prompt-kind { background: color-mix(in srgb,var(--cift-surface) 60%,transparent); color: var(--cift-sage-ink); }
.ww-prompt-card strong { font-size: 12px; font-weight: 550; line-height: 1.7; }
.ww-prompt-bottom { font-size: 10px; color: var(--cift-muted); }
.ww-draft-dot { color: var(--cift-sage-ink); font-size: 10px; }
.ww-editor-heading { flex: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 24px 16px; }
.ww-editor-heading h2 { font-size: 18px; font-weight: 550; }
.ww-editor-heading p { font-size: 12px; color: var(--cift-muted); margin-top: 6px; }
.ww-word-total { display: flex; flex-direction: column; align-items: flex-end; flex: none; font-variant-numeric: tabular-nums; }
.ww-word-total strong { font-size: 26px; font-weight: 500; line-height: 1.15; }
.ww-word-total span { font-size: 10px; color: var(--cift-muted); max-width: 90px; text-align: right; margin-top: 5px; }
.ww-editor-toolbar { flex: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 24px 17px; border-bottom: 1px solid var(--cift-line); }
.ww-editor-tabs { display: flex; gap: 3px; padding: 4px; border: 0; border-radius: 999px; background: var(--cift-control); flex-wrap: nowrap; }
.ww-editor-tabs button { min-height: 32px; padding: 5px 12px; border: 0; border-radius: 999px; background: transparent; color: var(--cift-muted); font-size: 12px; white-space: nowrap; transition: background-color 200ms; }
.ww-editor-tabs button.is-active { background: var(--cift-surface); color: var(--cift-ink); box-shadow: var(--cift-shadow-soft); }
.ww-editor-scroll { flex: 1; }
.ww-source-toggle { margin-left: auto; margin-right: 12px; font-size: 10px; color: var(--cift-muted); }
.ww-source-content { border-top: 1px solid var(--cift-line); padding: 16px; }
.ww-direction { font-family: var(--cift-font-reading); font-size: 14px; line-height: 1.85; margin-bottom: 9px !important; white-space: pre-wrap; overflow-wrap: anywhere; }
.ww-source-figure { margin: 12px 0; }
.ww-source-image > span { display: block; margin-top: 8px; font-family: var(--cift-font-ui); font-size: 10px; color: #5c6873; }
.ww-source-letter { padding-left: 12px; }
.ww-source-table-text { font-size: 11px; color: var(--cift-muted); margin-block: 10px; }
.ww-source-table-text > summary { cursor: pointer; padding-block: 8px; }
.ww-source-notes { margin-top: 12px; padding: 10px; border-radius: 8px; background: var(--cift-peach); color: var(--cift-peach-ink); font-size: 11px; }
.ww-source-notes p + p { margin-top: 6px; }
.ww-source-table-wrap { overflow-x: auto; }
.ww-paragraph-label { font-size: 12px; font-weight: 550; }
.ww-active-marker { border-radius: 999px; padding: 2px 6px; font-size: 9px; background: var(--cift-sage); color: var(--cift-sage-ink); }
.ww-paragraph-count { font-size: 10px; color: var(--cift-muted); }
html.cift-ui .main-area .ww input.ww-paragraph-title { border: 0; padding: 5px 0; border-radius: 0; font-size: 12px; font-weight: 400; margin: 0 0 10px; background: transparent; }
.ww-field-label { display: block !important; font-size: 11px !important; color: var(--cift-muted); margin-bottom: 6px; }
.ww-field-label > span { font-size: 10px; opacity: .85; margin-left: 6px; }
.ww-paragraph-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 8px; }
.ww-text-button { min-height: 32px; border: 0; border-radius: 8px; padding: 5px 2px; background: transparent; color: var(--cift-muted); font-size: 10px !important; }
.ww-text-button:hover { color: var(--cift-ink); }
.ww-text-button.ww-delete:hover { color: var(--cift-danger); }
.ww-notes-wrap { margin-top: 12px; }
.ww-add-paragraph { min-height: 44px; color: var(--cift-muted); border-radius: 14px; font-size: 12px !important; }
.ww-writing-hint { margin: 12px 0 0 !important; color: var(--cift-muted); font-size: 10px; text-align: center; }
.ww-material-content { flex: 1; min-height: 0; overflow-y: auto; padding: 0 18px 20px; scrollbar-width: thin; scrollbar-color: var(--cift-scrollbar) transparent; }
.ww-insert-target { margin: 2px 0 16px; padding: 10px 12px; border-radius: 12px; background: var(--brand-blue-soft); color: var(--brand-blue-ink); font-size: 11px; }
.ww-insert-target strong { font-weight: 600; }
.ww-sentence-form,.ww-template-form { display: grid; gap: 8px; margin-bottom: 18px; }
.ww-sentence-form textarea { min-height: 76px; resize: vertical; font-size: 13px; line-height: 1.8; }
.ww-sentence-form textarea[lang=en] { font-family: var(--cift-font-reading); }
.ww-sentence-form .ww-field-label { margin-top: 4px; margin-bottom: 0; }
.ww-sentence-form .ww-form-actions { margin-top: 6px; }
.ww-sentence-form .ww-form-actions > :first-child { flex: 1; }
.ww-form-error { font-size: 11px; color: var(--cift-danger); }
.ww-sentence-actions,.ww-template-actions { display: flex; gap: 10px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.ww-sentence-actions > .ww-button { margin-right: auto; }
.ww-template-note { position: relative; padding: 18px; border: 1px dashed var(--cift-line); border-radius: 14px; background: var(--cift-surface-soft); margin-bottom: 22px; }
.ww-template-note > .ww-chip { background: var(--cift-lilac); color: var(--cift-lilac-ink); font-size: 10px; min-height: 26px; margin-bottom: 12px; }
.ww-template-note h3 { font-size: 14px; margin-bottom: 8px; }
.ww-template-note p { font-size: 11px; color: var(--cift-muted); line-height: 1.8; }
.ww-template-form .ww-button { margin-top: 4px; }
.ww-subheading { padding-top: 18px; border-top: 1px solid var(--cift-line); margin-top: 22px !important; }
.ww-subheading span { margin-left: 5px; color: var(--cift-muted); }
.ww-template-card h4 { margin: 0; font-size: 13px; font-weight: 550; }
.ww-material-empty { padding: 28px 12px; border-top: 1px solid var(--cift-line); }
.ww-dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.ww-dialog-heading h2 { margin: 0; }
.ww > .ww-notice { position: fixed; bottom: 34px; left: 50%; transform: translateX(-50%); z-index: 80; margin: 0; max-width: calc(100vw - 32px); padding: 12px 20px; background: var(--cift-accent); color: var(--cift-on-accent); border-radius: 18px; pointer-events: none; box-shadow: var(--cift-shadow-float); }
.ww > .ww-error { flex: none; margin-bottom: 10px; }
.ww-loading { padding: 28px; color: var(--cift-muted); }
.ww-paragraph.is-drag-over { border-style: dashed; background: var(--cift-surface-soft); }
@media (max-width:1039px) { .ww-library > .ww-filter-row { grid-template-columns: 1fr auto; align-items: center; } .ww-material-content { padding: 4px max(18px,calc((100% - 580px)/2)) 24px; } }
@media (max-width:600px) {
  html.cift-ui .writing-shell .topbar .account-menu > .button { display: inline-flex; }
  .ww-toolbar { flex-wrap: wrap; }
  .ww-toolbar-actions { width: 100%; justify-content: flex-end; margin-top: 2px; }
  .ww-toolbar-actions .ww-button { min-height: 32px; }
  .ww-toolbar h1 { font-size: 21px; }
  .ww-toolbar .ww-heading > p { display: none; }
  .ww-toolbar-actions { width: auto; }
  .ww-toolbar { align-items: center; }
  .ww-toolbar-actions > [data-ww-action=home] { display: none; }
  .ww-panel-heading { padding-block: 16px; }
  .ww-editor-heading { padding: 16px; }
  .ww-editor-heading h2 { font-size: 16px; }
  .ww-editor-heading p { font-size: 11px; }
  .ww-editor-heading .ww-kicker { display: none; }
  .ww-editor-toolbar { padding: 0 14px 12px; gap: 8px; }
  .ww-editor-tabs button { padding-inline: 10px; min-height: 38px; font-size: 11px; }
  .ww-editor-toolbar > .ww-button { padding-inline: 10px; font-size: 11px; }
  .ww-source-content { padding: 12px; }
  .ww-source-toggle { display: none; }
  .ww-word-total strong { font-size: 23px; }
  .ww-library > .ww-filter-row { grid-template-columns: 1fr; }
  .ww .ww-text-button { min-height: 40px; }
  .ww-paragraph-top { gap: 4px; }
  html.cift-ui .main-area .ww input.ww-paragraph-title { font-size: 16px; }
  .ww-prompt-card strong { font-size: 13px; }
}
@media (max-width:1039px) {
  .ww-mobile-tabs { position: relative; isolation: isolate; }
  .ww-mobile-tabs::before { content: ''; position: absolute; z-index: -1; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 16px)/3); border-radius: 999px; background: var(--cift-surface); box-shadow: var(--cift-shadow-soft); transition: transform var(--cift-duration-normal) var(--cift-ease); }
  .ww[data-active-panel=editor] .ww-mobile-tabs::before { transform: translateX(calc(100% + 4px)); }
  .ww[data-active-panel=materials] .ww-mobile-tabs::before { transform: translateX(calc(200% + 8px)); }
  .ww-mobile-tabs button.is-active,.ww-mobile-tabs button[aria-pressed=true] { background: transparent; box-shadow: none; }
  .ww-layout > [data-panel] { animation: ww-panel-enter 220ms var(--cift-ease); }
}
@keyframes ww-panel-enter { from { opacity: .55; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .ww *, .ww *::before, .ww *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

/* A phone keeps the draft in place; the same question and material panels live
   in a native, resizable sheet. Desktop remains the three-column workspace. */
.ww-mobile-prompt, .ww-mobile-tools { display: none; }
.ww-material-search { display: block; margin-bottom: 14px; }
.ww-material-search > span { display: block; margin-bottom: 6px; font-size: 11px; color: var(--cift-muted); }
.ww-material-compose { border: 1px solid var(--cift-line); border-radius: 14px; background: var(--cift-surface-soft); margin-bottom: 18px; }
.ww-material-compose > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 10px 13px; color: var(--cift-ink); font-size: 12px; font-weight: 500; cursor: pointer; list-style: none; }
.ww-material-compose > summary::-webkit-details-marker { display: none; }
.ww-material-compose > summary > span[aria-hidden=true] { display: none; }
.ww-material-compose > summary::after { content: '+'; flex: none; font-size: 18px; color: var(--cift-muted); }
.ww-material-compose[open] > summary::after { content: '−'; }
.ww-material-compose > :not(summary) { margin: 0; padding: 0 13px 13px; }
.ww-template-preview { max-height: min(42dvh,360px); overflow-y: auto; overscroll-behavior: contain; padding: 14px; margin-top: 16px; border: 1px solid var(--cift-line); border-radius: 14px; background: var(--cift-surface-soft); scrollbar-width: thin; }
.ww-template-preview > article + article, .ww-template-preview > section + section { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--cift-line); }
.ww-template-preview h3 { font-size: 12px; font-weight: 600; }
.ww-template-preview p { font-family: var(--cift-font-reading); font-size: 15px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }

.ww.is-phone { padding-inline: 10px; }
.ww.is-phone > .ww-toolbar { flex-wrap: nowrap; gap: 8px; padding: 9px 4px 10px; min-height: 56px; }
.ww.is-phone > .ww-toolbar h1 { font-size: 19px; letter-spacing: -.5px; }
.ww.is-phone > .ww-toolbar .ww-kicker, .ww.is-phone > .ww-toolbar p, .ww.is-phone > .ww-toolbar .ww-save-status { display: none; }
.ww.is-phone .ww-toolbar-actions { width: auto; margin: 0; gap: 6px; }
.ww.is-phone .ww-toolbar-actions > [data-ww-action=home] { display: none; }
.ww.is-phone .ww-toolbar-actions :is(.ww-button,.ww-icon-button) { min-height: 44px; min-width: 44px; }
.ww.is-phone .ww-mobile-tabs { display: none; }
.ww.is-phone .ww-layout { display: flex; gap: 0; min-height: 0; }
.ww.is-phone .ww-layout > .ww-library, .ww.is-phone .ww-layout > .ww-materials { display: none !important; }
.ww.is-phone .ww-layout > .ww-editor { display: flex !important; width: 100%; flex: 1; border-radius: 20px; animation: none; }
.ww.is-phone .ww-editor > .ww-editor-heading, .ww.is-phone .ww-editor .ww-editor-scroll > .ww-source { display: none; }
.ww.is-phone .ww-mobile-prompt { flex: none; display: grid; width: 100%; grid-template-columns: minmax(0,1fr) auto; grid-template-areas: 'main count'; align-items: center; gap: 12px; padding: 14px 16px 12px; border: 0; border-radius: 19px 19px 0 0; text-align: left; color: var(--cift-ink); background: var(--cift-surface); transition: background-color 160ms; }
.ww.is-phone .ww-mobile-prompt:hover, .ww.is-phone .ww-mobile-prompt:active { background: var(--cift-surface-soft); }
.ww .ww-mobile-prompt-main { grid-area: main; display: grid; align-content: center; width: 100%; min-width: 0; min-height: 44px; gap: 3px; margin: 0; padding: 0; border: 0; border-radius: 8px; appearance: none; color: inherit; background: transparent; box-shadow: none; font: inherit; text-align: left; }
html.cift-ui .main-area .ww .ww-mobile-prompt-main:focus-visible { outline: 2px solid var(--brand-focus); outline-offset: 4px; box-shadow: none; }
.ww-mobile-prompt-label { display: block; font-size: 9px; letter-spacing: .13em; color: var(--cift-muted); }
.ww-mobile-prompt-main > strong { display: block; font-size: 16px; line-height: 1.45; font-weight: 550; overflow-wrap: anywhere; }
.ww-mobile-prompt-hint { display: inline-flex; align-items: center; gap: 4px; color: var(--cift-muted); font-size: 11px; }
.ww-mobile-prompt-hint svg { width: 13px; height: 13px; }
.ww-mobile-word-count { grid-area: count; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; max-width: 72px; font-size: 10px; color: var(--cift-muted); text-align: right; font-variant-numeric: tabular-nums; }
.ww-mobile-word-count strong { font-size: 25px; line-height: 1.15; font-weight: 500; color: var(--cift-ink); }
.ww.is-phone .ww-editor-toolbar { padding: 0 12px 12px; gap: 8px; }
.ww.is-phone .ww-editor-tabs { padding: 3px; gap: 2px; }
.ww.is-phone .ww-editor-tabs button { min-height: 44px; padding-inline: 11px; font-size: 12px; }
.ww.is-phone .ww-editor-toolbar > .ww-button { min-height: 44px; padding-inline: 12px; font-size: 12px; }
.ww.is-phone .ww-editor-scroll { padding: 16px 12px 20px; overscroll-behavior-y: contain; scroll-padding-block: 18px 30px; }
.ww.is-phone .ww-paragraph { margin-bottom: 16px; padding: 14px; border-radius: 16px; }
.ww.is-phone .ww-paragraph-top { gap: 8px; }
.ww.is-phone .ww-paragraph-label { font-size: 13px; }
.ww.is-phone .ww-active-marker { font-size: 10px; padding: 3px 7px; }
.ww.is-phone .ww-paragraph-actions { gap: 8px; }
.ww.is-phone .ww-text-button { min-height: 44px; min-width: 44px; padding-inline: 5px; font-size: 11px !important; }
.ww.is-phone .ww-writing-hint { padding-inline: 4px; font-size: 11px; line-height: 1.65; }
html.cift-ui .main-area .ww.is-phone :is(input,select,textarea) { font-size: 16px; }
html.cift-ui .main-area .ww.is-phone textarea.ww-english { min-height: 130px; font-size: 17px; line-height: 1.9; }
html.cift-ui .main-area .ww.is-phone :is(textarea.ww-notes,input.ww-paragraph-title) { font-size: 16px; }
.ww.is-phone .ww-mobile-tools { display: grid; flex: none; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; padding: 10px 0 4px; }
.ww.is-phone .ww-mobile-tools button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 48px; padding: 10px 6px; border: 1px solid var(--cift-line); border-radius: 999px; color: var(--cift-ink); background: var(--cift-surface); font-size: 12px; font-weight: 500; white-space: nowrap; box-shadow: var(--cift-shadow-soft); transition: background-color 150ms,box-shadow 150ms; touch-action: manipulation; }
.ww.is-phone .ww-mobile-tools button:nth-child(2) { background: var(--cift-sage); border-color: color-mix(in srgb,var(--cift-sage-ink) 15%,transparent); color: var(--cift-sage-ink); }
.ww.is-phone .ww-mobile-tools button:active { background: var(--cift-control-hover); box-shadow: none; }
.ww.is-phone .ww-mobile-tools svg { width: 17px; height: 17px; }
.ww.is-phone > .ww-footer { justify-content: center; min-height: 24px; padding: 4px 4px max(7px,env(safe-area-inset-bottom)); font-size: 10px; }
.ww.is-phone > .ww-footer p { font-size: 10px; }
.ww.is-phone > .ww-footer > :last-child:not(:first-child) { display: none; }
.ww.is-phone > .ww-notice { bottom: max(96px,calc(env(safe-area-inset-bottom) + 86px)); font-size: 12px; }
.ww.is-phone.is-keyboard > .ww-toolbar, .ww.is-phone.is-keyboard > .ww-footer { display: none; }
.ww.is-phone.is-keyboard .ww-mobile-prompt { padding-block: 8px; }
.ww.is-phone.is-keyboard .ww-mobile-prompt-label, .ww.is-phone.is-keyboard .ww-mobile-prompt-hint { display: none; }
.ww.is-phone.is-keyboard .ww-mobile-prompt-main > strong { font-size: 14px; }
.ww.is-phone.is-keyboard .ww-mobile-word-count { flex-direction: row; align-items: baseline; gap: 4px; }
.ww.is-phone.is-keyboard .ww-mobile-word-count strong { font-size: 18px; }
.ww.is-phone.is-keyboard .ww-editor-toolbar { padding-bottom: 8px; }
.ww.is-phone.is-keyboard .ww-mobile-tools { padding-block: 6px max(4px,env(safe-area-inset-bottom)); }
.ww.is-phone.is-keyboard .ww-mobile-tools button { min-height: 44px; }

.ww .ww-sheet-dialog { position: fixed; inset: var(--ww-viewport-top,0px) 0 auto; width: 100%; max-width: none; height: var(--ww-viewport-height,100dvh); max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: var(--cift-ink); overflow: hidden; font: inherit; }
.ww .ww-sheet-dialog[open] { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.ww-sheet-dialog::backdrop { background: color-mix(in srgb,var(--cift-scrim) 45%,transparent); backdrop-filter: none; }
.ww-sheet-frame { display: flex; flex-direction: column; flex: none; width: 100%; max-width: 680px; height: 62%; min-height: min(310px,calc(var(--ww-viewport-height,100dvh) - 16px)); max-height: calc(var(--ww-viewport-height,100dvh) - 12px); overflow: hidden; border: 1px solid var(--cift-line); border-bottom: 0; border-radius: 28px 28px 0 0; padding-bottom: max(12px,env(safe-area-inset-bottom)); background: var(--cift-surface); box-shadow: var(--cift-shadow-float); transform-origin: bottom center; }
.ww-sheet-dialog[data-expanded=true] .ww-sheet-frame { height: 92%; }
.ww-sheet-grip { display: flex; align-items: center; justify-content: center; flex: none; align-self: center; width: 96px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 999px; background: transparent; color: var(--cift-muted); cursor: ns-resize; touch-action: none; }
.ww-sheet-grip::before { content: ''; width: 38px; height: 4px; border-radius: 999px; background: color-mix(in srgb,var(--cift-muted) 42%,var(--cift-line)); }
.ww-sheet-grip:active::before { background: var(--cift-muted); }
.ww-sheet-heading { display: flex; align-items: center; flex: none; gap: 8px; padding: 0 18px 16px; }
.ww-sheet-heading > div:first-child { min-width: 0; flex: 1; }
.ww-sheet-heading h2 { font-size: 18px; font-weight: 550; letter-spacing: -.4px; line-height: 1.4; }
.ww-sheet-heading p { margin-top: 4px; font-size: 11px; color: var(--cift-muted); overflow-wrap: anywhere; }
.ww-sheet-heading :is(.ww-sheet-expand,.ww-sheet-close) { display: inline-flex; flex: none; align-items: center; justify-content: center; gap: 4px; width: 44px; min-width: 44px; height: 44px; min-height: 44px; border: 0; border-radius: 999px; padding: 10px; background: var(--cift-control); color: var(--cift-muted); touch-action: manipulation; }
.ww-sheet-heading :is(.ww-sheet-expand,.ww-sheet-close):hover { background: var(--cift-control-hover); color: var(--cift-ink); }
.ww-sheet-heading :is(.ww-sheet-expand,.ww-sheet-close):active { background: var(--cift-sage); color: var(--cift-sage-ink); }
.ww-sheet-content { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.ww-sheet-notice { flex: none; margin: 0 18px 12px; padding: 9px 12px; border-radius: 12px; background: var(--cift-sage); color: var(--cift-sage-ink); font-size: 12px; }
.ww-sheet-content > :is(.ww-library,.ww-materials) { display: flex !important; flex: 1; min-height: 0; width: 100%; border: 0; border-radius: 0; background: transparent; }
.ww-sheet-content > :is(.ww-library,.ww-materials) > .ww-panel-heading { display: none; }
.ww-sheet-content :is(.ww-prompt-list,.ww-material-content) { overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; scroll-padding-block: 10px 20px; }
.ww-sheet-content .ww-library > .ww-segmented, .ww-sheet-content .ww-materials > .ww-segmented { margin: 0 18px 12px; }
.ww-sheet-content .ww-segmented button { min-height: 44px; font-size: 13px; }
.ww-sheet-content .ww-library > .ww-filter-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; padding-inline: 18px; }
.ww-sheet-content .ww-year-label { gap: 6px; font-size: 12px; }
html.cift-ui .main-area .ww .ww-sheet-content .ww-year-label select { width: 104px; min-height: 44px; font-size: 16px; padding-inline: 10px; }
.ww-sheet-content .ww-part-filter { gap: 4px; }
.ww-sheet-content .ww-part-filter .ww-chip { min-height: 44px; padding-inline: 9px; font-size: 12px; }
.ww-sheet-content .ww-library-caption { padding: 12px 20px 6px; font-size: 11px; }
.ww-sheet-content .ww-prompt-list { padding: 6px 12px 18px; gap: 6px; grid-template-columns: 1fr; }
.ww-sheet-content .ww-prompt-card { margin: 0 0 6px; padding: 13px 14px; border-radius: 15px; }
.ww-sheet-content .ww-prompt-card strong { font-size: 13px; }
.ww-sheet-content .ww-prompt-bottom { font-size: 11px; }
.ww-sheet-content .ww-material-content { padding: 0 18px 22px; }
.ww-sheet-content .ww-insert-target { display: none; }
.ww-sheet-content .ww-material-search { margin-bottom: 12px; }
.ww-sheet-content .ww-material-search input { min-height: 46px; border-radius: 14px; background: var(--cift-surface-soft); }
.ww-sheet-content .ww-material-compose { margin-bottom: 14px; }
.ww-sheet-content .ww-material-compose > summary { min-height: 48px; padding-inline: 14px; font-size: 13px; }
.ww-sheet-content .ww-sentence-card { padding: 15px; border-radius: 16px; }
.ww-sheet-content .ww-sentence-card[draggable=true] { cursor: default; }
.ww-sheet-content .ww-sentence-card > p { font-size: 16px; line-height: 1.8; }
.ww-sheet-content .ww-sentence-card .ww-sentence-notes { font-size: 12px; }
.ww-sheet-content .ww-sentence-actions { gap: 8px; }
.ww-sheet-content :is(.ww-button,.ww-text-button) { min-height: 44px; }
.ww-sheet-content .ww-sentence-actions .ww-insert { background: var(--cift-sage); color: var(--cift-sage-ink); }
.ww-sheet-content .ww-template-note { margin-bottom: 16px; padding: 14px; }
.ww-sheet-content .ww-template-note .ww-chip { min-height: 24px; }
.ww-sheet-content .ww-template-note p { font-size: 12px; }
.ww-sheet-content .ww-template-card { border-radius: 16px; }
.ww-sheet-content .ww-template-card h4 { font-size: 14px; }
.ww-sheet-content > .ww-source { display: block !important; flex: 1; min-height: 0; width: 100%; margin: 0; overflow-y: auto; overscroll-behavior-y: contain; border: 0; border-radius: 0; background: transparent; scrollbar-width: thin; scrollbar-color: var(--cift-scrollbar) transparent; }
.ww-sheet-content > .ww-source > summary { display: none; }
.ww-sheet-content .ww-source-content { border: 0; padding: 0 20px 24px; }
.ww-sheet-content .ww-direction { font-size: 16px; line-height: 1.85; }
.ww-sheet-content .ww-source-image { margin-block: 16px; }
.ww-sheet-content .ww-source-image img { max-height: 420px; }
.ww-sheet-content .ww-source-notes { font-size: 12px; }
.ww-sheet-dialog.is-opening .ww-sheet-frame { animation: ww-sheet-enter 280ms cubic-bezier(.2,.8,.2,1) both; }
.ww-sheet-dialog.is-closing .ww-sheet-frame { animation: ww-sheet-exit 200ms cubic-bezier(.4,0,.8,.2) both; pointer-events: none; }
.ww-sheet-dialog.is-opening::backdrop { animation: ww-sheet-scrim-in 240ms ease-out both; }
.ww-sheet-dialog.is-closing::backdrop { animation: ww-sheet-scrim-out 180ms ease-in both; }
@keyframes ww-sheet-enter { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes ww-sheet-exit { from { transform: translateY(0); } to { transform: translateY(100%); } }
@keyframes ww-sheet-scrim-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ww-sheet-scrim-out { from { opacity: 1; } to { opacity: 0; } }
@media (max-width: 374px) {
  .ww.is-phone { padding-inline: 8px; }
  .ww.is-phone .ww-mobile-tools { gap: 5px; }
  .ww.is-phone .ww-mobile-tools button { gap: 4px; font-size: 11px; }
  .ww.is-phone .ww-editor-toolbar { gap: 5px; padding-inline: 10px; }
  .ww.is-phone .ww-editor-tabs button { padding-inline: 8px; font-size: 11px; }
  .ww.is-phone .ww-editor-toolbar > .ww-button { padding-inline: 9px; font-size: 11px; }
  .ww-sheet-content .ww-library > .ww-filter-row { grid-template-columns: 1fr; }
  .ww-sheet-content .ww-part-filter { justify-content: space-between; }
  .ww-sheet-content .ww-part-filter .ww-chip { flex: 1; }
}
@media (max-width:1039px) and (max-height:500px) {
  .ww.is-phone > .ww-toolbar, .ww.is-phone > .ww-footer { display: none; }
  .ww.is-phone .ww-mobile-prompt { padding-block: 8px; }
  .ww.is-phone .ww-mobile-prompt-label, .ww.is-phone .ww-mobile-prompt-hint { display: none; }
  .ww.is-phone .ww-editor-toolbar { padding-bottom: 8px; }
  .ww.is-phone .ww-mobile-tools { padding-top: 6px; }
  .ww-sheet-frame { height: 90%; min-height: 0; }
  .ww-sheet-heading { padding-bottom: 10px; }
  .ww-sheet-content .ww-library > .ww-filter-row { grid-template-columns: minmax(0,1fr) auto; }
  .ww-sheet-content .ww-prompt-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .ww .ww-sheet-dialog *, .ww .ww-sheet-dialog::backdrop { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Template preview keeps its choices and action visible while the example scrolls. */
.ww .ww-template-dialog[open] { display: flex; flex-direction: column; width: min(640px,calc(100vw - 24px)); height: min(680px,calc(var(--ww-viewport-height,100dvh) - 24px)); max-height: calc(var(--ww-viewport-height,100dvh) - 24px); padding: 20px; overflow: hidden; }
.ww-template-dialog > .ww-dialog-heading { flex: none; min-width: 0; gap: 12px; }
.ww-template-dialog > .ww-dialog-heading h2 { min-width: 0; font-size: 18px; line-height: 1.45; overflow-wrap: anywhere; }
.ww-template-dialog > .ww-template-preview { flex: 1; min-height: 0; max-height: none; margin-top: 16px; padding: 15px; }
.ww-template-dialog .ww-template-preview .ww-preview-notes { font-family: var(--cift-font-ui); font-size: 12px; line-height: 1.75; }
.ww-template-choices { flex: none; min-inline-size: 0; border: 0; padding: 0; margin: 16px 0 0; }
.ww-template-choices legend { display: block; padding: 0 0 8px; color: var(--cift-muted); font-size: 12px; font-weight: 500; }
.ww .ww-template-choices label { display: flex !important; align-items: flex-start; gap: 10px; min-height: 52px; padding: 10px 12px; border: 1px solid var(--cift-line); border-radius: 12px; color: var(--cift-ink); background: var(--cift-surface); font-size: 13px; line-height: 1.5; cursor: pointer; }
.ww-template-choices label + label { margin-top: 7px; }
.ww-template-choices label:has(input:checked) { border-color: color-mix(in srgb,var(--cift-sage-ink) 32%,var(--cift-line)); background: var(--cift-sage); color: var(--cift-sage-ink); }
.ww-template-choices label:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.ww-template-choices label > span { flex: 1; min-width: 0; }
.ww-template-choices label small { display: block; margin-top: 2px; color: var(--cift-muted); font-size: 11px; line-height: 1.6; }
html.cift-ui .main-area .ww .ww-template-choices input[type=radio] { appearance: auto; display: inline-block; flex: none; width: 18px; min-width: 18px; height: 18px; min-height: 18px; padding: 0; margin: 2px 0 0; border-radius: 50%; accent-color: var(--cift-sage-ink); box-shadow: none; cursor: inherit; }
.ww-template-dialog > .ww-dialog-actions { flex: none; position: relative; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--cift-line); background: var(--cift-surface); }
.ww-template-dialog > .ww-dialog-actions .ww-button { min-height: 44px; }
.ww.is-phone .ww-template-dialog[open] { padding: 16px; border-radius: 22px; }
.ww.is-phone .ww-template-dialog > .ww-dialog-actions { gap: 8px; }
.ww.is-phone .ww-template-dialog > .ww-dialog-actions .ww-button:first-child { min-width: 76px; }
.ww.is-phone .ww-template-dialog > .ww-dialog-actions .ww-primary { flex: 1; }
@media (max-height:500px) {
  .ww .ww-template-dialog[open] { padding: 12px 16px; }
  .ww-template-dialog > .ww-template-preview { margin-top: 10px; }
  .ww-template-choices { margin-top: 10px; }
  .ww-template-choices legend { padding-bottom: 5px; }
  .ww .ww-template-choices label { min-height: 44px; padding-block: 7px; }
  .ww-template-choices label small { display: inline; margin-left: 6px; }
  .ww-template-dialog > .ww-dialog-actions { padding-top: 8px; margin-top: 8px; }
}

/* Personal materials share the writing studio's data and Cift surfaces. */
html.cift-ui .home-page .home-writing-entries { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
html.cift-ui .home-page .home-writing-entries :is(.home-writing-entry,.home-materials-entry) { display: flex; min-width: 0; min-height: 128px; width: 100%; align-items: center; gap: 16px; padding: 22px; border: 1px solid var(--cift-line); border-radius: 20px !important; text-align: left; color: var(--cift-ink); background: var(--cift-surface); transition: background-color 180ms,border-color 180ms,box-shadow 180ms; }
html.cift-ui .home-page .home-writing-entries :is(.home-writing-entry,.home-materials-entry):hover { border-color: color-mix(in srgb,var(--cift-sage-ink) 30%,var(--cift-line)); box-shadow: var(--cift-shadow-soft); transform: none; }
.home-writing-entries :is(.home-writing-entry,.home-materials-entry) > span:nth-child(2) { display: grid; flex: 1; min-width: 0; gap: 5px; }
.home-writing-entries small { color: var(--cift-muted); font-size: 10px; letter-spacing: .12em; }
.home-writing-entries strong { font-size: 18px; font-weight: 600; line-height: 1.45; }
.home-writing-entries em { font-style: normal; color: var(--cift-muted); font-size: 12px; line-height: 1.65; }
.home-writing-entries .home-writing-icon { flex: none; }
.home-materials-entry .home-writing-icon { background: var(--brand-rose-soft); color: var(--brand-rose-ink); }
.ww.is-library :is(.ww-layout,.ww-mobile-tabs,.ww-mobile-tools) { display: none !important; }
.ww.is-library > .ww-toolbar { padding-bottom: 20px; }
.ww.is-library > .ww-vault { flex: 1; min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-color: var(--cift-scrollbar) transparent; padding: 0 4px 28px; scroll-padding-block: 16px; }
.ww-vault-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding-bottom: 18px; }
.ww-vault-tabs { display: inline-flex; flex: none; gap: 4px; padding: 4px; border-radius: 999px; background: var(--cift-control); margin-right: auto; }
.ww-vault-tabs button { min-height: 38px; padding: 8px 18px; border: 0; border-radius: 999px; color: var(--cift-muted); background: transparent; font-size: 13px; transition: background-color 180ms,color 180ms,box-shadow 180ms; }
.ww-vault-tabs :is(button.is-active,button[aria-selected=true],button[aria-pressed=true]) { color: var(--cift-ink); background: var(--cift-surface); box-shadow: var(--cift-shadow-soft); }
.ww-vault-controls > .ww-button { min-height: 42px; }
.ww-vault-controls > .ww-button[aria-pressed=true] { background: var(--cift-sage); color: var(--cift-sage-ink); border-color: color-mix(in srgb,var(--cift-sage-ink) 18%,transparent); }
.ww-vault-search { position: relative; min-width: 0; margin-bottom: 14px; }
html.cift-ui .main-area .ww .ww-vault-search input { min-height: 48px; border-radius: 14px; background: var(--cift-surface); font-size: 14px; padding-inline: 16px; }
.ww-vault-search > svg { position: absolute; left: 15px; top: 15px; color: var(--cift-muted); pointer-events: none; }
html.cift-ui .main-area .ww .ww-vault-search:has(>svg) input { padding-left: 43px; }
.ww-tag-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-bottom: 4px; }
.ww-tag-filters button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; max-width: 100%; border: 1px solid var(--cift-line); border-radius: 999px; padding: 7px 12px; color: var(--cift-muted); background: var(--cift-surface); font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; white-space: normal; transition: background-color 160ms,border-color 160ms,color 160ms; }
.ww-tag-filters button:hover { background: var(--cift-control-hover); }
.ww-tag-filters :is(button.is-active,button[aria-pressed=true]) { color: var(--cift-sage-ink); background: var(--cift-sage); border-color: color-mix(in srgb,var(--cift-sage-ink) 18%,var(--cift-sage)); }
.ww-tag-filters button :is(small,span) { min-width: 0; overflow-wrap: anywhere; }
.ww-tag-filters button small { font-size: 10px; font-variant-numeric: tabular-nums; opacity: .75; }
.ww-vault-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 20px 0 12px; color: var(--cift-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.ww-vault-summary > strong { color: var(--cift-ink); font-weight: 500; }
.ww-vault-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; align-items: start; }
.ww-vault-card { min-width: 0; display: flex; flex-direction: column; padding: 22px; border: 1px solid var(--cift-line); border-radius: 20px; background: var(--cift-surface); overflow-wrap: anywhere; transition: border-color 180ms,box-shadow 180ms; }
.ww-vault-card:hover { border-color: color-mix(in srgb,var(--cift-sage-ink) 24%,var(--cift-line)); box-shadow: var(--cift-shadow-soft); }
.ww-vault-card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 24px; margin-bottom: 18px; }
.ww-vault-card > header small { color: var(--cift-muted); font-size: 10px; letter-spacing: .09em; font-variant-numeric: tabular-nums; }
.ww-vault-card > header h3 { font-size: 16px; font-weight: 550; }
.ww-vault-english { font-family: var(--cift-font-reading); color: var(--cift-ink); font-size: 19px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.ww-vault-notes { font-family: var(--cift-font-ui); color: var(--cift-muted); font-size: 13px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 14px !important; }
.ww-item-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.ww-item-tags > span { display: inline-flex; align-items: center; min-width: 0; max-width: 100%; padding: 4px 9px; border-radius: 7px; background: var(--cift-surface-muted); color: var(--cift-muted); font-family: var(--cift-font-ui); font-size: 10px; line-height: 1.4; overflow-wrap: anywhere; }
.ww-vault-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--cift-line); }
.ww-vault-card-actions :is(.ww-button,.ww-text-button) { min-height: 36px; padding-inline: 10px; font-size: 11px !important; }
.ww-vault-card-actions > :first-child { margin-right: auto; }
.ww-vault-card-actions > .ww-delete { color: var(--cift-muted); }
.ww-vault-card-actions > .ww-delete:hover { color: var(--cift-danger); background: var(--cift-danger-bg); }
.ww-vault-template-body { min-width: 0; max-height: 290px; overflow-y: auto; scrollbar-width: thin; padding-right: 4px; }
.ww-vault-template-body > :is(section,article) + :is(section,article) { border-top: 1px solid var(--cift-line); margin-top: 16px; padding-top: 16px; }
.ww-vault-template-body h4 { margin: 0 0 8px; color: var(--cift-muted); font-size: 11px; font-weight: 500; }
.ww-vault-template-body .ww-vault-english { font-size: 16px; }
.ww-vault-template-body .ww-vault-notes { font-size: 12px; margin-top: 8px !important; }
.ww-vault-card > details { margin-top: 14px; }
.ww-vault-card > details > summary { cursor: pointer; padding-block: 10px; font-size: 12px; color: var(--cift-sage-ink); }
.ww-vault-grid > .ww-empty { grid-column: 1/-1; min-height: 270px; border: 1px dashed var(--cift-line); border-radius: 20px; background: var(--cift-surface-soft); }
.ww-study-board { max-width: 920px; margin: 12px auto 0; }
.ww-study-toolbar { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.ww-study-toolbar button { min-height: 40px; }
.ww-study-toolbar :is(button.is-active,button[aria-pressed=true]) { background: var(--cift-sage); color: var(--cift-sage-ink); }
.ww-study-card { min-width: 0; min-height: 300px; display: flex; flex-direction: column; justify-content: center; gap: 20px; padding: clamp(24px,4vw,56px); border: 1px solid var(--cift-line); border-radius: 24px; background: var(--cift-surface); box-shadow: var(--cift-shadow-soft); animation: ww-vault-reveal 200ms ease-out both; }
.ww-study-card > header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; color: var(--cift-muted); font-size: 11px; }
.ww-study-card h3 { font-size: 19px; font-weight: 550; }
.ww-study-card .ww-vault-english { font-size: clamp(20px,2.2vw,27px); line-height: 1.8; }
.ww-study-card .ww-vault-notes { font-size: 15px; line-height: 1.9; }
.ww-study-card :is(section,article) + :is(section,article) { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--cift-line); }
.ww-study-card :is(section,article) > h4 { margin: 0 0 12px; font-size: 12px; font-weight: 500; color: var(--cift-muted); }
.ww-study-hidden { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 96px; border: 1px dashed color-mix(in srgb,var(--cift-sage-ink) 24%,var(--cift-line)); border-radius: 14px; padding: 18px; color: var(--cift-sage-ink); background: var(--cift-surface-soft); font-size: 13px; line-height: 1.6; text-align: center; transition: background-color 160ms,border-color 160ms; }
.ww-study-hidden:hover { background: var(--cift-sage); border-color: var(--cift-sage-ink); }
.ww-study-navigation { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 20px; padding-bottom: 8px; }
.ww-study-navigation :is(.ww-button,.ww-icon-button) { min-height: 44px; }
.ww-study-navigation > :is(span,p) { min-width: 70px; text-align: center; color: var(--cift-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.ww-study-navigation .ww-icon-button { min-width: 44px; }
.ww-material-tag-filter { display: block; margin-bottom: 14px; }
html.cift-ui .main-area .ww :is(select.ww-material-tag-filter,.ww-material-tag-filter select) { min-height: 40px; padding: 8px 11px; border-radius: 10px; font-size: 12px; }
.ww-material-content .ww-item-tags { margin-top: 10px; gap: 5px; }
.ww-material-content .ww-item-tags > span { font-size: 9px; }
.ww-tags-field { display: grid; gap: 7px; }
.ww-tags-field small { color: var(--cift-muted); font-size: 11px; }
.ww-tag-manager { display: grid; gap: 14px; }
.ww-tag-manager > p { margin: 0; font-size: 12px; }
.ww-tag-option-row { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 10px 0; border-bottom: 1px solid var(--cift-line); }
.ww-tag-option-row > :is(input,label) { flex: 1; min-width: 0; }
.ww-tag-option-row > :is(.ww-button,.ww-icon-button,.ww-text-button) { flex: none; min-height: 40px; }
.ww-tag-option-row small { flex: none; color: var(--cift-muted); font-size: 11px; }
.ww-tag-picker { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-block: 18px; }
.ww .ww-tag-picker label { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 44px; border: 1px solid var(--cift-line); border-radius: 12px; padding: 10px 12px; background: var(--cift-surface); color: var(--cift-ink); line-height: 1.5; overflow-wrap: anywhere; cursor: pointer; }
.ww-tag-picker label:has(input:checked) { color: var(--cift-sage-ink); background: var(--cift-sage); border-color: color-mix(in srgb,var(--cift-sage-ink) 22%,var(--cift-line)); }
html.cift-ui .main-area .ww .ww-tag-picker input[type=checkbox] { appearance: auto; display: inline-block; flex: none; width: 17px; height: 17px; min-height: 17px; margin: 0; padding: 0; accent-color: var(--cift-sage-ink); border-radius: 4px; }
.ww-tag-create { display: flex; align-items: end; gap: 8px; margin-top: 14px; }
.ww-tag-create > :is(input,label) { flex: 1; min-width: 0; }
.ww-tag-create > .ww-button { min-height: 42px; flex: none; }
.ww-edit-template { display: grid; gap: 14px; margin-top: 18px; }
.ww-edit-template > section { display: grid; gap: 8px; border: 1px solid var(--cift-line); border-radius: 14px; padding: 14px; background: var(--cift-surface-soft); }
.ww-edit-template > section > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ww-edit-template > section h3 { font-size: 13px; }
.ww-edit-template textarea { resize: vertical; min-height: 100px; line-height: 1.8; }
.ww-edit-template textarea[lang=en] { font-family: var(--cift-font-reading); font-size: 16px; }
@keyframes ww-vault-reveal { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width:1199px) { .ww-vault-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width:760px) {
  html.cift-ui .home-page .home-writing-entries :is(.home-writing-entry,.home-materials-entry) { padding: 18px; min-height: 148px; gap: 12px; flex-wrap: wrap; align-content: center; }
  .home-writing-entries :is(.home-writing-entry,.home-materials-entry) > span:nth-child(2) { flex-basis: calc(100% - 60px); }
  .home-writing-entries strong { font-size: 16px; }
  .home-writing-entries em { font-size: 11px; }
  .ww-vault-card { padding: 18px; }
  .ww-vault-grid { gap: 12px; }
  .ww-vault-controls { gap: 8px; padding-bottom: 14px; }
  .ww-vault-tabs { width: 100%; margin: 0 0 4px; }
  .ww-vault-tabs button { flex: 1; min-height: 44px; }
  .ww-vault-controls > .ww-button { flex: 1; min-height: 44px; font-size: 12px; padding-inline: 12px; }
}
@media (max-width:600px) {
  html.cift-ui .home-page .home-writing-entries { gap: 10px; }
  html.cift-ui .home-page .home-writing-entries :is(.home-writing-entry,.home-materials-entry) { min-height: 170px; padding: 16px 14px; align-items: flex-start; gap: 12px; }
  .home-writing-entries .home-writing-icon { width: 38px; height: 38px; border-radius: 12px; }
  .home-writing-entries :is(.home-writing-entry,.home-materials-entry) > span:nth-child(2) { flex-basis: 100%; gap: 4px; }
  .home-writing-entries :is(.home-writing-entry,.home-materials-entry) > :last-child:not(:nth-child(2)):not(.home-writing-icon) { display: none; }
  .home-writing-entries small { font-size: 9px; }
  .home-writing-entries strong { font-size: 16px; }
  .ww.is-library > .ww-toolbar { display: flex; min-height: 64px; padding: 10px 4px 14px; flex-wrap: nowrap; }
  .ww.is-library .ww-toolbar-actions { flex: none; gap: 6px; width: auto; }
  .ww.is-library > .ww-toolbar h1 { font-size: 21px; }
  .ww.is-library > .ww-vault { padding-bottom: 16px; }
  .ww.is-library > .ww-footer { padding: 7px 4px max(8px,env(safe-area-inset-bottom)); }
  .ww.is-library > .ww-notice { bottom: max(48px,calc(env(safe-area-inset-bottom) + 40px)); }
  .ww-vault-grid { grid-template-columns: minmax(0,1fr); }
  .ww-vault-card { border-radius: 18px; padding: 20px; }
  .ww-vault-card > header { margin-bottom: 14px; }
  .ww-vault-english { font-size: 19px; }
  .ww-vault-card-actions { gap: 8px; margin-top: 16px; padding-top: 10px; }
  .ww-vault-card-actions :is(.ww-button,.ww-text-button) { min-height: 44px; min-width: 44px; padding-inline: 11px; }
  html.cift-ui .main-area .ww .ww-vault-search input { min-height: 48px; font-size: 16px; }
  .ww-tag-filters { gap: 7px; }
  .ww-tag-filters button { min-height: 44px; padding-inline: 12px; }
  .ww-vault-summary { margin-top: 16px; font-size: 11px; }
  .ww-study-toolbar { gap: 5px; margin-bottom: 12px; }
  .ww-study-toolbar button { flex: 1; min-height: 44px; font-size: 11px; padding-inline: 8px; }
  .ww-study-card { min-height: 300px; border-radius: 20px; padding: 24px 20px; gap: 18px; }
  .ww-study-card .ww-vault-english { font-size: 22px; }
  .ww-study-card .ww-vault-notes { font-size: 14px; }
  .ww-study-navigation { gap: 8px; margin-top: 16px; }
  .ww-study-navigation > :is(span,p) { min-width: 48px; font-size: 11px; }
  .ww-study-navigation .ww-button { padding-inline: 13px; }
  .ww-tag-option-row { flex-wrap: wrap; }
  .ww-tag-option-row > :is(input,label) { flex-basis: calc(100% - 116px); }
  .ww-tag-option-row > :is(.ww-button,.ww-icon-button,.ww-text-button) { min-height: 44px; }
  .ww .ww-tag-picker label { font-size: 13px; }
  .ww-tag-create > .ww-button { min-height: 44px; }
  html.cift-ui .main-area .ww :is(select.ww-material-tag-filter,.ww-material-tag-filter select) { min-height: 44px; font-size: 16px; }
}
@media (max-width:359px) {
  html.cift-ui .home-page .home-writing-entries { grid-template-columns: minmax(0,1fr); }
  html.cift-ui .home-page .home-writing-entries :is(.home-writing-entry,.home-materials-entry) { min-height: 110px; flex-wrap: nowrap; align-items: center; }
  .home-writing-entries :is(.home-writing-entry,.home-materials-entry) > span:nth-child(2) { flex-basis: auto; }
  .ww-vault-controls > .ww-button { padding-inline: 8px; font-size: 11px; }
  .ww.is-library .ww-toolbar-actions .ww-button { padding-inline: 9px; font-size: 11px; }
  .ww-tag-picker { grid-template-columns: minmax(0,1fr); }
  .ww-study-navigation { gap: 6px; }
  .ww-study-navigation .ww-button { padding-inline: 10px; }
}
@media (max-height:500px) and (min-width:601px) { .ww.is-library > .ww-toolbar { display: flex; padding-block: 8px; } .ww.is-library > .ww-footer { display: flex; } }
@media (prefers-reduced-motion:reduce) { .ww-study-card { animation: none; } .ww-vault-card,.ww-tag-filters button,.ww-vault-tabs button,.ww-study-hidden,.home-writing-entries button { transition: none !important; } }

/* Material actions and forms use the same rhythm in the shelf and workbench. */
.ww-vault-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.ww-vault-actions > .ww-button { min-height: 42px; }
.ww-vault-actions > .ww-button[aria-pressed=true] { background: var(--cift-sage); color: var(--cift-sage-ink); }
.ww-vault-tabs button > span { margin-left: 5px; font-size: 10px; font-variant-numeric: tabular-nums; color: var(--cift-muted); }
.ww .ww-vault-summary { margin: 20px 0 12px; line-height: 1.7; }
.ww-vault-search > .ww-field-label { margin-bottom: 1px; }
.ww-vault-card > header .ww-kicker { margin-bottom: 0; }
.ww-vault-card > header .ww-text-button { min-height: 36px; padding-inline: 7px; }
.ww-vault-card > h2 { margin-bottom: 5px; font-size: 18px; line-height: 1.5; }
.ww-vault-card .ww-vault-template-body { margin-top: 18px; }
.ww-vault-template-body > h3 { font-size: 11px; font-weight: 500; line-height: 1.6; color: var(--cift-muted); margin-bottom: 7px; }
.ww-vault-template-body > p[lang=en] { font-family: var(--cift-font-reading); color: var(--cift-ink); font-size: 16px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.ww-vault-template-body > p + h3 { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--cift-line); }
.ww-study-hidden { flex-direction: column; gap: 4px; }
.ww-study-hidden > span { display: block; font-size: 11px; font-weight: 400; color: var(--cift-muted); }
.ww .ww-study-shuffle { display: block; min-height: 44px; min-width: 88px; margin: 0 auto; font-size: 12px !important; }
.ww-study-card > .ww-item-tags { margin-top: 0; }
.ww-study-card > section > h3 { font-size: 12px; font-weight: 500; color: var(--cift-muted); margin-bottom: 12px; }
.ww .ww-vault-content > .ww-empty { min-height: 280px; margin-top: 16px; border: 1px dashed var(--cift-line); border-radius: 20px; background: var(--cift-surface-soft); }
.ww :is(.ww-vault-edit-dialog,.ww-tag-dialog,.ww-material-detail-dialog) { width: min(660px,calc(100vw - 32px)); max-height: calc(var(--ww-viewport-height,100dvh) - 32px); scroll-padding-block: 20px; }
.ww :is(.ww-vault-edit-dialog,.ww-tag-dialog) > .ww-dialog-heading { margin-bottom: 20px; }
.ww-vault-edit-form { display: grid; gap: 18px; }
.ww .ww-vault-edit-form .ww-field-label,.ww .ww-tag-dialog .ww-field-label { display: grid !important; gap: 8px; margin: 0; font-size: 12px !important; line-height: 1.6; }
.ww-vault-edit-form .ww-tags-field > span { margin: 0; }
.ww-vault-edit-form textarea { resize: vertical; font-size: 14px; line-height: 1.8; min-height: 94px; }
.ww-vault-edit-form textarea[lang=en] { font-family: var(--cift-font-reading); font-size: 17px; }
.ww-vault-edit-form .ww-form-actions { justify-content: flex-end; padding-top: 6px; }
.ww-vault-edit-form .ww-form-actions > .ww-button { min-height: 44px; min-width: 132px; }
.ww-edit-template-paragraphs { display: grid; gap: 14px; }
.ww .ww-edit-template-paragraphs > .ww-edit-template { margin: 0; display: grid; gap: 12px; padding: 16px; border: 1px solid var(--cift-line); border-radius: 14px; background: var(--cift-surface-soft); }
.ww-edit-template-paragraphs > .ww-edit-template > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ww-edit-template > header > h3 { font-size: 13px; }
.ww-edit-template > header .ww-text-button { padding-inline: 6px; }
.ww-vault-edit-dialog > .ww-dialog-actions { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--cift-line); }
.ww .ww-tag-dialog > .ww-hint { margin: 0 0 16px; font-size: 12px; line-height: 1.8; }
.ww-tag-dialog .ww-tag-create { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 12px; align-items: end; margin-top: 0; margin-bottom: 18px; }
.ww-tag-dialog .ww-tag-create .ww-form-error { grid-column: 1/-1; margin: 0; }
.ww-tag-dialog .ww-tag-option-row { align-items: end; flex-wrap: wrap; padding-block: 12px; }
.ww-tag-dialog .ww-tag-option-row > label { flex: 1 1 130px; }
.ww-tag-dialog .ww-tag-option-row .ww-form-error { flex-basis: 100%; margin: 0; }
.ww-tag-dialog .ww-tag-manager { gap: 0; }
.ww-tag-dialog form[data-ww-form=item-tags] { display: grid; gap: 16px; }
.ww-tag-dialog form[data-ww-form=item-tags] .ww-tag-picker { margin: 0; }
.ww-tag-dialog form[data-ww-form=item-tags] > .ww-button { justify-self: end; min-height: 44px; min-width: 118px; }
.ww .ww-material-detail-dialog .ww-vault-english { font-family: var(--cift-font-reading); font-size: 21px; color: var(--cift-ink); margin-block: 20px 10px; }
.ww .ww-material-detail-dialog .ww-vault-notes { margin-bottom: 0; font-size: 14px; }
.ww-material-detail-dialog .ww-template-preview .ww-preview-notes { font-family: var(--cift-font-ui); font-size: 12px; line-height: 1.8; }
@media (max-width:760px) {
  .ww-vault-actions { width: 100%; gap: 8px; }
  .ww-vault-actions > .ww-button { flex: 1; min-height: 44px; padding-inline: 12px; font-size: 12px; }
}
@media (max-width:600px) {
  .ww .ww-vault-summary { margin: 16px 0 12px; }
  .ww-vault-card > header .ww-text-button { min-height: 44px; }
  .ww-vault-actions > .ww-button { padding-inline: 9px; font-size: 11px; }
  .ww :is(.ww-vault-edit-dialog,.ww-tag-dialog,.ww-material-detail-dialog) { width: calc(100vw - 20px); max-width: calc(100vw - 20px); max-height: calc(var(--ww-viewport-height,100dvh) - 20px); padding: 18px; border-radius: 20px; }
  html.cift-ui .main-area .ww :is(.ww-vault-edit-dialog,.ww-tag-dialog) :is(input,textarea,select) { font-size: 16px; }
  .ww-vault-edit-form { gap: 16px; }
  .ww .ww-edit-template-paragraphs > .ww-edit-template { padding: 13px; }
  .ww-vault-edit-form .ww-form-actions > .ww-button { width: 100%; }
  .ww-tag-dialog .ww-tag-create { gap: 8px; }
  .ww-tag-dialog .ww-tag-create .ww-button { padding-inline: 11px; font-size: 12px; }
  .ww-tag-dialog .ww-tag-option-row > label { flex-basis: 120px; }
  .ww-tag-dialog .ww-tag-option-row .ww-button { padding-inline: 10px; font-size: 12px; }
  .ww.is-library.is-phone.is-keyboard:has(.ww-dialog[open]) > .ww-toolbar { display: flex; }
}

/* A quiet single-card shelf with an optional tactile side dial. */
.ww-sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.ww-vault-search-row { display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 16px; }
.ww-vault-search-row > .ww-vault-search { flex: 1; min-width: 0; margin: 0; }
html.cift-ui .main-area .ww .ww-vault-search-row input[type=search] { min-height: 48px; height: 48px; padding: 11px 20px; border-radius: 999px; border-color: var(--cift-line); background: var(--cift-surface); }
.ww .ww-vault-icon-action { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 48px; width: 48px; min-width: 48px; height: 48px; min-height: 48px; padding: 0; border: 1px solid var(--cift-line); border-radius: 50%; color: var(--cift-ink); background: var(--cift-surface); box-shadow: var(--cift-shadow-soft); transition: background-color 160ms,border-color 160ms,box-shadow 160ms; }
.ww .ww-vault-icon-action:hover { background: var(--cift-control-hover); }
.ww .ww-vault-icon-action:active { background: var(--cift-control); box-shadow: none; }
.ww .ww-vault-icon-action.ww-primary { color: var(--cift-on-accent); background: var(--cift-accent); border-color: var(--cift-accent); }
.ww .ww-vault-icon-action.ww-primary:hover { background: var(--cift-accent-hover); }
.ww-vault-icon-action svg { width: 20px; height: 20px; stroke-width: 1.6; }
.ww-vault-deck { position: relative; width: 100%; max-width: 860px; margin: 14px auto 0; min-width: 0; }
.ww-deck-stage { position: relative; width: 100%; height: clamp(390px,calc(100dvh - 370px),520px); min-height: 390px; max-width: 740px; margin-inline: auto; overflow: hidden; isolation: isolate; }
.ww-deck-slot { position: absolute; top: 6px; bottom: 8px; left: 20px; width: calc(100% - 40px); min-width: 0; will-change: transform; transform-origin: 50% 50%; }
.ww-deck-slot > .ww-vault-card { display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 0; padding: 24px 28px 18px; border-radius: 24px; border-color: var(--cift-line); background: var(--cift-surface); box-shadow: var(--cift-shadow-soft); overflow: hidden; }
.ww-deck-slot > .ww-vault-card:hover { border-color: var(--cift-line); }
.ww-deck-slot .ww-vault-card > header { flex: none; margin-bottom: 18px; }
.ww-vault-card-body { flex: 1; min-height: 0; min-width: 0; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-color: var(--cift-scrollbar) transparent; padding: 2px 8px 12px 0; scroll-padding-block: 12px; }
.ww-vault-card-body > .ww-vault-english { font-size: clamp(22px,2.1vw,29px); line-height: 1.85; }
.ww-vault-card-body > .ww-vault-notes { margin-top: 20px !important; font-size: 14px; line-height: 1.9; }
.ww-vault-card-body > h2 { font-size: 21px; margin-bottom: 8px; letter-spacing: -.3px; }
.ww-vault-card-body .ww-vault-template-body { max-height: none; overflow: visible; padding-right: 0; margin-top: 18px; }
.ww-vault-card-body .ww-vault-template-body > p[lang=en] { font-size: 18px; line-height: 1.9; }
.ww-vault-card-body .ww-vault-template-body section > p[lang=en] { font-family: var(--cift-font-reading); font-size: 18px; line-height: 1.9; white-space: pre-wrap; }
.ww-vault-card-body .ww-vault-template-body section > h3 { margin-bottom: 8px; color: var(--cift-muted); font-size: 11px; font-weight: 500; }
.ww-deck-slot .ww-vault-card-actions { flex: none; margin-top: 12px; padding-top: 12px; gap: 10px; }
.ww-deck-slot .ww-vault-card-actions :is(.ww-button,.ww-text-button) { min-height: 44px; min-width: 44px; }
.ww-deck-nav { display: flex; align-items: center; justify-content: center; gap: 24px; margin-top: 16px; }
.ww-deck-nav > button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; border: 1px solid var(--cift-line); border-radius: 50%; background: var(--cift-surface); color: var(--cift-ink); transition: background-color 160ms,border-color 160ms; }
.ww-deck-nav > button:hover:not(:disabled) { background: var(--cift-control-hover); }
.ww-deck-nav > button:disabled { opacity: .35; }
.ww-deck-position { min-width: 70px; text-align: center; font-size: 12px; letter-spacing: .16em; color: var(--cift-muted); font-variant-numeric: tabular-nums; }
.ww .ww-deck-hint { margin: 12px 12px 0; color: var(--cift-muted); text-align: center; font-size: 11px; line-height: 1.7; }
@media (max-width:760px) {
  .ww-vault-controls:has(+.ww-vault-search-row) { flex-wrap: nowrap; gap: 10px; }
  .ww-vault-controls:has(+.ww-vault-search-row) > .ww-vault-tabs { flex: 1; width: auto; min-width: 0; margin: 0; }
  .ww-vault-controls:has(+.ww-vault-search-row) > .ww-vault-tabs button { padding-inline: 14px; }
  .ww-vault-controls:has(+.ww-vault-search-row) > .ww-vault-actions { flex: none; width: auto; }
  .ww-vault-controls:has(+.ww-vault-search-row) > .ww-button { flex: none; }
}
@media (max-width:600px) {
  .ww-vault-search-row { gap: 8px; margin-bottom: 12px; }
  html.cift-ui .main-area .ww .ww-vault-search-row input[type=search] { height: 46px; min-height: 46px; font-size: 16px; padding-inline: 16px; }
  .ww .ww-vault-icon-action { flex-basis: 46px; width: 46px; min-width: 46px; height: 46px; min-height: 46px; }
  .ww-vault-controls:has(+.ww-vault-search-row) { gap: 8px; }
  .ww-vault-controls:has(+.ww-vault-search-row) > .ww-vault-tabs button { padding-inline: 10px; font-size: 12px; }
  .ww-vault-controls:has(+.ww-vault-search-row) .ww-vault-tabs button > span { margin-left: 3px; font-size: 9px; }
  .ww-vault-deck { margin-top: 10px; }
  .ww-deck-stage { height: 440px; min-height: 440px; }
  .ww-deck-slot { top: 4px; bottom: 6px; }
  .ww-deck-slot > .ww-vault-card { border-radius: 22px; padding: 16px 18px 12px; }
  .ww-deck-slot .ww-vault-card > header { margin-bottom: 12px; gap: 8px; }
  .ww-deck-slot .ww-vault-card > header .ww-text-button { font-size: 10px !important; }
  .ww-vault-card-body { padding-right: 3px; }
  .ww-vault-card-body > .ww-vault-english { font-size: 23px; line-height: 1.8; }
  .ww-vault-card-body > .ww-vault-notes { font-size: 13px; margin-top: 16px !important; }
  .ww-vault-card-body > h2 { font-size: 18px; }
  .ww-vault-card-body .ww-vault-template-body > p[lang=en] { font-size: 17px; }
  .ww-vault-card-body .ww-vault-template-body section > p[lang=en] { font-size: 17px; }
  .ww-deck-slot .ww-vault-card-actions { gap: 6px; margin-top: 8px; padding-top: 8px; }
  .ww-deck-slot .ww-vault-card-actions :is(.ww-button,.ww-text-button) { padding-inline: 8px; font-size: 10px !important; }
  .ww-deck-nav { gap: 22px; margin-top: 12px; }
  .ww .ww-deck-hint { margin-top: 9px; font-size: 10px; }
}
@media (max-width:359px) {
  .ww-vault-search-row { gap: 6px; }
  .ww .ww-vault-icon-action { flex-basis: 44px; width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
  .ww-vault-controls:has(+.ww-vault-search-row) > .ww-vault-tabs button { font-size: 11px; padding-inline: 7px; }
  .ww-vault-controls:has(+.ww-vault-search-row) > .ww-button { font-size: 10px; padding-inline: 9px; }
  .ww-deck-slot > .ww-vault-card { padding-inline: 13px; }
  .ww-deck-slot .ww-vault-card-actions { gap: 4px; }
  .ww-deck-slot .ww-vault-card-actions :is(.ww-button,.ww-text-button) { padding-inline: 6px; }
}
@media (prefers-reduced-motion:reduce) {
  .ww-deck-slot { transition: none !important; }
  .ww .ww-vault-icon-action,.ww-deck-nav > button { transition: none; }
}

/* Liquid progress capsule inspired by MetalForge's animated progress bar. */
.ww-progress-pill {
  --ww-progress-bg: var(--cift-surface-soft);
  --ww-progress-ink: var(--cift-ink);
  --ww-liquid-body: color-mix(in srgb, var(--brand-blue) 24%, var(--brand-progress-start));
  --ww-liquid-depth: color-mix(in srgb, var(--brand-blue) 38%, var(--brand-progress-start));
  --ww-liquid-crest: color-mix(in srgb, var(--brand-progress-end) 40%, white);
  --ww-liquid-shine: rgb(255 255 255 / .72);
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(198px, 100%);
  min-width: 152px;
  min-height: 52px;
  margin: 0;
  padding: 7px 10px 7px 13px;
  appearance: none;
  overflow: hidden;
  border: 1px solid var(--cift-line);
  border-radius: 999px;
  color: var(--ww-progress-ink);
  background: var(--ww-progress-bg);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .85), 0 3px 12px rgb(37 58 76 / .045);
  cursor: pointer;
  font: inherit;
  text-align: left;
  isolation: isolate;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}
.ww.is-phone .ww-progress-pill { grid-area: count; justify-self: end; width: min(184px, 100%); min-width: 146px; }
.ww-progress-pill:hover { border-color: var(--brand-focus); box-shadow: var(--cift-shadow-soft); transform: translateY(-1px); }
.ww-progress-pill:active { transform: translateY(0); }
.ww-progress-liquid {
  position: absolute;
  z-index: 0;
  inset: 0 auto 0 0;
  width: clamp(0%, var(--progress, 0%), 100%);
  min-width: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(105deg, var(--brand-progress-start) 0%, var(--brand-progress-mid) 42%, var(--brand-progress-end) 100%);
  transition: width 450ms cubic-bezier(.22,.8,.2,1);
}
.ww-progress-liquid::before,
.ww-progress-liquid::after {
  content: '';
  position: absolute;
  left: -40%;
  top: 27%;
  width: 180%;
  height: 260%;
  border-radius: 46% 52% 43% 48%;
  background: linear-gradient(180deg, var(--ww-liquid-crest) 0%, var(--ww-liquid-body) 6%, var(--ww-liquid-depth) 35%, var(--brand-progress-mid) 75%);
  opacity: .86;
  transform-origin: 50% 18%;
  animation: ww-progress-tide 4.2s ease-in-out infinite;
}
.ww-progress-liquid::after {
  left: -27%;
  top: 48%;
  width: 160%;
  height: 220%;
  border-radius: 53% 42% 48% 45%;
  background: linear-gradient(180deg, var(--ww-liquid-crest), var(--brand-progress-mid) 9%, var(--ww-liquid-body) 48%);
  opacity: .72;
  animation-name: ww-progress-counter-tide;
  animation-duration: 5.3s;
  animation-delay: -2.1s;
}
.ww-progress-fill {
  position: absolute;
  z-index: 1;
  inset: -35% -40%;
  background: linear-gradient(110deg, transparent 36%, var(--ww-liquid-shine) 46%, transparent 57%);
  opacity: .45;
  animation: ww-progress-sheen 3.6s ease-in-out infinite;
}
.ww-progress-glint {
  position: absolute;
  z-index: 2;
  top: 7%;
  right: -5px;
  width: 19px;
  height: 86%;
  border-radius: 50%;
  background: radial-gradient(ellipse, var(--ww-liquid-crest), transparent 70%);
  opacity: .6;
  animation: ww-progress-edge 2.8s ease-in-out infinite;
}
.ww-progress-copy { position: relative; z-index: 3; display: grid; min-width: 0; gap: 2px; line-height: 1; }
.ww-progress-kicker { overflow: hidden; color: var(--ww-progress-ink); font-size: 8px; font-weight: 600; letter-spacing: .12em; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.ww-progress-reading { display: flex; align-items: baseline; gap: 4px; min-width: 0; white-space: nowrap; }
.ww-progress-reading strong { font-size: 20px; font-weight: 700; letter-spacing: -.04em; }
.ww-progress-reading b { color: var(--ww-progress-ink); font-size: 10px; font-weight: 600; }
.ww-progress-reading small { max-width: 78px; overflow: hidden; color: var(--ww-progress-ink); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.ww-progress-percent { position: relative; z-index: 3; margin-left: auto; color: var(--ww-progress-ink); font-size: 17px; font-weight: 600; letter-spacing: -.04em; }
html.cift-ui.is-dark .ww-progress-pill {
  --ww-progress-bg: #111214;
  --ww-progress-ink: #f5f7fb;
  --ww-liquid-body: color-mix(in srgb, var(--brand-blue) 14%, var(--brand-progress-mid));
  --ww-liquid-depth: var(--brand-progress-start);
  --ww-liquid-crest: color-mix(in srgb, var(--brand-blue) 12%, var(--brand-progress-end));
  --ww-liquid-shine: color-mix(in srgb, var(--ww-liquid-crest) 80%, transparent);
  border-color: var(--cift-line);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .08), 0 4px 14px rgb(0 0 0 / .28);
}
@keyframes ww-progress-tide {
  0%, 100% { transform: translate(-5%, 5%) rotate(-6deg); }
  50% { transform: translate(5%, -6%) rotate(6deg); }
}
@keyframes ww-progress-counter-tide {
  0%, 100% { transform: translate(7%, -5%) rotate(7deg); }
  50% { transform: translate(-7%, 5%) rotate(-7deg); }
}
@keyframes ww-progress-sheen {
  0%, 100% { transform: translateX(-22%) skewX(-8deg); opacity: .25; }
  50% { transform: translateX(22%) skewX(8deg); opacity: .65; }
}
@keyframes ww-progress-edge {
  0%, 100% { transform: scale(.72, .85); opacity: .35; }
  50% { transform: scale(1.12, 1.04); opacity: .7; }
}
.ww-progress-paused .ww-progress-liquid::before,
.ww-progress-paused .ww-progress-liquid::after,
.ww-progress-paused .ww-progress-fill,
.ww-progress-paused .ww-progress-glint {
  animation-play-state: paused;
}
@media (prefers-reduced-motion: reduce) {
  .ww-progress-pill, .ww-progress-liquid { transition: none; }
  .ww-progress-liquid::before, .ww-progress-liquid::after, .ww-progress-fill, .ww-progress-glint { animation: none; }
}
/* A single notes field: the same textarea is edited and veiled in place. */
.ww .ww-note-editor {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--cift-line);
  border-radius: 14px;
  background: var(--cift-surface-soft);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.ww .ww-note-editor:focus-within {
  border-color: var(--cift-muted);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--cift-muted) 12%, transparent);
}
.ww .ww-note-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 0 4px 0 14px;
}
.ww .ww-note-heading .ww-field-label { margin: 0; font-size: 12px; line-height: 1.5; }
.ww .ww-note-visibility {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--cift-muted);
  background: transparent;
  box-shadow: none;
  transform: none;
  transition: color 180ms ease, background-color 180ms ease;
}
.ww .ww-note-visibility:hover { color: var(--cift-ink); background: var(--cift-control); }
.ww .ww-note-visibility svg { width: 18px; height: 18px; pointer-events: none; }
.ww .ww-note-eye-slash { opacity: 0; transition: opacity 180ms ease; }
.ww .ww-note-editor[data-revealed="false"] .ww-note-eye-slash { opacity: 1; }
.ww .ww-note-body { position: relative; min-width: 0; }
html.cift-ui .main-area .ww .ww-note-body textarea.ww-notes {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 120px;
  margin: 0;
  padding: 4px 14px 16px;
  border: 0;
  border-radius: 0;
  color: var(--cift-ink);
  background: transparent;
  font-size: 14px;
  line-height: 1.8;
  outline: none;
  box-shadow: none;
  filter: blur(0);
  opacity: 1;
  transition: filter 260ms ease, opacity 260ms ease;
}
html.cift-ui .main-area .ww .ww-note-editor[data-revealed="false"] textarea.ww-notes {
  filter: blur(5px);
  opacity: .4;
  pointer-events: none;
  user-select: none;
}
.ww .ww-note-cover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 16px;
  border: 0;
  border-radius: 0;
  background: color-mix(in srgb, var(--cift-surface) 12%, transparent);
  color: var(--cift-muted);
  box-shadow: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: none;
  transition: opacity 220ms ease, visibility 0s linear 220ms;
}
.ww .ww-note-cover > span {
  padding: 6px 11px;
  border: 1px solid var(--cift-line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--cift-surface) 86%, transparent);
  font-size: 12px;
  line-height: 1.5;
}
.ww .ww-note-editor[data-revealed="false"] .ww-note-cover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 220ms ease, visibility 0s;
}
.ww .ww-note-visibility:focus-visible, .ww .ww-note-cover:focus-visible {
  outline: 2px solid var(--cift-ink);
  outline-offset: -4px;
}
@media (max-width: 600px) {
  html.cift-ui .main-area .ww .ww-note-body textarea.ww-notes { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .ww .ww-note-editor, .ww .ww-note-editor * { transition: none !important; }
}
.ww-progress-modal { max-width:340px; text-align:center; }
.ww-progress-dialog-ring { display:grid; place-items:center; width:96px; height:96px; margin:18px auto; border-radius:50%; background:radial-gradient(circle,var(--cift-surface) 57%,var(--cift-accent) 58% 64%,transparent 65%); }
.ww-progress-dialog-ring strong { font-size:28px; }
.ww-progress-dialog-ring span { color:var(--cift-muted); font-size:11px; }
@media (max-width:600px) { .ww-mobile-prompt { min-height:86px; } .ww-progress-pill { min-width:74px; padding-right:8px; } }

html.cift-ui .main-area .ww .ww-vault-search-row .ww-vault-search:has(>svg) input[type=search] { padding-left: 43px; }
html.cift-ui .main-area .ww.is-library .ww-vault-search-row .ww-vault-search > input[type=search] { border-radius: 999px !important; }

/* Compact tag rail: the full collection lives in the tag browser. */
.ww-tag-bar { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; }
.ww-tag-bar > .ww-tag-filters { flex: 1; min-width: 0; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; padding: 4px 2px; scrollbar-width: none; overscroll-behavior-x: contain; scroll-padding-inline: 8px; }
.ww-tag-bar > .ww-tag-filters::-webkit-scrollbar { display: none; }
.ww-tag-bar > .ww-tag-filters > button { flex: none; white-space: nowrap; overflow-wrap: normal; min-height: 40px; }
.ww .ww-tag-expand { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; border: 1px solid var(--cift-line); border-radius: 50%; color: var(--cift-muted); background: var(--cift-surface); transition: color 160ms,background-color 160ms; }
.ww .ww-tag-expand:hover { color: var(--cift-ink); background: var(--cift-control-hover); }
.ww-tag-expand svg { width: 17px; height: 17px; stroke-width: 1.5; }
.ww .ww-tag-browser { width: min(600px,calc(100vw - 28px)); max-height: calc(var(--ww-viewport-height,100dvh) - 28px); }
.ww-tag-browser > .ww-dialog-heading { margin-bottom: 18px; }
.ww-tag-browser-grid { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 10px; margin-top: 16px; }
.ww-tag-browser-grid button { display: inline-flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 100%; min-height: 44px; padding: 11px 14px; border: 1px solid var(--cift-line); border-radius: 14px; background: var(--cift-surface-soft); color: var(--cift-ink); font-size: 13px; line-height: 1.5; transition: background-color 160ms,border-color 160ms,color 160ms; }
.ww-tag-browser-grid button > span { min-width: 0; overflow-wrap: anywhere; }
.ww-tag-browser-grid button > small { flex: none; padding: 2px 6px; border-radius: 6px; color: var(--cift-muted); background: var(--cift-surface); font-size: 10px; font-variant-numeric: tabular-nums; }
.ww-tag-browser-grid button:hover { background: var(--cift-control-hover); }
.ww-tag-browser-grid button[aria-pressed=true] { color: var(--cift-sage-ink); border-color: color-mix(in srgb,var(--cift-sage-ink) 22%,var(--cift-line)); background: var(--cift-sage); }

/* Fine camera-style dial: one visual definition, with only size overrides. */
.ww-dial-layer { --ww-dial-ink: #3b4854; --ww-dial-muted: #5c6873; --ww-dial-glass: linear-gradient(154deg,rgba(255,255,255,.28),rgba(242,246,250,.16) 52%,rgba(250,247,250,.22)); --ww-dial-hover: rgba(255,255,255,.34); --ww-dial-rim: rgba(255,255,255,.66); position: absolute; inset: 0 auto 0 0; width: 0; z-index: 20; pointer-events: none; }
html.cift-ui.is-dark .ww-dial-layer { --ww-dial-ink: #f1f4f7; --ww-dial-muted: #d6dde5; --ww-dial-glass: linear-gradient(154deg,rgba(255,255,255,.16),rgba(242,246,250,.08) 52%,rgba(250,247,250,.12)); --ww-dial-hover: rgba(255,255,255,.18); --ww-dial-rim: rgba(255,255,255,.30); }
.ww .ww-dial-trigger { position: absolute; top: 50%; left: 0; display: flex; align-items: center; justify-content: center; width: 44px; height: 52px; min-width: 44px; min-height: 52px; padding: 0 6px 0 0; transform: translateY(-50%); border: 0; border-radius: 0 999px 999px 0; color: var(--ww-dial-ink); background: var(--ww-dial-glass); box-shadow: inset -1px 0 0 var(--ww-dial-rim),2px 2px 10px rgba(38,47,42,.07); backdrop-filter: blur(6px) saturate(45%); -webkit-backdrop-filter: blur(6px) saturate(45%); cursor: pointer; pointer-events: auto; transition: opacity 180ms,background-color 180ms; }
.ww .ww-dial-trigger:hover { background: var(--ww-dial-hover); }
.ww .ww-dial-trigger svg { width: 22px; height: 28px; stroke: currentColor; stroke-width: 1; }
.ww .ww-dial-trigger[aria-expanded=true] { opacity: 0; pointer-events: none; }
.ww-dial-panel { position: absolute; top: 50%; left: 0; width: 156px; height: 280px; overflow: hidden; transform: translateY(-50%); transform-origin: left center; border: 0; border-radius: 0 156px 156px 0; color: var(--ww-dial-ink); background: var(--ww-dial-glass); box-shadow: inset -1px 0 0 var(--ww-dial-rim),4px 3px 18px rgba(38,47,42,.055); backdrop-filter: blur(6px) saturate(45%); -webkit-backdrop-filter: blur(6px) saturate(45%); pointer-events: auto; animation: ww-dial-arrive 260ms cubic-bezier(.22,1,.36,1) both; }
.ww-dial-panel::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(ellipse at 12% 0%,rgba(255,255,255,.12),transparent 62%); pointer-events: none; }
.ww .ww-dial-surface { position: relative; display: block; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; border-radius: inherit; outline: none; background: transparent; color: var(--ww-dial-ink); overflow: hidden; touch-action: none; cursor: ew-resize; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
html.cift-ui .main-area .ww .ww-dial-surface:focus-visible { outline: 1px solid var(--ww-dial-ink); outline-offset: -5px; }
html.cift-ui .main-area .ww :is(.ww-dial-trigger,.ww-dial-close):focus-visible { outline: 1px solid var(--ww-dial-ink); outline-offset: -4px; }
html.cift-ui .main-area .ww .ww-dial-layer[data-dial-input=pointer] :is(.ww-dial-surface,.ww-dial-trigger,.ww-dial-close):focus-visible { outline: none; }
html.cift-ui .main-area .ww .ww-dial-layer[data-dial-input=keyboard] :is(.ww-dial-surface,.ww-dial-trigger,.ww-dial-close):focus { outline: 1px solid var(--ww-dial-ink); outline-offset: -5px; }
.ww .ww-dial-surface > svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; pointer-events: none; }
.ww-dial-ticks line { stroke: currentColor; stroke-width: .65; stroke-linecap: butt; }
.ww-dial-ticks line.is-major { stroke-width: 1; }
.ww-dial-pointer { fill: none; stroke: currentColor; stroke-width: 1.1; stroke-linecap: butt; }
.ww-dial-readout { position: absolute; top: 50%; left: 18px; display: grid; gap: 7px; transform: translateY(-50%); pointer-events: none; }
.ww-dial-caption { display: block; color: var(--ww-dial-muted); font-size: 8px; font-weight: 500; letter-spacing: .2em; line-height: 1; }
.ww-dial-readout-values { display: flex; align-items: baseline; gap: 5px; color: var(--ww-dial-muted); font-size: 10px; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.ww-dial-readout-values > strong { color: var(--ww-dial-ink); font-size: 20px; font-weight: 400; letter-spacing: -.025em; }
.ww .ww-dial-close { position: absolute; top: 27px; left: 8px; z-index: 3; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 50%; color: var(--ww-dial-muted); background: transparent; cursor: pointer; pointer-events: auto; transition: background-color 160ms,color 160ms; }
.ww .ww-dial-close:hover { color: var(--ww-dial-ink); background: var(--ww-dial-hover); }
.ww .ww-dial-close svg { width: 14px; height: 14px; stroke-width: 1; }
.ww-dial-layer.is-closing .ww-dial-panel { animation: ww-dial-depart 220ms cubic-bezier(.4,0,.2,1) both; pointer-events: none; }
.ww-dial-layer.is-closing .ww-dial-panel * { pointer-events: none; }
@keyframes ww-dial-arrive { from { opacity: 0; transform: translateY(-50%) translateX(-18px) scale(.95); } to { opacity: 1; transform: translateY(-50%) translateX(0) scale(1); } }
@keyframes ww-dial-depart { from { opacity: 1; transform: translateY(-50%) translateX(0) scale(1); } to { opacity: 0; transform: translateY(-50%) translateX(-18px) scale(.95); } }
@media (max-width:600px) {
  .ww-tag-bar { gap: 6px; }
  .ww-tag-bar > .ww-tag-filters { gap: 7px; }
  .ww-tag-bar > .ww-tag-filters > button { min-height: 44px; padding-inline: 12px; }
  .ww .ww-tag-browser { width: calc(100vw - 20px); max-width: calc(100vw - 20px); padding: 18px; border-radius: 20px; }
  .ww-tag-browser-grid { gap: 8px; }
  .ww-tag-browser-grid button { padding: 10px 12px; font-size: 12px; }
  .ww-dial-panel { width: 140px; height: 250px; }
  .ww-dial-readout { left: 15px; gap: 6px; }
  .ww-dial-readout-values { gap: 4px; }
  .ww-dial-readout-values > strong { font-size: 19px; }
  .ww .ww-dial-close { top: 22px; left: 6px; }
}
@media (prefers-reduced-motion:reduce) {
  .ww-dial-panel,.ww-dial-layer.is-closing .ww-dial-panel { animation: none; }
  .ww-dial-ticks,.ww .ww-dial-trigger,.ww .ww-dial-close,.ww .ww-tag-expand,.ww-tag-browser-grid button { transition: none; }
}
