/* ============================================================
   iOS Files – Design System
   ============================================================ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

/* ── Tokens ── */
:root {
  --ios-blue:        #007AFF;
  --ios-blue-dark:   #0062cc;
  --ios-red:         #FF3B30;
  --ios-green:       #34C759;
  --ios-yellow:      #FFCC00;
  --ios-orange:      #FF9500;
  --ios-teal:        #5AC8FA;
  --ios-purple:      #AF52DE;

  --bg:              #F2F2F7;
  --bg-grouped:      #FFFFFF;
  --surface:         #FFFFFF;
  --surface-2:       #F2F2F7;
  --separator:       rgba(60,60,67,0.12);
  --separator-opaque:#C6C6C8;

  --label:           #000000;
  --label-2:         rgba(60,60,67,0.60);
  --label-3:         rgba(60,60,67,0.30);
  --label-inv:       #FFFFFF;

  --tab-bg:          rgba(249,249,249,0.94);
  --nav-bg:          rgba(249,249,249,0.94);

  --folder-blue:     #007AFF;
  --folder-manu:     #5AC8FA;
  --folder-sandra:   #FF2D55;
  --folder-general:  #FF9500;

  --radius-sm:       8px;
  --radius-md:       12px;
  --radius-lg:       16px;
  --radius-xl:       20px;

  --shadow-card:     0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
  --shadow-modal:    0 20px 60px rgba(0,0,0,0.3);
  --shadow-ctx:      0 8px 32px rgba(0,0,0,0.18);

  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;

  --nav-h:           52px;
  --tab-h:           83px;   /* includes safe area padding */
  --safe-bottom:     env(safe-area-inset-bottom, 0px);
}

/* ── Base ── */
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--label);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  height: 100dvh;
}

button, input, select, a { font-family: inherit; }
button { border: 0; background: none; cursor: pointer; padding: 0; }
a { text-decoration: none; color: inherit; }

/* ═══════════════════════════════════════════════════════════
   APP SHELL
═══════════════════════════════════════════════════════════ */
.app,
.app-root {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  position: relative;
}

.view-shell {
  min-height: 100%;
}

/* ═══════════════════════════════════════════════════════════
   NAV BAR  (iOS top navigation)
═══════════════════════════════════════════════════════════ */
.nav-bar {
  display: flex;
  align-items: center;
  height: var(--nav-h);
  padding: 0 8px;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--separator);
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  padding-top: env(safe-area-inset-top, 0px);
}

.nav-actions {
  min-width: 76px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.nav-side {
  display: flex;
  align-items: center;
  min-width: 80px;
}
.nav-left  { justify-content: flex-start; }
.nav-right { justify-content: flex-end; }

.nav-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
  margin: 0;
  color: var(--label);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  max-width: calc(100% - 180px);
  pointer-events: none;
}

/* Back button */
.nav-back,
.nav-back-btn {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--ios-blue);
  font-size: 17px;
  font-weight: 400;
  padding: 6px 6px 6px 2px;
  border-radius: 8px;
  min-height: 44px;
  transition: opacity 120ms;
  flex-shrink: 0;
}
.nav-back:active,
.nav-back-btn:active { opacity: 0.5; }
.nav-back-chevron,
.nav-back-btn svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.nav-back span,
.nav-back-btn span {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Nav icon buttons */
.nav-icon-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--ios-blue);
  transition: background 120ms;
  flex-shrink: 0;
  cursor: pointer;
}
.nav-icon-btn svg { width: 22px; height: 22px; }
.nav-icon-btn:active { background: rgba(0,122,255,0.12); }

.nav-action-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  color: var(--ios-blue);
  background: rgba(0,122,255,0.08);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-action-btn svg {
  width: 18px;
  height: 18px;
}
.nav-action-btn:active {
  background: rgba(0,122,255,0.16);
}

/* ═══════════════════════════════════════════════════════════
   MAIN CONTENT
═══════════════════════════════════════════════════════════ */
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.view { padding: 0 0 16px; }

/* ═══════════════════════════════════════════════════════════
   HOME VIEW
═══════════════════════════════════════════════════════════ */
.home-view {
  padding: 20px 16px 20px;
}

.home-section { margin-bottom: 16px; }

.home-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 8px 4px;
}
.home-section-header .home-section-title {
  margin: 0;
}
.home-section-add-btn {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(0,122,255,0.12);
  color: var(--ios-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
}
.home-section-add-btn svg { width: 16px; height: 16px; }

.home-section-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--label-2);
  margin: 0 0 8px 4px;
}

/* Locations list – iOS grouped table style */
.locations-list {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.location-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  min-height: 56px;
  cursor: pointer;
  transition: background 120ms;
  position: relative;
  text-align: left;
  width: 100%;
  border: 0;
  background: none;
  font-family: inherit;
}
.location-row:not(:last-child)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 60px;
  right: 0;
  height: 1px;
  background: var(--separator);
}
.location-row:active {
  background: rgba(0,0,0,0.04);
}

.location-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.location-icon svg { width: 18px; height: 18px; color: white; }

.location-icon.icon-manu    { background: var(--folder-manu); }
.location-icon.icon-sandra  { background: var(--folder-sandra); }
.location-icon.icon-general { background: var(--folder-general); }
.location-icon.icon-default { background: var(--folder-blue); }

.location-body {
  flex: 1;
  min-width: 0;
}
.location-name {
  font-size: 17px;
  font-weight: 400;
  color: var(--label);
  display: block;
}
.location-meta {
  font-size: 13px;
  color: var(--label-2);
  display: block;
  margin-top: 1px;
}

.location-chevron {
  color: var(--label-3);
  flex-shrink: 0;
}
.location-chevron svg { width: 17px; height: 17px; }

/* Server card */
.server-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.server-card-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.server-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--label-3);
  flex-shrink: 0;
  transition: background 300ms;
}
.server-dot.online  { background: var(--ios-green); }
.server-dot.offline { background: var(--ios-red); }
.server-status-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--label);
}
.server-urls {
  font-size: 12px;
  color: var(--label-2);
  margin: 0;
  word-break: break-all;
}

.session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding: 0 2px;
}
.session-label {
  font-size: 14px;
  color: var(--label-2);
}
.text-btn-blue {
  font-size: 15px;
  font-weight: 500;
  color: var(--ios-blue);
  padding: 4px 0;
  min-height: 36px;
}

