/* Task-based menus share the same actions on every screen size. */
.task-back { color: #954139; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.task-trail, .related-tools { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; color: #49576b; font-size: 14px; }
.related-tools { margin-top: 14px; column-gap: 16px; }
.related-tools a { color: #954139; text-decoration: underline; text-underline-offset: 3px; }
.task-hero .upload-card { min-height: 190px; }
.task-guide { margin: 24px 0 10px; padding: 22px 24px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.task-guide h2 { margin: 0 0 10px; font-size: 19px; }
.task-guide ol { padding-left: 1.4em; margin: 0; font-size: 14px; line-height: 1.65; color: #49576b; }
.task-guide li + li { margin-top: 5px; }
a.tool-card { display: block; color: inherit; text-decoration: none; }
.workspace-menu-button,.catalog-category-control { display: none; }
.sidebar .nav-item { flex-shrink: 0; line-height: 1.45; }
.sidebar .nav-item>.icon { flex-shrink: 0; }
.sidebar .nav-label { flex-shrink: 0; margin-bottom: 9px; }
.sidebar .side-divider { margin-top: 12px; margin-bottom: 16px; }
@media (min-width:901px) and (max-height:850px) {
  .sidebar .side-note { display: none; }
  .sidebar .sidebar-footer { margin-top: auto; padding-top: 18px; }
  .sidebar .brand { margin-bottom: 24px; }
  .sidebar .nav-item { min-height: 40px; margin-bottom: 3px; padding-top: 9px; padding-bottom: 9px; }
}
.tools-section { scroll-margin-top: 84px; }
#open-scan-button { display: block; margin: 6px auto 0; color: #a83329; font-weight: 650; }
#scan-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 5px 12px; background: #fff; border-bottom: 1px solid var(--line); }
#scan-bar [data-scan-status] { flex: 1; min-width: 100px; color: #4b596a; font-size: 12px; }
#scan-bar button, .text-format-bar .scan-entry { width: auto; padding: 6px 12px; border: 1px solid #c9d5df; border-radius: 6px; color: #314e61; background: #fff; font-size: 12px; }
#scan-bar [aria-pressed=true] { color: #953b28; border-color: #ba5543; background: #fff4ee; }
#scan-targets { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.scan-region, .scan-selection { position: absolute; margin: 0; padding: 0; min-width: 0; min-height: 0; border: 1px dashed #30719c; background: #4492c610; border-radius: 2px; }
.scan-region { pointer-events: auto; }
.scan-region.cell { border-style: solid; border-color: #198365; background: #28966d0b; }
.scan-region:is(:hover,:focus-visible) { outline: 2px solid #2a6284; background: #9ed4f130; }
.scan-mode .canvas-helper { display: none; }
.scan-mode #overlay-canvas, .hand-mode #scan-targets *, #scan-targets.marking .scan-region { pointer-events: none; }
#scan-targets.marking { pointer-events: auto; touch-action: none; cursor: crosshair; }
.scan-selection { pointer-events: none; border: 2px solid #aa4c32; background: #f0be9d40; }
#scan-error { color: #a33124; }
#scan-value { resize: vertical; min-height: 82px; }
@media (max-width:900px) {
  #scan-bar { padding: 3px 6px; gap: 4px; }
  #scan-bar button { min-height: 44px; padding: 4px 8px; }
}
.tool-card .tool-price {
  display: inline-block; margin-inline-start: .3em; color: #346753;
  font-size: 10px; font-weight: 600; letter-spacing: 0; vertical-align: middle;
}
.grouped-catalog { display: flex; flex-direction: column; gap: 20px; }
.catalog-group { border: 1px solid #dfe5ec; border-radius: 14px; background: #fff; overflow: clip; }
.catalog-group>summary { list-style: none; display: flex; align-items: center; gap: 14px; padding: 20px; cursor: pointer; min-height: 80px; }
.catalog-group>summary::-webkit-details-marker { display: none; }
.catalog-group>summary:hover { background: #f8fafc; }
.catalog-group>summary:focus-visible { outline: 3px solid #457cf1; outline-offset: -3px; border-radius: 12px; }
.category-symbol { display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; flex-shrink: 0; background: #fff0ed; color: #c33b32; border-radius: 10px; }
.category-symbol .icon { width: 22px; height: 22px; }
.category-copy { flex: 1; min-width: 0; }
.category-copy b { display: block; font-size: 16px; color: #2b384d; }
.category-copy small { display: block; margin-top: 5px; font-size: 12px; color: #738096; line-height: 1.5; }
.category-count { font-size: 11px; color: #69768b; white-space: nowrap; }
.catalog-group>summary>.icon { width: 17px; height: 17px; flex-shrink: 0; color: #7d8aa0; }
.catalog-group[open]>summary>.icon { transform: rotate(90deg); }
.catalog-group-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; padding: 0 18px 18px; }
.catalog-group .tool-card { min-height: 151px; background: #fafbfc; }
.filter-tabs { flex-wrap: wrap; }
.filter-tabs button { min-height: 40px; }
.mobile-picker-filters { display: grid; gap: 10px; margin: 0 0 18px; }
.mobile-picker-filters input,.mobile-picker-filters select { width: 100%; min-width: 0; min-height: 46px; border: 1px solid #dce2eb; border-radius: 9px; padding: 10px 12px; background: #fff; color: #34425a; }
.mobile-picker-filters input { background: #f7f9fb; }
.mobile-picker-content section:first-child h3 { margin-top: 5px; }
.mobile-picker-empty { padding: 18px 4px; font-size: 14px; color: #66758c; line-height: 1.6; }
#workspace-menu { width: min(420px,calc(100vw - 24px)); padding: 0 20px 20px; }
.workspace-menu-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; position: sticky; top: 0; background: #fff; padding: 16px 0 12px; z-index: 1; }
.workspace-menu-heading h2 { margin: 0; font-size: 21px; letter-spacing: -.5px; }
.workspace-menu-heading .icon-button { width: 44px; height: 44px; flex-shrink: 0; }
.workspace-menu-section { border-top: 1px solid #e4e8ee; padding: 14px 0 8px; }
.workspace-menu-section>span { display: block; font-size: 10px; letter-spacing: 1.4px; color: #8591a3; margin: 0 10px 7px; }
.workspace-menu-section button,.workspace-menu-section a { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 10px; font-size: 14px; color: #3d4c63; text-align: left; border-radius: 8px; }
.workspace-menu-section button:hover,.workspace-menu-section a:hover { background: #f3f5f8; }
.workspace-menu-section button[aria-current=true] { background: #fff0ed; color: #b8332c; font-weight: 650; }
.workspace-menu-section .icon { width: 20px; height: 20px; flex-shrink: 0; }
.workspace-menu-section button span { flex: 1; }
.workspace-menu-section button>.icon:last-child:not(:first-child) { width: 14px; }
@media (min-width:1450px) { .catalog-group-grid { grid-template-columns: repeat(4,minmax(0,1fr)); } }
@media (min-width:901px) and (max-width:1100px) {
  .catalog-group-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .editor-toolbar,.editor-toolbar[data-mode=edit] { height: auto; max-height: 142px; flex-wrap: wrap; overflow-x: hidden; overflow-y: auto; }
}
@media (max-width:900px) {
  .topbar { gap: 8px; }
  .topbar .top-badges { display: none; }
  .workspace-menu-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 10px 13px; border: 1px solid #dfe4eb; border-radius: 9px; color: #34425a; font-size: 13px; background: #fff; margin-left: auto; }
  .workspace-menu-button .icon { width: 19px; height: 19px; }
  .hero-copy>p { margin-bottom: 10px; }
  .home-content { padding-top: 18px; }
  .trust-strip { margin-bottom: 18px; }
  #filter-tabs { display: none; }
  .catalog-category-control { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0; }
  .catalog-category-control>span { font-size: 12px; color: #6e7b8f; flex-shrink: 0; }
  .catalog-category-control select { min-width: 0; max-width: 65%; flex: 1; height: 46px; padding: 8px 10px; border: 1px solid #dce2eb; border-radius: 9px; background: #fff; color: #34425a; }
  .grouped-catalog { gap: 10px; }
  .catalog-group>summary { min-height: 82px; padding: 15px 12px; gap: 11px; }
  .category-symbol { width: 38px; height: 38px; }
  .category-copy b { font-size: 15px; }
  .category-copy small { font-size: 11px; margin-top: 4px; }
  .category-count { font-size: 10px; }
  .catalog-group>summary>.icon { width: 14px; }
  .catalog-group-grid { grid-template-columns: 1fr; gap: 8px; padding: 0 10px 10px; }
  .catalog-group .tool-card { min-height: 86px; padding: 15px 30px 15px 65px; }
  .catalog-group .tool-card .tool-icon { left: 12px; top: 18px; width: 38px; height: 38px; }
  .catalog-group .tool-card h3 { font-size: 14px; margin-top: 0; }
  .catalog-group .tool-card p { font-size: 12px; }
}
@media (max-width:900px), (pointer:coarse) and (orientation:landscape) and (max-height:520px) and (max-width:1100px) {
  .editor-tabs { display: none; }
  .editor-toolbar,.editor-toolbar[data-mode=edit] { height: 50px; flex-wrap: nowrap; overflow: hidden; justify-content: flex-start; }
  .editor-toolbar .tool-button,.editor-toolbar[data-mode=edit] .tool-button { display: none; }
  .editor-toolbar .tool-button.mobile-shortcut,.editor-toolbar[data-mode=edit] .tool-button.mobile-shortcut { display: flex; flex: 1 1 0; min-width: 0; max-width: 150px; white-space: normal; line-height: 1.25; font-size: 11px; text-align: center; }
  .mobile-all-tools { flex-basis: 76px; }
  .mobile-picker-heading { padding-top: 10px; }
  .mobile-picker-content h3 { font-size: 13px; }
  .mobile-tool-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .mobile-tool-grid button { min-height: 80px; font-size: 12px; padding: 8px 5px; }
  .mobile-tool-grid button span { overflow-wrap: anywhere; }
  #mobile-tool-picker { max-height: calc(100dvh - 24px); }
}
@media (min-width:600px) and (max-width:900px) {
  .catalog-group-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .mobile-tool-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media (max-width:359px) {
  .category-symbol { display: none; }
  .category-copy small { font-size: 11px; }
  .mobile-tool-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
