@media(max-width:760px){
  .app{height:auto;min-height:100dvh}
  .app>main{overflow:visible}
  .sidebar{position:sticky;top:0;flex:none;height:66px;min-height:66px;z-index:4}
  .add-button{min-height:40px;font-size:12px}
  .topbar{height:43px;min-height:43px}
  .top-actions button{min-width:38px;min-height:38px;justify-content:center}
  .heading{flex:none;padding:14px 18px 12px;align-items:center;gap:14px}
  .heading h1{font-size:19px;line-height:1.35;margin:0;max-width:210px;letter-spacing:-.6px}
  .heading .eyebrow,.heading p{display:none}
  .view-toggle{flex-direction:row;margin:0}
  .view-toggle button{min-height:38px;font-size:11px;padding:8px 10px}
  .view-toggle button svg{display:none}
  .map-toolbar{position:sticky;top:66px;z-index:3;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;padding:9px 18px 12px;flex:none;min-height:0;background:#fcfcf8}
  #mobile-filter{display:block;width:100%;max-width:none;min-width:0;min-height:43px;border:1px solid #dce3d1;border-radius:9px;padding:9px 10px;background:#f5f7ee;color:#4c6041;font-size:16px}
  .map-caption{font-size:11px;gap:6px;padding-left:2px}
  .map-caption #map-description{display:none}
  .search{grid-column:1/-1;width:100%;min-height:44px;display:flex;gap:10px;padding:0 12px;border:1px solid #e0e5d7;border-radius:9px;background:#fffefa;margin:0}
  .search input{width:100%;min-width:0;flex:1;font-size:16px;padding:10px 0;background:transparent}
  #map-view{flex:none;min-height:260px;overflow:visible;background:#f7f8f2;scroll-margin-top:190px}
  #viewport{position:static;overflow:visible;cursor:auto;touch-action:pan-y pinch-zoom}
  #map-space,#world{width:100%!important;height:auto!important;min-height:100%;transform:none!important}
  #world{position:static}
  #regions,#connections,.map-center,.map-bottom,.map-hint,#connections-toggle{display:none!important}
  #nodes{position:static;display:flex;flex-direction:column;gap:26px;padding:20px 18px 28px}
  .card-group{min-width:0}
  .card-group h2{display:flex;align-items:center;gap:9px;font-family:Manrope,sans-serif;font-size:13px;font-weight:650;color:#58664e;margin:0 0 13px;line-height:1.5}
  .card-group h2>.icon{color:var(--area-color);width:19px;height:19px}
  .card-group h2>span{min-width:0;overflow-wrap:anywhere}
  .card-group h2 small{margin-left:auto;font-size:11px;font-weight:400;color:#858e79;border:1px solid #dfe5d5;border-radius:6px;min-width:23px;text-align:center;padding:1px 5px}
  .area-cards{display:grid;gap:12px}
  #nodes .node{position:relative;left:auto!important;top:auto!important;width:100%;min-height:80px;padding:18px;border-radius:12px;gap:10px;touch-action:pan-y pinch-zoom;cursor:pointer;box-shadow:0 2px 0 var(--node-base);scroll-margin-top:200px;scroll-margin-bottom:20px}
  #nodes .node:hover{transform:none}
  #nodes .node:active{opacity:1;cursor:pointer}
  #nodes .node-type{display:none}
  #nodes .node-title{font-size:16px;line-height:1.5;font-weight:550;letter-spacing:0}
  .card-excerpt{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere;font-size:13px;line-height:1.65;color:#7a816f}
  #nodes .node-meta{justify-content:flex-start;flex-wrap:wrap;gap:8px 14px;margin-top:2px}
  #nodes .node-meta:empty{display:none}
  #nodes .note-count{font-size:11px;gap:5px;white-space:nowrap}
  #nodes .note-count .icon{width:13px;height:13px}
  #nodes .urgency{font-size:10px;padding:4px 7px}
  #nodes .node-progress{height:4px;margin-top:2px}
  #map-empty{top:50%;padding:22px 18px}
  #map-empty>span{font-size:23px}
  #map-empty h2{font-size:18px;margin:8px 0}
  #map-empty p{font-size:12px;line-height:1.7}
  .capture-wrap{flex:none;padding:10px 18px 8px}
  .quick-capture{width:100%;max-width:none;min-height:46px}
  .quick-capture input{font-size:16px}
  .quick-capture button{width:44px;min-width:44px;min-height:44px}
  .capture-footnote{font-size:10px;line-height:1.5}
  .notes-view,.oblivion-view{padding:22px 18px 28px}
  .journal-entry button{font-size:14px;min-height:40px}
  .journal-entry p{font-size:14px;line-height:1.8}
  .detail-fields select,.detail-fields input,.detail-description,.note-form textarea,.connect-select{font-size:16px}
  #thought-title,#thought-due,#area-name,#area-keywords{font-size:16px}
  .detail-fields select,.detail-fields input,.connect-select{min-height:44px}
  .detail-dialog .icon-button{min-width:40px;min-height:40px}
  /* A thought fills the screen edge to edge, as on larger screens. */
  .detail-dialog{inset:0;width:100%;max-width:none;height:100dvh;max-height:none;margin:0;padding:0;border:0;border-radius:0;box-shadow:none;background:#fcfcf8}
  .detail-dialog::backdrop{background:#fcfcf8}
  .detail-top{position:sticky;top:0;z-index:2;padding:8px 10px 8px 20px;background:#fcfcf8ee;backdrop-filter:blur(8px);border-bottom:1px solid #eef0e8}
  .detail-title{field-sizing:content;margin-top:0}
  /* Phones keep one column in the original order: details, then the notes timeline, then actions. */
  .detail-layout{display:flex;flex-direction:column;padding:20px 20px calc(28px + env(safe-area-inset-bottom))}
  .detail-main,.detail-aside{display:contents}
  .detail-notes{order:1}
  .detail-bottom{order:2}
  .rest-button,.note-form button{min-height:44px;font-size:13px}
  .site-footer{padding-bottom:max(9px,env(safe-area-inset-bottom))}
}