/* ═══════════════════════════════════════════════════════════
   BROWSER VIEW  – File Grid
═══════════════════════════════════════════════════════════ */
.browser-view {
  padding: 0;
}

/* Upload banner */
.upload-banner {
  height: 4px;
  background: rgba(0,122,255,0.12);
  position: relative;
  overflow: hidden;
}
.upload-banner-bar {
  height: 100%;
  background: var(--ios-blue);
  width: 0%;
  transition: width 200ms;
}

.ptr-indicator {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 12px);
  left: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ios-blue);
  box-shadow: var(--shadow-card);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(-8px) scale(0.94);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
  z-index: 180;
}
.ptr-indicator svg {
  width: 24px;
  height: 24px;
}
.ptr-indicator.ptr-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0) scale(1);
}
.ptr-indicator.ptr-loading svg {
  animation: ptr-spin 0.8s linear infinite;
}

@keyframes ptr-spin {
  to { transform: rotate(360deg); }
}

.file-input-hidden {
  position: fixed;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* File grid – card per item */
.file-grid {
  padding: 12px 16px 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
}

/* Empty state */
.grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--label-2);
}
.grid-empty p { font-size: 15px; margin: 8px 0 0; }
.grid-empty-icon { font-size: 48px; display: block; }

/* Folder tile */
.file-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px 12px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 100ms, box-shadow 100ms;
  position: relative;
  border: 0;
  font-family: inherit;
  text-align: center;
  width: 100%;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}
.file-tile:active {
  transform: scale(0.96);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.file-tile.selected {
  outline: 2.5px solid var(--ios-blue);
  outline-offset: -1px;
}

/* Tile icon / thumb */
.tile-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.tile-folder-icon {
  width: 64px;
  height: 64px;
}

.tile-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tile-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
}
.tile-thumb-placeholder svg { width: 28px; height: 28px; color: var(--label-3); }

.tile-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--label);
  line-height: 1.3;
  max-height: 32px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
  width: 100%;
}
.tile-meta {
  font-size: 11px;
  color: var(--label-2);
  width: 100%;
}

/* More button on tile */
.tile-more-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--label-2);
  opacity: 0;
  transition: opacity 150ms, background 120ms;
}
.file-tile:hover .tile-more-btn { opacity: 1; }
.tile-more-btn:active { background: rgba(0,0,0,0.06); opacity: 1; }
.tile-more-btn svg { width: 18px; height: 18px; }

