.app-body {
  height: 100vh;
  overflow: hidden;
}
.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
}
.app-side {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--elev) 88%, var(--bg));
  min-width: 0;
}
.app-side-top {
  padding: 18px 16px 12px;
  display: grid;
  gap: 14px;
}
.app-new { width: 100%; justify-content: center; }
.app-history {
  flex: 1;
  overflow: auto;
  padding: 6px 10px 16px;
}
.app-hist-label {
  margin: 12px 10px 4px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}
.app-hist-label:first-child { margin-top: 4px; }
.app-hist-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  border-radius: 12px;
}
.app-hist-row:hover, .app-hist-row.is-on {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.app-hist {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 10px 8px 10px 10px;
  border-radius: 12px;
  cursor: pointer;
  display: grid;
  gap: 3px;
  min-width: 0;
}
.app-hist-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 6px;
  opacity: 0.7;
}
.app-hist-row:hover .app-hist-actions,
.app-hist-row.is-on .app-hist-actions,
.app-hist-row.is-pinned .app-hist-actions {
  opacity: 1;
}
.app-hist-act {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.app-hist-act:hover { background: rgba(232, 238, 246, 0.08); color: var(--ink); }
.app-hist-act.is-danger:hover { color: #e08a8a; }
.app-hist small {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--task);
}
.app-hist span {
  display: block;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-hist em {
  font-style: normal;
  color: var(--faint);
  font-size: 12px;
}
.app-side-foot {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.app-side-foot a { color: var(--accent); }
.app-main {
  overflow: auto;
  padding: 28px 28px 80px;
  min-height: 0;
}
.app-main.is-embed {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.career-frame {
  display: block;
  width: 100%;
  flex: 1;
  height: 100%;
  min-height: 0;
  border: 0;
  background: var(--bg);
}
.app-main-inner { width: min(920px, 100%); margin: 0 auto; }
.app-hero { margin-bottom: 28px; }
.app-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.app-card {
  appearance: none;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--elev);
  border-radius: 16px;
  padding: 18px 16px 20px;
  color: inherit;
  cursor: pointer;
  min-height: 168px;
  display: grid;
  align-content: start;
  gap: 8px;
}
.app-card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.app-card .kit { color: var(--muted); font-size: 13px; line-height: 1.4; }
.app-card h3 { font-size: 22px; font-weight: 500; }
.app-brief {
  display: grid;
  gap: 14px;
  max-width: 640px;
}
.app-brief .field textarea {
  min-height: 110px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  padding: 12px 14px;
  resize: vertical;
  outline: none;
}
.app-brief .field textarea:focus { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.app-result { display: grid; gap: 22px; }
.app-result h1 { font-size: clamp(34px, 5vw, 52px); }
.result-block {
  background: var(--elev);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px 20px 22px;
}
.result-block h2 { font-size: clamp(22px, 3vw, 30px); margin: 0 0 14px; }
.result-table { width: 100%; border-collapse: collapse; }
.result-table th, .result-table td {
  text-align: left;
  padding: 10px 8px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}
.result-table th {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  border-top: 0;
}
.result-list { display: grid; gap: 8px; padding-left: 18px; color: var(--muted); }
.result-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.result-cards article {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}
.result-cards h3 { font-size: 16px; margin-bottom: 6px; }
.result-cards p { color: var(--muted); font-size: 13px; line-height: 1.45; }
.result-steps { display: grid; gap: 0; }
.result-steps li {
  list-style: none;
  padding: 12px 0 12px 36px;
  border-top: 1px solid var(--line);
  position: relative;
}
.result-steps li::before {
  content: counter(step);
  counter-increment: step;
  position: absolute;
  left: 0;
  top: 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
}
.result-steps { counter-reset: step; }
.result-prose { color: var(--muted); line-height: 1.6; font-size: 16px; }
.app-menu {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 30;
}
@media (max-width: 840px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-side {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(320px, 88vw);
    z-index: 25;
    transform: translateX(-105%);
    transition: transform .2s ease;
  }
  .app-side.is-open { transform: none; }
  .app-menu { display: inline-flex; }
  .app-main { padding: 64px 16px 72px; }
}
