/* Phase 26 — focused product polish from the visual audit.
   Loaded only by the workspace shell; no application workflow is replaced here. */

/* Mobile search should read as one real, centered icon button, not a clipped input border. */
@media (max-width: 680px) {
  .global-search-shell {
    width: 33px;
    min-width: 33px;
    height: 36px;
    flex: 0 0 33px;
    transition: width .18s ease, flex-basis .18s ease;
  }
  .global-search-shell .searchbox {
    position: relative;
    display: block;
    width: 100%;
    height: 36px;
    overflow: hidden;
    border: 1px solid var(--line, #e0e5ef);
    border-radius: 8px;
    background: var(--surface-2, #f7f8fc);
    box-sizing: border-box;
  }
  .global-search-shell .searchbox .icon {
    left: 8px;
    z-index: 2;
    width: 15px;
    height: 15px;
    color: var(--muted, #596579);
  }
  .global-search-shell:not(:focus-within) .searchbox input {
    position: absolute;
    inset: 0;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: inherit;
    background: transparent;
    color: transparent;
    caret-color: transparent;
    box-shadow: none;
    cursor: pointer;
  }
  .global-search-shell:not(:focus-within) .searchbox input::placeholder,
  .global-search-shell:not(:focus-within) .searchbox input::-webkit-input-placeholder {
    color: transparent !important;
    -webkit-text-fill-color: transparent;
    opacity: 0 !important;
  }
  .global-search-shell:focus-within {
    width: clamp(96px, calc(100vw - 250px), 148px);
    min-width: 0;
    flex: 0 1 clamp(96px, calc(100vw - 250px), 148px);
  }
  .global-search-shell:focus-within .searchbox {
    overflow: visible;
    border-color: transparent;
    background: transparent;
  }
  .global-search-shell:focus-within .searchbox .icon {
    left: 9px;
    color: var(--muted, #596579);
  }
  .global-search-shell:focus-within .searchbox input {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 36px;
    padding: 0 8px 0 31px;
    border: 1px solid var(--line, #e0e5ef);
    border-radius: 8px;
    background: var(--surface, #fff);
    color: var(--ink, #171e30);
    caret-color: currentColor;
    font-size: 11px;
    cursor: text;
  }
  .global-search-shell:focus-within .global-search-kbd { display: none; }
  .dark-mode .global-search-shell:not(:focus-within) .searchbox {
    border-color: #3b4559;
    background: #20283a;
  }
  .dark-mode .global-search-shell:focus-within .searchbox input {
    border-color: #3b4559;
    background: #171d2b;
  }
}

/* Show the attention state without repeating the same count in a fourth KPI slot.
   The status panel still retains the detailed breakdown and full numbers. */
#view-content .metric-card { min-width: 0; }
#view-content .metric-top > span:first-child { overflow-wrap: normal; }
#view-content .metric-foot { overflow-wrap: anywhere; }
#view-content .timeline-scope-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 11px 18px 0;
  margin-top: 13px;
  border-top: 1px solid var(--line, #e6eaf1);
  color: var(--muted, #596579);
  font-size: 11px;
  line-height: 1.45;
}
#view-content .timeline-scope-note .icon {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  margin-top: 1px;
}
@media (max-width: 680px) {
  #view-content .mobile-dashboard-summary-meta { white-space: normal; text-align: right; }
  #view-content .timeline-scope-note { padding: 10px 13px 0; font-size: 11px; }
}

/* A short landscape window is a high-value workspace, not a miniature desktop page.
   Tighten the top chrome and keep the first action row in the initial viewport. */
@media (min-width: 681px) and (max-width: 900px) and (orientation: landscape) and (max-height: 520px) {
  .app-topbar { height: 54px; min-height: 54px; padding-inline: 12px; gap: 10px; }
  .topbar-left { gap: 8px; }
  .mobile-brand img { width: 82px; }
  .topbar-actions { gap: 5px; }
  .topbar-actions .icon-btn { width: 32px; height: 32px; }
  /* Use the same compact affordance as mobile when the vertical workspace is short. */
  .global-search-shell { width: 34px; min-width: 34px; height: 34px; flex: 0 0 34px; transition: width .18s ease, flex-basis .18s ease; }
  .global-search-shell .searchbox { position: relative; display: block; width: 100%; height: 34px; overflow: hidden; border: 1px solid var(--line, #e0e5ef); border-radius: 8px; background: var(--surface-2, #f7f8fc); box-sizing: border-box; }
  .global-search-shell .searchbox .icon { left: 9px; z-index: 2; width: 15px; height: 15px; color: var(--muted, #596579); }
  .global-search-shell:not(:focus-within) .searchbox input { position: absolute; inset: 0; box-sizing: border-box; width: 100%; min-width: 0; height: 100%; padding: 0; border: 0; border-radius: inherit; background: transparent; color: transparent; caret-color: transparent; box-shadow: none; cursor: pointer; }
  .global-search-shell:not(:focus-within) .searchbox input::placeholder, .global-search-shell:not(:focus-within) .searchbox input::-webkit-input-placeholder { color: transparent !important; -webkit-text-fill-color: transparent; opacity: 0 !important; }
  .global-search-shell:not(:focus-within) .global-search-kbd { display: none; }
  .global-search-shell:focus-within { width: clamp(135px, 21vw, 190px); min-width: 0; flex: 0 1 clamp(135px, 21vw, 190px); }
  .global-search-shell:focus-within .searchbox { overflow: visible; border-color: transparent; background: transparent; }
  .global-search-shell:focus-within .searchbox .icon { left: 9px; color: var(--muted, #596579); }
  .global-search-shell:focus-within .searchbox input { position: relative; box-sizing: border-box; width: 100%; min-width: 0; height: 34px; padding: 0 8px 0 31px; border: 1px solid var(--line, #e0e5ef); border-radius: 8px; background: var(--surface, #fff); color: var(--ink, #171e30); caret-color: currentColor; font-size: 11px; cursor: text; }
  .dark-mode .global-search-shell:not(:focus-within) .searchbox { border-color: #3b4559; background: #20283a; }
  .dark-mode .global-search-shell:focus-within .searchbox input { border-color: #3b4559; background: #171d2b; }
  #add-lease-top { min-height: 34px; }
  .app-content { padding-top: 10px; padding-bottom: 20px; }
  #view-content .page-top { margin-bottom: 8px; gap: 12px; }
  #view-content .page-eyebrow { display: none; }
  #view-content .page-title { font-size: clamp(22px, 2.6vw, 27px); line-height: 1.06; }
  #view-content .page-subtitle { margin-top: 4px; font-size: 11px; line-height: 1.35; }
  #view-content .overview-banner { margin-bottom: 7px; padding: 7px 10px; gap: 8px; border-radius: 8px; }
  #view-content .overview-banner .banner-icon { width: 27px; height: 27px; border-radius: 8px; }
  #view-content .overview-banner .banner-copy strong { font-size: 11px; line-height: 1.25; }
  #view-content .overview-banner .banner-copy p { font-size: 11px; line-height: 1.3; }
  #view-content .overview-banner .banner-action { min-height: 30px; padding: 4px 6px; font-size: 11px; }
  #view-content .metric-grid { gap: 7px; margin-bottom: 7px; }
  #view-content .metric-grid .metric-card { padding: 7px 9px 8px; border-radius: 8px; }
  #view-content .metric-top { gap: 5px; font-size: 11px; line-height: 1.25; margin-bottom: 4px; }
  #view-content .metric-icon { width: 22px; height: 22px; border-radius: 6px; }
  #view-content .metric-value strong { font-size: clamp(18px, 2.2vw, 22px); }
  #view-content .metric-foot { margin-top: 4px; font-size: 11px; line-height: 1.2; }
  #view-content .main-dashboard-grid { grid-template-columns: minmax(0, 1.2fr) minmax(230px, .8fr); gap: 10px; }
  #view-content .dashboard-primary-stack, #view-content .side-stack { gap: 10px; }
  #view-content .panel-head { padding: 10px 12px 7px; }
  #view-content .panel-title { font-size: 13px; }
  #view-content .panel-description { font-size: 11px; }
  #view-content .attention-row { padding: 7px 3px; }
  #view-content .attention-date { width: 32px; height: 34px; }
  #view-content .attention-main strong { font-size: 11px; }
  #view-content .attention-main p { font-size: 11px; }
  #view-content .attention-side .pill { font-size: 11px; }
  #view-content .subtle-action { min-height: 28px; font-size: 11px; }
  #view-content .timeline-scope-note { padding-top: 8px; margin-top: 8px; font-size: 11px; }
  #view-content.view-enter .metric-card { animation: none !important; opacity: 1 !important; transform: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .global-search-shell { transition: none !important; }
}

/* Long currency figures in the four-up report summaries must fit the 320px viewport. */
@media (max-width: 380px) {
  #view-content .report-metrics .metric-value { min-width: 0; gap: 4px; }
  #view-content .report-metrics .metric-value strong { max-width: 100%; font-size: 18px; letter-spacing: -.055em; white-space: nowrap; }
}