/* List view (for docs/files in a folder – less visual noise) */
.file-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  min-height: 56px;
  background: var(--surface);
  position: relative;
  cursor: pointer;
  transition: background 120ms;
  border: 0;
  font-family: inherit;
  text-align: left;
  width: 100%;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.file-list-item:not(:last-child)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 60px;
  right: 0;
  height: 1px;
  background: var(--separator);
}
.file-list-item:first-child { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.file-list-item:last-child  { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.file-list-item:only-child  { border-radius: var(--radius-lg); }
.file-list-item:active      { background: rgba(0,0,0,0.04); }
.file-list-item.selected    { background: rgba(0,122,255,0.06); }

.list-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.list-thumb { width: 100%; height: 100%; object-fit: cover; }
.list-icon-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
}
.list-icon-placeholder svg { width: 18px; height: 18px; color: var(--label-3); }

.list-body { flex: 1; min-width: 0; }
.list-name {
  font-size: 16px;
  font-weight: 400;
  color: var(--label);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}
.list-meta {
  font-size: 13px;
  color: var(--label-2);
  display: block;
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-more-btn {
  width: 36px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--label-3);
  flex-shrink: 0;
  border-radius: 8px;
  transition: background 120ms;
}
.list-more-btn:active { background: rgba(0,0,0,0.06); }
.list-more-btn svg { width: 18px; height: 18px; }

/* Folder SVG icon colors */
.folder-color-manu    .folder-body { fill: #5AC8FA; }
.folder-color-manu    .folder-tab  { fill: #4BB8E8; }
.folder-color-sandra  .folder-body { fill: #FF2D55; }
.folder-color-sandra  .folder-tab  { fill: #E8264C; }
.folder-color-general .folder-body { fill: #FF9500; }
.folder-color-general .folder-tab  { fill: #E88600; }
.folder-color-default .folder-body { fill: #007AFF; }
.folder-color-default .folder-tab  { fill: #006DE8; }
.folder-color-sub     .folder-body { fill: #007AFF; }
.folder-color-sub     .folder-tab  { fill: #006DE8; }

/* ═══════════════════════════════════════════════════════════
   VIEWER OVERLAY
═══════════════════════════════════════════════════════════ */
.viewer-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #000;
  display: flex;
  flex-direction: column;
}

.viewer-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  height: 52px;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}
.viewer-close {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: white;
  transition: background 120ms;
}
.viewer-close svg { width: 22px; height: 22px; }
.viewer-close:active { background: rgba(255,255,255,0.15); }

.viewer-filename {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  color: white;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
}
.viewer-dl-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: white;
  transition: background 120ms;
}
.viewer-dl-btn svg { width: 22px; height: 22px; }
.viewer-dl-btn:active { background: rgba(255,255,255,0.15); }

.viewer-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.viewer-media {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-width: 0;
  height: 100%;
}

.viewer-media img, .viewer-body video, .viewer-media video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.viewer-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(8px);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms, opacity 120ms;
  opacity: 0.8;
}
.viewer-nav-btn svg { width: 22px; height: 22px; }
.viewer-nav-btn:active { background: rgba(255,255,255,0.2); opacity: 1; }
.viewer-nav-prev { left: 10px; }
.viewer-nav-next { right: 10px; }
.viewer-media audio {
  width: 90%;
  max-width: 400px;
}
.viewer-media iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: white;
}

.viewer-meta {
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  padding: 10px 16px calc(10px + var(--safe-bottom));
  margin: 0;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   TAB BAR
═══════════════════════════════════════════════════════════ */
.tab-bar {
  display: flex;
  align-items: stretch;
  height: var(--tab-h);
  padding-bottom: var(--safe-bottom);
  background: var(--tab-bg);
  border-top: 1px solid var(--separator);
  flex-shrink: 0;
  gap: 2px;
}

.tab-item,
.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--label-2);
  padding: 8px 4px;
  transition: color 120ms;
  min-height: 44px;
  border: 0;
  background: none;
  font-family: var(--font);
}
.tab-icon,
.tab-btn svg { width: 24px; height: 24px; flex-shrink: 0; }
.tab-btn span { line-height: 1.05; }
.tab-item.active,
.tab-btn.active { color: var(--ios-blue); }
.tab-item:active,
.tab-btn:active { color: var(--ios-blue-dark); }

/* ═══════════════════════════════════════════════════════════
   CONTEXT MENU
═══════════════════════════════════════════════════════════ */
.context-menu {
  position: fixed;
  z-index: 500;
  min-width: 200px;
  background: rgba(239,239,244,0.92);
  backdrop-filter: saturate(180%) blur(30px);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-ctx);
  overflow: hidden;
  animation: ctx-pop 160ms cubic-bezier(0.25,0.46,0.45,0.94);
}

@keyframes ctx-pop {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}

.ctx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 16px;
  font-size: 16px;
  color: var(--label);
  transition: background 80ms;
  text-align: left;
}
.ctx-item:active { background: rgba(0,0,0,0.07); }
.ctx-icon { width: 18px; height: 18px; color: var(--ios-blue); flex-shrink: 0; }
.ctx-danger { color: var(--ios-red); }
.ctx-danger .ctx-icon { color: var(--ios-red); }

.ctx-divider {
  height: 1px;
  background: var(--separator-opaque);
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════
   MODALS (iOS Alert style)
═══════════════════════════════════════════════════════════ */
.ios-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.ios-modal-backdrop[hidden] { display: none; }

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.ios-modal,
.ios-modal-sheet {
  width: 270px;
  background: rgba(242,242,247,0.97);
  border-radius: var(--radius-xl);
  box-shadow: 0 10px 24px rgba(0,0,0,0.16);
  overflow: hidden;
  text-align: center;
}
@keyframes modal-pop {
  from { opacity: 0; transform: scale(1.08); }
  to   { opacity: 1; transform: scale(1); }
}

.ios-modal-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--label);
  margin: 0;
  padding: 20px 16px 4px;
}

.ios-modal-fields {
  padding: 12px 16px 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  overflow-x: hidden;
}
.ios-modal-input {
  width: 100%;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--separator-opaque);
  background: white;
  padding: 0 10px;
  font-size: 16px;
  color: var(--label);
  outline: none;
}
.ios-modal-input:focus {
  border-color: var(--ios-blue);
  box-shadow: 0 0 0 3px rgba(0,122,255,0.18);
}

.ios-modal-actions {
  display: flex;
  border-top: 1px solid var(--separator-opaque);
  margin-top: 12px;
}
.ios-modal-btn-divider {
  width: 1px;
  background: var(--separator-opaque);
}
.ios-modal-btn {
  flex: 1;
  height: 44px;
  font-size: 17px;
  font-weight: 400;
  color: var(--ios-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 80ms;
}
.ios-modal-btn:active { background: rgba(0,0,0,0.06); }
.ios-modal-btn-primary { font-weight: 600; }

/* ═══════════════════════════════════════════════════════════
   AUTH SHEET
═══════════════════════════════════════════════════════════ */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 700;
  background: linear-gradient(160deg, #1c1c1e 0%, #2c2c2e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-overlay[hidden] { display: none; }

.auth-sheet {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.auth-app-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  margin-bottom: 10px;
}
.auth-app-icon svg { width: 100%; height: 100%; display: block; }

.auth-title {
  font-size: 28px;
  font-weight: 700;
  color: white;
  margin: 0;
  letter-spacing: -0.4px;
}
.auth-subtitle {
  font-size: 15px;
  color: rgba(255,255,255,0.55);
  margin: 0 0 20px;
}

.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-fields {
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}
.auth-field-wrap {
  display: flex;
  align-items: center;
  padding: 0 16px;
  min-height: 52px;
}
.auth-fields-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 0 16px;
}
.auth-input {
  width: 100%;
  background: none;
  border: 0;
  outline: none;
  font-size: 16px;
  color: white;
  height: 100%;
  min-height: 52px;
  padding: 0;
}
.auth-input::placeholder { color: rgba(255,255,255,0.35); }

.auth-error {
  font-size: 14px;
  color: #FF453A;
  text-align: center;
  padding: 6px 0;
  margin: 0;
}

.auth-submit {
  height: 52px;
  width: 100%;
  border-radius: var(--radius-lg);
  background: var(--ios-blue);
  color: white;
  font-size: 17px;
  font-weight: 600;
  transition: filter 120ms, transform 100ms;
  margin-top: 4px;
}
.auth-submit:hover  { filter: brightness(1.08); }
.auth-submit:active { transform: scale(0.97); filter: brightness(0.95); }

/* ═══════════════════════════════════════════════════════════
   SHARED UTILITIES
═══════════════════════════════════════════════════════════ */
[hidden] { display: none !important; }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════ */
@media (min-width: 768px) {
  .file-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    padding: 16px 20px 20px;
  }

  .home-view {
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 24px 36px;
  }

  .module-view,
  .trash-view {
    max-width: 920px;
    margin: 0 auto;
    padding: 24px 24px 36px;
  }

  .files-view {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 24px 36px;
  }

  .search-view {
    max-width: 1100px;
    margin: 0 auto;
  }
}

@media (min-width: 1024px) {
  :root { --tab-h: 64px; }

  .nav-bar {
    padding-left: 18px;
    padding-right: 18px;
  }

  .home-dashboard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-dashboard-tile {
    min-height: 116px;
  }

  .tab-bar {
    width: min(460px, calc(100% - 32px));
    margin: 0 auto 14px;
    height: 60px;
    padding-bottom: 0;
    border: 1px solid var(--separator);
    border-radius: 18px;
    box-shadow: var(--shadow-card);
  }

  .tab-item,
  .tab-btn { flex-direction: row; gap: 8px; font-size: 13px; padding: 0 18px; }
  .tab-icon,
  .tab-btn svg { width: 20px; height: 20px; }
}

@media (max-width: 520px) {
  .nav-bar {
    padding-left: 10px;
    padding-right: 10px;
  }

  .nav-actions {
    min-width: 0;
    gap: 6px;
  }

  .nav-action-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
  }

  .nav-action-btn svg {
    width: 16px;
    height: 16px;
  }

  .nav-title {
    max-width: calc(100% - 148px);
  }

  #thumbnail-zoom-btn {
    display: none !important;
  }
}

