/* Landing: the app's own look on top of ui-kit. Only --ui-accent and --ui-accent-text are set here. */
:root { --ui-accent: #c9a84c; --ui-accent-text: #111; }

.lp-bar { display: flex; justify-content: flex-end; margin: 4px 0 8px; }

/* Tiles: a flat grid, about four across on a phone. */
.lp-tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px 10px;
            grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.lp-tile__link { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 4px;
                 border-radius: var(--ui-radius); color: inherit; text-decoration: none; text-align: center; }
.lp-tile__link:hover { background: var(--ui-hover); }
.lp-tile__icon { flex: none; width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center;
                 background: var(--ui-accent-dim); color: var(--ui-accent-link);
                 font-family: var(--ui-font-display); font-size: 1.7rem; font-weight: 600; }
/* A site's own icon fills the tile's square, on a light card so dark icons show in dark mode too. */
.lp-tile__icon:has(img) { background: #fff; overflow: hidden; }
.lp-tile__icon img { width: 70%; height: 70%; object-fit: contain; }
.lp-tile__name { font-size: 0.9rem; line-height: 1.25; overflow-wrap: anywhere;
                 display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lp-tile__actions { display: none; }
/* The drag handle shows with Edit on only. */
#main:not([data-editing]) .lp-tiles .dr-handle { display: none; }
#main[data-editing] .lp-tile .dr-handle { flex: none; margin-left: -10px; }

/* Edit on: the tiles become rows with their buttons. */
#main[data-editing] .lp-tiles { display: block; }
#main[data-editing] .lp-tile { display: flex; align-items: center; gap: 4px; min-height: 64px; }
#main[data-editing] .lp-tile__link { flex: 1; min-width: 0; flex-direction: row; text-align: left; gap: 12px; padding: 6px 2px; }
#main[data-editing] .lp-tile__icon { width: 44px; height: 44px; border-radius: 12px; font-size: 1.25rem; }
#main[data-editing] .lp-tile__name { font-size: 1rem; }
#main[data-editing] .lp-tile__actions { display: flex; flex: none; }
.lp-hidden[hidden], #main:not([data-editing]) .lp-hidden { display: none; }

/* Rows: hidden links on the page, shared links on the admin side. */
.lp-rows { list-style: none; margin: 0; padding: 0; }
.lp-row { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.lp-row .lp-tile__icon { width: 44px; height: 44px; border-radius: 12px; font-size: 1.25rem; }
.lp-row__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lp-row__name { overflow-wrap: anywhere; }
.lp-row__url { font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-row__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; }
.lp-row__actions .ui-btn, .lp-tile__actions .ui-btn { min-height: 44px; padding: 0 10px; }
.lp-row .lp-edit { flex: 1; margin: 8px 0; }
.lp-rows--admin .dr-handle { flex: none; margin-left: -10px; }
/* Icon-only buttons: a 44px square tap area. */
.lp-icon-btn.ui-btn { min-width: 44px; padding: 0 10px; }
.ui-add__button .icon { display: block; }

.lp-settings { margin-top: 40px; padding-bottom: 120px; }
.lp-form { padding: 4px 10px 6px; }
.lp-add { margin-top: 28px; }
.lp-signout { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 60px; }

/* Hidden links sit indented under their heading. */
#hidden-list { padding-left: 12px; }

/* Admin rows on a phone: the buttons go on their own line under the name. */
@media (max-width: 480px) {
  .lp-rows--admin .lp-row { flex-wrap: wrap; }
  .lp-rows--admin .lp-row__actions { width: 100%; justify-content: flex-start; margin: -8px 0 6px 56px; }
}

/* The + button stays at the content column's right edge on wide screens (ui-main is 720px wide
   with 18px padding; 50% is half the window without its scrollbar); on a phone it keeps ui-kit's place. */
.ui-add { right: max(18px, env(safe-area-inset-right, 0px), calc(50% - 360px + 18px)); }
