@import url('./tokens.css');

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #dedfe5; color: var(--ink); font: 17px -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { border: 0; cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
a { color: var(--tint); }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--tint); outline-offset: 3px; }
.shell { width: 100%; max-width: 430px; min-height: 100dvh; margin: auto; background: var(--bg); }
.workspace { min-width: 0; padding: 0 20px; }
.topbar { position: sticky; top: 0; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; height: calc(66px + env(safe-area-inset-top)); padding: calc(10px + env(safe-area-inset-top)) 20px 10px; margin: 0 -20px; z-index: 5; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.glass-control { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: 0 2px 8px #00000006, inset 0 1px 0 #ffffff28; }
.glass-control svg { width: 22px; height: 22px; }
.account-button { grid-column: 1; }
.add-button { grid-column: 3; color: var(--tint); }
.preview-badge { grid-column: 2; justify-self: center; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.preview-badge > span { width: 5px; height: 5px; background: var(--tertiary); border-radius: 50%; }
main { padding: 12px 0 132px; min-height: calc(100dvh - 66px); }
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 48px; padding: 11px 20px; border-radius: 25px; font-size: 16px; font-weight: 600; white-space: nowrap; }
.primary { background: var(--tint); color: #fff; }
.secondary { background: var(--control); color: var(--ink); }
.primary svg, .secondary svg { width: 19px; height: 19px; }
.toolbar { display: flex; align-items: center; gap: 10px; margin: 0 0 24px; }
.search-wrap { position: relative; flex: 1; min-width: 0; }
.search-wrap svg { position: absolute; width: 19px; height: 19px; left: 11px; top: 13px; color: var(--muted); }
.search { width: 100%; height: 46px; border: 0; background: var(--control); border-radius: 13px; padding: 10px 12px 10px 37px; color: var(--ink); font-size: 17px; }
.search::placeholder { color: var(--muted); opacity: 1; font-size: 16px; }
.filter { min-height: 44px; max-width: 100%; min-width: 0; border: 0; background: var(--surface); border-radius: 22px; color: var(--tint); padding: 10px 12px; font-size: 15px; }
.toolbar > .filter { flex: 1; width: 0; }
#clip-type { flex: 0 0 80px; background: transparent; padding-right: 0; }
.date { color: var(--muted); font-size: 13px; }
.section-caption { margin: 0 0 10px; padding: 0 16px; color: var(--muted); font-size: 13px; }
.clip-grid { display: grid; grid-template-columns: minmax(0, 1fr); background: var(--surface); border-radius: 24px; overflow: hidden; }
.clip-card { display: flex; align-items: center; gap: 3px; padding: 15px 10px 15px 16px; position: relative; min-height: 107px; }
.clip-card + .clip-card::before { content: ''; position: absolute; top: 0; left: 64px; right: 0; height: .5px; background: var(--line); }
.clip-open { display: flex; align-items: flex-start; gap: 12px; background: transparent; color: var(--ink); text-align: left; padding: 0; min-height: 64px; min-width: 0; flex: 1; }
.clip-kind-symbol { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 36px; color: var(--muted); }
.clip-kind-symbol svg { width: 22px; height: 22px; }
.link-symbol { color: var(--tint); }
.clip-body { display: block; flex: 1; min-width: 0; }
.clip-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.4; margin-bottom: 7px; letter-spacing: -.15px; }
.clip-meta { display: block; color: var(--muted); font-size: 13px; }
.copy-button { flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--tint); background: transparent; }
.copy-button:active { background: var(--tint-soft); }
.copy-button svg { width: 20px; height: 20px; }
.empty { padding: 38px 24px; color: var(--muted); font-size: 15px; line-height: 1.5; text-align: center; }
.empty strong { display: block; color: var(--ink); margin-bottom: 7px; font-size: 17px; font-weight: 600; }
.backlog-project { margin: 0 0 22px; }
.project-picker { width: 100%; display: flex; align-items: center; gap: 10px; padding: 0 4px; min-height: 52px; text-align: left; color: var(--ink); background: transparent; }
.project-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0; }
.project-mark svg { width: 21px; height: 21px; }
.project-atelier { background: #dceee4; color: #28835a; }
.project-folio { background: #e7e0f5; color: #8463c5; }
.project-notes { background: #f8e8cc; color: #b07e30; }
.project-picker-text { flex: 1; font-size: 20px; font-weight: 600; letter-spacing: -.4px; }
.project-picker small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; letter-spacing: 0; margin-top: 3px; }
.picker-chevron { font-size: 22px; color: var(--tint); padding: 0 7px; }
.status-tabs { display: flex; background: var(--control); padding: 3px; border-radius: 13px; margin: 0 0 18px; }
.status-tabs button { flex: 1; min-height: 38px; border-radius: 10px; color: var(--muted); background: transparent; font-size: 14px; position: relative; }
.status-tabs button::after { content: ''; position: absolute; inset: -3px 0; }
.status-tabs button[aria-pressed=true] { background: var(--surface); color: var(--ink); box-shadow: 0 2px 4px #0000000c, 0 0 1px #00000010; font-weight: 600; }
.task-search { margin-bottom: 28px; }
.task-group { margin-bottom: 26px; }
.task-group summary { display: flex; align-items: center; gap: 8px; list-style: none; min-height: 44px; padding: 0 8px 7px; color: var(--ink); cursor: pointer; font-size: 15px; font-weight: 600; }
.task-group summary::-webkit-details-marker { display: none; }
.task-group summary::before { content: '›'; color: var(--muted); font-size: 20px; transition: transform .2s; }
.task-group[open] summary::before { transform: rotate(90deg); }
.task-group summary span { color: var(--muted); font-size: 13px; font-weight: 400; }
.task-list { overflow: hidden; background: var(--surface); border-radius: 22px; }
.task-row { display: flex; align-items: center; gap: 4px; padding: 10px 16px 10px 8px; min-height: 70px; position: relative; }
.task-row + .task-row::before { content: ''; position: absolute; top: 0; left: 56px; right: 0; height: .5px; background: var(--line); }
.check { width: 44px; height: 44px; flex-shrink: 0; border: 0; background: transparent; display: grid; place-items: center; position: relative; }
.check::before { content: ''; position: absolute; width: 23px; height: 23px; border: 1.5px solid var(--tertiary); border-radius: 50%; }
.check svg { z-index: 1; width: 14px; height: 14px; color: #fff; }
.check.checked::before { background: var(--tint); border-color: var(--tint); }
.task-edit { min-height: 44px; flex: 1; padding: 2px 0; text-align: left; background: transparent; color: var(--ink); font-size: 17px; line-height: 1.4; letter-spacing: -.2px; overflow-wrap: anywhere; }
.task-edit.done { color: var(--muted); text-decoration: line-through; }
.project-menu { margin: 14px -2px 0; background: var(--surface); border-radius: 20px; overflow: hidden; }
.project-option { display: flex; align-items: center; gap: 12px; width: 100%; padding: 15px; text-align: left; background: transparent; color: var(--ink); font-size: 17px; }
.project-option + .project-option { border-top: .5px solid var(--line); }
.project-option small { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.project-selected { width: 22px; height: 22px; margin-left: auto; color: var(--tint); }
.project-selected svg { width: 21px; height: 21px; }
.pages-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.page-card { overflow: hidden; background: var(--surface); border-radius: 24px; }
.page-image-button { width: 100%; display: block; padding: 0; background: var(--control); }
.page-image { width: 100%; height: auto; display: block; aspect-ratio: 1.55; object-fit: cover; }
.page-meta { padding: 16px 18px 18px; }
.page-meta h2 { font-size: 17px; font-weight: 600; letter-spacing: -.3px; margin: 0 0 7px; }
.page-meta p { color: var(--muted); font-size: 13px; margin: 0; }
.version-tag { display: inline-block; vertical-align: middle; margin-left: 7px; font-size: 11px; padding: 4px 7px; border-radius: 7px; background: var(--control); color: var(--muted); font-weight: 500; letter-spacing: 0; }
.usage-overview { padding: 25px 22px 18px; margin-bottom: 20px; background: var(--surface); border-radius: 26px; }
.metric-label { color: var(--muted); font-size: 14px; }
.metric-value { margin: 11px 0 27px; font-size: 46px; line-height: 1.1; font-weight: 650; letter-spacing: -2px; font-variant-numeric: tabular-nums; }
.metric-value > span { font-size: 27px; font-weight: 400; color: var(--tertiary); vertical-align: 5px; }
.usage-token-row { display: flex; justify-content: space-between; gap: 12px; padding-top: 17px; border-top: .5px solid var(--line); font-size: 14px; }
.usage-token-row > span { color: var(--muted); }
.usage-token-row strong { font-weight: 550; font-variant-numeric: tabular-nums; }
.metric-note { color: var(--tertiary); font-size: 11px; margin-top: 12px; }
.analysis-grid { display: grid; gap: 20px; }
.panel { padding: 21px 22px; border-radius: 24px; background: var(--surface); }
.panel h2 { margin: 0 0 24px; font-size: 17px; font-weight: 600; letter-spacing: -.3px; }
.bars { height: 135px; display: flex; align-items: flex-end; gap: 12px; margin: 8px 0 0; }
.bar-group { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 10px; }
.bar { width: 100%; max-width: 29px; min-height: 2px; background: var(--tint); opacity: .72; border-radius: 5px 5px 2px 2px; }
.bar-group small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.provider-row { margin: 22px 0 0; }
.provider-label { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 15px; }
.provider-label strong { font-size: 14px; font-weight: 500; }
.provider-line { height: 5px; background: var(--control); border-radius: 3px; overflow: hidden; }
.provider-fill { height: 100%; border-radius: 3px; }
.provider-Claude { background: #d78e65; }
.provider-Codex { background: #8b83e8; }
/* Le matériau de verre reste dans la couche de navigation, au-dessus du contenu. */
.mobile-nav { --tab-index: 0; position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 10; display: flex; width: calc(100% - 32px); max-width: 374px; height: 72px; padding: 5px; border-radius: 38px; border: .75px solid var(--glass-edge); background: var(--glass); backdrop-filter: blur(28px) saturate(1.8); -webkit-backdrop-filter: blur(28px) saturate(1.8); box-shadow: 0 6px 26px #00000012, 0 1px 5px #00000008, inset 0 1px 1px #ffffff70; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.mobile-nav::before { content: ''; position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc((100% - 10px) / 4); transform: translateX(calc(var(--tab-index) * 100%)); border-radius: 32px; background: var(--glass-lens); border: .6px solid #ffffff64; box-shadow: inset 0 1px 1px #ffffff8f, 0 1px 3px #00000005; pointer-events: none; transition: transform .35s cubic-bezier(.2,.9,.25,1.1); }
.mobile-nav.dragging::before { transition: none; }
.nav-link { position: relative; z-index: 1; flex: 1; min-width: 0; min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; text-decoration: none; color: var(--muted); font-size: 10px; font-weight: 550; border-radius: 32px; transition: color .2s; -webkit-user-drag: none; }
.nav-link.active { color: var(--tint); font-weight: 650; }
.nav-link.active[href="#clips"] svg { fill: var(--tint); }
.nav-link svg { width: 24px; height: 24px; stroke-width: 1.8; pointer-events: none; }
.nav-link span { pointer-events: none; }
.nav-link:active svg { transform: scale(.94); }
.skip { position: absolute; top: -100px; left: 10px; z-index: 30; padding: 12px; background: var(--surface); }
.skip:focus { top: 10px; }
dialog { width: min(410px, calc(100% - 24px)); max-height: 90dvh; margin: auto; padding: 25px; border: .5px solid var(--line); border-radius: 28px; color: var(--ink); background: var(--bg); box-shadow: 0 20px 80px #0002; }
dialog::backdrop { background: #00000038; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.dialog-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.dialog-top h2 { font-size: 20px; font-weight: 600; letter-spacing: -.5px; margin: 0; }
.close-button { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; color: var(--muted); background: var(--control); font-size: 28px; font-weight: 300; }
.form-description { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 22px; }
label.field { display: grid; gap: 10px; color: var(--muted); font-size: 13px; font-weight: 400; margin: 22px 0; }
textarea { width: 100%; min-height: 140px; resize: none; padding: 16px; color: var(--ink); border: 0; border-radius: 18px; background: var(--surface); font-size: 17px; line-height: 1.5; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; flex-wrap: wrap; margin-top: 24px; }
.checkbox-label { display: flex; flex-direction: row-reverse; align-items: center; justify-content: space-between; gap: 12px; min-height: 59px; padding: 12px 16px; border-radius: 18px; background: var(--surface); font-size: 16px; }
.checkbox-label input { appearance: none; -webkit-appearance: none; position: relative; flex-shrink: 0; width: 51px; height: 31px; margin: 0; border: 0; border-radius: 18px; background: var(--control); cursor: pointer; transition: background .2s; }
.checkbox-label input::before { content: ''; position: absolute; left: 2px; top: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px #0002; transition: transform .2s; }
.checkbox-label input:checked { background: #34c759; }
.checkbox-label input:checked::before { transform: translateX(20px); }
.error { min-height: 18px; margin-top: 12px; color: #e34438; font-size: 13px; line-height: 1.5; }
.detail-text { white-space: pre-wrap; overflow-wrap: anywhere; padding: 18px; max-height: 45vh; overflow: auto; line-height: 1.5; font-size: 17px; background: var(--surface); border-radius: 18px; }
.image-dialog img { width: 100%; display: block; border-radius: 15px; }
.zoom-frame { overflow: auto; max-height: 65vh; }
.zoom-frame.zoomed img { width: 200%; max-width: none; }
.account-info { padding: 18px; border-radius: 20px; background: var(--surface); color: var(--muted); font-size: 14px; line-height: 1.6; }
.account-info strong { display: block; color: var(--ink); font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.danger { color: #e34438; }
.banner-error { padding: 15px; margin-bottom: 20px; border-radius: 16px; color: #a04337; background: #fff0e9; font-size: 14px; line-height: 1.5; }
#toast { position: fixed; bottom: calc(102px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%) translateY(12px); width: max-content; max-width: min(380px, calc(100% - 30px)); padding: 14px 19px; border: .5px solid var(--glass-edge); border-radius: 25px; font-size: 14px; color: var(--ink); background: var(--glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 3px 20px #00000012; text-align: center; z-index: 40; opacity: 0; pointer-events: none; transition: .2s; }
#toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.task-sheet, .project-sheet { position: fixed; inset: auto 0 0; width: min(430px, 100%); max-width: 430px; max-height: 90dvh; margin: 0 auto; padding: 30px 20px max(28px, env(safe-area-inset-bottom)); border: 0; border-radius: 32px 32px 0 0; animation: sheet-in .25s ease-out; }
.task-sheet::before, .project-sheet::before { content: ''; position: absolute; top: 10px; left: calc(50% - 18px); width: 36px; height: 5px; border-radius: 3px; background: #8e8e9359; }
.task-sheet textarea { min-height: 105px; font-size: 20px; font-weight: 500; letter-spacing: -.35px; }
.task-sheet .filter { width: 100%; border-radius: 18px; min-height: 52px; color: var(--ink); }
@keyframes sheet-in { from { transform: translateY(35px); opacity: .5; } to { transform: translateY(0); opacity: 1; } }
@media (max-width: 350px) {
  .workspace { padding: 0 16px; }
  .topbar { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .clip-card { padding-left: 10px; padding-right: 5px; }
  .clip-open { gap: 8px; }
  .clip-text { font-size: 15px; }
  .clip-kind-symbol { width: 26px; }
  .metric-value { font-size: 40px; }
  .filter { font-size: 14px; }
  .status-tabs button { font-size: 13px; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .mobile-nav, .topbar, .glass-control, #toast { background: var(--surface); }
}
@media (prefers-reduced-transparency: reduce) {
  .mobile-nav, .topbar, .glass-control, #toast { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
  dialog::backdrop { backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --muted: var(--ink); --line: #8e8e93; }
  .mobile-nav, .glass-control { background: var(--surface); border: 1px solid var(--ink); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