/* ── Search view ─────────────────────────────────────────────────── */
.search-view {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.search-bar-wrap {
  padding: 12px 16px 8px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--surface);
  border-radius: 12px;
  padding: 0 12px;
  gap: 8px;
  box-shadow: var(--shadow-card);
}

.search-bar-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  color: var(--label-tertiary);
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font);
  font-size: 16px;
  color: var(--label);
  padding: 11px 0;
  min-width: 0;
}

.search-input::placeholder { color: var(--label-tertiary); }
.search-input::-webkit-search-cancel-button { display: none; }

.search-clear {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-clear svg { width: 18px; height: 18px; }

.search-results {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 16px 16px;
}

.search-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--label-secondary);
  font-size: 15px;
}

.search-empty-icon { font-size: 44px; display: block; margin-bottom: 12px; }

.search-group-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--label-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 4px 6px;
}

.search-result-list {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin-bottom: 4px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 0.5px solid var(--separator);
  cursor: pointer;
  text-align: left;
  font-family: var(--font);
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:active { background: rgba(0,0,0,0.04); }

.search-result-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-result-icon svg { width: 32px; height: 32px; }

.search-result-body { flex: 1; min-width: 0; }

.search-result-name {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: var(--label);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-path {
  display: block;
  font-size: 12px;
  color: var(--label-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* ── Drag & Drop ─────────────────────────────────────────────────── */
.drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 10px;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.22), 0 2px 8px rgba(0,0,0,0.12);
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
  font-weight: 500;
  color: var(--label);
  opacity: 0.92;
  transform: scale(1.06) rotate(1.5deg);
  transform-origin: top left;
  user-select: none;
  -webkit-user-select: none;
}

.drag-ghost-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drag-ghost-icon svg { width: 30px; height: 30px; }

.drag-ghost-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drag-active {
  opacity: 0.35 !important;
}

.drop-target-hover {
  outline: 2.5px solid var(--ios-blue) !important;
  outline-offset: 1px;
  background: rgba(0,122,255,0.07) !important;
}

/* iOS-style context popover (shown on long-press / right-click on empty area) */
.ctx-popover {
  position: fixed;
  z-index: 1000;
  min-width: 200px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.18), 0 1px 2px rgba(0,0,0,0.08);
  border: 0.5px solid rgba(0,0,0,0.08);
  opacity: 0;
  transform: scale(0.92);
  transform-origin: top left;
  transition: opacity 120ms ease-out, transform 120ms ease-out;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
.ctx-popover-visible { opacity: 1; transform: scale(1); }
.ctx-popover-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 15px;
  color: var(--ios-blue);
  cursor: pointer;
  text-align: left;
}
.ctx-popover-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.ctx-popover-item:hover { background: rgba(0,122,255,0.10); }
.ctx-popover-item:active { background: rgba(0,122,255,0.18); }

.auth-passkey-btn {
  margin-top: 10px;
  width: 100%;
  min-height: 44px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,0.95);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.16);
}
.auth-passkey-btn:active { opacity: 0.7; }

.home-events-card,
.module-summary-card,
.module-card,
.module-card-list,
.home-dashboard-tile {
  box-shadow: var(--shadow-card);
}

.home-events-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.home-event-row {
  width: 100%;
  min-height: 52px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}
.home-event-row:not(:last-child) {
  border-bottom: 1px solid var(--separator);
}
.home-events-empty {
  margin: 0;
  padding: 16px;
  min-height: 56px;
  display: flex;
  align-items: center;
  color: var(--label-2);
}
.home-event-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.home-event-delete-btn {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255,59,48,0.12);
  color: var(--ios-red);
  display: flex;
  align-items: center;
  justify-content: center;
}
.home-event-delete-btn svg {
  width: 16px;
  height: 16px;
}
.home-event-calendar-btn {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(0,122,255,0.12);
  color: var(--ios-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.home-event-calendar-btn svg {
  width: 15px;
  height: 15px;
}
.home-event-date {
  min-width: 52px;
  color: var(--ios-blue);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}
.home-event-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.home-event-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--label);
}
.home-event-note {
  font-size: 12px;
  color: var(--label-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-gcal-row { padding: 0 16px 12px; }
.event-gcal-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(0,122,255,0.08);
  color: var(--ios-blue);
  font-size: 13px;
  font-weight: 600;
}
.event-gcal-btn[hidden] { display: none !important; }

.home-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.home-dashboard-tile {
  min-height: 132px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  gap: 10px;
}
.home-dashboard-tile:active {
  background: rgba(0,0,0,0.03);
}
.home-dashboard-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 19px;
  font-weight: 800;
}
.home-dashboard-icon::before { display: block; }
.home-dashboard-icon-files { background: linear-gradient(135deg, #4facfe, #00c2fe); }
.home-dashboard-icon-files::before { content: "F"; }
.home-dashboard-icon-economy { background: linear-gradient(135deg, #34c759, #30d158); }
.home-dashboard-icon-economy::before { content: "€"; }
.home-dashboard-icon-passwords { background: linear-gradient(135deg, #ff9500, #ffb340); }
.home-dashboard-icon-passwords::before { content: "•"; }
.home-dashboard-icon-wishlist { background: linear-gradient(135deg, #ff2d55, #ff6a88); }
.home-dashboard-icon-wishlist::before { content: "+"; }
.home-dashboard-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--label);
}
.home-dashboard-meta {
  font-size: 13px;
  line-height: 1.35;
  color: var(--label-2);
}

.module-view {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.files-view,
.trash-view {
  padding: 16px;
}
.module-summary-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
}
.module-summary-kicker {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--label-2);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.module-summary-title {
  display: block;
  font-size: 26px;
  font-weight: 700;
  color: var(--label);
  line-height: 1.1;
}
.module-summary-meta {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--label-2);
}
.module-summary-debtor { color: var(--ios-red); }
.module-summary-creditor { color: var(--ios-green); }

.module-segment-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 12px;
}
.module-segment-control {
  display: inline-flex;
  gap: 8px;
  min-width: 100%;
}
.module-segment-btn {
  flex-shrink: 0;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--label-2);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-card);
}
.module-segment-btn.active {
  color: var(--ios-blue);
  background: rgba(0,122,255,0.12);
  box-shadow: none;
}

.economy-section-panel,
.module-card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.economy-month-card,
.module-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.economy-month-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--separator);
}
.economy-month-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--label);
}
.economy-month-total {
  font-size: 13px;
  font-weight: 600;
  color: var(--label-2);
}
.economy-entry-row,
.module-list-row {
  width: 100%;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}
