/* On Easy app — Home screen styles for oneasy-site/app/os/home.js
   (projects/oneasy/HOME-LAYOUT-SPEC.md, "The screen, top to bottom").
   Reuses the tokens already defined on :root in app/css/member.css and app/os/os.css
   (--panel, --panel-2, --ink, --dim, --rule, --accent, --pill, --radius) rather than
   redefining them. Phone-first at 390px; every tap target is at least 44px. */

.oeh-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  flex: none;
}
.oeh-top-spacer { flex: 1; }

.oeh-avatar {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: var(--pill, 999px);
  border: 1px solid var(--rule, #f4f4f714);
  background: var(--panel, #131319);
  color: var(--ink, #f4f4f7);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  touch-action: manipulation;
}
/* Desktop rail owns account (face+name bottom-left). Phone keeps this disc. */
@media (min-width: 900px) {
  .oeh-avatar { display: none !important; }
}

.oeh-icon-btn {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 0.72rem;
  border: 1px solid var(--rule, #f4f4f714);
  background: var(--panel, #131319);
  color: var(--ink, #f4f4f7);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  padding: 0;
  margin-left: 0.5rem;
  touch-action: manipulation;
}
.oeh-icon-btn svg { width: 1.25rem; height: 1.25rem; }

.oeh-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; }

.oeh-row-new .oeh-row-btn { border: 1px dashed var(--rule, #f4f4f722); cursor: pointer; }
.oeh-row-new .oeh-row-btn:hover,
.oeh-row-new .oeh-row-btn:focus-visible {
  background: #2c2c2e;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
  cursor: pointer;
}
.oeh-row-new .oeh-row-btn:hover .oeh-new-mark,
.oeh-row-new .oeh-row-btn:focus-visible .oeh-new-mark {
  border-color: #fff;
  background: #3a3a3c;
  color: #fff;
}
.oeh-row-new .oeh-row-btn:hover .oeh-row-name,
.oeh-row-new .oeh-row-btn:focus-visible .oeh-row-name { text-decoration: underline; }
.oeh-new-affordance {
  display: none;
  flex: none;
  margin-left: 0.4rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #3a3a3c;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}
.oeh-row-new .oeh-row-btn:hover .oeh-new-affordance,
.oeh-row-new .oeh-row-btn:focus-visible .oeh-new-affordance { display: inline-flex; }
.oeh-new-btn { position: relative; }
.oeh-new-tip {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  padding: 0.28rem 0.55rem;
  border-radius: 0.55rem;
  background: #2c2c2e;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 650;
  white-space: nowrap;
  box-shadow: 0 8px 24px #00000066;
  pointer-events: none;
}
.oeh-new-btn:hover .oeh-new-tip,
.oeh-new-btn:focus-visible .oeh-new-tip { display: block; }
.oeh-new-btn:hover,
.oeh-new-btn:focus-visible { cursor: pointer; background: #3a3a3c; }
.oe-home-root .oeh-row-new .oeh-row-btn:hover,
.oe-home-root .oeh-row-new .oeh-row-btn:focus-visible {
  background: #2c2c2e;
  cursor: pointer;
}
.oe-home-root .oeh-new-btn:hover,
.oe-home-root .oeh-new-btn:focus-visible {
  background: #3a3a3c;
  cursor: pointer;
}
.oeh-face.has-photo { position: relative; overflow: hidden; border-radius: 999px; }
.oeh-face.has-photo svg { display: none; }
.oeh-face-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.oeh-new-mark {
  width: 2.4rem; height: 2.4rem; min-width: 2.4rem;
  border-radius: 999px;
  border: 1px solid var(--rule, #f4f4f722);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.35rem; font-weight: 600; color: var(--ink, #f4f4f7);
  background: var(--panel-2, #1b1b22);
}

.oeh-empty {
  margin: 1rem;
  padding: 1.1rem 1rem;
  border: 1px dashed var(--rule, #f4f4f722);
  border-radius: 1rem;
  background: var(--panel, #131319);
  display: grid;
  gap: 0.55rem;
}
.oeh-empty strong { font-size: 1rem; color: var(--ink, #f4f4f7); }
.oeh-empty p { margin: 0; color: var(--dim, #9a9aa8); font-size: 0.88rem; }
.oeh-empty-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; }

/* ---------------------------------------------------------------- pinned grid */
.oeh-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem 0.5rem;
  padding: 0.5rem 1rem 1.25rem;
}
.oeh-tile { position: relative; min-width: 0; }
.oeh-tile-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  min-height: 44px;
  background: none;
  border: 0;
  color: var(--ink, #f4f4f7);
  cursor: pointer;
  font: inherit;
  padding: 0.25rem;
  touch-action: manipulation;
}
.oeh-tile-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-width: 100%;
  font-size: 0.82rem;
  line-height: 1.2;
  white-space: normal;
  overflow: hidden;
  text-align: center;
  position: relative;
  padding-right: 0;
}

/* ---------------------------------------------------------------- recent list */
.oeh-list { padding: 0 0.5rem 1rem; }
.oeh-row { position: relative; }
.oeh-row-btn {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: none;
  border: 0;
  color: var(--ink, #f4f4f7);
  cursor: pointer;
  font: inherit;
  text-align: left;
  padding: 0.55rem 0.5rem;
  border-radius: var(--radius, 1.25rem);
  touch-action: manipulation;
}
.oeh-row-btn:hover, .oeh-row-btn:focus-visible { background: var(--panel, #131319); }
.oeh-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.oeh-row-name {
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
}
.oeh-row-preview {
  font-size: 0.88rem;
  color: var(--oe-meta, #c4c4d0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.oeh-row-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 0.4rem; flex: none; }
.oeh-row-time { font-size: 0.82rem; font-weight: 550; color: var(--oe-meta, #c4c4d0); }

/* ---------------------------------------------------------------- shared: faces, dots, menus */
.oeh-face { display: inline-flex; flex: none; color: var(--oeh-face, var(--accent, #8b7cff)); --oeh-i: 0; }
.oeh-face svg { width: 100%; height: 100%; display: block; overflow: visible; }
.oeh-face .oeh-ring { fill: none; stroke: currentColor; stroke-width: 8; stroke-linecap: round; }
.oeh-face .oeh-line { fill: none; stroke: currentColor; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.oeh-face-lg { width: 5.6rem; height: 5.6rem; }
.oeh-face-md { width: 44px; height: 44px; }
.oeh-face-sm { width: 1.5rem; height: 1.5rem; }

/* Idle motion lives in living-mark.css. Home only staggers the grid/list so pins
   and rows do not sync-blink. */
.oeh-grid .oeh-tile:nth-child(1) .oeh-life { --oeh-i: 0; --oe-life-i: 0; }
.oeh-grid .oeh-tile:nth-child(2) .oeh-life { --oeh-i: 1; --oe-life-i: 1; }
.oeh-grid .oeh-tile:nth-child(3) .oeh-life { --oeh-i: 2; --oe-life-i: 2; }
.oeh-grid .oeh-tile:nth-child(4) .oeh-life { --oeh-i: 3; --oe-life-i: 3; }
.oeh-grid .oeh-tile:nth-child(5) .oeh-life { --oeh-i: 4; --oe-life-i: 4; }
.oeh-grid .oeh-tile:nth-child(6) .oeh-life { --oeh-i: 5; --oe-life-i: 5; }
.oeh-list .oeh-row:nth-child(1) .oeh-life { --oeh-i: 3; --oe-life-i: 3; }
.oeh-list .oeh-row:nth-child(2) .oeh-life { --oeh-i: 4; --oe-life-i: 4; }
.oeh-list .oeh-row:nth-child(3) .oeh-life { --oeh-i: 5; --oe-life-i: 5; }
.oeh-list .oeh-row:nth-child(4) .oeh-life { --oeh-i: 6; --oe-life-i: 6; }
.oeh-list .oeh-row:nth-child(5) .oeh-life { --oeh-i: 7; --oe-life-i: 7; }
.oeh-list .oeh-row:nth-child(6) .oeh-life { --oeh-i: 8; --oe-life-i: 8; }

.oeh-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent, #8b7cff);
  margin-left: 0.35rem;
  vertical-align: middle;
}

.oeh-more {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border: 0;
  background: transparent;
  color: var(--dim, #9a9aa8);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}
.oeh-more-row { top: 50%; transform: translateY(-50%); }

.oeh-menu-open .oeh-scroll { overflow: visible; }
.oeh-menu {
  position: absolute;
  top: 44px;
  right: 0;
  z-index: 40;
  min-width: 10.5rem;
  background: var(--panel-2, #1a1a22);
  border: 1px solid var(--rule, #f4f4f714);
  border-radius: 0.85rem;
  box-shadow: 0 8px 24px #00000066;
  overflow: hidden;
}
.oeh-menu button {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 1rem;
  background: none;
  border: 0;
  color: var(--ink, #f4f4f7);
  font: inherit;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}
.oeh-menu button:hover { background: var(--panel, #131319); }
.oeh-menu button.is-danger { color: #ff6b81; }
.oeh-menu button.is-danger:hover { background: #2a1518; }
.oeh-menu-rule {
  height: 1px;
  margin: 0.15rem 0.65rem;
  background: var(--rule, #f4f4f714);
}
.oeh-menu-label {
  display: block;
  padding: 0.55rem 1rem 0.15rem;
  color: var(--dim, #9a9aa8);
  font-size: 0.75rem;
}
.oeh-menu-input {
  display: block;
  width: calc(100% - 1.3rem);
  margin: 0.15rem 0.65rem 0.35rem;
  min-height: 44px;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--rule, #f4f4f714);
  border-radius: 0.55rem;
  background: var(--panel, #131319);
  color: var(--ink, #f4f4f7);
  font: inherit;
}

.oeh-section {
  padding: 0.85rem 0.65rem 0.3rem;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dim, #9a9aa8);
}

.oeh-hidden { margin-top: 0.5rem; padding-top: 0.35rem; border-top: 1px solid var(--rule, #f4f4f714); }
.oeh-hidden-toggle {
  width: 100%;
  min-height: 44px;
  padding: 0.45rem 0.65rem;
  background: none;
  border: 0;
  color: var(--dim, #9a9aa8);
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
}
.oeh-unhide {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  min-height: 44px;
  min-width: 44px;
  padding: 0 0.7rem;
  border: 0;
  background: none;
  color: var(--accent, #8b7cff);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

@media (min-width: 900px) {
  .oeh-grid { grid-template-columns: repeat(3, 1fr); }
}
