/* phase7-newchat.css — owner UX round (new chat / top bar / starters / panels). */

/* --------------------------------------------------------------------------
   New Chat Sheet
   -------------------------------------------------------------------------- */
#picker .sheet.newchat-sheet {
  max-height: min(92dvh, 700px);
  display: flex;
  flex-direction: column;
  padding: 14px 16px calc(16px + var(--safe-bottom, 0px));
  box-sizing: border-box;
}

.newchat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.newchat-sec-title {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-2, #888);
  margin: 8px 0 6px;
  user-select: none;
}

.newchat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
  max-height: 250px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 1px;
}

.newchat-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 72px;
  padding: 8px 10px;
  border-radius: var(--radius-md, 14px);
  border: 1.5px solid var(--line, rgba(125, 125, 125, 0.2));
  background: var(--surface, #fff);
  cursor: pointer;
  text-align: left;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
  box-sizing: border-box;
}

.newchat-card:active {
  transform: scale(0.98);
  background: var(--surface-2, rgba(125, 125, 125, 0.1));
}

.newchat-card.is-selected {
  border-color: var(--accent, #b45309);
  background: color-mix(in srgb, var(--accent, #b45309) 10%, var(--surface, #fff));
}

.newchat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.newchat-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink, #111);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.newchat-card-pin {
  font-size: 11px;
  flex: none;
  opacity: 0.85;
}

.newchat-card-parent {
  font-size: 11px;
  color: var(--ink-2, #666);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.newchat-card-meta {
  font-size: 10.5px;
  color: var(--ink-3, #999);
  margin-top: 4px;
}

.newchat-card-browse {
  border-style: dashed;
  background: var(--surface-2, rgba(125, 125, 125, 0.06));
}

.newchat-model-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-sm, 10px);
  border: 1px solid var(--line, rgba(125, 125, 125, 0.2));
  background: var(--surface, #fff);
  margin-bottom: 16px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease;
  box-sizing: border-box;
}

.newchat-model-row:active {
  background: var(--surface-2, rgba(125, 125, 125, 0.1));
}

.newchat-model-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2, #666);
  min-width: 0;
}

.newchat-model-left svg {
  flex: none;
}

.newchat-model-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink, #111);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.newchat-model-right {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-3, #999);
  flex: none;
}

.newchat-chevron {
  font-size: 16px;
  line-height: 1;
}

.newchat-model-row-tight {
  margin-bottom: 0;
}

.newchat-user-row {
  margin-bottom: 16px;
}

.newchat-start-btn {
  width: 100%;
  height: 48px;
  min-height: 48px;
  border-radius: var(--radius-md, 14px);
  border: none;
  background: var(--accent, #b45309);
  color: var(--on-accent, #fff);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s ease, transform 0.1s ease;
  box-sizing: border-box;
}

.newchat-start-btn:active {
  transform: scale(0.99);
  opacity: 0.9;
}

/* --------------------------------------------------------------------------
   Browse Sheet Additions (recent folder chips + path input + open/new footer)
   -------------------------------------------------------------------------- */
.p5-browse-recents {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 8px;
  margin-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}

.p5-browse-chip {
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm, 10px);
  border: 1px solid var(--line, rgba(125, 125, 125, 0.2));
  background: var(--surface, #fff);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink, #111);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  cursor: pointer;
  flex: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease;
}

.p5-browse-chip:active {
  background: var(--surface-2, rgba(125, 125, 125, 0.1));
}

.p5-browse-pin {
  font-size: 11px;
}

.p5-browse-input-row {
  margin-bottom: 8px;
}

.p5-browse-input {
  width: 100%;
  height: 40px;
  border-radius: var(--radius-sm, 10px);
  border: 1px solid var(--line, rgba(125, 125, 125, 0.2));
  background: var(--surface, #fff);
  color: var(--ink, #111);
  padding: 0 12px;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  box-sizing: border-box;
  outline: none;
}

.p5-browse-input:focus {
  border-color: var(--accent, #b45309);
}

/* Browse foot buttons (Phase 5 / Ospi) */
html.phase5 .p5-folder-sheet .p5-folder-foot .p5-folder-open-new {
  flex: 1 1 50%;
  border: 1px solid var(--accent, #b45309);
  background: var(--accent, #b45309);
  color: var(--on-accent, #FDFBF7);
}

html.phase5 .p5-folder-sheet .p5-folder-foot .p5-folder-open-new:active {
  background: color-mix(in srgb, var(--accent, #b45309) 82%, var(--ink, #231F1C));
}

html.phase5 .p5-folder-sheet .p5-folder-foot .p5-folder-open.p5-folder-open-secondary {
  flex: 1 1 35%;
  border: 1px solid var(--line, rgba(60, 48, 36, 0.12));
  background: var(--surface, #FAF6F0);
  color: var(--ink-2, #6B5F53);
}

html.phase5 .p5-folder-sheet .p5-folder-foot .p5-folder-open.p5-folder-open-secondary:active {
  background: var(--surface-2, #EAE1D2);
}