.economy-entry-row:not(:last-child),
.module-list-row:not(:last-child) {
  border-bottom: 1px solid var(--separator);
}
.economy-entry-main,
.module-list-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.economy-entry-title,
.module-list-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--label);
}
.economy-entry-meta,
.module-list-meta {
  font-size: 12px;
  color: var(--label-2);
}
.economy-entry-amount,
.module-list-tag {
  font-size: 14px;
  font-weight: 700;
  color: var(--label);
}

.module-inline-btn {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--ios-blue);
  background: rgba(0,122,255,0.1);
  font-size: 14px;
  font-weight: 600;
}
.module-actions-row {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 12px;
}

.module-fab {
  position: fixed;
  right: 20px;
  bottom: calc(var(--tab-h) + 16px);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--ios-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,122,255,0.45);
  z-index: 220;
}
.module-fab svg { width: 26px; height: 26px; }
.module-fab[hidden] { display: none !important; }

.fab-upload {
  position: fixed;
  right: 20px;
  bottom: calc(var(--tab-h) + 16px);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--ios-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.45);
  z-index: 220;
}
.fab-upload svg { width: 26px; height: 26px; }
.fab-upload[hidden] { display: none !important; }

.ios-modal-textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  border: 0;
  border-radius: 12px;
  background: var(--surface-2);
  padding: 12px 14px;
  font-size: 15px;
  color: var(--label);
}

.wishlist-priority-alta { color: var(--ios-red); }
.wishlist-priority-media { color: var(--ios-orange); }
.wishlist-priority-baja { color: var(--ios-blue); }

/* ── Module list cards (wishlist, events, passwords) ──────────────────── */
.module-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.module-summary-label {
  font-size: 14px;
  color: var(--label-2);
}
.module-summary-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--label);
}

.module-list-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-card);
}
.module-list-card-done {
  opacity: 0.45;
}
.module-list-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.module-list-note {
  font-size: 12px;
  color: var(--label-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.module-list-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.module-action-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--label-2);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.module-action-btn-edit {
  background: rgba(0, 122, 255, 0.10);
  color: var(--ios-blue);
}
.module-action-btn-del {
  background: rgba(255, 59, 48, 0.10);
  color: var(--ios-red);
}

.ios-input,
.ios-textarea {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  min-width: 0;
  border: 1px solid var(--separator);
  border-radius: 12px;
  background: rgba(255,255,255,0.94);
  color: var(--label);
  font-size: 16px;
  padding: 0 14px;
  outline: none;
  appearance: auto;
  -webkit-appearance: auto;
}

.ios-input[type="date"],
.ios-input[type="time"],
.ios-input[type="datetime-local"],
.ios-input[type="month"],
.ios-input[type="week"],
.ios-input[type="number"],
.ios-input[type="text"],
.ios-input select,
select.ios-input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.ios-input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
}

.ios-input:focus,
.ios-textarea:focus {
  border-color: rgba(0,122,255,0.45);
  box-shadow: 0 0 0 3px rgba(0,122,255,0.12);
}

.ios-textarea {
  min-height: 92px;
  padding: 12px 14px;
  resize: vertical;
}

.ios-modal-sheet {
  width: min(420px, calc(100vw - 24px));
  text-align: left;
}

.ios-modal-sheet .ios-modal-title {
  text-align: center;
}

.settle-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 112px;
}

.settle-section-carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 16px;
  padding-bottom: 2px;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
}

.settle-section-carousel::-webkit-scrollbar {
  display: none;
}

.settle-section-slide {
  min-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.settle-hero {
  position: relative;
  margin: -16px -16px 0;
  padding: 18px 16px 16px;
  background: linear-gradient(180deg, #f39a2d 0%, #ef8d22 100%);
  color: var(--label-inv);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settle-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.settle-hero-kicker,
.settle-hero-caption {
  font-size: 13px;
  color: rgba(255,255,255,0.86);
}

.settle-hero-kicker {
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.settle-hero-caption {
  display: block;
  width: 100%;
  text-align: left;
  white-space: normal;
  word-break: break-word;
}

.settle-hero-circle {
  width: min(220px, 56vw);
  aspect-ratio: 1;
  margin: 4px auto 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 20%, rgba(110, 73, 22, 0.95), rgba(78, 51, 15, 0.96));
  box-shadow: 0 8px 20px rgba(92, 46, 4, 0.16);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px;
  gap: 6px;
}

.settle-hero-name {
  font-size: 14px;
  color: rgba(255,255,255,0.72);
}

.settle-hero-amount {
  font-size: 29px;
  line-height: 1;
  letter-spacing: -0.03em;
}

.settle-hero-note {
  font-size: 14px;
  color: rgba(255,255,255,0.88);
}

.settle-group-strip,
.settle-category-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.settle-group-strip::-webkit-scrollbar,
.settle-category-strip::-webkit-scrollbar {
  display: none;
}

.settle-group-pill,
.settle-category-pill {
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.88);
  background: rgba(255,255,255,0.14);
}

.settle-group-pill {
  min-width: 108px;
  padding: 11px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  text-align: left;
}

.settle-group-pill.active,
.settle-category-pill.active {
  background: rgba(255,255,255,0.92);
  color: #8f4d09;
  border-color: rgba(255,255,255,0.92);
}

.settle-group-pill-name {
  font-size: 15px;
  font-weight: 700;
}

.settle-group-pill-meta {
  font-size: 12px;
  opacity: 0.88;
}

.settle-category-pill {
  min-height: 34px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
}

.settle-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(15,23,42,0.06);
}

.settle-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--separator);
}

