/* 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-activity-btn { position: relative; }
.oeh-activity-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid var(--bg, #09090b);
  border-radius: 999px;
  background: #ff5c72;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}

.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.is-active .oeh-row-btn {
  background: color-mix(in srgb, var(--accent, #8b7cff) 9%, transparent);
  box-shadow: inset 3px 0 0 var(--accent, #8b7cff);
}
.oeh-row.is-active .oeh-row-name { color: #fff; }
.oeh-tile.is-active .oeh-tile-btn {
  border-radius: 0.9rem;
  background: color-mix(in srgb, var(--accent, #8b7cff) 8%, transparent);
}
.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-presence {
  min-height: 1rem;
  color: var(--oe-meta, #c4c4d0);
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1;
}
.oeh-presence.is-needs_you { color: #ff8aa0; }
.oeh-presence.is-thinking,
.oeh-presence.is-listening { color: color-mix(in srgb, var(--accent, #8b7cff) 72%, white); }
.oeh-row:has(.oeh-face[data-state="needs_you"]) .oeh-row-preview { color: #ff8aa0; font-weight: 650; }
.oeh-row:has(.oeh-face[data-state="thinking"]) .oeh-row-preview,
.oeh-row:has(.oeh-face[data-state="listening"]) .oeh-row-preview { color: var(--ink, #f4f4f7); }
.oeh-row-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 0.4rem; flex: none; }
/* Resting row has no clock. The time sits out of flow on the right edge and
   paints only for a fine pointer there (or keyboard focus). Touch stays blank. */
.oeh-row-time {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0.5rem;
  width: min(46%, 9rem);
  height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  box-sizing: border-box;
  margin: 0;
  padding: 0.7rem 0 0 0.85rem;
  font-size: 0.82rem;
  font-weight: 550;
  line-height: 1.25;
  color: transparent;
  background: none;
  pointer-events: none;
  white-space: nowrap;
}
.oeh-row:has(.oeh-dot) .oeh-row-time { padding-right: 1rem; }
@media (hover: hover) and (pointer: fine) {
  .oeh-row-time { pointer-events: auto; }
  .oeh-row:hover .oeh-row-btn { background: var(--panel, #131319); }
  .oeh-row-time:hover,
  .oeh-row:has(.oeh-more:hover) .oeh-row-time,
  .oeh-row:has(.oeh-row-btn:focus-visible) .oeh-row-time,
  .oeh-row:has(.oeh-more:focus-visible) .oeh-row-time {
    color: var(--oe-meta, #c4c4d0);
    background-image: linear-gradient(90deg, transparent, var(--panel, #131319) 34%);
    background-repeat: no-repeat;
    background-size: 100% 1.25em;
    background-position: right 0.7rem;
  }
}

/* ---------------------------------------------------------------- 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-body { fill: currentColor; }
.oeh-face .oeh-eyes { fill: none; stroke: #0a0a0e; stroke-width: 6; stroke-linecap: round; }
.oeh-face .oeh-signal-plate { fill: #0a0a0e; opacity: .16; }
.oeh-face .oeh-line { fill: none; stroke: #0a0a0e; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; opacity: .76; }
.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;
  z-index: 3;
  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-x: hidden;
  overflow-y: auto;
}
.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;
  max-height: calc(100dvh - 1rem);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.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); }
}

/* v229 qualification: desktop rail is navigation, so pinned identities stay compact.
   Phone retains the larger touch-first faces. */
@media (min-width: 900px) {
  .oe-home-root .oeh-grid { gap: 4px 8px; padding: 8px 14px 6px; }
  .oe-home-root .oeh-tile { min-height: 88px; }
  .oe-home-root .oeh-tile-btn { gap: 4px; padding: 2px; }
  .oe-home-root .oeh-face-lg { width: 54px; height: 54px; }
  .oe-home-root .oeh-tile-name { font-size: 14px; line-height: 17px; }
}
