/* Identité Karnet : papier, menthe, corail et miel. Les blocs TDS utilisent
   l’apparence papier publiée ; cette feuille habille les compositions du produit. */
:root {
    color-scheme: light;
    --ink: light-dark(#233e35, #f5eedf);
    --muted: light-dark(#627367, #b9c8ba);
    --line: light-dark(#dee4d9, #405249);
    --panel: light-dark(#fffefa, #24342e);
    --bg: light-dark(#faf7f0, #172420);
    --brand: light-dark(#08796f, #65d1be);
    --brand-dark: light-dark(#07635b, #8adacb);
    --brand-light: light-dark(#e7f5ed, #28483c);
    --mint: light-dark(#0f9b8e, #54cab7);
    --mint-dark: var(--brand-dark);
    --mint-soft: light-dark(#dff2e9, #2e5145);
    --coral: light-dark(#c65e55, #ffaea1);
    --coral-light: light-dark(#fbe8dd, #503c33);
    --coral-soft: var(--coral-light);
    --yellow: light-dark(#f7cf68, #e5bd68);
    --yellow-soft: light-dark(#fbf0ce, #493f2b);
    --accent: var(--yellow);
    --accent-light: var(--yellow-soft);
    --accent-soft: var(--yellow-soft);
    --blue: light-dark(#2871a2, #9ccde3);
    --blue-soft: light-dark(#e8f3f6, #2a4147);
    --purple: light-dark(#7955a0, #d7bcea);
    --purple-soft: light-dark(#f1eaf7, #423449);
    --warn: light-dark(#88601b, #e5bd68);
    --ok: light-dark(#08796f, #8adacb);
    --danger: light-dark(#b42318, #ffaea1);
    --karnet-on-brand: light-dark(#ffffff, #12382e);
    --karnet-glass: var(--panel);
    --karnet-line: var(--line);
    --karnet-shadow: 0 12px 32px light-dark(#24453612, #07130d40);
    --karnet-soft-shadow: 0 8px 24px light-dark(#2445360c, #07130d30);
    --shadow-sm: var(--karnet-soft-shadow);
    --shadow-md: var(--karnet-shadow);
}
:root[data-mode="light"] { color-scheme: light; }
:root[data-mode="dark"] { color-scheme: dark; }

body {
    color: var(--ink);
    background:
        radial-gradient(ellipse at 96% 3%, color-mix(in srgb, var(--mint-soft) 60%, transparent), transparent 30rem),
        var(--bg);
}
body::before { display: none; }
a { color: var(--brand-dark); }
input, select, textarea { accent-color: var(--brand); }

/* Conserver l'espace de tous les objets, commandes et menus existants. */ .hero-more-dropdown { background: var(--panel); border-color: var(--line); }

.btn, :where(button:not([class^="tds-"]):not([class*=" tds-"])) {
    background: var(--brand);
    color: var(--karnet-on-brand);
    border-color: transparent;
    font-weight: 600;
    box-shadow: none;
}
.btn:hover, :where(button:not([class^="tds-"]):not([class*=" tds-"])):hover {
    background: var(--brand-dark);
    color: var(--karnet-on-brand);
    box-shadow: none;
}
.btn.secondary, button.secondary, .source-form-cancel {
    background: var(--panel);
    color: var(--ink);
    border-color: var(--line);
}
.btn.secondary:hover, button.secondary:hover, .source-form-cancel:hover {
    background: var(--brand-light);
    color: var(--brand-dark);
    border-color: var(--line);
}
.btn.danger, button.danger { background: var(--panel); color: var(--danger); border-color: var(--danger); }
.btn.danger:hover, button.danger:hover { background: var(--coral-soft); color: var(--danger); }
.btn.success { background: var(--mint-soft); color: var(--ok); }
.btn.warning { background: var(--yellow-soft); color: var(--warn); }
.btn.unavailable, .btn[disabled], button:disabled { opacity: .65; }

.card, .form-panel, .inline-panel, .profile-section, .collab-panel, .collab-card,
.source-card, .reservation-card, .subscription-card, .aide-card, .scenario-card,
.section-card, .share-wizard-card, .wizard-context-card, .assistant-next-action,
.empty-state-url-panel, .table-panel, .modal-panel {
    background: var(--panel);
    color: var(--ink);
    border-color: var(--line);
    box-shadow: var(--karnet-soft-shadow);
    border-radius: 18px;
}
.card h2, .card h3, .page-title, .home-hero h1, .home-step h2, .home-ideas h2 { color: var(--ink); }
.lead, .home-hero .lead, .hero .lead, .dashboard-lists .list-description { color: var(--muted); }
.page-title::after, .home-hero h1::after, .hero h1::after {
    background: linear-gradient(90deg, var(--mint), var(--yellow), var(--coral));
    height: 4px;
}
.pill { background: var(--panel); color: var(--muted); border-color: var(--line); font-weight: 500; }
.pill.info, .pill.ok, .pill.mint { background: var(--mint-soft); color: var(--mint-dark); }
.pill.warn, .pill.warning, .pill.yellow { background: var(--yellow-soft); color: var(--warn); }
.pill.danger, .pill.coral { background: var(--coral-soft); color: var(--danger); }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.purple { background: var(--purple-soft); color: var(--purple); }

/* L'accueil garde ses démonstrations, ses contenus et ses appels à l'action. */
.home-hero, .dashboard-hero {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}
.home-hero::before, .home-hero::after { background: var(--mint-soft); opacity: .45; }
.home-kicker { background: var(--yellow-soft); color: var(--warn); border-color: transparent; }
.home-proof-strip, .home-tags span { background: var(--panel); color: var(--muted); border-color: var(--line); }
.home-preview-card { background: var(--panel); border-color: var(--line); box-shadow: var(--karnet-shadow); }
.dashboard-hero h1 { font-weight: 700; letter-spacing: -.035em; }
.dashboard-hero-metrics { color: var(--muted); }

/* Petits carnets : illustration décorative, commandes et aperçus inchangés. */
.dashboard-lists, .dashboard-folder-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
}
.dashboard-lists .list-card {
    --card-accent-soft: color-mix(in srgb, var(--card-accent) 12%, var(--panel));
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--karnet-soft-shadow);
    padding: 20px;
    overflow: hidden;
    gap: 16px;
    transform: none;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: none;
    grid-template-rows: none;
    align-items: stretch;
}
.dashboard-lists .list-card > * { grid-area: auto; }
.dashboard-lists .list-tags { align-self: start; }
.dashboard-lists .list-actions { align-content: start; }
.dashboard-lists .tag-urgent { position: static; }
.dashboard-lists .list-card:nth-child(n) { transform: none; }
.dashboard-lists .list-card:hover {
    border-color: color-mix(in srgb, var(--card-accent) 45%, var(--line));
    box-shadow: var(--karnet-shadow);
    transform: translateY(-2px);
}
.dashboard-lists .list-card.is-archived { background: var(--panel); border-style: dashed; }
.dashboard-lists .list-card.urgent { border-color: var(--warn); }
.dashboard-lists .list-card h3, .list-title-link { color: var(--ink); font-weight: 600; }
.dashboard-lists .list-card-header { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; }
.dashboard-lists .list-card-icon {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    box-shadow: none;
    background: color-mix(in srgb, var(--card-accent) 14%, var(--panel));
    color: var(--ink);
    font-size: 1.15rem;
}
.karnet-card-cover {
    background: color-mix(in srgb, var(--card-accent) 18%, var(--panel));
    margin: -20px -20px 0;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    overflow: hidden;
    position: relative;
}
.karnet-card-cover::after {
    content: '';
    position: absolute;
    top: -48px;
    right: -22px;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--panel) 30%, transparent);
}
.karnet-paper-book {
    display: block;
    width: 58px;
    height: 72px;
    border-left: 8px solid var(--card-accent);
    border-radius: 7px 12px 12px 7px;
    background: var(--panel);
    box-shadow: 4px 4px 0 color-mix(in srgb, var(--ink) 8%, transparent);
    transform: rotate(-7deg);
    position: relative;
}
.karnet-paper-book::before {
    content: '';
    position: absolute;
    left: 9px;
    right: 10px;
    top: 27px;
    height: 24px;
    background: repeating-linear-gradient(to bottom, var(--line) 0 2px, transparent 2px 9px);
}
.karnet-paper-book::after {
    content: '';
    position: absolute;
    right: 11px;
    top: 0;
    width: 11px;
    height: 22px;
    background: var(--yellow);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%);
}
.karnet-cover-symbol {
    display: grid;
    place-items: center;
    background: var(--panel);
    color: var(--ink);
    width: 38px;
    height: 38px;
    border-radius: 12px;
    transform: rotate(8deg);
}
.dashboard-lists .list-preview-images, .dashboard-lists .list-stats-inline {
    background: var(--brand-light);
    border-color: var(--line);
    box-shadow: none;
}
.dashboard-lists .list-stats-inline .stat-value { color: var(--brand-dark); }
.dashboard-lists .list-stats-inline { grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); }
.dashboard-lists .list-stats-inline .stat + .stat { border-top: 0; }
.dashboard-lists .list-preview-images img, .dashboard-lists .preview-more { min-height: 0; }
.dashboard-lists .tag-urgent { background: var(--yellow-soft); color: var(--warn); }
.list-card-drag-handle { background: var(--panel); color: var(--muted); border-color: var(--line); }

/* Garder une photo de couverture lisible sans lui appliquer un filtre. */
.list-hero:not(:has(.list-hero-bg)) { background: var(--mint-soft); border-color: var(--line); box-shadow: var(--karnet-soft-shadow); }
.list-hero:not(:has(.list-hero-bg)) .list-hero-body { color: var(--ink); }
.list-hero:has(.list-hero-bg) .list-hero-bg { opacity: 1; filter: none; }
.list-hero:has(.list-hero-bg) .list-hero-overlay { display: block; position: absolute; inset: 0; background: linear-gradient(180deg, #10282099, #102820ee); }
.list-hero:has(.list-hero-bg) .list-hero-body { color: #fffefa; }
.list-hero:has(.list-hero-bg) :is(h1, .list-hero-description, .list-hero-kicker, .list-hero-byline) { color: #fffefa; }
.gift-card, .task-card, .checklist-card, .note-card, .route-card { background-color: var(--panel); border-color: var(--line); }
.gift-card .btn.secondary { color: var(--ink); }
.gift-image, .gift-image-placeholder { background-color: var(--mint-soft); }

@media (max-width: 1680px) {
}
@media (max-width: 600px) {
    .dashboard-lists, .dashboard-folder-grid { grid-template-columns: minmax(0, 1fr); }
    .dashboard-lists .list-card-header { grid-template-columns: 40px minmax(0, 1fr); }
    .list-card-drag-handle { grid-column: 1 / -1; justify-self: start; }
    .card, .section-card, .form-panel { min-width: 0; }
    input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 16px; max-width: 100%; }
    .actions { flex-wrap: wrap; }
    .btn { white-space: normal; overflow-wrap: anywhere; text-align: center; }
    .list-actions .btn, .gift-card-footer .btn, .gift-card-footer button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    .dashboard-lists .list-card:hover { transform: none; }
}
@media print {
    :root[data-mode] { color-scheme: light; }
}

/* Composition Karnet du bandeau partagé : aucun rendu tds-* recopié. */
.karnet-header-row { min-height: 68px; gap: 12px; }
.karnet-header-create-symbol { display: none; }
.karnet-header-language { flex-shrink: 0; }
.karnet-header-end { flex-wrap: wrap; max-width: 100%; }
.karnet-notification-menu strong { flex-basis: 100%; font-weight: 600; }
.karnet-notification-menu .tds-nav-group__item > span { color: inherit; font-size: .8rem; }
.karnet-notification-count { display: inline-grid; place-items: center; min-width: 20px; padding: 2px 5px; border-radius: 999px; background: var(--coral-soft); color: var(--ink); font-size: .72rem; }
@media (max-width: 1023.98px) {
  .karnet-header-create-label { display: none; }
  .karnet-header-create-symbol { display: inline; font-size: 24px; line-height: 1; }
}
@media (max-width: 639.98px) {
  .karnet-header-row { gap: 6px; min-height: 60px; }
}

@media (max-width: 639.98px) {
  .karnet-header-end { gap: 6px; }
  .karnet-header-environment { position: absolute; bottom: -9px; left: 16px; }
}

/* Ancienne pastille de langue Karnet, select natif accessible sur toute la surface. */
.lang-form {
    position: relative;
    margin: 0;
    display: inline-flex;
    min-width: 78px;
    min-height: 38px;
    align-items: center;
    gap: 5px;
    border: 1px solid rgba(176, 219, 209, .74);
    border-radius: 999px;
    padding: 0 23px 0 11px;
    background: rgba(255, 255, 255, .72);
}
.lang-flag { display: inline-flex; align-items: center; width: 18px; font-size: .95rem; line-height: 1; pointer-events: none; }
.lang-current { color: var(--ink); font-size: .84rem; font-weight: 950; letter-spacing: .01em; white-space: nowrap; pointer-events: none; }
.lang-form::after {
    content: "";
    position: absolute;
    right: 10px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    pointer-events: none;
    transform: translateY(-65%) rotate(45deg);
}
.lang-select { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.lang-select option { color: var(--ink); background: var(--panel); }
.lang-form:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.lang-form:has(noscript button) { flex-wrap: wrap; padding-block: 6px; }
.lang-form noscript { position: relative; z-index: 1; }
/* Les deux vues du tableau de bord restent lisibles avec le texte agrandi. */
.dashboard-tabs { max-width: 100%; }
.dashboard-tabs a { min-width: 0; flex-wrap: wrap; overflow-wrap: anywhere; }
@media (max-width: 600px) {
    .dashboard-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Les parcours de connexion et de transfert restent utilisables avec le texte agrandi. */
.auth-page { overflow-wrap: anywhere; }
.auth-card { min-width: 0; grid-template-columns: minmax(0, 1fr); }
.auth-card > *, .auth-card form, .auth-card input { min-width: 0; max-width: 100%; }
.auth-card .btn, .auth-card button { white-space: normal; overflow-wrap: anywhere; }