.settle-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--label);
}

.settle-card-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--label-2);
}

.settle-transactions,
.settle-month-group {
  display: flex;
  flex-direction: column;
}

.settle-month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 700;
  color: var(--label-2);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.settle-transaction-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  text-align: left;
}

.settle-month-group + .settle-month-group {
  border-top: 1px solid var(--separator);
}

.settle-transaction-row:not(:last-child) {
  border-bottom: 1px solid var(--separator);
}

.settle-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}

.settle-avatar-manu {
  background: linear-gradient(135deg, #7c49fd, #9d6dff);
}

.settle-avatar-sandra {
  background: linear-gradient(135deg, #9a9aa2, #7c7c84);
}

.settle-transaction-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.settle-transaction-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--label);
}

.settle-transaction-meta,
.settle-transaction-note {
  font-size: 12px;
  color: var(--label-2);
}

.settle-transaction-note {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settle-transaction-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.settle-transaction-amount {
  font-size: 15px;
  font-weight: 700;
  color: #e06d22;
}

.settle-transaction-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.settle-debt-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.settle-debt-row-action {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
}

.settle-debt-row-action:active {
  background: rgba(15,23,42,0.04);
}

.settle-debt-row-balanced {
  justify-content: center;
  color: var(--ios-green);
}

.settle-debt-person {
  font-size: 15px;
  font-weight: 600;
  color: var(--label);
}

.settle-debt-arrow {
  font-size: 18px;
  color: var(--label-2);
}

.settle-debt-right {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settle-debt-amount {
  font-size: 16px;
  font-weight: 700;
  color: #e06d22;
}

.settle-total-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
}

.settle-total-amount {
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  color: var(--label);
}

.settle-total-note {
  font-size: 13px;
  color: var(--label-2);
}

.settle-fab {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + 18px);
  transform: translateX(-50%);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(180deg, #f7a33c 0%, #ef8d22 100%);
  color: #fff;
  font-size: 34px;
  line-height: 1;
  box-shadow: 0 10px 20px rgba(239,141,34,0.22);
  z-index: 11;
}

.settle-fab:active {
  transform: translateX(-50%) scale(0.97);
}

.settle-confirm-copy {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--label);
  text-align: center;
}

.settle-sheet-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.settle-sheet-toggle-btn {
  min-height: 38px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--label-2);
  font-size: 14px;
  font-weight: 700;
}

.settle-sheet-toggle-btn.active {
  background: rgba(239,141,34,0.14);
  color: #d56f12;
}

.settle-sheet-amount {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 0 2px;
}

.settle-sheet-amount-input {
  width: 100%;
  min-height: 56px;
  border: 0;
  background: transparent;
  text-align: right;
  font-size: 44px;
  line-height: 1;
  letter-spacing: -0.04em;
  color: #e06d22;
  outline: none;
  padding: 0;
}

.settle-sheet-currency {
  font-size: 16px;
  font-weight: 700;
  color: var(--label-2);
  flex-shrink: 0;
}

.settle-sheet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.settle-sheet-grid > * {
  min-width: 0;
}

.settle-sheet-grid > :last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.settle-sheet-split {
  border: 1px solid var(--separator);
  border-radius: 14px;
  overflow: hidden;
}

.settle-sheet-split-title {
  margin: 0;
  padding: 12px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--separator);
  font-size: 12px;
  font-weight: 700;
  color: var(--label-2);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.settle-sheet-split-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}

.settle-sheet-split-row + .settle-sheet-split-row {
  border-top: 1px solid var(--separator);
}

.settle-sheet-split-person {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settle-sheet-split-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settle-sheet-split-copy span {
  font-size: 14px;
  font-weight: 600;
  color: var(--label);
}

.settle-sheet-split-copy small {
  font-size: 12px;
  color: var(--label-2);
}

.settle-sheet-split-check {
  color: #e08a1b;
  font-size: 18px;
  font-weight: 700;
}

.password-secret-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.password-secret-pill {
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--label-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.password-action-btn {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--ios-blue);
  background: rgba(0,122,255,0.09);
  font-size: 12px;
  font-weight: 700;
}

.vault-auth-actions {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
}

.module-empty-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 22px 16px;
  text-align: center;
  color: var(--label-2);
  box-shadow: var(--shadow-card);
}

/* ============================================================
   2026 Refresh
   ============================================================ */

.page-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dashboard-container,
.settle-container {
  width: min(100%, 940px);
  margin: 0 auto;
}

.dashboard-shell,
.browser-shell,
.search-shell,
.trash-shell,
.vault-shell,
.wishlist-shell,
.events-shell {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 20px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
  background: linear-gradient(145deg, rgba(255,255,255,0.98), rgba(247,249,252,0.96));
}

.hero-panel::after {
  content: '';
  position: absolute;
  inset: auto -10% -42% auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255,255,255,0.38);
  pointer-events: none;
}

.hero-panel-home {
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.92), transparent 38%),
    linear-gradient(135deg, rgba(90,200,250,0.24), rgba(255,149,0,0.16));
}

.hero-panel-files {
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.92), transparent 38%),
    linear-gradient(135deg, rgba(0,122,255,0.20), rgba(255,204,0,0.14));
}

.hero-panel-search {
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.92), transparent 38%),
    linear-gradient(135deg, rgba(90,200,250,0.18), rgba(52,199,89,0.12));
}

.hero-panel-trash {
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.92), transparent 38%),
    linear-gradient(135deg, rgba(255,149,0,0.18), rgba(255,59,48,0.12));
}

.hero-panel-passwords {
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.92), transparent 38%),
    linear-gradient(135deg, rgba(255,149,0,0.16), rgba(90,200,250,0.14));
}

.hero-panel-wishlist {
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.92), transparent 38%),
    linear-gradient(135deg, rgba(255,45,85,0.15), rgba(90,200,250,0.14));
}

.hero-panel-events {
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.92), transparent 38%),
    linear-gradient(135deg, rgba(52,199,89,0.16), rgba(90,200,250,0.12));
}

.hero-panel-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.hero-panel-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.hero-panel-kicker,
.section-kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(15, 23, 42, 0.6);
}

.hero-panel-title {
  margin: 0;
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.05;
  letter-spacing: 0;
  color: #111827;
}

