/* Shared screen chrome. Component rules opt in through .tm-workspace; printed
   labels and the custom catalogue / dealer price tables keep their own styles. */
@media screen {
  .tm-panel {
    --tm-navy: #14263f;
    --tm-blue: #245dcc;
    --tm-ink: #1b2d45;
    --tm-muted: #53657b;
    --tm-line: #dce4ee;
    --tm-surface: #f4f7fb;
    --tm-white: #fff;
    --tm-radius: 8px;
    background: var(--tm-white);
    color: var(--tm-ink);
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
  }

  .tm-panel .tm-shell { min-height: 100vh; min-height: 100dvh; }
  .tm-panel .tm-content { min-width: 0; background: var(--tm-white); }
  .tm-panel .tm-main {
    min-width: 0;
    max-width: 100%;
    padding: 24px 28px 40px;
    scrollbar-gutter: stable;
  }
  .tm-panel .tm-main--embed { padding: 16px; }
  .tm-panel .tm-main:focus { outline: none; }
  .tm-panel .tm-main:focus-visible { outline: 2px solid var(--tm-blue); outline-offset: -3px; }
  .tm-panel :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--tm-blue);
    outline-offset: 3px;
  }
  .tm-panel .tm-skip-link {
    position: fixed;
    top: 8px;
    left: 12px;
    z-index: 1000;
    padding: 10px 16px;
    border-radius: 6px;
    background: var(--tm-white);
    color: var(--tm-navy);
    font-weight: 600;
    transform: translateY(-160%);
  }
  .tm-panel .tm-skip-link:focus { transform: translateY(0); }

  .tm-panel .tm-sidebar-side { z-index: 40; scrollbar-width: thin; }
  .tm-panel .tm-sidebar {
    width: 244px;
    background: var(--tm-navy);
    color: #d0daea;
  }
  .tm-panel .tm-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 82px;
    padding: 18px;
    border-bottom: 1px solid #2c3d55;
  }
  .tm-panel .tm-brand-mark {
    display: grid;
    place-items: center;
    flex: none;
    width: 34px;
    height: 38px;
    border: 1px solid #477cc9;
    border-radius: 7px;
    background: #213d64;
    color: #e6f0ff;
  }
  .tm-panel .tm-brand-name { font-size: 17px; font-weight: 700; letter-spacing: -.025em; color: #fff; }
  .tm-panel .tm-brand-caption { font-size: 12px; color: #a9bdd7; }
  .tm-panel .tm-navigation { padding: 12px 10px; }
  .tm-panel .tm-navigation .menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 35px;
    margin: 2px 0;
    padding: 7px 10px;
    border-left: 3px solid transparent;
    border-radius: 5px;
    color: #d0daea;
    font-size: 13px;
    line-height: 1.4;
    text-decoration: none;
    transition: background-color 120ms ease;
  }
  .tm-panel .tm-navigation .menu-link:hover { background: #223b5b; color: #fff; }
  .tm-panel .tm-navigation .menu-link[aria-current="page"] {
    background: #234573;
    border-left-color: #79afff;
    color: #fff;
    font-weight: 650;
  }
  .tm-panel .tm-nav-icon { flex: none; opacity: .9; }
  .tm-panel .tm-sidebar :where(a, button):focus-visible { outline-color: #a9d0ff; }
  .tm-panel .tm-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 36px;
    height: 36px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    font-size: 21px;
    cursor: pointer;
  }
  .tm-panel .tm-icon-button:hover { background: #28415f; }
  .tm-panel .tm-icon-button:disabled { opacity: .55; cursor: wait; }
  .tm-panel .tm-market { border-top: 1px solid #2c3d55; }
  .tm-panel .tm-sidebar-heading { color: #bccce1; font-size: 12px; font-weight: 600; }
  .tm-panel .tm-market-price { font-size: 12px; }
  .tm-panel .tm-market-change { font-size: 11px; }
  .tm-panel .tm-market-status { margin: 10px 6px 0; color: #a9bdd7; font-size: 11px; line-height: 1.5; }
  .tm-panel .tm-account { padding: 16px 20px 20px; border-top: 1px solid #2c3d55; }
  .tm-panel .tm-account-name { overflow-wrap: anywhere; color: #f1f5fa; font-size: 13px; font-weight: 600; }
  .tm-panel .tm-account-role { margin: 2px 0 8px; color: #a9bdd7; font-size: 12px; }
  .tm-panel .tm-account-period { display: flex; justify-content: space-between; margin-bottom: 12px; color: #bccce1; font-size: 12px; }
  .tm-panel .tm-account-period span { color: #fff; font-weight: 600; }
  .tm-panel .tm-signout {
    width: 100%;
    min-height: 34px;
    border: 1px solid #5b718b;
    border-radius: 6px;
    background: transparent;
    color: #e2eaf5;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
  }
  .tm-panel .tm-signout:hover { background: #28415f; color: #fff; }
  .tm-panel .tm-mobile-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 8px 12px;
    background: var(--tm-navy);
    color: #fff;
  }
  .tm-panel .tm-mobile-brand { flex: 1; font-size: 15px; font-weight: 650; }
  .tm-panel .tm-mobile-period { color: #bccce1; font-size: 12px; }
  .tm-panel .tm-mobile-bar :focus-visible { outline-color: #a9d0ff; }

  /* The parent marks page headers explicitly: coloured financial/status cards
     elsewhere are never selected by their gradient or colour utilities. */
  .tm-panel .tm-workspace .tm-page-header {
    min-width: 0;
    margin-bottom: 20px;
    padding: 6px 0 20px;
    border: 0;
    border-bottom: 1px solid var(--tm-line);
    border-radius: 0;
    background: var(--tm-white);
    background-image: none;
    box-shadow: none;
    color: var(--tm-ink);
    animation: none;
  }
  .tm-panel .tm-page-header > .absolute { display: none; }
  .tm-panel .tm-page-header :where(h1, h2) { color: var(--tm-ink); font-size: 24px; line-height: 1.25; letter-spacing: -.025em; }
  .tm-panel .tm-page-header :where(p, .opacity-75, .opacity-80, .opacity-90) { color: var(--tm-muted); opacity: 1; }
  .tm-panel .tm-page-header :where(.text-4xl, .text-5xl, .text-6xl) { font-size: 24px; line-height: 1.25; }
  .tm-panel .tm-page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
  .tm-panel .tm-page-header :where(.btn[class*="bg-white/"], .btn.bg-white) {
    background: #eef4ff;
    border: 1px solid #b9cdec;
    color: #204f9f;
    box-shadow: none;
    backdrop-filter: none;
  }
  .tm-panel .tm-page-header :where(.btn[class*="bg-white/"], .btn.bg-white):hover { background: #e1ecff; border-color: #89aae0; }
  .tm-panel .tm-page-header .btn.bg-amber-500 {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    color: #713f12;
  }
  .tm-panel .tm-page-header .btn.bg-amber-500:hover { background: #fde68a; border-color: #fbbf24; }
  .tm-panel .tm-page-header .tm-page-actions > a[class*="bg-gradient-"] {
    background: var(--tm-blue);
    background-image: none;
    border: 1px solid var(--tm-blue);
    border-radius: 6px;
    box-shadow: none;
    color: #fff;
  }
  .tm-panel .tm-workspace .tm-filter-bar {
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid var(--tm-line);
    border-radius: var(--tm-radius);
    background: var(--tm-surface);
    box-shadow: none;
  }

  /* Low specificity allows each page's semantic colours, size utilities and
     dedicated components (e.g. .pz-tablo) to retain their own presentation. */
  :where(.tm-panel .tm-workspace) .btn { border-radius: 6px; font-weight: 600; text-transform: none; box-shadow: none; }
  :where(.tm-panel .tm-workspace) .btn-sm { min-height: 34px; height: auto; padding: 6px 11px; font-size: 12px; line-height: 1.4; }
  :where(.tm-panel .tm-workspace) .btn-xs { min-height: 28px; height: auto; padding: 4px 8px; font-size: 12px; line-height: 1.3; }
  :where(.tm-panel .tm-workspace) .btn-primary:not(.btn-outline) { background-color: var(--tm-blue); border-color: var(--tm-blue); color: #fff; }
  :where(.tm-panel .tm-workspace) .btn-primary:not(.btn-outline):hover { background-color: #1c4fae; border-color: #1c4fae; }
  :where(.tm-panel .tm-workspace) .btn-outline.btn-primary { color: #245dcc; border-color: #245dcc; }
  :where(.tm-panel .tm-workspace) .btn-outline.btn-primary:hover { background-color: #245dcc; color: #fff; }
  :where(.tm-panel .tm-workspace) :is(.input, .select, .textarea) { border-radius: 6px; font-size: 14px; }
  :where(.tm-panel .tm-workspace) :is(.input-sm, .select-sm) { height: 34px; min-height: 34px; font-size: 13px; }
  :where(.tm-panel .tm-workspace) :is(.input-bordered, .select-bordered, .textarea-bordered) { border-color: #bdcadb; }
  :where(.tm-panel .tm-workspace) :is(.input, .select, .textarea):focus-visible { border-color: #245dcc; outline: 2px solid #245dcc; outline-offset: 2px; }
  :where(.tm-panel .tm-workspace) .label-text { font-size: 13px; }
  :where(.tm-panel .tm-workspace) .table { font-size: 13px; font-variant-numeric: tabular-nums; }
  :where(.tm-panel .tm-workspace) .table :where(th, td) { padding: 10px 12px; }
  :where(.tm-panel .tm-workspace) .table-sm :where(th, td) { padding: 8px 12px; }
  :where(.tm-panel .tm-workspace) .table-xs :where(th, td) { padding: 6px 10px; }
  :where(.tm-panel .tm-workspace) .table :where(thead) { background: var(--tm-surface); color: var(--tm-muted); font-size: 12px; }
  :where(.tm-panel .tm-workspace) .table :where(thead th) { font-weight: 600; white-space: nowrap; }
  :where(.tm-panel .tm-workspace) .table :where(tbody tr) { border-bottom-color: #e7edf4; }
  :where(.tm-panel .tm-workspace) .modal-box { border: 1px solid var(--tm-line); border-radius: 12px; box-shadow: 0 20px 60px #14263f26; }
  :where(.tm-panel .tm-workspace) .modal-action { gap: 8px; flex-wrap: wrap; }
  :where(.tm-panel .tm-workspace) .alert { border-radius: 8px; font-size: 13px; line-height: 1.5; }
  .tm-panel .tm-main :where(.overflow-x-auto) { min-width: 0; max-width: 100%; overscroll-behavior-x: contain; }
  .tm-panel form[data-tm-pending] :where(button, input)[aria-disabled="true"] { cursor: wait; opacity: .65; }

  .tm-panel .tm-request-notice {
    position: fixed;
    top: 16px;
    right: 20px;
    z-index: 60;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: min(440px, calc(100vw - 32px));
    padding: 14px 16px;
    border: 1px solid #e4b992;
    border-radius: 8px;
    background: #fffaf3;
    color: #6c3a14;
    box-shadow: 0 4px 18px #14263f1a;
    font-size: 13px;
  }
  .tm-panel .tm-request-notice[hidden] { display: none; }
  .tm-panel .tm-request-notice p { margin: 0; }
  .tm-panel #tm-notice-close { flex: none; min-width: 28px; min-height: 28px; border-radius: 4px; color: inherit; font-size: 22px; line-height: 1; }
  .tm-panel #tm-notice-close:hover { background: #f6e9d9; }
}

@media screen and (max-width: 1023px) {
  .tm-panel .tm-mobile-bar { display: flex; }
  .tm-panel .tm-main { padding: 20px 16px 32px; }
  .tm-panel .tm-sidebar { width: min(280px, calc(100vw - 48px)); }
  .tm-panel .tm-nav-close { margin-left: auto; }
  .tm-panel .tm-navigation .menu-link { min-height: 40px; }
  .tm-panel.tm-nav-open { overflow: hidden; }
  .tm-panel .tm-request-notice { top: 68px; right: 16px; }
}
@media screen and (min-width: 1024px) {
  .tm-panel .tm-mobile-bar, .tm-panel .tm-nav-close { display: none; }
}
@media screen and (max-width: 639px) {
  .tm-panel .tm-main { padding: 16px 12px 28px; }
  .tm-panel .tm-page-header :where(h1, h2) { font-size: 22px; }
  .tm-panel .tm-workspace .tm-page-header { padding-bottom: 16px; margin-bottom: 16px; }
  .tm-panel .tm-workspace .tm-filter-bar { padding: 12px; }
  .tm-panel .tm-filter-bar :where(.input, .select, .flex-1) { min-width: 0; max-width: 100%; }
  .tm-panel .tm-main--embed { padding: 12px; }
}
@media screen and (prefers-reduced-motion: reduce) {
  .tm-panel .tm-navigation .menu-link, .tm-panel .tm-sidebar, .tm-panel .drawer-overlay { transition: none; }
}
@media print {
  .tm-panel .tm-skip-link, .tm-panel .tm-request-notice,
  .tm-panel .tm-mobile-bar, .tm-panel .tm-sidebar-side { display: none !important; }
}
