/* home.css — layout of the Home page (home.js). Colours, radii and shadows
 * come from the shared classes in ui.css (.ui-panel, .btn-primary,
 * .btn-ghost) and the tokens in base.css, so both themes apply as is. */

.home-panel {
  display: none;
  flex: 1;
  overflow-y: auto;
}
.home {
  /* Width, centring and padding come from .page and .home-panel (page.css). */
  display: flex; flex-direction: column; gap: 20px;
}

/* Greeting, headline and description */
.home-hero { display: flex; flex-direction: column; gap: 8px; }
.home-hero[hidden] { display: none; }
.home-greeting {
  margin: 0;
  color: var(--accent);
  font-size: 13px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
}
.home-headline {
  /* Size, weight and gradient come from .page-title.hero (page.css). */
  margin: 0;
  overflow-wrap: anywhere;
}
.home-description { margin: 0; max-width: 640px; color: var(--text-secondary); font-size: 16px; line-height: 1.5; }
.home-description[hidden] { display: none; }

/* The ask box: a gradient border, attach and Ask inside it */
.home-ask {
  position: relative;
  display: flex; flex-direction: column;
  margin-top: 8px;
  padding: 8px;
  border-radius: 22px;
  background: var(--glass-bg);
  box-shadow: var(--ask-shadow), var(--glass-highlight);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
.home-ask::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--ask-ring);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.home-ask:focus-within { box-shadow: var(--ask-shadow), var(--field-focus-ring); }
.home-ask-input {
  width: 100%;
  min-height: 92px;
  resize: none;
  box-sizing: border-box;
  padding: 14px 16px 6px;
  border: 0; outline: 0;
  background: transparent;
  color: var(--field-text);
  font: inherit; font-size: 17px; line-height: 1.5;
}
.home-ask-input::placeholder { color: var(--field-placeholder); }
.home-ask-files { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 12px; }
.home-ask-files[hidden] { display: none; }
.home-ask-file {
  display: inline-flex; align-items: center; gap: 4px;
  max-width: 100%;
  padding: 2px 2px 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--chip-bg);
  color: var(--text-secondary);
  font-size: 13px;
}
.home-ask-file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-ask-file-remove.btn-ghost { padding: 2px 8px; min-height: 0; font-size: 12px; }
.home-ask-bar { display: flex; align-items: center; gap: 8px; padding: 4px 6px 2px; }
.home-attach.btn-ghost { padding: 8px; border-radius: var(--radius-sm); }
.home-ask-note { flex: 1; min-width: 0; color: var(--error); font-size: 13px; }
.home-ask-note:empty { visibility: hidden; }
.home-ask-bar .btn-primary { min-width: 88px; }

/* Starter prompts: three cards side by side */
.home-starters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.home-starters[hidden] { display: none; }
.home-starter.ui-panel {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font: inherit; font-size: 14px; line-height: 1.45;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.home-starter.ui-panel:hover { border-color: var(--card-border-hover); }
.home-starter.ui-panel:focus-visible { border-color: var(--accent); }
.home-starter-label {
  color: var(--text-dim);
  font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
}

/* Tiles: four in a row, two by two on narrow screens. Each number has its colour. */
.home-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 12px; }
.home-tile {
  display: flex; flex-direction: column;
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid;
  color: var(--text);
  text-decoration: none;
}
.home-tile:hover, .home-tile:focus-visible { border-color: var(--accent); }
.home-tile-label {
  color: var(--text-dim);
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
}
.home-tile-count { margin-top: 2px; font-size: 32px; font-weight: 800; line-height: 1.15; letter-spacing: -0.03em; }
.home-tile-detail { color: var(--text-secondary); font-size: 13px; }
.home-tile[data-tile="today"] .home-tile-count { color: var(--tone-violet-text); }
.home-tile[data-tile="week"] .home-tile-count { color: var(--text); }
.home-tile[data-tile="memories"] .home-tile-count { color: var(--tone-info-text); }
.home-tile[data-tile="schedules"] .home-tile-count { color: var(--tone-warning-text); }

/* Two columns: recent conversations, and what the workspace can use */
.home-columns {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px;
  margin-top: 16px;
  align-items: start;
}
.home-columns > section { min-width: 0; }
.home-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.home-section-head h2 { margin: 0; color: var(--text); font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.home-uses-count {
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--tone-neutral-bg);
  box-shadow: inset 0 0 0 1px var(--tone-neutral-ring);
  color: var(--tone-neutral-text);
  font-size: 12px; font-weight: 800;
}

.home-recent-box { display: flex; flex-direction: column; padding: 6px; border: 1px solid; }
.home-recent-list { display: flex; flex-direction: column; }
/* The list ends with the link to the Conversations page, as in the sidebar. */
.home-show-all {
  margin-top: 2px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  color: var(--accent);
  font-size: 14px; font-weight: 700;
  text-decoration: none;
}
.home-show-all:hover, .home-show-all:focus-visible { background: var(--chip-bg); }
.home-recent-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
}
.home-recent-row:hover, .home-recent-row:focus-visible { background: var(--chip-bg); }
.home-recent-row:hover .home-recent-title { color: var(--accent); }
.home-recent-title { min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-recent-time { flex-shrink: 0; color: var(--text-dim); font-size: 12px; }
.home-recent-empty { margin: 0; padding: 10px 12px; color: var(--text-dim); font-style: italic; }

.home-uses-panel { padding: 14px 18px; border: 1px solid; }
.home-uses-head {
  margin: 0 0 6px;
  color: var(--text-dim);
  font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
}
.home-uses-list + .home-uses-empty + .home-uses-head { margin-top: 14px; }
.home-uses-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.home-uses-list:empty { display: none; }
.home-uses-item {
  max-width: 100%;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--chip-bg);
  color: var(--text-secondary);
  font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.home-uses-empty { margin: 0; color: var(--text-dim); font-size: 13px; }
.home-uses-empty[hidden] { display: none; }

@media (max-width: 1000px) {
  .home-columns { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .home-panel { padding: 20px 12px max(20px, env(safe-area-inset-bottom)); }
  .home { gap: 16px; }
  .home-headline { font-size: 28px; }
  .home-description { font-size: 15px; }
  .home-ask { border-radius: 18px; }
  .home-ask-input { font-size: 16px; padding: 10px 10px 4px; }
  .home-starters { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .home-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
  .home-tile { padding: 12px 14px; }
  .home-tile-count { font-size: 26px; }
  .home-columns { gap: 20px; margin-top: 4px; }
}
