:root {
  color-scheme: light;
  --bg: #fcfbf9;
  --surface: #ffffff;
  --ink: #151515;
  --muted: #707070;
  --line: #e2e2de;
  --accent: #151515;
  --accent-soft: #efefec;
  --danger: #151515;
  /* Pally emploie une grotesque éditoriale. Helvetica Neue est disponible sur
     macOS et donne le même rythme sans intégrer ni appeler une police tierce. */
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, input, textarea, select { font: inherit; }
.icon-sprite { height: 0; overflow: hidden; position: absolute; width: 0; }

.app-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: #fcfbf9; border-right: 1px solid var(--line); padding: 8px 12px 16px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow: auto; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 24px; font-weight: 760; letter-spacing: -1.6px; text-decoration: none; padding: 8px 6px 36px; }
.brand.compact { padding: 0 0 28px; font-size: 27px; }
.brand-mark { width: 27px; height: 27px; flex: none; object-fit: cover; object-position: center; border-radius: 50%; border: 1px solid #d4d4d0; background: #e8e8e6; filter: grayscale(1) contrast(1.08); }
.brand.compact .brand-mark { width: 39px; height: 39px; }
.accent { color: var(--accent); }

.nav-label { color: #777772; font-size: 10px; font-weight: 760; letter-spacing: .8px; margin: 21px 6px 8px; }
.nav-item { align-items: center; background: transparent; border: 0; border-radius: 7px; color: #53534f; cursor: pointer; display: flex; font-size: 13px; gap: 9px; line-height: 16px; min-height: 28px; padding: 6px 6px; text-align: left; width: 100%; }
.nav-icon { color: #777; fill: none; flex: none; height: 16px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.75; width: 16px; }
.nav-item:hover { background: #f1f1ef; }
.nav-item.active { background: var(--accent-soft); color: var(--ink); font-weight: 650; }
.nav-item.active .nav-icon { color: var(--ink); }
.sidebar-bottom { border-top: 1px solid var(--line); display: grid; font-size: 12px; gap: 10px; margin-top: auto; padding: 16px 6px 2px; }
.sidebar-bottom a, .plain-button { background: transparent; border: 0; color: var(--muted); cursor: pointer; font-size: 12px; padding: 0; text-align: left; text-decoration: none; }
.plain-button:hover, .sidebar-bottom a:hover { color: var(--ink); }

main { margin: 0 auto; max-width: 720px; padding: 80px 0 88px; width: 100%; }
#main:focus { outline: none; }
.view-header { align-items: flex-start; display: flex; gap: 20px; justify-content: space-between; margin-bottom: 42px; }
.eyebrow { color: #555; font-size: 10px; font-weight: 760; letter-spacing: 1.4px; margin: 0 0 12px; }
.view-header .eyebrow { display: none; }
.view-header h1, .gate-card h1 { font-size: 36px; font-weight: 500; letter-spacing: -.9px; line-height: 1.05; margin: 0; }
.view-header h1 em { font-family: Georgia, serif; font-weight: 400; }
.subhead { color: var(--muted); font-size: 15px; line-height: 1.55; margin: 13px 0 0; max-width: 620px; }

.primary, .secondary, .danger { border-radius: 12px; cursor: pointer; font-weight: 680; padding: 12px 17px; white-space: nowrap; }
.primary { background: var(--ink); border: 1px solid var(--ink); box-shadow: 0 8px 20px #0000001c; color: #fff; }
.primary:hover { background: #000; }
.secondary { background: #fff; border: 1px solid #cfcfcb; color: var(--ink); }
.secondary:hover { border-color: var(--ink); }
.danger { background: #fff; border: 1px solid var(--ink); color: var(--danger); }
.danger:hover { background: #f0f0ed; }

.overview-grid { display: grid; gap: 13px; grid-template-columns: repeat(4, 1fr); margin: 25px 0 36px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 15px; min-height: 116px; padding: 20px; }
.stat .number { font-size: 36px; font-weight: 650; letter-spacing: -2px; }
.stat p { color: var(--muted); font-size: 12px; margin: 8px 0 0; }
.grid-two { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.panel h2 { font-size: 19px; letter-spacing: -.7px; margin: 0 0 5px; }
.panel .muted { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0 0 18px; }
.panel-link { background: transparent; border: 0; color: var(--ink); cursor: pointer; font-weight: 680; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.compact-list { display: grid; gap: 4px; list-style: none; margin: 7px 0 0; padding: 0; }
.compact-list li { border-top: 1px solid #eeeeeb; display: flex; font-size: 14px; gap: 12px; justify-content: space-between; padding: 12px 0; }
.compact-list li span:last-child { color: var(--muted); font-size: 12px; }

.connection-hero { align-items: center; background: #fff; border: 1px solid #d7d7d2; border-radius: 17px; display: flex; gap: 20px; justify-content: space-between; padding: 22px 24px; }
.connection-hero h2 { margin: 0; font-size: 20px; }
.connection-hero p { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.connection-dot { background: var(--ink); border-radius: 50%; display: inline-block; height: 8px; margin-right: 7px; width: 8px; }

.list-layout { align-items: start; display: grid; gap: 26px; grid-template-columns: minmax(0, 1fr) 310px; }
.list-layout.single { grid-template-columns: minmax(0, 1fr); }
.records { display: grid; gap: 11px; }
.record { background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 18px 19px; }
.record-top { align-items: flex-start; display: flex; gap: 14px; justify-content: space-between; }
.record h2, .record h3 { font-size: 16px; letter-spacing: -.35px; margin: 0; }
.record p { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 8px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.personal-story p { color: var(--ink); font-size: 16px; line-height: 1.7; margin: 0; white-space: pre-wrap; }
.record-meta { color: #858582; font-size: 12px; margin-top: 12px; }
.record-journal { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; }
.record-journal > strong { font-size: 12px; letter-spacing: -.1px; }
.record-history { display: grid; gap: 7px; list-style: none; margin: 10px 0 0; padding: 0; }
.record-history li { align-items: baseline; color: #555; display: flex; font-size: 12px; gap: 10px; justify-content: space-between; }
.record-history time { color: var(--muted); flex: none; font-size: 11px; }
.record-history-empty { color: var(--muted); font-size: 12px; margin: 8px 0 0; }
.automation-groups { display: grid; gap: 12px; }
.automation-group-heading { border-bottom: 1px solid var(--line); margin: 0 0 8px; padding: 0 0 14px; }
.automation-group-heading h2 { font-size: 20px; font-weight: 500; letter-spacing: -.5px; line-height: 1.2; margin: 0; }
.automation-group-heading p { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 5px 0 0; }
.automation-group-heading.group-heading { margin-top: 32px; }
.automation-disclosure { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; overflow: visible; }
.automation-disclosure summary { align-items: center; cursor: pointer; display: flex; gap: 12px; list-style: none; padding: 17px 0; }
.automation-disclosure summary::-webkit-details-marker { display: none; }
.automation-chevron { color: #6e6e69; display: inline-block; font-size: 24px; font-weight: 400; line-height: 1; transform: rotate(0deg); transition: transform .16s ease; }
.automation-disclosure[open] .automation-chevron { transform: rotate(90deg); }
.automation-dot { background: #e9a916; border-radius: 50%; display: inline-block; flex: none; height: 6px; width: 6px; }
.automation-dot.active { background: #50c878; }
.automation-dot.paused { background: #e9a916; }
.automation-summary-copy { flex: 1; min-width: 0; }
.automation-disclosure summary h2 { font-size: 16px; font-weight: 500; letter-spacing: -.35px; margin: 0; overflow-wrap: anywhere; }
.automation-disclosure summary p { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 5px 0 0; overflow-wrap: anywhere; }
.automation-state { align-items: center; color: var(--muted); display: inline-flex; font-size: 12px; gap: 7px; margin-left: 12px; white-space: nowrap; }
.automation-state .automation-dot { height: 6px; width: 6px; }
.automation-disclosure-body { border-top: 1px solid var(--line); padding: 18px 0 22px 42px; }
.automation-disclosure-body > div:first-child > p { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 10px 0 0; white-space: pre-wrap; }
.automation-disclosure-body > .record-actions { justify-content: flex-end; margin-top: 18px; }
.task-disclosure { background: transparent; border: 0; border-bottom: 1px solid var(--line); overflow: visible; }
.task-disclosure summary { align-items: center; cursor: pointer; display: flex; gap: 12px; list-style: none; padding: 17px 0; }
.task-disclosure summary::-webkit-details-marker { display: none; }
.task-chevron { color: #6e6e69; display: inline-block; font-size: 24px; font-weight: 400; line-height: 1; transform: rotate(0deg); transition: transform .16s ease; }
.task-disclosure[open] .task-chevron { transform: rotate(90deg); }
.task-dot { background: #a4a4a0; border-radius: 50%; display: inline-block; flex: none; height: 6px; width: 6px; }
.task-dot.active { background: #4c91e8; }
.task-dot.waiting { background: #e9a916; }
.task-dot.done { background: #50c878; }
.task-summary-copy { flex: 1; min-width: 0; }
.task-summary-copy h2 { font-size: 16px; font-weight: 500; letter-spacing: -.35px; margin: 0; overflow-wrap: anywhere; }
.task-summary-copy p { color: var(--muted); font-size: 12px; line-height: 1.45; margin: 5px 0 0; overflow-wrap: anywhere; }
.task-due { color: var(--muted); font-size: 12px; margin-left: 4px; text-align: right; white-space: nowrap; }
.task-disclosure-body { border-top: 1px solid var(--line); padding: 16px 0 22px 42px; }
.task-disclosure-body > p { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 0 0 16px; white-space: pre-wrap; }
.task-disclosure-body > .record-actions { justify-content: flex-end; }
.task-evidence { background: #f8f8f6; border: 1px solid var(--line); border-radius: 11px; display: grid; gap: 7px; margin: 0 0 16px; padding: 13px 14px; }
.task-evidence .tag { justify-self: start; }
.task-evidence strong { font-size: 13px; overflow-wrap: anywhere; }
.task-evidence p { color: var(--muted); font-size: 12px; line-height: 1.48; margin: 0; white-space: pre-wrap; }
.task-evidence small, .task-evidence-unavailable { color: var(--muted); font-size: 11px; line-height: 1.45; }
.task-evidence-unavailable { margin: 0 0 16px !important; }
.tracker-progress { align-items: baseline; display: flex; flex-wrap: wrap; gap: 8px 11px; margin-top: 15px; }
.tracker-progress strong { font-size: 18px; letter-spacing: -.45px; }
.tracker-progress span { color: var(--muted); font-size: 12px; }
.record-actions { display: flex; gap: 8px; }
.compact-action { font-size: 12px; padding: 7px 10px; }
.icon-button { background: #f2f2ef; border: 0; border-radius: 8px; color: #555; cursor: pointer; height: 30px; min-width: 30px; }
.icon-button:hover { background: #dfdfdb; color: var(--ink); }
.form-card { position: sticky; top: 24px; }
.form-card h2 { margin-bottom: 16px; }
.field { display: grid; gap: 6px; margin: 13px 0; }
.field label { color: #555; font-size: 12px; font-weight: 650; }
.checkbox-field label { align-items: center; display: flex; gap: 8px; }
.field.checkbox-field input { height: 16px; margin: 0; width: 16px; }
.field input, .field textarea, .field select { background: #fff; border: 1px solid #dcdcd8; border-radius: 9px; color: var(--ink); padding: 10px 11px; width: 100%; }
.field textarea { min-height: 100px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--ink); outline: 3px solid #e5e5e1; }
.form-note { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 13px 0; }
.empty { background: #fff; border: 1px dashed #d4d4cf; border-radius: 16px; color: var(--muted); padding: 42px 26px; text-align: center; }
.empty strong { color: var(--ink); display: block; font-size: 16px; margin-bottom: 8px; }

.tag { align-items: center; background: #ededeb; border-radius: 99px; color: #222; display: inline-flex; font-size: 11px; font-weight: 700; gap: 5px; padding: 5px 9px; }
.tag.neutral, .tag.success, .tag.warning { background: #ededeb; color: #333; }
.apps-list { background: #fff; border: 1px solid var(--line); border-radius: 17px; padding: 8px 23px; }
.app-row { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 18px; padding: 21px 0; }
.app-row:last-child { border: 0; }
.app-icon { background: #ededeb; border-radius: 11px; color: var(--ink); display: grid; font-weight: 800; height: 37px; place-items: center; width: 37px; }
.app-copy { flex: 1; min-width: 0; }
.app-copy h2 { font-size: 16px; margin: 0; }
.app-copy p { color: var(--muted); font-size: 13px; line-height: 1.4; margin: 5px 0 0; }
.app-row .secondary, .app-row .primary { font-size: 13px; padding: 10px 14px; }
.future-grid { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); margin-top: 28px; }
.future { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 17px; }
.future h3 { font-size: 15px; margin: 0 0 7px; }
.future p { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 0; }
.notice { background: #f0f0ed; border-radius: 13px; color: #41413f; font-size: 13px; line-height: 1.55; margin: 18px 0; padding: 17px 19px; }
.placeholder { background: #fff; border: 1px solid var(--line); border-radius: 18px; max-width: 650px; padding: 32px; }
.placeholder h2 { font-size: 23px; letter-spacing: -1px; margin: 0 0 12px; }
.placeholder p { color: var(--muted); line-height: 1.6; margin: 0; }
.placeholder .small { font-size: 13px; margin-top: 17px; }
.settings-block { border-bottom: 1px solid var(--line); max-width: 720px; padding: 25px 0; }
.settings-block:first-of-type { padding-top: 0; }
.settings-block h2 { font-size: 20px; margin: 0 0 6px; }
.settings-block p { color: var(--muted); line-height: 1.6; margin: 0 0 15px; }
.settings-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 16px; }
.button-link { display: inline-flex; text-decoration: none; }
.toggle-field { align-items: center; color: var(--ink); display: flex; font-weight: 650; gap: 10px; margin: 20px 0 12px; }
.toggle-field input { accent-color: var(--ink); height: 18px; width: 18px; }
.review-section { border-bottom: 1px solid var(--line); margin-bottom: 36px; padding-bottom: 36px; }
.review-list { display: grid; gap: 12px; }
.review-card { align-items: center; background: #fffdf7; border: 1px solid #e4dcc8; border-radius: 16px; display: flex; gap: 20px; justify-content: space-between; padding: 18px; }
.review-card p { margin: 9px 0 3px; }
.review-card small { color: var(--muted); }
.memory-library, .working-notes { margin-top: 34px; }
.memory-section-heading { border-bottom: 1px solid var(--line); margin-bottom: 18px; padding-bottom: 13px; }
.memory-section-heading h2 { font-size: 20px; font-weight: 500; letter-spacing: -.5px; line-height: 1.2; margin: 0; }
.memory-section-heading p { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 6px 0 0; }
.memory-group { margin-top: 28px; }
.memory-group h3 { color: #6e6e69; font-size: 11px; font-weight: 760; letter-spacing: 1.1px; margin: 0 0 10px; }
.working-note { background: #fff; border: 1px solid var(--line); border-radius: 15px; overflow: hidden; }
.working-note summary { align-items: center; cursor: pointer; display: flex; justify-content: space-between; list-style: none; padding: 16px 18px; }
.working-note summary::-webkit-details-marker { display: none; }
.working-note summary::after { color: var(--muted); content: '⌄'; font-size: 16px; transform: rotate(-90deg); transition: transform .16s ease; }
.working-note[open] summary::after { transform: rotate(0); }
.working-note summary h3 { font-size: 15px; letter-spacing: -.3px; margin: 0; }
.working-note summary p, .working-note > div p { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 4px 0 0; }
.working-note > div { border-top: 1px solid var(--line); padding: 14px 18px; }
.working-note-list { display: grid; gap: 8px; list-style: none; margin: 12px 0 0; padding: 0; }
.working-note-list li { border-top: 1px solid #eeeeeb; color: #4c4c49; font-size: 13px; line-height: 1.5; padding-top: 8px; white-space: pre-wrap; }
.working-note-empty { color: var(--muted); font-size: 12px; }
.profile-form { margin-top: 20px; }
.profile-form-grid { display: grid; gap: 0 16px; grid-template-columns: 1fr 1fr; max-width: 650px; }
.profile-form .primary { margin-top: 7px; }

/* L'accueil a une zone plus large, avec une colonne de lecture centrée dans
   son contenu. Les autres écrans restent volontairement plus compacts. */
#main:has(.home-noticed) { max-width: 1188px; padding-top: 80px; }
#main:has(.home-noticed) > * { max-width: 768px; margin-left: 210px; margin-right: 0; }
#main:has(.home-noticed) > .view-header { margin-bottom: 42px; }
#main:has(.home-noticed) > .view-header .eyebrow { display: none; }
#main:has(.home-noticed) > .view-header h1 { font-size: 60px; font-weight: 500; letter-spacing: -1.5px; line-height: .94; }

/* Pages principales : la même sobriété éditoriale que le tableau de référence. */
.profile-sheet, .workspace-sheet, .connection-sheet { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.profile-sheet { margin: 0 0 36px; }
.profile-row { align-items: center; border-bottom: 1px solid var(--line); display: grid; gap: 18px; grid-template-columns: 135px 1fr; min-height: 45px; padding: 0 18px; }
.profile-row:last-child { border-bottom: 0; }
.profile-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; line-height: 1.55; padding: 18px; }
.profile-updated { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; line-height: 1.45; padding: 15px 18px; }
.sync-status { align-items: center; color: var(--muted); display: flex; flex-wrap: wrap; font-size: 12px; gap: 10px 16px; margin: -5px 0 20px; }
.sync-status span { background: #f0f0ed; border-radius: 999px; padding: 6px 10px; }
.sync-status span.sync-error { background: #fff0ee; color: #9a2f24; }
.history-section-title { font-size: 15px; letter-spacing: .1px; margin: 0 0 20px; }
.history-section-title:not(:first-child) { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 28px; }
.profile-row span { color: #6e6e69; font-size: 11px; font-weight: 760; letter-spacing: 1.1px; }
.profile-row strong { color: #3d3d3b; font-size: 14px; font-weight: 500; }
.focus-section { margin-top: 62px; }
.card-grid { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.insight-card, .person-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; min-height: 160px; padding: 24px 26px; }
.person-card-button { color: inherit; cursor: pointer; font: inherit; text-align: left; width: 100%; }
.person-card-button:hover { border-color: #aaa9a4; box-shadow: 0 8px 20px #0000000b; }
.person-card-button:focus-visible { outline: 3px solid #d7d7d1; outline-offset: 3px; }
.person-open-context { display: block; font-size: 12px; font-weight: 680; margin-top: 14px; text-decoration: underline; text-underline-offset: 3px; }
.insight-card h3, .person-card h3 { font-size: 18px; letter-spacing: -.55px; line-height: 1.35; margin: 14px 0 0; overflow-wrap: anywhere; }
.insight-card p, .person-card p { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 11px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.insight-card > p { color: #858582; font-size: 12px; }
.review-insight .record-actions { margin-top: 17px; }
.person-card-top, .person-record-copy { align-items: center; display: flex; gap: 11px; }
.person-card-top { justify-content: space-between; }
.person-initial { align-items: center; background: #ecece9; border-radius: 50%; color: var(--ink); display: inline-flex; flex: none; font-size: 14px; font-weight: 750; height: 36px; justify-content: center; width: 36px; }
.person-relationship { color: #454542 !important; font-weight: 650; margin-top: 8px !important; }
.person-email { margin-top: 8px !important; }
.person-email a { color: #555; text-underline-offset: 3px; }
.team-members { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 15px; }
.teams-sheet { max-width: 800px; }
.team-record h2 { margin-top: 10px; }
.person-source { color: #858582; display: block; font-size: 12px; line-height: 1.45; margin-top: 13px; }
.person-record-copy { align-items: flex-start; }
.person-record-copy h2 { margin-top: 8px; }
.person-context { margin: -6px 0 26px; }
.person-context-heading { align-items: flex-start; border-bottom: 1px solid var(--line); display: flex; gap: 16px; justify-content: space-between; padding-bottom: 17px; }
.person-context-heading h2 { font-size: 24px; letter-spacing: -.9px; margin: 0; }
.person-context-heading p { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 6px 0 0; }
.person-context-source { color: #6c6c68; font-size: 12px; margin: 15px 0 18px; }
.person-context-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.person-context-grid section { border: 1px solid var(--line); border-radius: 13px; padding: 15px; }
.person-context-grid h3 { font-size: 14px; letter-spacing: -.25px; margin: 0 0 11px; }
.context-list { display: grid; gap: 10px; list-style: none; margin: 0; padding: 0; }
.context-list li { border-top: 1px solid #ededeb; display: grid; gap: 3px; padding-top: 10px; }
.context-list li:first-child { border-top: 0; padding-top: 0; }
.context-list strong { font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.context-list span { color: var(--muted); font-size: 11px; line-height: 1.45; }
.section-link { display: inline-block; margin-top: 18px; }
.section-links { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 18px; }
.activity-list { display: grid; list-style: none; margin: 0; padding: 0; }
.activity-list li { align-items: flex-start; border-bottom: 1px solid var(--line); display: flex; gap: 13px; padding: 16px 0; }
.activity-list li:first-child { padding-top: 0; }
.activity-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.activity-icon { align-items: center; background: #eeeeeb; border-radius: 50%; color: var(--ink); display: flex; flex: none; font-size: 14px; font-weight: 750; height: 32px; justify-content: center; width: 32px; }
.activity-list strong { display: block; font-size: 14px; overflow-wrap: anywhere; }
.activity-list p { color: var(--muted); font-size: 12px; margin: 4px 0 0; }
.history-entry-heading { align-items: center; display: flex; flex-wrap: wrap; gap: 7px; }
.history-entry-heading .tag { flex: none; font-size: 10px; padding: 4px 8px; }
.priority-list { display: grid; gap: 10px; }
.priority-list article { align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; display: grid; gap: 12px; grid-template-columns: auto minmax(0, 1fr) auto; padding: 15px 17px; }
.priority-list strong { font-size: 14px; overflow-wrap: anywhere; }
.priority-list p { color: var(--muted); font-size: 12px; margin: 0; white-space: nowrap; }
.tag.priority-high { background: #1d1d1b; color: #fff; }
.record-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.inline-list-search { align-items: center; display: flex; gap: 8px; margin: -13px 0 25px; max-width: 460px; }
.inline-list-search input { background: #fff; border: 1px solid #dcdcd8; border-radius: 999px; min-width: 0; padding: 9px 13px; width: 100%; }
.inline-list-search input:focus { border-color: var(--ink); outline: 3px solid #e5e5e1; }
.record-filters button { background: #fff; border: 1px solid var(--line); border-radius: 999px; color: #666; cursor: pointer; font-size: 12px; font-weight: 650; padding: 9px 13px; }
.record-filters button.selected { background: var(--ink); border-color: var(--ink); color: #fff; }
.person-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.section-heading { border-bottom: 1px solid var(--line); margin-bottom: 21px; padding-bottom: 12px; }
.section-heading h2 { font-size: 30px; font-weight: 500; letter-spacing: -.75px; line-height: 1.2; margin: 0; }
.section-heading p { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 7px 0 0; }
.home-recently .personal-story, .home-story .personal-story { background: transparent; border: 0; border-radius: 0; padding: 0; }
.home-recently .personal-story p { font-size: 17px; line-height: 1.65; }
.home-recently .history-preview { margin-top: 30px; }
.workspace-sheet { min-height: 240px; padding: 28px; }
.portal-sheet { max-width: 760px; }
.portal-stack { display: grid; gap: 16px; }
.portal-card { border: 1px solid var(--line); border-radius: 16px; padding: 23px; }
.portal-card h2 { font-size: 18px; letter-spacing: -.5px; margin: 0; }
.portal-card p { color: var(--muted); font-size: 14px; line-height: 1.58; margin: 9px 0 0; max-width: 620px; }
.portal-card .secondary { margin-top: 17px; }
.portal-plan > span { color: #6e6e69; font-size: 10px; font-weight: 760; letter-spacing: 1.1px; }
.portal-plan h2 { font-size: 25px; margin-top: 9px; }
.portal-metrics { display: grid; gap: 11px; margin-top: 18px; }
.portal-metrics span { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; padding-top: 11px; }
.portal-metrics strong { color: var(--ink); font-size: 17px; margin-right: 4px; }
.search-sheet { min-height: 0; }
.search-form { display: grid; gap: 8px; }
.search-form label { color: #555; font-size: 12px; font-weight: 650; }
.search-form > div { display: flex; gap: 10px; }
.search-form input { background: #fff; border: 1px solid #dcdcd8; border-radius: 10px; min-width: 0; padding: 12px 13px; width: 100%; }
.search-form input:focus { border-color: var(--ink); outline: 3px solid #e5e5e1; }
.search-results { margin-top: 26px; }
.search-count { color: var(--muted); font-size: 13px; margin: 0 0 13px; }
.search-result { align-items: flex-start; display: flex; gap: 16px; justify-content: space-between; }
.search-result h2 { margin-top: 10px; }
.workspace-sheet .empty { background: transparent; border: 0; max-width: 500px; padding: 30px 0; text-align: left; }
.workspace-sheet .empty span { display: block; line-height: 1.6; max-width: 480px; }
.sheet-row { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 18px; padding: 20px 0; }
.sheet-row:last-child { border-bottom: 0; }
.sheet-icon { align-items: center; background: #f0f0ed; border-radius: 50%; display: flex; flex: none; font-size: 14px; font-weight: 750; height: 35px; justify-content: center; width: 35px; }
.sheet-copy { flex: 1; min-width: 0; }
.sheet-copy h2 { font-size: 16px; letter-spacing: -.3px; margin: 0; }
.sheet-copy p { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 4px 0 0; }
.connection-sheet { margin-top: 28px; padding: 0 25px; }
.connection-title { border-bottom: 1px solid var(--line); padding: 26px 0 18px; }
.connection-title h2 { font-size: 23px; letter-spacing: -1px; margin: 0; }
.connection-title p { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.connection-row { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 16px; padding: 20px 0; }
.connection-row:last-child { border-bottom: 0; }
.connection-row .tag { margin-left: 7px; vertical-align: middle; }
.connection-row .secondary, .connection-row .primary { font-size: 13px; margin-left: auto; padding: 10px 15px; }
.connection-account { background: #fbfbfa; border: 1px solid var(--line); border-radius: 12px; margin: -3px 0 18px 51px; padding: 14px; }
.connection-account strong { font-size: 14px; }
.connection-account p { color: var(--muted); font-size: 12px; margin: 4px 0 0; }
.connection-sync { color: var(--muted); display: block; font-size: 12px; margin-top: 7px; }
.connection-sync.error { color: #9a2f24; }
.apple-messages-sheet { display: grid; gap: 17px; }
.apple-messages-status { display: grid; gap: 8px; }
.apple-messages-status .tag { justify-self: start; }
.apple-messages-status h2 { font-size: 22px; letter-spacing: -.8px; margin: 0; }
.apple-messages-status p { margin: 0; }
.setup-steps { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.setup-step { align-items: flex-start; display: grid; gap: 15px; grid-template-columns: 28px 1fr; padding: 20px 22px; }
.setup-step + .setup-step { border-top: 1px solid var(--line); }
.setup-step > span { align-items: center; background: #f0f0ed; border-radius: 50%; display: flex; font-size: 12px; font-weight: 750; height: 27px; justify-content: center; width: 27px; }
.setup-step h2 { font-size: 16px; letter-spacing: -.35px; margin: 2px 0 0; }
.setup-step p { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 6px 0 0; max-width: 650px; }
.connection-disconnect-confirm { align-items: center; background: #fbfbfa; border: 1px solid var(--line); border-radius: 12px; display: flex; gap: 16px; margin: -3px 0 18px 51px; padding: 14px; }
.connection-disconnect-copy { flex: 1; min-width: 0; }
.connection-disconnect-copy strong { font-size: 14px; overflow-wrap: anywhere; }
.connection-disconnect-copy p { color: var(--muted); font-size: 12px; margin: 4px 0 0; }
.connection-disconnect-actions { display: flex; flex: none; gap: 8px; }
.connection-disconnect-actions .secondary, .connection-disconnect-actions .primary { font-size: 13px; padding: 10px 15px; }
.apple-icloud-form { background: #fbfbfa; border: 1px solid var(--line); border-radius: 14px; display: grid; gap: 2px 16px; grid-template-columns: 1fr 1fr; margin: -2px 0 21px 51px; padding: 18px; }
.apple-icloud-form .field { margin: 0; }
.apple-icloud-form .field small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.apple-icloud-form .field label span { color: var(--muted); font-weight: 500; }
.apple-label { grid-column: 1 / 2; margin-top: 10px !important; }
.apple-actions { align-items: end; display: flex; gap: 14px; grid-column: 1 / -1; justify-content: space-between; margin-top: 13px; }
.apple-actions a { color: var(--ink); font-size: 12px; font-weight: 650; text-underline-offset: 3px; }
.muted-action { color: #777; cursor: default; }

.access-gate { align-content: center; background: linear-gradient(180deg, #fbfbfa 0%, #fafafa 57%, #f0f0ed 100%); display: grid; inset: 0; min-height: 100svh; padding: 28px; place-items: center; position: fixed; z-index: 10; }
.access-gate[hidden] { display: none; }
.gate-card { background: #fff; border: 1px solid #deded9; border-radius: 24px; box-shadow: 0 24px 70px #1717171c; padding: 36px; width: min(100%, 500px); }
.gate-card h1 { font-size: clamp(37px, 5.2vw, 52px); letter-spacing: -2.8px; line-height: .98; }
.gate-card > p:not(.error) { color: var(--muted); font-size: 17px; line-height: 1.52; margin: 23px 0 34px; }
.gate-card .primary { border-radius: 999px; margin: 0 0 4px; padding: 15px 20px; width: 100%; }
.gate-card .small { color: #7b7b76; font-size: 12px; line-height: 1.5; margin: 22px 0 0; }
.error { color: #a61b1b; font-size: 13px; font-weight: 650; line-height: 1.45; margin: 20px 0 0; min-height: 20px; }
.toast { background: #202020; border-radius: 11px; bottom: 24px; color: #fff; font-size: 13px; max-width: 340px; opacity: 0; padding: 13px 16px; position: fixed; right: 24px; transform: translateY(90px); transition: .2s; z-index: 30; }
.toast.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { border-bottom: 1px solid var(--line); border-right: 0; height: auto; padding: 14px; position: static; }
  .brand { padding: 4px 6px 13px; }
  .sidebar nav { display: flex; gap: 3px; overflow: auto; padding-bottom: 2px; }
  .nav-label, .sidebar-bottom { display: none; }
  .nav-item { flex: none; font-size: 12px; padding: 8px; width: auto; }
  .nav-item .nav-icon { display: none; }
  main { max-width: none; padding: 42px 24px; }
  .overview-grid { grid-template-columns: repeat(2, 1fr); }
  .person-context-grid { grid-template-columns: 1fr; }
  .list-layout { grid-template-columns: 1fr; }
  .form-card { order: -1; position: static; }
  .future-grid { grid-template-columns: 1fr 1fr; }
  #main:has(.home-noticed) { max-width: none; padding: 58px 24px 70px; }
  #main:has(.home-noticed) > * { margin-left: 0; max-width: none; }
}

@media (max-width: 1400px) and (min-width: 901px) {
  #main:has(.home-noticed) { max-width: 720px; padding-top: 64px; }
  #main:has(.home-noticed) > * { margin-left: 0; }
}

@media (max-width: 590px) {
  main { padding: 34px 17px 60px; }
  #main:has(.home-noticed) { padding: 48px 17px 60px; }
  #main:has(.home-noticed) > .view-header h1 { font-size: 42px; letter-spacing: -1.5px; }
  .view-header { display: block; margin-bottom: 27px; }
  .view-header .primary { margin-top: 18px; }
  .view-header h1 { font-size: 38px; letter-spacing: -2px; }
  .overview-grid, .grid-two, .future-grid, .card-grid { grid-template-columns: 1fr; }
  .panel { padding: 19px; }
  .connection-hero { align-items: flex-start; display: block; }
  .connection-hero .primary { margin-top: 16px; }
  .app-row { align-items: flex-start; flex-wrap: wrap; }
  .app-copy { min-width: calc(100% - 56px); }
  .app-row button { margin-left: 55px; }
  .access-gate { padding: 18px; }
  .gate-card { border-radius: 23px; padding: 32px 28px; }
  .gate-card h1 { font-size: 39px; }
  .profile-row { grid-template-columns: 1fr; gap: 2px; padding: 12px 15px; }
  .connection-sheet { padding: 0 18px; }
  .connection-disconnect-confirm { align-items: stretch; flex-direction: column; margin-left: 0; }
  .setup-step { padding: 18px; }
  .connection-disconnect-actions { width: 100%; }
  .connection-disconnect-actions button { flex: 1; }
  .search-form > div { align-items: stretch; flex-direction: column; }
  .apple-icloud-form { grid-template-columns: 1fr; margin-left: 0; }
  .apple-label { grid-column: auto; }
  .profile-form-grid { grid-template-columns: 1fr; }
  .priority-list article { align-items: flex-start; grid-template-columns: auto 1fr; }
  .priority-list p { grid-column: 2; }
}

.home-connections { margin: 0; padding: 0 25px; }
.home-connections .connection-row { min-height: 54px; }
.home-connections .tag { margin-left: auto; }
.recent-moments { background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 18px 22px; }

/* L'accueil reprend la séquence éditoriale du tableau de référence : profil,
   signaux, personnes, récit, puis les éléments opérationnels. */
#main:has(.home-noticed) { display: flex; flex-direction: column; }
#main:has(.home-noticed) > .view-header { order: 0; }
#main:has(.home-noticed) > .profile-sheet { order: 1; }
#main:has(.home-noticed) > .overview-grid { order: 2; }
#main:has(.home-noticed) > .home-noticed { order: 3; }
#main:has(.home-noticed) > .home-people { order: 4; }
#main:has(.home-noticed) > .home-recently { order: 5; }
#main:has(.home-noticed) > .home-story { order: 6; }
