/*
 * VTA RC6.2 Minimal UI Refresh.
 * Presentation only: no application behaviour, rate logic, editor content or API changes.
 * Screen-only rules deliberately leave DOCX/PDF and browser print styling untouched.
 */
@media screen {
  /* Shared visual language: existing shell structure and navigation are preserved. */
  .app-shell {
    --vta-ui-ink: #16324f;
    --vta-ui-muted: #60758b;
    --vta-ui-line: #dfe7ef;
    --vta-ui-soft: #f5f8fc;
    --vta-ui-focus: #2467a7;
  }
  .app-shell .sidebar {
    background: #112f4c;
    padding: 16px 12px;
    scrollbar-color: #54728c transparent;
  }
  .app-shell .brand { padding: 3px 8px 17px; gap: 10px; border-color: #ffffff24; }
  .app-shell .brand img { border-radius: 11px; }
  .app-shell .brand strong { font-size: 15px; line-height: 1.35; }
  .app-shell .nav { gap: 3px; margin-top: 10px; }
  .app-shell .nav-group { padding: 13px 12px 5px; color: #aebed0; }
  .app-shell .sidebar .nav button {
    border-radius: 9px;
    min-height: 40px;
    padding: 9px 11px;
    font-size: 12px;
    font-weight: 630;
    line-height: 1.4;
    transition: background-color .15s ease, color .15s ease;
  }
  .app-shell .sidebar .nav button:hover { background: #ffffff19; }
  .app-shell .sidebar .nav button.active {
    background: #e7f1fc;
    color: #123c62;
    box-shadow: inset 3px 0 0 #4085c0;
  }
  .app-shell .sidebar .nav button:focus-visible,
  .app-shell .topbar button:focus-visible {
    outline: 2px solid #9fd5ff;
    outline-offset: 2px;
  }
  .app-shell .topbar {
    background: #fff;
    border-bottom-color: var(--vta-ui-line);
    box-shadow: 0 1px 4px #17345008;
  }
  .app-shell .topbar .search-wrap input {
    background: #f8fafd;
    border-color: var(--vta-ui-line);
    border-radius: 9px;
    height: 42px;
  }
  .app-shell .topbar .search-wrap input:focus-visible {
    outline: 2px solid #c2dffa;
    border-color: var(--vta-ui-focus);
  }
  .app-shell .workspace { background: #f5f7fa; }
  .app-shell .workspace .page-head h1 { color: var(--vta-ui-ink); letter-spacing: -.025em; }
  .app-shell .workspace .page-head p { color: var(--vta-ui-muted); }
  .app-shell .sidebar .side-foot { color: #c3d1df; }

  /* Tour Library: retain all existing V5 entrypoints and import controls. */
  .tour-library .tl-heading { border-bottom-color: var(--vta-ui-line); }
  .tour-library .tl-heading h1 { color: #163d61; font-size: 27px; letter-spacing: -.025em; }
  .tour-library .tl-card,
  .tour-library .tl-panel,
  .tour-library .tl-metric,
  .tour-library .tl-import-item {
    background: #fff;
    border: 1px solid var(--vta-ui-line);
    border-radius: 12px;
    box-shadow: 0 3px 14px #12345108;
  }
  .tour-library .tl-card { padding: 17px; gap: 9px; }
  .tour-library .tl-card:hover,
  .tour-library .tl-card:focus-within { border-color: #8caac5; box-shadow: 0 8px 20px #12345112; }
  .tour-library .tl-icon { background: #eaf1f8; color: #285a86; }
  .tour-library .tl-card strong { color: #16324f; }
  .tour-library .tl-metric strong { color: #1e507d; }
  .tour-library input:focus-visible,
  .tour-library textarea:focus-visible,
  .tour-library select:focus-visible,
  .tour-library button:focus-visible {
    outline: 2px solid #84b4dd;
    outline-offset: 2px;
  }

  /* Existing Proposal Studio V5: enhance chrome and readable paper, not the editor engine. */
  .vtps {
    --vt-navy: #153451;
    --vt-blue: #2467a7;
    --vt-border: #dfe7ef;
    --vt-muted: #60758b;
  }
  .vtps .vtps-top {
    padding: 14px 20px;
    margin-bottom: 16px;
    border-radius: 12px;
    border-color: var(--vt-border);
    box-shadow: 0 2px 12px #17345009;
  }
  .vtps .vtps-top h1 { font-size: 22px; letter-spacing: -.025em; }
  .vtps .vtps-top-actions { gap: 7px; }
  .vtps .vtps-top-actions button {
    min-height: 38px;
    border-radius: 8px;
    padding: 8px 12px;
  }
  .vtps .vtps-top-actions button:hover:not(:disabled) { border-color: #86a6c3; background: #f5f9fd; }
  .vtps .vtps-top-actions .vtps-save:hover:not(:disabled) { background: #214b70; color: #fff; }
  .vtps .vtps-main { max-width: 1480px; grid-template-columns: 185px minmax(0,1fr); gap: 18px; }
  .vtps .vtps-sidebar { padding: 10px 6px; }
  .vtps .vtps-sidebar button { border-radius: 8px; min-height: 36px; font-size: 12px; }
  .vtps .vtps-paper {
    max-width: 1080px;
    padding: 36px 44px 44px;
    border-color: var(--vt-border);
    border-radius: 12px;
    box-shadow: 0 8px 30px #1534510d;
  }
  .vtps .vtps-paper-title { font-size: 28px !important; }
  .vtps .vtps-meta { background: #f7f9fc; border-color: var(--vt-border); }
  .vtps .vtps-paper h3 { color: #153451; }
  .vtps .vtps-day { border-top-color: #e1e8ef; }
  .vtps .vtps-text-area { border: 1px solid transparent; border-radius: 7px; }
  .vtps .vtps-text-area:hover { border-color: #d9e3ed; }
  .vtps .vtps-text-area:focus { border-color: #82b1d9; outline: 2px solid #d9eaf8; }
  .vtps input, .vtps textarea, .vtps select { border-radius: 7px; border-color: #d4e0e9; }
  .vtps tbody tr:hover { background: #f9fbfe; }
  .vtps .vtps-subaction { background: #f4f8fc; border-color: #d2e2ef; }

  /* Blank Word editor: same ProseMirror/Tiptap surface and same toolbar actions. */
  body.vta-doc-focus .workspace,
  .wd-editor { background: #eef2f6; }
  .wd-chrome { box-shadow: 0 2px 13px #12345110; }
  .wd-header { min-height: 50px; height: auto; padding: 7px 18px; }
  .wd-header input { border-radius: 7px; }
  .wd-toolbar { min-height: 44px; gap: 5px; }
  .wd-editor button, .wd-editor select { border-radius: 7px; border-color: #d9e3ec; }
  .wd-editor button:hover:not(:disabled) { background: #eef5fb; border-color: #aec9e1; }
  .wd-editor .wd-primary { background: #173d5f; border-color: #173d5f; color: #fff; }
  .wd-editor .wd-primary:hover:not(:disabled) { background: #285878; color: #fff; }
  .wd-menu summary { border-radius: 7px; }
  .wd-canvas { padding-top: 28px; }
  .wd-page { border: 1px solid #e0e6ec; box-shadow: 0 10px 32px #16345016; }
  .wd-page .tiptap:focus-visible { outline: 0; }
  .wd-footer { border-color: #dce5ec; }

  /* Smart Cost Direct Edit: pricing logic, source evidence, and cell DOM stay unchanged. */
  .vta-direct-cost { max-width: 1600px; }
  .vta-direct-cost .page-head { margin-bottom: 14px; }
  .vta-direct-cost .page-head h1 { font-size: 25px; }
  .vta-direct-cost .quote-steps {
    background: #eaf0f6;
    border: 1px solid #dce6ef;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 12px;
  }
  .vta-direct-cost .quote-steps button { border-radius: 7px; padding: 9px 11px; }
  .vta-direct-cost .quote-steps button.active { color: #163d60; }
  .vta-direct-cost .vta-toolbar,
  .vta-direct-cost .vta-guest-controls {
    border-color: var(--vta-ui-line);
    background: #fff;
    border-radius: 10px;
    margin: 10px 0;
    padding: 9px 13px;
  }
  .vta-direct-cost .vta-toolbar { gap: 10px 16px; }
  .vta-direct-cost .vta-save-state { color: #25714b; }
  .vta-direct-cost .vta-cost-section {
    border-color: #dce5ed;
    border-radius: 11px;
    box-shadow: 0 2px 10px #15345107;
    margin: 12px 0;
  }
  .vta-direct-cost .vta-cost-section > header { background: #f5f8fb; padding: 11px 15px; }
  .vta-direct-cost .vta-cost-section h2 { color: #173d5f; font-size: 15px; }
  .vta-direct-cost .vta-table-header {
    background: #f9fbfd;
    color: #516b82;
    border-bottom-color: #dae5ee;
    padding: 10px 15px;
  }
  .vta-direct-cost .vta-cost-line {
    border-bottom-color: #e9eef4;
    padding-top: 8px;
    padding-bottom: 8px;
    transition: background-color .12s ease;
  }
  .vta-direct-cost .vta-cost-line:hover { background: #f8fbfe; }
  .vta-direct-cost .vta-cost-line:focus-within { background: #f3f8fe; }
  .vta-direct-cost .vta-cost-line input,
  .vta-direct-cost .vta-cost-line select { border-radius: 6px; }
  .vta-direct-cost .vta-cost-line input:focus,
  .vta-direct-cost .vta-cost-line select:focus {
    border-color: #2c75b3;
    outline: 2px solid #d7eaf9;
    background: #fff;
  }
  .vta-direct-cost .vta-name { font-size: 13px !important; }
  .vta-direct-cost .vta-star-caption { color: #466786; }
  .vta-direct-cost .vta-cost-summary {
    background: #fff;
    border-color: #dce5ee;
    border-radius: 10px;
    padding: 14px;
  }
  .vta-direct-cost .vta-cost-summary strong { font-size: 14px; color: #1e5078; }
  .vta-direct-cost .vta-cost-summary b { font-size: 16px; color: #163d60; }
  .vta-direct-cost .vta-add-bar { margin: 12px 0; }
  .vta-direct-cost .vta-add-bar .btn { border-radius: 8px; }
  .vta-direct-cost .vta-remove:focus-visible,
  .vta-direct-cost .vta-add-bar button:focus-visible { outline: 2px solid #2b76b8; outline-offset: 2px; }
}
@media screen and (min-width: 1101px) {
  .app-shell { grid-template-columns: 208px minmax(0,1fr); grid-template-rows: 60px minmax(0,1fr); }
  .app-shell .workspace { padding: 24px; }
}
@media screen and (min-width: 821px) and (max-width: 1100px) {
  .app-shell { grid-template-columns: 190px minmax(0,1fr); grid-template-rows: 60px minmax(0,1fr); }
  .app-shell .workspace { padding: 18px; }
  .vtps .vtps-main { grid-template-columns: 150px minmax(0,1fr); }
  .vtps .vtps-paper { padding: 28px 25px; }
}
@media screen and (max-width: 820px) {
  /* Preserve existing Quick Quote/mobile navigation and Direct Cost mobile cards. */
  .app-shell .sidebar { display: none; }
  .app-shell .topbar { min-height: 64px; }
  .vtps .vtps-main { display: block; }
  .vtps .vtps-sidebar { position: static; }
  .vtps .vtps-paper { padding: 24px 15px; }
  .vtps .vtps-top { padding: 14px; }
  .wd-canvas { padding: 12px 6px 60px; }
  .vta-direct-cost .vta-cost-line { padding-top: 12px; padding-bottom: 12px; }
  .vta-direct-cost .vta-cost-summary { padding: 12px; }
}
@media screen and (prefers-reduced-motion: reduce) {
  .app-shell .sidebar .nav button,
  .vta-direct-cost .vta-cost-line { transition: none; }
}


/* V5 template gallery: switchable, screen-only presentation styles; no export or pricing effects. */
@media screen {
  .vtps .vtps-template-gallery {
    border: 1px solid #dbe6ee;
    border-radius: 14px;
    padding: 19px;
    margin: 0 0 18px;
    background: #fff;
    box-shadow: 0 4px 16px #12345109;
  }
  .vtps .vtps-template-gallery[hidden] { display: none !important; }
  .vtps .vtps-template-intro {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 15px;
  }
  .vtps .vtps-template-intro h2 { margin: 0 0 5px; color: #183b5c; font-size: 17px; }
  .vtps .vtps-template-intro p { margin: 0; font-size: 12px; line-height: 1.6; color: #65788c; max-width: 760px; }
  .vtps .vtps-template-intro > span {
    flex: none; font-size: 10px; letter-spacing: .06em; font-weight: 700;
    padding: 6px 9px; border-radius: 999px; background: #edf4fa; color: #225781;
  }
  .vtps .vtps-template-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
  .vtps .vtps-template-card {
    display: flex; flex-direction: column; gap: 6px; text-align: left;
    min-width: 0; min-height: 208px; padding: 11px;
    background: #fff; border: 1px solid #dbe6ee; border-radius: 11px;
    transition: border-color .12s ease, box-shadow .12s ease;
  }
  .vtps .vtps-template-card:hover, .vtps .vtps-template-card:focus-visible {
    background: #fff; border-color: #85a9ca; box-shadow: 0 3px 12px #12345112;
  }
  .vtps .vtps-template-card.selected { border: 2px solid #2467a7; padding: 10px; background: #f8fbff; }
  .vtps .vtps-template-card:focus-visible { outline: 3px solid #c2ddf5; outline-offset: 2px; }
  .vtps .vtps-template-card strong { color: #183a58; font-size: 12px; line-height: 1.4; }
  .vtps .vtps-template-card small { color: #63798c; font-size: 11px; line-height: 1.45; }
  .vtps .vtps-template-card em { margin-top: auto; color: #2467a7; font-size: 11px; font-style: normal; font-weight: 700; }
  .vtps .vtps-template-thumbnail {
    display: grid; grid-template-rows: 19px 7px 27px 7px;
    gap: 5px; width: 100%; height: 91px; border: 1px solid #e2e9ef; border-radius: 7px;
    padding: 9px 14px; background: #fff; overflow: hidden;
  }
  .vtps .vtps-template-thumbnail i { display: block; border-radius: 2px; background: #e4ebf1; }
  .vtps .vtps-template-thumbnail i:first-child { background: #173b5e; width: 60%; }
  .vtps .vtps-template-thumbnail i:nth-child(2) { width: 90%; }
  .vtps .vtps-template-thumbnail i:nth-child(3) { background: #eff4f8; }
  .vtps .vtps-template-thumbnail i:last-child { width: 72%; }
  .vtps .vtps-template-thumbnail--brochure i:first-child { background: #bd943c; width: 78%; }
  .vtps .vtps-template-thumbnail--brochure i:nth-child(3) { background: linear-gradient(110deg,#a8bfcc,#e0ebed 70%); }
  .vtps .vtps-template-thumbnail--quick { grid-template-rows: 10px 6px 6px 6px; }
  .vtps .vtps-template-thumbnail--quick i:first-child { width: 78%; }
  .vtps .vtps-template-thumbnail--b2b i:nth-child(3) {
    background: repeating-linear-gradient(to bottom,#c8d7e6 0 6px,#fff 6px 9px);
    border: 1px solid #b7cbd9;
  }
  .vtps .vtps-template-unavailable {
    margin-top: 13px; border-top: 1px solid #e5ebf1; padding-top: 12px;
    color: #7b8895; font-size: 12px;
  }
  /* Deliberately preserve all V5 document sections and input values for every layout. */
  .vtps[data-vtps-layout="brochure"] .vtps-paper { border-top: 5px solid #c6a054; }
  .vtps[data-vtps-layout="brochure"] .vtps-brand { border-color: #c6a054; }
  .vtps[data-vtps-layout="brochure"] .vtps-paper-title { letter-spacing: -.04em; font-size: 32px !important; }
  .vtps[data-vtps-layout="brochure"] .vtps-paper h3 { border-bottom: 2px solid #eadbbc; }
  .vtps[data-vtps-layout="brochure"] .vtps-day-head > b { background: #fff3d9; color: #785a25; }
  .vtps[data-vtps-layout="quick"] .vtps-paper { max-width: 980px; }
  .vtps[data-vtps-layout="quick"] .vtps-paper h3 { margin-top: 18px; margin-bottom: 8px; font-size: 15px; }
  .vtps[data-vtps-layout="quick"] .vtps-day { padding: 11px 0 5px; margin: 8px 0; }
  .vtps[data-vtps-layout="quick"] .vtps-paper .vtps-meta { margin-bottom: 13px; padding: 12px; }
  .vtps[data-vtps-layout="quick"] .vtps-day-meta { margin-bottom: 8px; }
  .vtps[data-vtps-layout="b2b"] .vtps-paper { border-top: 4px solid #25699c; }
  .vtps[data-vtps-layout="b2b"] #vtps-prices { border: 1px solid #cddfeb; background: #f8fbfd; padding: 14px; border-radius: 8px; }
  .vtps[data-vtps-layout="b2b"] #vtps-prices th { background: #1b4d72; }
  .vtps[data-vtps-layout="b2b"] #vtps-policies { border-top: 2px solid #b9d0e0; margin-top: 26px; }
}
@media screen and (min-width: 821px) and (max-width: 1200px) {
  .vtps .vtps-template-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media screen and (max-width: 820px) {
  .vtps .vtps-template-gallery { padding: 13px; }
  .vtps .vtps-template-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .vtps .vtps-template-card { padding: 9px; }
  .vtps .vtps-template-card.selected { padding: 8px; }
  .vtps .vtps-template-intro { flex-wrap: wrap; }
}
@media screen and (max-width: 430px) {
  .vtps .vtps-template-grid { grid-template-columns: 1fr; }
  .vtps .vtps-template-card { min-height: 0; }
}
@media screen and (prefers-reduced-motion: reduce) {
  .vtps .vtps-template-card { transition: none; }
}
