/* Morga Serrano · visual theme inspired by the calm FamilyCal layout.
   Screen-only: the dedicated A4 policy sheet keeps its original print rules. */
@media screen {
  :root {
    --forest:#204f3e;
    --forest-dark:#173c30;
    --ink:#233c32;
    --quiet:#687d72;
    --line:#e1ebe4;
    --mint:#e8f3ed;
    --surface:#ffffff;
    font-family:'Segoe UI',system-ui,-apple-system,sans-serif;
    background:#f1f6f3;
    color:var(--ink);
  }
  body { background:radial-gradient(ellipse at 90% 0,#e4efe7 0,transparent 45%),#f1f6f3; }
  #app { min-height:100vh; }
  #app aside {
    inset:16px auto 16px 16px;
    width:232px;
    padding:25px 13px 16px;
    border:1px solid #e0e9e1;
    border-radius:24px;
    box-shadow:0 12px 45px #27483406;
    z-index:3;
  }
  .ui-icon { display:inline-block;width:23px;height:23px;vertical-align:middle;flex-shrink:0; }
  #app .brand { gap:10px;padding:0 9px 25px; }
  #app .brand>b { display:flex;align-items:center;justify-content:center;width:43px;height:46px;padding:0;border-radius:15px;background:var(--mint);color:var(--forest); }
  #app .brand>b .ui-icon { width:27px;height:27px; }
  #app .brand>span { font-size:17px;font-weight:750;letter-spacing:-.6px; }
  #app .brand small { font-size:8px;letter-spacing:2px;color:#7e9386; }
  #app .navlabel { font-size:9px;letter-spacing:2px;font-weight:650;color:#94a297;margin:7px 15px 13px; }
  #app nav { scrollbar-width:thin;scrollbar-color:#dce6dc transparent; }
  #app .nav { gap:10px;border-radius:13px;padding:8px 10px;margin-bottom:4px;min-height:46px;font-size:12px;color:#60766a;transition:background-color .15s,color .15s; }
  #app .nav>span { display:inline-flex;align-items:center;justify-content:center;flex:0 0 32px;width:32px;height:32px;border-radius:11px;background:#f1f5f0;color:#55765f; }
  #app .nav>span .ui-icon { width:19px;height:19px; }
  #app .nav:hover { background:#f4f8f3;color:var(--forest); }
  #app .nav.active { background:#e8f2eb;color:#214e39;font-weight:700; }
  #app .nav.active>span { box-shadow:0 0 0 2px #fff; }
  #app [data-view=events]>span { background:#f0eaff;color:#8b6ab5; }
  #app [data-view=tasks]>span { background:#fce9ef;color:#bb5e7a; }
  #app [data-view=shopping]>span { background:#fff3d8;color:#b58932; }
  #app [data-view=children]>span { background:#e2f3ef;color:#328c7b; }
  #app [data-view=documents]>span { background:#e9effa;color:#6689b3; }
  #app [data-view=subscriptions]>span { background:#eaf1e1;color:#789345; }
  #app [data-view=insurance]>span { background:#fdefe1;color:#b78252; }
  #app [data-view=warranty]>span { background:#e1f1ed;color:#417c68; }
  #app [data-view=maintenance]>span { background:#f6e9f2;color:#a06d90; }
  #app [data-view=contacts]>span { background:#e6f2fa;color:#538fae; }
  #app [data-view=archive]>span { background:#eef0e9;color:#7a8565; }
  #app .side-bottom { padding-top:14px; }
  #app .home-note { background:linear-gradient(120deg,#f3f5ea,#edf4ed);border:1px solid #e6ecdf;border-radius:16px;padding:17px 15px;font-size:11px;color:#7b8b74; }
  #app .home-note strong { color:#536b4e; }
  #app .home-note>span { color:#b8c7a0; }
  #app .profile { padding:15px 8px 0;border-color:var(--line);font-size:12px; }
  #app .profile small { color:#819587;font-size:10px; }
  #app .profile i,#app .avatar { background:#e9eee2;color:#53694f;font-weight:650; }
  #app .workspace { margin-left:264px; }
  #app .workspace>header { height:76px;background:transparent;border:0;padding:0 34px;font-size:12px;color:#829487; }
  #app .workspace>header em { color:#b7c5ba; }
  #app .local-pill { display:inline-flex;background:#e6f1e9;border:1px solid #dbe8dd;border-radius:30px;padding:7px 12px;font-size:10px;color:#5a7b62; }
  #app main { max-width:1530px;padding:20px 34px 34px; }
  #app .topline { margin-bottom:28px;gap:20px; }
  #app .eyebrow { color:#879b8a;font-size:10px;letter-spacing:1.8px; }
  #app h1 { font-size:34px;font-weight:720;letter-spacing:-1.1px;line-height:1.2;margin:10px 0; }
  #app .topline p { color:#7b9080;font-size:13px; }
  #app h2 { font-weight:700;color:var(--ink);letter-spacing:-.45px; }
  #app h3 { color:var(--ink); }
  #app p { color:var(--quiet); }
  #app .muted { color:#7c8e7e;font-size:11px; }
  #app main>footer { border-color:var(--line);color:#8fa190;font-size:9px;letter-spacing:1px;margin-top:30px;padding-top:21px;gap:15px; }
  #app .card { border:1px solid var(--line);border-radius:22px;background:var(--surface);padding:24px;box-shadow:0 7px 25px #2e513207; }
  #app .section-title { gap:14px;margin-bottom:18px; }
  #app .section-title h2 { font-size:17px; }
  #app .subtle { background:#f0f5ec;color:#809474;border-radius:8px;font-size:10px; }
  #app .home-overview { display:grid;grid-template-columns:minmax(0,1.35fr) minmax(290px,1fr);gap:22px;margin-bottom:24px;align-items:stretch; }
  #app .home-overview .welcome-banner { margin:0;min-height:290px;border:0;border-radius:24px;position:relative;overflow:hidden;padding:30px;background:linear-gradient(125deg,#183e31,#356e57 74%,#6d9a80);box-shadow:0 10px 32px #234c3213; }
  #app .welcome-banner:after { content:'';position:absolute;right:-85px;bottom:-130px;width:350px;height:350px;border:1px solid #ffffff0d;border-radius:50%;box-shadow:0 0 0 35px #ffffff04,0 0 0 70px #ffffff03;pointer-events:none; }
  #app .welcome-banner>div:first-child { position:relative;z-index:1;max-width:100%; }
  #app .welcome-banner .eyebrow { color:#c0d8c8;font-size:9px;letter-spacing:1.9px; }
  #app .welcome-banner h2 { font:700 clamp(25px,2.4vw,34px)/1.17 'Segoe UI',system-ui,sans-serif;color:#fff;letter-spacing:-.9px;margin:20px 0 14px; }
  #app .welcome-banner p { color:#d0e1d5;font-size:12px;line-height:1.8;max-width:340px; }
  #app .welcome-banner .textbtn { background:#ffffff12;border:1px solid #ffffff28;border-radius:11px;color:#fff;font-size:12px;padding:11px 15px;margin-top:10px; }
  #app .welcome-banner .house-art { display:none; }
  #app .stats { grid-template-columns:repeat(2,minmax(0,1fr));gap:13px;margin:0; }
  #app .stat { border:1px solid var(--line);border-radius:20px;padding:19px;text-align:left;box-shadow:0 5px 22px #2e513205; }
  #app .stat:hover { border-color:#bcd3c2;background:#fbfdfb; }
  #app .stat>div { gap:8px;font-size:11px;color:#6f8674; }
  #app .stat b { font-size:32px;font-weight:700;letter-spacing:-.8px;color:#294936;margin:10px 0 8px; }
  #app .stat small { color:#8b9d8b;font-size:9px;line-height:1.5; }
  #app .stat-icon { display:flex;align-items:center;justify-content:center;padding:0;width:31px;height:31px;border-radius:10px;background:#eee9fa;color:#8e76b8;flex-shrink:0; }
  #app .stat-icon .ui-icon { width:18px;height:18px; }
  #app .stat-icon.c1 { background:#fbe8ed;color:#c07b8b; }
  #app .stat-icon.c2 { background:#fff1d6;color:#c19b50; }
  #app .stat-icon.c3 { background:#e6f1e4;color:#71966a; }
  #app .columns { gap:22px;grid-template-columns:1.1fr 1fr;margin-bottom:22px; }
  #app .module-grid { grid-template-columns:repeat(4,minmax(0,1fr));gap:15px; }
  #app .module-tile { border-color:var(--line);border-radius:19px;padding:22px;background:#fff;transition:border-color .15s,background-color .15s; }
  #app .module-tile:hover { background:#f8fcf8;border-color:#bcd3c2; }
  #app .module-tile i { display:flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:13px;background:#ebf3e7;color:#75935c; }
  #app .module-tile:nth-child(3n+2) i { background:#eaf2fb;color:#668ba8; }
  #app .module-tile:nth-child(3n) i { background:#fcf0df;color:#bd9257; }
  #app .module-tile strong { font-size:12px;font-weight:600; }
  #app .module-tile small { color:#8d9d8a;font-size:10px; }
  #app .record { gap:12px;padding:19px 0;border-color:#edf2ed; }
  #app .record-body { min-width:0; }
  #app .record-body strong { font-size:13px;line-height:1.5;font-weight:600;color:#304d3b; }
  #app .record-body small { font-size:11px;color:#829481;line-height:1.6; }
  #app .record-body .record-expense { color:#3d6950;font-size:12px; }
  #app .record-body .record-expense-basis { color:#8a9b86;font-size:10px; }
  #app .record-body .record-tenure { color:#6e8864; }
  #app .record-end small { font-size:11px;color:#879a83; }
  #app .record-cost strong { color:#365d45;font-size:14px; }
  #app .record-cost small { color:#819278;font-size:10px; }
  #app .check { width:19px;height:19px;border-radius:6px;border-color:#d6e2d3; }
  #app .check.checked { background:#6c936d;border-color:#6c936d; }
  #app .tag { border-radius:8px;background:#eff4ec;color:#7b916d;font-size:10px;padding:5px 8px; }
  #app .tag.green { background:#e6f2e5;color:#628459; }
  #app .tag.amber { background:#fff1d9;color:#9e7c3f; }
  #app .tag.red { background:#fce8e5;color:#b36c5d; }
  #app .empty { padding:22px 10px; }
  #app .empty strong { font-size:13px;color:#6f8867; }
  #app .empty p { font-size:12px;color:#91a18a; }
  #app .toolbar { gap:15px;margin:22px 0; }
  #app .tabs { background:#eaf1e8;border:1px solid #e3ebdf;border-radius:13px;padding:4px;gap:3px;width:max-content;max-width:100%; }
  #app .tabs button { font-size:11px;border-radius:9px;padding:9px 13px;color:#79906e; }
  #app .tabs button.selected { background:#fff;color:#365e3d;box-shadow:0 2px 6px #35502a09;font-weight:650; }
  #app #search { background:#fff;font-size:12px;max-width:310px;border-radius:12px;padding:12px 14px; }
  #app .audit-intro { background:linear-gradient(120deg,#e6f0e3,#eef5e9);border-color:#dae7d4;border-radius:21px;padding:25px; }
  #app .audit-intro h2 { font-size:23px; }
  #app .audit-intro p { font-size:12px;color:#6e8461; }
  #app .audit-stats { gap:14px; }
  #app .audit-stats>div,#app .audit-stats>.audit-stat-link { border-color:var(--line);border-radius:18px;padding:21px;background:white; }
  #app .audit-stats b { color:#496e47;font-size:30px;font-weight:650; }
  #app .audit-stats span { color:#7b9171;font-size:11px; }
  #app .audit-notice { border-radius:13px;padding:15px 18px;background:#fff9eb;border-color:#f0dfb7;font-size:11px;color:#947b4b; }
  #app .audit-filters { gap:16px;margin:25px 0; }
  #app .audit-filters label { font-size:11px;color:#7f9275; }
  #app .audit-filters .audit-checkbox { margin-top:0; }
  #app .audit-contract>summary { padding:22px 0;gap:20px; }
  #app .audit-contract summary strong.company-line { font-size:13px;line-height:1.5; }
  #app .audit-contract summary small { font-size:10px;color:#8c9e80;line-height:1.8; }
  #app .audit-contract summary .warranty-deadline { font-size:11px;color:#597c4d; }
  #app .audit-count { color:#7b916b; }
  #app .audit-count b { color:#527749;font-size:15px; }
  #app .audit-money { color:#507447;font-size:14px; }
  #app .audit-calendar { background:#f6faf2;border-color:#e1ebd7;border-radius:14px;padding:18px; }
  #app .audit-period { border-radius:7px;padding:6px 8px; }
  #app .audit-table th,#app .audit-table td { padding:12px 9px;border-color:#e8efdf; }
  #app .audit-missing-list { margin-bottom:20px; }
  #app .audit-missing-list h2 { font-size:17px; }
  #app .warranty-month { margin-bottom:24px; }
  #app .warranty-month-header h2,#app .subscription-budget-heading h2 { font-size:23px;margin:8px 0; }
  #app .warranty-month-total>strong,#app .subscription-budget-totals strong { color:#3b694b;font-size:30px;font-weight:720;letter-spacing:-.8px; }
  #app .warranty-month-total>span,#app .warranty-month-total small,#app .subscription-budget-totals span { color:#8b9d7f;font-size:11px; }
  #app .warranty-month-nav>span { color:#69875b;font-size:13px; }
  #app .warranty-month-products { gap:11px;grid-template-columns:repeat(2,minmax(0,1fr));margin:22px 0 16px; }
  #app .warranty-month-products li { background:#fafcf8;border:1px solid #e8efdf;border-radius:14px;padding:14px 12px;gap:10px; }
  #app .warranty-month-products small { color:#899a7c;font-size:10px;line-height:1.65; }
  #app .warranty-month-products .textbtn { color:#436b45;font-size:12px; }
  #app .warranty-month-products li>strong { font-size:13px;color:#416b41; }
  #app .warranty-month-products .warranty-deadline { color:#66874f;font-size:10px; }
  #app .warranty-month-note,#app .subscription-budget .subscription-budget-note { color:#93a184;line-height:1.8;font-size:10px; }
  #app .subscription-month-groups { gap:8px 22px; }
  #app .subscription-month-group .warranty-month-products { grid-template-columns:1fr; }
  #app .subscription-month-heading { padding:0 2px; }
  #app .subscription-month-heading h3 { color:#648451;font-size:12px; }
  #app .subscription-budget-category { border-color:#e5eddf; }
  #app .subscription-budget-category>summary { padding:19px 0; }
  #app .subscription-budget-category summary strong { color:#486f42;font-size:13px; }
  #app .subscription-budget-category summary small { color:#8da17b;font-size:10px; }
  #app .subscription-budget-table th,#app .subscription-budget-table td { padding:13px 9px;border-color:#eaf0e3; }
  #app .subscription-budget-table .textbtn { font-size:12px; }
  #app .subscription-group { margin-bottom:20px; }
  #app .calendar { padding:23px; }
  #app .calendar-grid { gap:6px; }
  #app .weekdays span { padding:13px 7px;font-size:11px;color:#8da07f; }
  #app .day { min-height:132px;border:1px solid #e4edde;border-radius:14px;padding:7px;background:#f9fcf6; }
  #app .day.outside { opacity:.45; }
  #app .day.today { border-color:#b5cfaa;background:#f0f7e9; }
  #app .daynum { color:#607f50;font-size:12px;font-weight:650;width:28px;height:28px;padding:3px; }
  #app .today .daynum { background:#577e48;color:white; }
  #app .cal-event { border-radius:8px;padding:7px 6px;font-size:10px;line-height:1.5; }
  #app .google-panel { margin-bottom:22px; }
  #app .google-calendar-choice { border-radius:11px; }
  #app .google-picker fieldset { border-color:#e0eada;border-radius:14px; }
  #app .archive-intro { border-radius:20px;background:#eaf3e5;border-color:#dfead6; }
  #app .file-card { padding:22px 0;gap:17px;border-color:#e7eddf; }
  #app .file-symbol { border-radius:12px;background:#edf5e6;border-color:#dfebd3; }
  #app .file-details>strong { font-size:13px;line-height:1.5;color:#44623d; }
  #app .file-details>small,#app .file-details>p { font-size:11px;color:#7c9071; }
  #app .company-icon { border-color:#e7ede0;border-radius:12px; }
  #app .company-icon-small { border-radius:8px; }

  /* Controls shared by the workspace and dialogs; avoid the A4 paper. */
  .primary { background:var(--forest);border-radius:12px;padding:12px 18px;box-shadow:0 4px 9px #214d3011;font-size:12px;font-weight:600; }
  .primary:hover { background:var(--forest-dark); }
  .secondary { border-color:#dfe9d9;border-radius:11px;background:#fff;color:#527148;padding:10px 14px;font-size:12px; }
  .secondary:hover { background:#f6faf2;border-color:#bed2af; }
  .textbtn { color:#668657;font-size:11px;line-height:1.5; }
  button:disabled { cursor:default; }
  input,select,textarea { border-color:#dce8d4;border-radius:11px;background:#fbfdf9;color:#49623e;padding:11px 12px; }
  input:focus,select:focus,textarea:focus { outline:2px solid #9cbc8866;outline-offset:1px;border-color:#9cbd88; }
  button:focus-visible,a:focus-visible,summary:focus-visible { outline:2px solid #82a56d;outline-offset:3px; }
  label { font-size:12px;color:#779066; }
  input[type=checkbox] { accent-color:var(--forest); }
  dialog:not(.policy-print-dialog) { border:1px solid #dce7d3;border-radius:24px;padding:28px;color:#49613f;box-shadow:0 28px 85px #1c3e2e22; }
  dialog:not(.policy-print-dialog)::backdrop { background:#193a2c65;backdrop-filter:blur(5px); }
  dialog:not(.policy-print-dialog) h2 { color:#294b31;font-weight:700;font-size:23px;letter-spacing:-.5px; }
  dialog:not(.policy-print-dialog) .eyebrow { color:#90a57f;font-size:9px;letter-spacing:1.8px; }
  dialog:not(.policy-print-dialog) .close { color:#94ab83;right:17px;top:13px; }
  dialog:not(.policy-print-dialog) p { color:#809570; }
  dialog:not(.policy-print-dialog) .muted { color:#8ca079;font-size:11px; }
  dialog:not(.policy-print-dialog) .danger { border-radius:11px; }
  dialog:not(.policy-print-dialog) .policy-costs>div { border:1px solid #dfead5;border-radius:16px;padding:20px;background:#eef5e5; }
  dialog:not(.policy-print-dialog) .policy-costs strong { color:#466c35; }
  dialog:not(.policy-print-dialog) .policy-facts { gap:20px; }
  dialog:not(.policy-print-dialog) .policy-facts dt { font-size:11px;color:#8ca17d; }
  dialog:not(.policy-print-dialog) .policy-facts dd { font-size:13px;color:#48643b; }
  dialog:not(.policy-print-dialog) .record-documents,
  dialog:not(.policy-print-dialog) .price-history,
  dialog:not(.policy-print-dialog) .service-dossier,
  dialog:not(.policy-print-dialog) #warranty-metadata,
  dialog:not(.policy-print-dialog) #insurance-payment-fields { border-radius:14px;background:#f7faf2;border-color:#e3ecd8; }
  dialog:not(.policy-print-dialog) .record-documents summary { line-height:1.6; }
  #fileviewer { width:min(1000px,96vw); }
  #fileviewer .document-preview { border-radius:14px;border-color:#e1ead5;background:#f0f5e9; }
  #app .auth { max-width:460px;padding:60px 28px; }
  .auth .auth-brand { display:flex;align-items:center;justify-content:center;width:65px;height:65px;border-radius:22px;background:#e6f0df;color:#6c8c54; }
  .auth .auth-brand .ui-icon { width:38px;height:38px; }
  #app .auth h1 { font:720 36px/1.2 'Segoe UI',system-ui,sans-serif;color:#305534;letter-spacing:-1px; }
  .auth p { color:#8aa078;font-size:13px; }
  #toast { border-radius:13px;background:var(--forest);box-shadow:0 6px 24px #143d3020; }
}

@media screen and (min-width:1500px) {
  #app .home-overview { grid-template-columns:minmax(0,1.5fr) minmax(330px,1fr); }
  #app .welcome-banner h2 { font-size:36px; }
}
@media screen and (max-width:1150px) {
  #app aside { width:212px; }
  #app .workspace { margin-left:240px; }
  #app main { padding:20px 24px 28px; }
  #app .workspace>header { padding:0 24px; }
  #app .brand>span { font-size:16px; }
  #app .nav { gap:8px;font-size:11px;padding:8px; }
  #app .home-overview { grid-template-columns:1.2fr 1fr;gap:17px; }
  #app .home-overview .welcome-banner { padding:25px; }
  #app .stat { padding:16px; }
  #app .columns { grid-template-columns:1fr; }
  #app .module-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media screen and (max-width:960px) {
  #app .home-overview { grid-template-columns:1fr; }
  #app .home-overview .welcome-banner { min-height:235px; }
  #app .stats { grid-template-columns:repeat(4,minmax(0,1fr)); }
  #app .stat>div { align-items:flex-start;flex-direction:column-reverse; }
  #app .stat small { font-size:9px; }
  #app .card { padding:21px; }
  #app .warranty-month-header { gap:16px; }
}
@media screen and (max-width:760px) {
  #app aside { position:sticky;top:0;inset:auto;width:auto;margin:10px 10px 0;padding:13px 12px 9px;border-radius:19px;z-index:4;box-shadow:0 5px 20px #304e3110; }
  #app .brand { width:max-content;padding:0 0 12px;gap:9px; }
  #app .brand>b { width:34px;height:36px;border-radius:11px; }
  #app .brand>b .ui-icon { width:23px;height:23px; }
  #app .brand>span { font-size:16px; }
  #app .brand small { font-size:7px;margin-top:4px;letter-spacing:1.8px; }
  #app nav { display:flex;gap:5px;overflow-x:auto;padding:2px 0 3px; }
  #app .nav { flex:0 0 auto;width:auto;min-height:38px;padding:5px 8px;gap:6px;margin:0;font-size:11px; }
  #app .nav>span { flex-basis:27px;width:27px;height:27px;border-radius:9px; }
  #app .nav>span .ui-icon { width:17px;height:17px; }
  #app .navlabel { display:none; }
  #app .side-bottom { display:flex;align-items:center;gap:8px;position:absolute;right:13px;top:14px;margin:0;padding:0; }
  #app .side-bottom .home-note { display:none; }
  #app .side-bottom>.nav { font-size:0;padding:0;gap:0; }
  #app .side-bottom>.nav>span { width:30px;height:30px; }
  #app .profile { width:auto;padding:0;border:0; }
  #app .profile>span { display:none; }
  #app .profile>i { width:31px;height:31px; }
  #app .workspace { margin-left:0; }
  #app .workspace>header { height:54px;padding:0 21px;font-size:11px; }
  #app .workspace>header .local-pill { display:none; }
  #app main { padding:14px 16px 25px; }
  #app .topline { margin-bottom:22px;gap:12px;align-items:flex-start; }
  #app h1 { font-size:28px;letter-spacing:-.8px; }
  #app .topline p { font-size:12px;line-height:1.7;margin-bottom:0; }
  #app .eyebrow { font-size:9px;letter-spacing:1.4px; }
  #app .topline>.primary { padding:11px 12px;font-size:11px;margin-top:18px; }
  #app .home-overview { gap:15px;margin-bottom:19px; }
  #app .home-overview .welcome-banner { min-height:248px;padding:25px;border-radius:22px; }
  #app .welcome-banner h2 { font-size:29px; }
  #app .stats { grid-template-columns:repeat(2,minmax(0,1fr));gap:11px; }
  #app .stat { padding:17px;border-radius:17px; }
  #app .stat>div { flex-direction:row;align-items:center;font-size:11px; }
  #app .stat b { font-size:29px; }
  #app .columns { gap:17px;margin-bottom:18px; }
  #app .card { padding:20px;border-radius:20px; }
  #app .section-title { gap:10px;flex-wrap:wrap; }
  #app .section-title h2 { font-size:16px; }
  #app .record { flex-wrap:wrap;gap:10px;padding:18px 0; }
  #app .record-body { min-width:0;flex:1; }
  #app .record-body strong { font-size:12px; }
  #app .record-cost { margin-left:29px;text-align:left; }
  #app .record-end { margin-left:auto; }
  #app .record:has(>.company-icon) .record-body { flex-basis:calc(100% - 82px);min-width:0; }
  #app .record:has(>.company-icon) .record-cost { margin-left:51px; }
  #app .record-cost:has(.insurance-payment) { min-width:0;width:100%;margin-left:29px; }
  #app .module-grid { grid-template-columns:repeat(2,minmax(0,1fr));gap:12px; }
  #app .module-tile { padding:18px; }
  #app .toolbar { flex-direction:column;align-items:stretch;gap:13px; }
  #app #search { max-width:none; }
  #app .tabs { max-width:100%;overflow-x:auto;flex-wrap:nowrap; }
  #app .tabs button { white-space:nowrap;padding:9px 11px;font-size:10px; }
  #app .audit-intro { padding:22px; }
  #app .audit-intro h2 { font-size:21px; }
  #app .audit-stats { grid-template-columns:repeat(2,minmax(0,1fr));gap:11px; }
  #app .audit-stats>div,#app .audit-stats>.audit-stat-link { padding:18px; }
  #app .audit-stats b { font-size:27px; }
  #app .audit-filters { grid-template-columns:1fr 1fr;gap:14px; }
  #app .audit-filters .audit-grouping { max-width:none; }
  #app .audit-contract>summary { grid-template-columns:minmax(0,1fr);gap:10px;padding:20px 0; }
  #app .audit-count,#app .audit-money { padding-left:19px; }
  #app .audit-contract summary strong.company-line { font-size:12px; }
  #app .warranty-month-header { align-items:flex-start; }
  #app .warranty-month-header h2,#app .subscription-budget-heading h2 { font-size:21px; }
  #app .warranty-month-nav { order:3;width:100%;gap:8px; }
  #app .warranty-month-nav>span { min-width:128px;font-size:12px; }
  #app .warranty-month-nav .textbtn { margin-left:auto; }
  #app .warranty-month-total>strong { font-size:25px; }
  #app .warranty-month-products { grid-template-columns:1fr;gap:10px; }
  #app .subscription-month-groups { grid-template-columns:1fr; }
  #app .subscription-budget-heading { gap:18px; }
  #app .subscription-budget-totals { width:100%;gap:28px; }
  #app .subscription-budget-totals>div { text-align:left; }
  #app .subscription-budget-totals strong { font-size:26px; }
  #app .subscription-budget-columns { grid-template-columns:minmax(0,1fr) 68px 82px;gap:7px; }
  #app .subscription-budget-category summary strong { font-size:12px; }
  #app .subscription-budget-table { margin-left:0; }
  #app .subscription-budget-table th,#app .subscription-budget-table td { padding:11px 5px; }
  #app .subscription-budget-table td:nth-child(n+2) { width:auto; }
  #app .calendar { padding:13px;overflow-x:auto; }
  #app .calendar-grid,#app .weekdays { min-width:610px; }
  #app .calendar-grid { gap:5px; }
  #app .day { min-height:112px;padding:5px;border-radius:10px; }
  #app .cal-event { font-size:10px;padding:5px; }
  #app .weekdays span { padding:12px 5px; }
  #app main>footer { font-size:8px;line-height:1.7;flex-wrap:wrap; }
  dialog:not(.policy-print-dialog) { padding:24px 19px;border-radius:21px;max-height:90dvh; }
  dialog:not(.policy-print-dialog) h2 { font-size:21px; }
  #fileviewer { padding:22px 15px; }
  #fileviewer .document-preview { padding:4px; }
  .form-actions { gap:12px;flex-wrap:wrap; }
  #app .auth { padding:45px 24px; }
}
@media screen and (prefers-reduced-motion:reduce) {
  #app .nav,#app .module-tile { transition:none; }
}

@media screen {
  #recordform [hidden] { display:none!important; }
  dialog.module-record-dialog { width:min(680px,94vw); }
  .module-form-heading { display:flex;align-items:center;gap:14px;margin:5px 25px 22px 0; }
  .module-form-heading>span { display:flex;align-items:center;justify-content:center;width:48px;height:48px;flex:0 0 48px;background:#e8f3ed;color:#507e65;border-radius:15px; }
  dialog .module-form-heading h2 { margin:6px 0 0; }
  .module-record-section { margin:22px 0;padding:3px 18px 18px;border:1px solid #e1eadb;border-radius:15px;min-width:0; }
  .module-record-section legend { font-size:12px;font-weight:650;color:#6e8a5e;padding:0 7px; }
  .module-record-section .field-wide { grid-column:1/-1; }
  #app .record-body .record-module-detail { color:#698265; }
  .record-module-detail b { font-weight:600; }
}
@media screen and (max-width:580px) {
  .module-record-section { padding:3px 13px 15px; }
  .module-record-section .form-grid { grid-template-columns:1fr; }
}

/* Product pictures are screen-only. Policy A4 sheets keep their own layout. */
@media screen {
  dialog.policy-mail-dialog { width:min(680px,94vw);max-height:92dvh;overflow:auto; }
  .policy-mail-actions { display:flex;flex-wrap:wrap;gap:8px;margin:10px 0 18px; }
  .form-actions .policy-mail-actions { margin:0; }
  .policy-request-notice { display:grid;gap:4px;margin:14px 0;padding:13px 15px;border:1px solid #c89843;border-left:5px solid #a97018;border-radius:10px;background:#fff5df;color:#68450f;font-size:12px;line-height:1.5;text-align:left;overflow-wrap:anywhere; }
  .policy-request-notice .policy-request-label { color:#70460a;font-size:12px;font-weight:750;letter-spacing:.035em;text-transform:uppercase; }
  .policy-request-notice.is-compact { margin:9px 0;padding:8px 10px;font-size:11px; }
  #app .record-body .policy-request-notice { color:#68450f; }
  #app .record:has(.policy-request-notice) { border-color:#c89843; }
  .policy-request-repeat { width:100%;margin:10px 0 18px;padding:12px 14px;border:1px solid #d6dfd3;border-radius:10px; }
  .policy-request-repeat summary { cursor:pointer;font-size:12px;font-weight:650;color:#52694e; }
  .policy-request-repeat p { font-size:12px;line-height:1.6; }
  .policy-request-repeat .policy-mail-actions { margin:10px 0 0; }
  .policy-summary-dialog .form-actions { flex-wrap:wrap;gap:10px; }
  .policy-mail-dialog textarea { resize:vertical;min-height:200px; }
  .policy-mail-dialog .form-actions { flex-wrap:wrap;gap:10px; }
}
@media screen {
  .warranty-product-thumb { display:flex;align-items:center;justify-content:center;width:72px;height:72px;flex:0 0 72px;border:1px solid #e0e7df;border-radius:12px;background:#fff;padding:5px;overflow:hidden;color:#75877a; }
  .warranty-product-thumb img { width:100%;height:100%;object-fit:contain; }
  .warranty-product-thumb.is-missing::after { content:"Sin foto";font-size:10px; }
  .warranty-product-thumb:focus-visible { outline:2px solid #2d6953;outline-offset:3px; }
  #app .warranty-row-company { display:flex;align-items:center;gap:6px;margin:5px 0; }
  #app .warranty-row-company .company-icon { width:26px;height:26px;flex:0 0 26px;border-radius:6px;padding:2px; }
  #app .audit-product-heading { display:flex;align-items:center;gap:14px;min-width:0; }
  #app .audit-product-heading>span { min-width:0;overflow-wrap:anywhere; }
  .warranty-product-photo { margin:20px 0;padding:16px;background:#fff;border:1px solid #e0e7df;border-radius:16px;text-align:center; }
  .warranty-product-photo img { display:block;margin:auto;width:100%;max-width:320px;height:200px;object-fit:contain; }
  .warranty-product-photo figcaption { color:#6a7d70;font-size:12px;line-height:1.6;overflow-wrap:anywhere; }
  .warranty-product-photo a { display:inline-block;margin-top:5px; }
}
@media screen and (max-width:650px) {
  .warranty-product-thumb { width:76px;height:76px;flex-basis:76px; }
  #app .audit-product-heading { align-items:flex-start;gap:10px; }
  #app .warranty-record { flex-wrap:wrap; }
  #app .warranty-record .record-body { flex:1 1 140px; }
  #app .warranty-record .record-end { margin-left:auto; }
}

@media screen {
  dialog.activity-dialog { width:min(880px,95vw); }
  .activity-card { padding:22px 0;border-bottom:1px solid #e3ebdf; }
  .activity-card:first-child { padding-top:0; }.activity-card:last-child { border-bottom:0;padding-bottom:0; }
  .activity-card-top,.activity-detail-actions { display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap; }
  .activity-card-top h2 { margin:8px 0 12px;font-size:20px; }
  .activity-table-wrap { overflow-x:auto; }
  .activity-week { width:100%;border-collapse:collapse;font-size:12px;margin:14px 0; }
  .activity-week th,.activity-week td { text-align:left;padding:11px 12px;border-bottom:1px solid #e8eee4;vertical-align:top; }
  .activity-week thead { background:#f0f5ed;color:#718466;font-size:10px; }
  .activity-week tbody th { font-weight:600; }.activity-week td:nth-child(2) { white-space:nowrap; }
  .activity-next { padding:15px 18px;background:#edf5ef;border-radius:13px;margin:16px 0; }
  .activity-next>span,.activity-next small { display:block;font-size:11px;color:#67836e;margin:4px 0; }
  .activity-next strong { display:block;font-size:15px;color:#385f49;line-height:1.6; }
  .activity-source,.activity-change-note { font-size:11px;margin:12px 0 0; }
  .activity-change-note { color:#977128; }.activity-source { color:#7c8f7b; }
  .activity-detail-actions { justify-content:flex-start;margin:18px 0; }
  .activity-slot { display:grid;grid-template-columns:125px 100px 100px minmax(100px,1fr) 30px;gap:8px;align-items:end;padding:8px 0;border-bottom:1px solid #edf1e8; }
  .activity-slot label { margin:0; }.activity-slot button { margin-bottom:9px;font-size:20px; }
  .activity-slot label,.activity-slot input,.activity-slot select { min-width:0; }
  #activity-add-day { margin-top:14px; }
  .activity-extra { border:1px solid #e2eadc;border-radius:12px;padding:16px;margin:20px 0; }
  .activity-extra>summary { cursor:pointer;font-size:12px;font-weight:600;color:#59704e; }
  .activity-extra[open]>summary { margin-bottom:12px; }
  .activity-done { display:flex;align-items:center;gap:8px; }.activity-done input { width:auto;margin:0; }
  .activity-notes { white-space:pre-wrap; }
  .activity-agenda-heading { margin-top:24px; }.activity-agenda-heading h3 { margin:0 0 6px; }
  .activity-session { display:flex;justify-content:space-between;align-items:center;gap:15px;padding:14px 0;border-bottom:1px solid #e6ecdf;font-size:12px; }
  .activity-session strong,.activity-session small { display:block;line-height:1.6; }.activity-session small { color:#7d8f72; }
  .activity-session .tag { display:inline-block;margin:5px 0; }.activity-session.cancelled strong { text-decoration:line-through;color:#8d9388; }
  #activity-form [hidden] { display:none!important; }
}
@media screen and (max-width:680px) {
  .activity-slot { grid-template-columns:repeat(3,minmax(0,1fr)) 30px; }
  .activity-slot label:nth-child(4) { grid-column:1/4;grid-row:2; }
  .activity-slot>button { grid-column:4;grid-row:1/3; }
  .activity-session { align-items:flex-start;flex-direction:column;gap:8px; }
  .activity-week th,.activity-week td { padding:9px 6px; }.activity-week { font-size:11px; }
  .activity-card-top { align-items:flex-start; }
}

@media screen {
  #app .training-week { margin-bottom:24px;padding:22px; }
  .training-week-heading { display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:18px; }
  .training-week-heading h2 { font-size:21px;margin:8px 0; }.training-week-heading h2 .tag { font-size:10px;vertical-align:middle;margin-left:7px; }
  .training-week-heading p { margin:0;font-size:11px; }.training-week-navigation { display:flex;gap:5px; }
  .training-week-navigation .secondary { padding:8px 10px;font-size:11px; }
  .training-week-grid { display:grid;grid-template-columns:repeat(7,minmax(90px,1fr));gap:6px;overflow-x:auto;padding:2px 0 8px;scrollbar-width:thin; }
  .training-week-day { min-width:0;border:1px solid #e5ecdf;border-radius:12px;background:#fafbf8;padding:5px; }
  .training-week-day.is-today { border-color:#67957a;background:#f0f7ef; }
  .training-week-date { display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:68px;padding:5px 0 9px;gap:3px;color:#71866c; }
  .training-week-date>span { text-transform:uppercase;letter-spacing:1px;font-size:9px; }.training-week-date>strong { font-size:19px;font-weight:600; }
  .training-week-date>small { font-size:9px;color:#437151; }.training-week-day.is-today .training-week-date>strong { color:#315e42; }
  .training-week-session { display:block;width:100%;min-width:0;text-align:left;border:0;border-radius:8px;padding:10px 6px;margin:0 0 6px;line-height:1.5;color:#365f4b;background:#e5f0e8; }
  .training-week-session:last-child { margin-bottom:0; }.training-week-session>strong { display:block;font-size:11px;font-weight:650; }
  .training-week-session>span.training-week-time { display:block;font-size:10px;font-variant-numeric:tabular-nums;white-space:nowrap;margin:3px 0; }
  .training-week-session>small { display:block;font-size:9px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis; }
  .training-week-session.training-tone-1 { background:#f6eedc;color:#85662e; }.training-week-session.training-tone-2 { background:#e8eef9;color:#4a6284; }.training-week-session.training-tone-3 { background:#e8f2e2;color:#507143; }
  .training-week-session:hover { filter:brightness(.97); }.training-week-session:focus-visible { outline:2px solid #456d54;outline-offset:2px; }
  .training-week-session.is-cancelled { opacity:.65;background:#f1e7e4;color:#8a6257; }.training-week-session.is-cancelled .training-week-time { text-decoration:line-through; }
  .training-week-status { display:block;font-size:9px;font-weight:600;margin-top:4px; }
  .training-week-empty { margin:12px 0;text-align:center;font-size:9px;color:#a0aa98; }
}
@media screen and (max-width:580px) {
  #app .training-week { padding:17px; }.training-week-heading { gap:12px; }.training-week-navigation { width:100%;justify-content:flex-end; }
  .training-week-grid { grid-template-columns:repeat(7,minmax(108px,1fr));scroll-snap-type:x proximity; }.training-week-day { scroll-snap-align:start; }
  .training-week-session>strong { font-size:12px; }.training-week-session>span.training-week-time { font-size:11px; }.training-week-session>small { font-size:10px; }
}

@media screen {
  dialog.match-dialog { width:min(610px,94vw);padding:0;border:0;border-radius:25px;background:#fff;overflow:auto;box-shadow:0 28px 90px #153c3838; }
  dialog.match-dialog .close { top:13px;right:15px;z-index:2;width:34px;height:34px;display:grid;place-items:center;border-radius:50%;background:#fffdf4e8;color:#284b43;font-size:24px;line-height:1;box-shadow:0 2px 8px #163c3514; }
  .match-hero { height:158px;position:relative;overflow:hidden;background:#dcece4; }
  .match-hero>svg { display:block;width:100%;height:100%; }
  .match-hero-caption { position:absolute;right:26px;bottom:18px;color:#244f40;font-size:9px;letter-spacing:2px;font-weight:750;background:#f6f9e5da;border-radius:20px;padding:7px 11px; }
  .match-content { padding:24px 30px 20px; }
  .match-topline { display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:15px; }
  .match-person { color:#28564b;font-size:12px;font-weight:750; }
  .match-state { font-size:10px;font-weight:600;padding:6px 10px;border-radius:20px;color:#88682c;background:#fbf2de; }
  .match-state.is-played { color:#38624b;background:#eaf3e9; }
  dialog.match-dialog h2 { font-size:23px;letter-spacing:-.6px;line-height:1.3;margin:0 0 7px;color:#214d43; }
  .match-subtitle { font-size:11px;color:#7d8e83;margin:0; }
  .match-scoreboard { display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:15px;align-items:center;padding:25px 0;margin-top:12px;border-bottom:1px solid #e9eee8; }
  .match-team { display:flex;flex-direction:column;align-items:center;text-align:center;min-width:0;gap:8px; }
  .match-shield { width:45px;height:51px;display:grid;place-items:center;background:#e9eff3;color:#587084;font-size:14px;font-weight:750;border-radius:13px 13px 19px 19px;border:1px solid #dce6eb; }
  .match-shield.is-home-club { background:#fdebea;border-color:#f0d4d0;color:#ad5c53; }
  .match-shield.has-badge { position:relative;width:60px;height:64px;background:white;border:0;border-radius:0; }
  .match-shield img { position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:white; }
  .match-shield img[hidden] { display:none; }
  .match-team strong { font-size:12px;line-height:1.5;color:#35594d;overflow-wrap:anywhere;max-width:100%; }
  .match-team>small { color:#89958d;font-size:10px; }
  .match-score { text-align:center;align-self:center;min-width:94px; }
  .match-score>b { display:block;color:#254f43;font-size:34px;font-weight:650;letter-spacing:-1px;white-space:nowrap; }
  .match-score>small { color:#8a978c;font-size:9px;display:block;margin-top:6px; }
  .match-facts { display:grid;gap:18px;margin:22px 0 25px; }
  .match-facts>div { display:flex;gap:13px;align-items:flex-start; }
  .match-facts svg,.match-source svg { width:19px;height:19px;flex-shrink:0;color:#719586;margin-top:1px; }
  .match-facts span { display:block;color:#8a988d;font-size:10px;margin-bottom:5px; }
  .match-facts strong { display:block;color:#3b5b4e;font-size:12px;font-weight:550;line-height:1.6;overflow-wrap:anywhere; }
  .match-facts p { margin:4px 0 0;font-size:12px;color:#6a7d70; }
  .match-map-link { display:inline-block;margin-top:8px;color:#286454;font-size:11px;text-decoration:underline;text-underline-offset:3px;line-height:1.8; }
  .cal-event-place { display:block;margin-top:3px;font-size:inherit;opacity:.85; }
  .match-actions { display:flex;gap:9px;flex-wrap:wrap;align-items:center; }
  .match-actions a { display:inline-flex;align-items:center;justify-content:center;gap:15px;text-decoration:none;font-size:11px; }
  .match-source { display:flex;align-items:center;gap:7px;font-size:10px;color:#8d9b91;margin:23px 0 0; }
  .match-source svg { width:13px;height:13px;margin:0; }
}
@media screen and (max-width:580px) {
  dialog.match-dialog { width:94vw;border-radius:20px;max-height:92dvh;padding:0; }
  .match-hero { height:126px; }.match-hero-caption { right:16px;font-size:8px;letter-spacing:1px;bottom:13px; }
  .match-content { padding:20px; }dialog.match-dialog h2 { font-size:21px; }
  .match-scoreboard { gap:9px; }.match-score { min-width:72px; }.match-score>b { font-size:28px; }
  .match-team strong { font-size:11px; }.match-actions>a { flex:1; }.match-facts { margin-bottom:20px; }
}

.shared-shopping-card{padding:16px}.shared-shopping-frame{width:100%;height:calc(100vh - 285px);min-height:560px;border:0;border-radius:16px;background:#fff}@media(max-width:600px){.shared-shopping-card{padding:8px}.shared-shopping-frame{height:calc(100dvh - 230px);min-height:540px}}
