/* Home workspace: a quiet, light canvas that keeps the cloud tools one click away. */
.home-page {
  position: relative;
  height: calc(100vh - 56px);
  min-height: 0;
  overflow: hidden;
  color: #182235;
  background: linear-gradient(135deg, #eaf3ff 0%, #f0f3ff 46%, #f6f3ff 100%);
}
.home-page::before {
  content: "";
  position: absolute;
  inset: 56px 0 0;
  pointer-events: none;
  opacity: .56;
  background-image: linear-gradient(115deg, rgba(117, 181, 255, .13), transparent 35%), linear-gradient(300deg, rgba(172, 146, 255, .12), transparent 42%);
}
.app-toolbar {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 12px;
  color: #1c2a43;
  background: rgba(249, 251, 255, .86);
  border-bottom: 1px solid rgba(128, 145, 174, .16);
  box-shadow: 0 1px 8px rgba(81, 101, 139, .04);
  backdrop-filter: blur(14px);
}
.toolbar-left, .toolbar-window-controls { display: flex; align-items: center; }
.toolbar-left { min-width: 0; gap: 5px; }
.toolbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 178px;
  margin-right: 5px;
  padding: 7px 11px 7px 7px;
  color: #1e2a3e;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid rgba(120, 139, 173, .18);
  border-radius: 18px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 4px 14px rgba(86, 105, 146, .06);
}
.toolbar-brand img { width: 24px; height: 24px; border-radius: 8px; object-fit: cover; }
.toolbar-brand b { color: #71809a; font-weight: 600; }
.toolbar-icon, .toolbar-window-icon {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: #24324a;
  border: 0;
  border-radius: 9px;
  background: transparent;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.toolbar-icon:hover, .toolbar-window-icon:hover { color: #2463df; background: rgba(66, 120, 233, .10); }
.toolbar-icon:active, .toolbar-window-icon:active { transform: scale(.94); }
.toolbar-icon svg, .toolbar-window-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.toolbar-add { flex: 0 0 32px; width: 32px; height: 32px; min-width: 32px; align-self: center; display: inline-grid; place-items: center; padding: 0; color: #1f68e4; font-size: 27px; font-weight: 300; line-height: 1; transform: none !important; }
.toolbar-add:active { transform: none !important; }
.toolbar-add span { transform: translateY(-1px); }
.toolbar-tabs {
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: min(48vw, 620px);
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}
.toolbar-tabs::-webkit-scrollbar { display: none; }
.toolbar-tab-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  flex: 0 0 auto;
  max-width: 180px;
  padding: 0 10px;
  color: #29354b;
  font-size: 12px;
  font-weight: 700;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, .76);
  box-shadow: 0 3px 10px rgba(94, 114, 153, .05);
  cursor: pointer;
}
.toolbar-tab-item:hover,
.toolbar-tab-item[aria-current="page"] {
  color: #1e3d78;
  background: rgba(232, 241, 255, .96);
}
.toolbar-tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.toolbar-tab-close {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-left: 1px;
  color: #8b98ab;
  font-size: 14px;
  line-height: 1;
  border-radius: 50%;
}
.toolbar-tab-close:hover {
  color: #d9465f;
  background: rgba(239, 102, 123, .14);
}
.tab-number { display: inline-grid; place-items: center; width: 17px; height: 17px; color: #fff; font-size: 10px; border-radius: 50%; background: #2468df; }
.toolbar-tab-number { display: inline-grid; place-items: center; width: 17px; height: 17px; color: #fff; font-size: 10px; border-radius: 50%; background: #2468df; }
.toolbar-window-controls { gap: 2px; }
.toolbar-window-icon { width: 30px; height: 30px; border-radius: 7px; }
.toolbar-window-icon svg { width: 15px; height: 15px; stroke-width: 1.9; }
.toolbar-window-icon.close:hover { color: #d9465f; background: rgba(239, 102, 123, .12); }

/* Keep the welcome page toolbar identical to the shared toolbar injected on
   mirrored tool pages. */
.app-toolbar {
  position: sticky;
  top: 0;
  z-index: 10000;
  min-height: 56px;
  background: rgba(249, 251, 255, .94);
  border-bottom: 1px solid rgba(128, 145, 174, .16);
  box-shadow: 0 1px 8px rgba(81, 101, 139, .08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(12px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.toolbar-brand { background: rgba(255, 255, 255, .86); }
.toolbar-tab-item { background: rgba(255, 255, 255, .82); }

.home-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(860px, calc(100% - 34px));
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  padding: clamp(210px, 25vh, 280px) 0 70px;
}
.home-intro { text-align: center; }
.home-intro h1 {
  margin: 0;
  color: #19243a;
  font-size: clamp(24px, 1.8vw, 28px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.25;
}
.home-intro h1 span { color: #32afea; }
.home-rotating-heading { min-height: 1.25em; }
.home-heading-lead, .home-heading-accent, #homeHeadingCopy { display: inline-block; }
.home-heading-lead { color: #19243a !important; }
.home-heading-accent { color: #32afea; }
.home-heading-accent.is-changing, #homeHeadingCopy.is-changing { animation: home-heading-change .42s ease both; }
@keyframes home-heading-change {
  0% { opacity: .2; transform: translateY(5px); }
  100% { opacity: 1; transform: translateY(0); }
}
.home-intro p { margin: 15px 0 25px; color: #8290a9; font-size: 14px; letter-spacing: .02em; }
 .prompt-box {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 46px;
  width: 100%;
  min-height: 116px;
  padding: 14px;
  border: 1px solid rgba(168, 181, 207, .31);
  border-radius: 20px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 15px 35px rgba(91, 113, 157, .16), 0 2px 4px rgba(98, 117, 158, .05);
  backdrop-filter: blur(15px);
}
.prompt-upload {
  display: grid;
  place-items: center;
  width: 58px;
  height: 76px;
  padding: 0;
  color: #6d7b95;
  border: 1px solid rgba(160, 174, 201, .24);
  border-radius: 13px;
  background: rgba(242, 246, 252, .92);
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.prompt-upload:hover { color: #2570dd; border-color: rgba(55, 122, 225, .46); background: #f0f6ff; }
.prompt-upload svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.prompt-editor { display: flex; flex-direction: column; justify-content: space-between; min-width: 0; padding: 2px 13px 0; }
.prompt-editor textarea { width: 100%; min-height: 50px; padding: 5px 0 0; color: #27344c; border: 0; outline: 0; resize: none; background: transparent; font-size: 12px; line-height: 1.5; }
.prompt-editor textarea::placeholder { color: #b7c2d3; }
.prompt-options { position: relative; display: flex; align-items: center; gap: 8px; }
.home-optional { display: none !important; }
.select-pill { position: relative; display: inline-flex; align-items: center; gap: 5px; min-height: 35px; padding: 0 10px 0 12px; color: #39465d; font-size: 12px; white-space: nowrap; border: 1px solid rgba(156, 170, 198, .24); border-radius: 18px; background: rgba(245, 247, 252, .92); transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.select-pill:hover, .select-pill:focus-within { border-color: rgba(62, 123, 229, .42); background: #fff; }
.select-pill.compact { color: #4c586d; min-height: 35px; }
.select-pill svg { width: 14px; height: 14px; flex: 0 0 14px; fill: none; stroke: #6d7b91; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.assistant-mode-control { position: relative; }
.assistant-mode-trigger { cursor: pointer; }
.assistant-mode-trigger[aria-expanded="true"] { border-color: rgba(62, 123, 229, .48); background: #fff; box-shadow: 0 4px 12px rgba(58, 106, 190, .10); }
.assistant-mode-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.assistant-mode-menu { position: absolute; z-index: 8; top: calc(100% + 8px); left: 0; width: 240px; overflow: hidden; padding: 5px; border: 1px solid rgba(150, 167, 200, .27); border-radius: 14px; background: rgba(255, 255, 255, .98); box-shadow: 0 14px 30px rgba(68, 91, 144, .20); }
.assistant-mode-item { display: flex; width: 100%; flex-direction: column; gap: 4px; padding: 10px 11px; color: #2d3850; text-align: left; border: 0; border-radius: 10px; background: transparent; transition: background .16s ease, color .16s ease; }
.assistant-mode-item:hover, .assistant-mode-item:focus-visible, .assistant-mode-item.active { color: #1e3d78; outline: 0; background: #edf4ff; }
.assistant-mode-item strong { font-size: 12px; font-weight: 700; }
.assistant-mode-item span { color: #7e8da8; font-size: 11px; line-height: 1.35; }
.setting-select { cursor: pointer; padding-right: 8px; }
.setting-select select { width: auto; min-width: 28px; max-width: 78px; padding: 0; color: inherit; font: inherit; cursor: pointer; appearance: none; border: 0; outline: 0; background: transparent; }
.setting-select span { color: #63718a; }
.ratio-select select, .resolution-select select, .count-select select { min-width: 30px; }
.vector-mode-options { display: flex; align-items: center; gap: 6px; }
.toggle-pill { display: inline-flex; align-items: center; gap: 4px; min-height: 35px; padding: 0 9px; color: #657187; font-size: 11px; white-space: nowrap; border: 1px solid rgba(156, 170, 198, .24); border-radius: 18px; background: rgba(245, 247, 252, .92); }
.toggle-pill.is-checked { color: #4b627f; background: #edf3fb; }
.toggle-pill input { width: 11px; height: 11px; margin: 0; accent-color: #3d78e8; }
.prompt-submit { align-self: end; display: grid; place-items: center; width: 38px; height: 38px; margin: 0 0 1px 0; padding: 0; color: #9ca7ba; border: 0; border-radius: 50%; background: #eff1f6; transition: color .18s ease, background .18s ease, transform .18s ease; }
.prompt-submit:hover { color: #fff; background: #3779e7; transform: translateY(-1px); }
.prompt-submit svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.prompt-status { min-height: 20px; margin: 8px 0 0; color: #5b78b2; font-size: 12px; text-align: center; transition: color .18s ease; }
.prompt-status[data-state="success"] { color: #238b72; }
.prompt-status[data-state="error"] { color: #cf4f65; }

.tool-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 13px; width: 100%; margin-top: 4px; }
.tool-card {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 62px;
  gap: 9px;
  padding: 9px 10px;
  color: #27334b;
  border: 1px solid rgba(168, 181, 207, .26);
  border-radius: 14px;
  background: rgba(255, 255, 255, .70);
  box-shadow: 0 7px 18px rgba(110, 128, 165, .07);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.tool-card.active { border-color: rgba(78, 125, 221, .34); }
.tool-card:hover { border-color: rgba(78, 125, 221, .42); background: rgba(255, 255, 255, .96); box-shadow: 0 17px 34px rgba(86, 111, 170, .23), 0 4px 10px rgba(96, 122, 180, .12); transform: translateY(-3px); }
.tool-icon { display: grid; flex: 0 0 32px; place-items: center; width: 32px; height: 32px; color: #fff; border-radius: 10px; }
.tool-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tool-icon.navy { background: #1d2b43; }.tool-icon.blue { background: #22aceb; }.tool-icon.violet { background: #6a6ff2; }.tool-icon.violet-dark { background: #5b55d9; }.tool-icon.green { background: #2fc18c; }.tool-icon.cyan { background: #2aaed9; }.tool-icon.indigo { background: #6366e9; }.tool-icon.amber { background: #f5a918; }.tool-icon.orange { background: #f08f2f; }.tool-icon.mint { background: #29bd91; }.tool-icon.purple { background: #815df0; }.tool-icon.teal { background: #24bc91; }.tool-icon.rose { background: #ec6584; }
.tool-copy { display: flex; flex-direction: column; min-width: 0; gap: 4px; }
.tool-copy strong { overflow: hidden; color: #29354a; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.tool-copy small { overflow: hidden; color: #8894a8; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.settings-fab { position: fixed; right: 14px; bottom: 14px; z-index: 5; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; color: #101827; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 10px 22px rgba(57, 77, 119, .18); transition: transform .18s ease, box-shadow .18s ease; }
.settings-fab:hover { transform: translateY(-2px); box-shadow: 0 22px 44px rgba(57, 77, 119, .23); }
.settings-fab svg { width: 18px; height: 18px; }
.settings-fab svg circle { transform: translateY(-2.15px) scale(1.45); transform-box: fill-box; transform-origin: center; }

@media (max-width: 1050px) {
  /* Keep every tool card within the first viewport on the desktop shell's
     minimum 1024px window, including the extended feature set. */
  .home-content { padding-top: clamp(170px, 20vh, 220px); padding-bottom: 36px; }
  .tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tool-card { min-height: 58px; padding: 8px 9px; gap: 8px; }
}
@media (max-width: 680px) {
  .app-toolbar { padding: 0 7px; }
  .toolbar-brand { min-width: 0; max-width: 160px; margin-right: 1px; padding-right: 7px; }
  .toolbar-brand span { overflow: hidden; text-overflow: ellipsis; }
  .toolbar-window-icon:nth-child(1), .toolbar-window-icon:nth-child(3) { display: none; }
  .toolbar-tabs { max-width: 42vw; }
  .toolbar-tab-item { padding: 0 9px; }
  .home-content { width: min(100% - 24px, 560px); padding-top: 105px; }
  .home-intro h1 { font-size: 24px; }
  .home-intro p { margin-bottom: 20px; font-size: 12px; }
  .prompt-box { grid-template-columns: 48px minmax(0, 1fr) 40px; min-height: 118px; padding: 10px; border-radius: 18px; }
  .prompt-upload { width: 48px; height: 68px; }
  .prompt-editor { padding-left: 9px; padding-right: 8px; }
  .prompt-editor textarea { font-size: 13px; }
  .prompt-options { flex-wrap: wrap; gap: 6px; padding-bottom: 2px; }
  .select-pill { padding-left: 8px; font-size: 11px; }
  .assistant-mode-menu { width: min(240px, calc(100vw - 48px)); }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .tool-card { min-height: 62px; padding: 9px; }
  .settings-fab { right: 10px; bottom: 80px; width: 32px; height: 32px; }
  .settings-fab svg { width: 17px; height: 17px; }
}
@media (max-width: 390px) {
  .toolbar-icon { width: 27px; }
  .toolbar-brand { max-width: 125px; }
  .toolbar-tabs { max-width: 34vw; }
  .home-intro h1 { font-size: 21px; }
  .tool-copy strong { font-size: 12px; }
  .tool-copy small { font-size: 10px; }
}
