/* Deliberately separate from the unchanged mobile stylesheet. The link's media
   gate and this rule both enforce the exact desktop breakpoint. */
@media (min-width: 1024px) {
  #app:has(#main:not([hidden]) > #desktop-layout) { max-width:none; }
  #main:has(> #desktop-layout) > .main-header,
  #main:has(> #desktop-layout) > .main-content { display:none; }

  .desktop-layout {
    direction:rtl;
    display:grid;
    grid-template-columns:minmax(0,68fr) minmax(0,32fr);
    align-items:start;
    gap:20px;
    width:calc(100% - 64px);
    max-width:1400px;
    margin:32px auto;
    text-align:right;
  }
  .desktop-primary,.desktop-secondary {
    display:flex;
    flex-direction:column;
    gap:20px;
    min-width:0;
  }
  .desktop-layout .search-panel,
  .desktop-layout .account-panel,
  .desktop-history,.desktop-facilities {
    width:100%;
    min-width:0;
    margin:0;
    background:var(--card);
    border-radius:10px;
  }
  .desktop-layout .search-panel { padding:24px; }
  .desktop-layout #search-title { margin:0 0 16px;text-align:right; }
  .desktop-layout .search-controls { padding:0;margin:0; }
  .desktop-layout #search-input { width:100%;text-align:right;font-size:15px; }
  .desktop-layout #search-button {
    width:calc(100% - 64px);
    max-width:480px;
    margin:18px auto 0;
  }
  .desktop-layout #app-message { margin:16px 0 0;text-align:right; }
  .desktop-layout #results { margin:16px 0 0; }
  .desktop-layout #results:empty { display:none; }

  .desktop-layout .account-panel { height:auto;padding:18px 16px; }
  .desktop-layout .account-summary { width:100%; }
  .desktop-layout .account-summary > span { margin-right:12px;white-space:normal; }
  .desktop-layout .buy-plan { width:100%;max-width:100%;margin:18px 0 0; }

  .desktop-history { padding:20px 24px; }
  .desktop-history-heading { display:flex;align-items:center;justify-content:space-between;gap:16px; }
  .desktop-history-heading h2 { color:var(--yellow);font-size:16px; }
  .desktop-history-heading .text-button { padding:0;flex-shrink:0; }
  .desktop-history-list { margin-top:8px; }
  .desktop-history-empty { color:var(--muted);font-size:14px;line-height:1.87;padding:16px 0; }
  .desktop-history .history-row { margin:0;padding:10px 0;box-shadow:none;border-radius:9px; }
  .desktop-history .history-row + .history-row { border-top:1px solid var(--stroke); }
  .desktop-history .history-open { padding:0;gap:12px; }
  .desktop-history .history-open .avatar { width:44px;height:44px; }
  .desktop-history .history-text {
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(100px,1fr) minmax(130px,1.2fr);
    align-items:center;
    gap:12px;
    flex:1;
    margin:0;
    font-size:14px;
  }
  .desktop-history .history-text > span,
  .desktop-history .history-text time { white-space:normal;overflow-wrap:anywhere; }
  .desktop-history .history-text time { margin:0;text-align:right;font-size:12px; }
  .desktop-history .history-remove { width:36px;height:44px;padding:8px;margin:0 8px 0 0; }
  .desktop-history .history-remove .icon { width:20px;height:20px; }

  .desktop-facilities { padding:12px; }
  .desktop-layout #menu { gap:0; }
  .desktop-layout .menu-item { height:auto;min-height:74px;margin:0;padding:12px 4px;gap:10px;box-shadow:none; }
  .desktop-layout .menu-item + .menu-item { border-top:1px solid var(--stroke); }
  .desktop-layout .menu-icon { width:40px;height:40px;padding:8px; }
  .desktop-layout .menu-copy strong { font-size:14px; }
  .desktop-layout .menu-copy > span { margin-top:2px;font-size:12px; }
  .desktop-layout .menu-item .menu-arrow { width:18px;height:18px;margin:0; }
  .desktop-layout #features { height:auto;margin:8px 0 0;padding:12px 0 0;border-top:1px solid var(--stroke); }
  .desktop-layout .feature-row > div { height:64px; }
}