.hero-panel-subtitle {
  margin: 0;
  max-width: 58ch;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(17, 24, 39, 0.68);
}

.hero-status-pill,
.section-meta-chip,
.vault-card-pill,
.event-card-pill,
.trash-days-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.hero-status-pill.is-online {
  background: rgba(52,199,89,0.16);
  color: #15803d;
}

.hero-status-pill.is-offline {
  background: rgba(255,59,48,0.14);
  color: #b42318;
}

.hero-status-pill.is-neutral {
  background: rgba(15,23,42,0.08);
  color: rgba(15,23,42,0.72);
}

.hero-status-pill.is-warn {
  background: rgba(255,149,0,0.16);
  color: #b45309;
}

.hero-metrics {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.hero-metric-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 14px 13px;
  border-radius: 18px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(255,255,255,0.65);
  min-width: 0;
}

.hero-metric-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(17, 24, 39, 0.52);
}

.hero-metric-value {
  font-size: 22px;
  line-height: 1.05;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-metric-note {
  font-size: 12px;
  color: rgba(17, 24, 39, 0.6);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-block-compact {
  gap: 12px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.section-header-tight {
  align-items: center;
}

.section-title {
  margin: 3px 0 0;
  font-size: 20px;
  line-height: 1.1;
  color: #111827;
}

.section-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-chip-btn,
.section-icon-btn,
.icon-pill-btn,
.trash-btn {
  border: 0;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, opacity 120ms ease;
}

.section-chip-btn {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(15,23,42,0.06);
  color: #111827;
  font-size: 13px;
  font-weight: 700;
}

.section-chip-btn-strong {
  background: rgba(0,122,255,0.12);
  color: var(--ios-blue);
}

.section-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(15,23,42,0.06);
  color: #111827;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.section-icon-btn svg {
  width: 18px;
  height: 18px;
}

.section-chip-btn:active,
.section-icon-btn:active,
.icon-pill-btn:active,
.trash-btn:active {
  transform: translateY(1px);
}

.module-empty-card {
  padding: 24px 20px;
  border-radius: 22px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(15,23,42,0.06);
  box-shadow: 0 16px 32px rgba(15,23,42,0.06);
}

.module-empty-card-inline {
  box-shadow: none;
  background: rgba(255,255,255,0.76);
}

.module-empty-title {
  display: block;
  font-size: 18px;
  color: #111827;
  margin-bottom: 6px;
}

.module-empty-copy {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

.quick-link-grid,
.folder-entry-grid,
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.quick-link-card,
.folder-entry-card,
.info-card {
  position: relative;
  overflow: hidden;
  min-height: 124px;
  border-radius: 22px;
  padding: 18px;
  background: rgba(255,255,255,0.94);
  border: 1px solid rgba(15,23,42,0.06);
  box-shadow: 0 8px 18px rgba(15,23,42,0.04);
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.quick-link-card::before,
.folder-entry-card::before,
.info-card::before {
  content: '';
  position: absolute;
  inset: auto -10% -40% auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
}

.quick-link-card.tone-files { background: linear-gradient(145deg, rgba(79,172,254,0.18), rgba(255,255,255,0.96)); }
.quick-link-card.tone-economy { background: linear-gradient(145deg, rgba(52,199,89,0.14), rgba(255,255,255,0.96)); }
.quick-link-card.tone-passwords { background: linear-gradient(145deg, rgba(255,149,0,0.18), rgba(255,255,255,0.96)); }
.quick-link-card.tone-wishlist { background: linear-gradient(145deg, rgba(255,45,85,0.14), rgba(255,255,255,0.96)); }
.quick-link-card.tone-events { background: linear-gradient(145deg, rgba(90,200,250,0.16), rgba(255,255,255,0.96)); }

.quick-link-icon,
.vault-card-icon,
.wish-card-status,
.event-date-badge,
.folder-entry-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quick-link-icon {
  background: rgba(255,255,255,0.84);
  color: #111827;
  font-size: 18px;
  font-weight: 800;
}

.quick-link-copy,
.folder-entry-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  margin-top: auto;
}

.quick-link-title,
.folder-entry-title,
.info-card-value,
.trash-card-title,
.vault-card-title,
.wish-card-title,
.event-card-title {
  font-size: 18px;
  color: #111827;
  line-height: 1.15;
}

.quick-link-text,
.folder-entry-text,
.info-card-note,
.trash-card-note,
.vault-card-note,
.wish-card-note,
.event-card-note {
  font-size: 13px;
  line-height: 1.45;
  color: rgba(17,24,39,0.62);
}

.quick-link-arrow {
  margin-top: auto;
  font-size: 12px;
  font-weight: 700;
  color: rgba(17,24,39,0.55);
}

.info-card-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(17,24,39,0.52);
}

.info-card-value {
  font-size: 24px;
}

.info-card-action {
  justify-content: space-between;
}

.text-btn-blue {
  align-self: flex-start;
  padding: 0;
}

.home-events-card-polished {
  border-radius: 22px;
  background: rgba(255,255,255,0.94);
  border: 1px solid rgba(15,23,42,0.06);
  box-shadow: 0 8px 18px rgba(15,23,42,0.04);
}

.home-event-row-polished {
  padding: 14px 16px;
  gap: 14px;
}

.home-event-date-card {
  width: 58px;
  min-width: 58px;
  padding: 10px 8px;
  border-radius: 16px;
  background: rgba(0,122,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.browser-shell .hero-metric-value {
  font-size: 20px;
}

.selection-bar-card,
.upload-progress-card {
  border-radius: 18px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.94);
  border: 1px solid rgba(15,23,42,0.06);
  box-shadow: 0 14px 26px rgba(15,23,42,0.05);
}

.selection-bar-card {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.upload-progress-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.folder-entry-card {
  min-height: 136px;
}

.folder-entry-icon svg {
  width: 22px;
  height: 22px;
}

.folder-entry-meta {
  margin-top: auto;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(17,24,39,0.62);
}

.folder-entry-meta span {
  font-size: 22px;
  color: #111827;
}

.crumb-strip {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.crumb-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(15,23,42,0.08);
  color: rgba(15,23,42,0.68);
  font-size: 12px;
  font-weight: 700;
}

.crumb-chip-soft {
  background: rgba(255,255,255,0.75);
}

.search-bar-wrap-polished {
  padding: 0;
  background: transparent;
  position: static;
}

.search-bar-polished {
  min-height: 56px;
  border-radius: 18px;
  padding: 0 16px;
  background: rgba(255,255,255,0.94);
  border: 1px solid rgba(15,23,42,0.06);
  box-shadow: 0 16px 30px rgba(15,23,42,0.06);
}

.search-results {
  padding: 0 0 12px;
  overflow: visible;
}

.search-group-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-result-list-polished {
  border-radius: 20px;
  background: transparent;
  box-shadow: none;
}

.search-result-item-polished {
  min-height: 72px;
  margin-bottom: 10px;
  border: 1px solid rgba(15,23,42,0.06);
  border-radius: 18px;
  background: rgba(255,255,255,0.94);
  box-shadow: 0 14px 26px rgba(15,23,42,0.05);
}

.search-result-item-polished:last-child {
  border-bottom: 1px solid rgba(15,23,42,0.06);
}

.search-result-icon-polished {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(15,23,42,0.05);
}

.search-result-open {
  font-size: 12px;
  font-weight: 700;
  color: rgba(17,24,39,0.55);
}

.trash-card-stack,
.vault-card-stack,
.wish-card-stack,
.event-card-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trash-card,
.vault-card,
.wish-card,
.event-card {
  border-radius: 22px;
  background: rgba(255,255,255,0.94);
  border: 1px solid rgba(15,23,42,0.06);
  box-shadow: 0 16px 30px rgba(15,23,42,0.06);
}

.trash-card {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px;
  align-items: center;
}

.trash-card-media {
  position: relative;
  width: 84px;
  height: 84px;
}

.trash-item-thumb,
.trash-item-icon-wrap-polished {
  width: 100%;
  height: 100%;
  border-radius: 20px;
  background: rgba(15,23,42,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.trash-item-icon-wrap-polished svg {
  width: 34px;
  height: 34px;
  color: rgba(17,24,39,0.48);
}

.trash-card-body,
.vault-card-body,
.wish-card-body,
.event-card-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.trash-card-top,
.vault-card-top,
.event-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.trash-card-meta,
.vault-card-meta,
.event-card-meta {
  font-size: 13px;
  color: rgba(17,24,39,0.6);
}

.trash-days-pill {
  background: rgba(255,149,0,0.14);
  color: #b45309;
}

.trash-card-actions,
.vault-card-actions,
.wish-card-actions,
.event-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trash-btn,
.icon-pill-btn {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: rgba(15,23,42,0.06);
  color: rgba(17,24,39,0.7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.trash-btn svg,
.icon-pill-btn svg {
  width: 18px;
  height: 18px;
}

.trash-btn-restore {
  background: rgba(52,199,89,0.14);
  color: #15803d;
}

.trash-btn-delete,
.icon-pill-btn-del {
  background: rgba(255,59,48,0.12);
  color: #b42318;
}

.icon-pill-btn-calendar {
  background: rgba(0,122,255,0.12);
  color: var(--ios-blue);
}

.icon-pill-btn-edit {
  background: rgba(0,122,255,0.12);
  color: var(--ios-blue);
}

.vault-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 14px;
  padding: 16px;
  align-items: flex-start;
}

.vault-card-icon {
  background: linear-gradient(145deg, rgba(255,149,0,0.18), rgba(0,122,255,0.14));
  color: #111827;
  font-size: 18px;
  font-weight: 800;
}

.vault-card-pill {
  min-height: 28px;
  background: rgba(15,23,42,0.07);
  color: rgba(17,24,39,0.64);
}

.vault-secret-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.vault-secret-code {
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(15,23,42,0.06);
  color: #111827;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}

.wish-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 14px;
  padding: 16px;
  align-items: center;
}

.wish-card-status {
  background: rgba(0,122,255,0.10);
  color: var(--ios-blue);
  font-size: 12px;
  font-weight: 800;
}

.wish-card-status-done {
  background: rgba(52,199,89,0.14);
  color: #15803d;
}

.wish-card-done {
  opacity: 0.72;
}

.event-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 14px;
  padding: 16px;
  align-items: flex-start;
}

.event-date-badge {
  flex-direction: column;
  gap: 2px;
  background: rgba(0,122,255,0.10);
  color: var(--ios-blue);
}

.event-date-badge-done {
  background: rgba(52,199,89,0.14);
  color: #15803d;
}

.event-date-day {
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.event-date-month {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.event-card-pill {
  min-height: 28px;
  background: rgba(0,122,255,0.12);
  color: var(--ios-blue);
}

.event-card-pill-done {
  background: rgba(52,199,89,0.14);
  color: #15803d;
}

.module-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.module-segment-scroll {
  margin-bottom: 0;
}

.module-segment-control {
  gap: 10px;
}

.module-segment-btn {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(15,23,42,0.06);
  box-shadow: 0 10px 22px rgba(15,23,42,0.05);
}

.module-segment-btn.active {
  background: rgba(0,122,255,0.12);
  color: var(--ios-blue);
}

@media (min-width: 768px) {
  .quick-link-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .folder-entry-grid,
  .info-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-panel {
    padding: 24px;
  }

  .wish-card-stack,
  .event-card-stack,
  .vault-card-stack,
  .trash-card-stack {
    gap: 14px;
  }
}

@media (max-width: 767px) {
  .hero-panel-header,
  .section-header,
  .trash-card,
  .vault-card,
  .wish-card,
  .event-card {
    grid-template-columns: 1fr;
  }

  .hero-panel-header,
  .section-header {
    align-items: flex-start;
  }

  .hero-metrics,
  .quick-link-grid,
  .folder-entry-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .quick-link-card,
  .folder-entry-card,
  .info-card {
    min-height: 0;
  }

  .settle-sheet-grid {
    grid-template-columns: 1fr;
  }

  .settle-sheet-grid > :last-child:nth-child(odd) {
    grid-column: auto;
  }

  .settle-hero-caption {
    text-align: left;
  }

  .trash-card-media {
    width: 100%;
    height: 180px;
  }

  .vault-card-actions,
  .wish-card-actions,
  .event-card-actions,
  .trash-card-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .search-result-item-polished {
    min-height: 66px;
  }
}
