.ai-launch-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin: 0 0 28px;
  padding: 20px 22px;
  border: 1px solid rgba(123, 167, 255, 0.32);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(88, 71, 210, 0.2), rgba(17, 31, 49, 0.96));
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.16);
}
.ai-launch-card h2 {
  margin: 0;
  font-size: 21px;
}
.ai-launch-card p:not(.eyebrow) {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}
.ai-launch-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(145deg, #6240e7, #8b64ff);
  font-size: 24px;
  color: white;
  box-shadow: 0 12px 32px rgba(98, 64, 231, 0.3);
}
.ai-action {
  border: 1px solid rgba(139, 100, 255, 0.42);
  border-radius: 12px;
  background: linear-gradient(135deg, #5f3cdf, #7953ee);
  color: #fff;
  font-weight: 800;
  padding: 12px 16px;
  transition: 0.18s ease;
}
.ai-action:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}
.card-actions .ai-action {
  white-space: nowrap;
}
.cora-dialog {
  width: min(1380px, calc(100% - 22px));
  height: min(900px, calc(100vh - 22px));
  max-width: none;
  max-height: none;
  padding: 0;
  border: 1px solid #33465d;
  border-radius: 24px;
  background: #080f1c;
  color: var(--text);
  box-shadow: 0 40px 140px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}
.cora-dialog::backdrop {
  background: rgba(0, 4, 10, 0.82);
  backdrop-filter: blur(8px);
}
.cora-shell {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  background: radial-gradient(circle at 88% 0, rgba(111, 79, 236, 0.16), transparent 26%), #090f1a;
}
.cora-header {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #202b3c;
  background: rgba(10, 17, 29, 0.96);
}
.cora-back {
  font-size: 18px;
}
.cora-project-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, #7250ed, #9a7aff);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
}
.cora-project-title {
  min-width: 0;
}
.cora-project-title strong,
.cora-project-title span {
  display: block;
}
.cora-project-title strong {
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cora-project-title span {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cora-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid rgba(85, 214, 190, 0.28);
  border-radius: 999px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  background: rgba(85, 214, 190, 0.06);
}
.cora-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(85, 214, 190, 0.08);
}
.cora-context {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid #1c2736;
  background: #0d1522;
}
.cora-context div {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #26374d;
  border-radius: 11px;
  background: #101b2a;
}
.cora-context small,
.cora-context strong {
  display: block;
}
.cora-context small {
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 3px;
}
.cora-context strong {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cora-frame-wrap {
  position: relative;
  min-height: 0;
  background: #f7f5f2;
}
.cora-frame-wrap iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  border: 0;
  background: #fff;
}
.cora-frame-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  text-align: center;
  padding: 28px;
  background: linear-gradient(180deg, #f9f8f7, #efedf7);
  color: #222;
}
.cora-frame-loading[hidden] {
  display: none;
}
.cora-frame-loading strong {
  font-size: 18px;
}
.cora-frame-loading span {
  max-width: 480px;
  color: #676474;
  font-size: 13px;
  line-height: 1.55;
}
.cora-frame-loading .brand-mark {
  background: linear-gradient(145deg, #7250ed, #a184ff);
  color: #fff;
}
.cora-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 9px 16px;
  border-top: 1px solid #202b3c;
  background: #0b1421;
  color: var(--muted);
  font-size: 11px;
}
.cora-footer span:last-child {
  color: var(--accent);
}
@media (max-width: 900px) {
  .ai-launch-card {
    grid-template-columns: auto 1fr;
  }
  .ai-launch-card > .primary {
    grid-column: 1/-1;
  }
  .cora-dialog {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
  }
  .cora-header {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
  }
  .cora-live {
    display: none;
  }
  .cora-context {
    grid-template-columns: 1fr 1fr;
  }
  .cora-context div:nth-child(3) {
    grid-column: 1/-1;
  }
}
@media (max-width: 620px) {
  .ai-launch-card {
    grid-template-columns: 1fr;
    padding: 18px;
  }
  .ai-launch-icon {
    width: 46px;
    height: 46px;
  }
  .cora-header {
    grid-template-columns: auto auto minmax(0, 1fr);
    padding: 10px;
  }
  .cora-header #openCoraExternal {
    grid-column: 1/-1;
    width: 100%;
  }
  .cora-context {
    grid-template-columns: 1fr;
    padding: 8px 10px;
  }
  .cora-context div:nth-child(3) {
    grid-column: auto;
  }
  .cora-footer {
    font-size: 10px;
    padding: 8px 10px;
  }
  .cora-footer span:first-child {
    display: none;
  }
  .card-actions {
    gap: 6px;
  }
  .card-actions .ai-action,
  .card-actions .primary,
  .card-actions .secondary {
    flex: 1 1 auto;
  }
}

/* CORA AI NATIVE EDITOR 20260820 */
.cora-shell {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}
.cora-native-editor {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  background: #09111d;
  overflow: hidden;
}
.cora-chat-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-right: 1px solid #202b3c;
}
.cora-chat-heading {
  padding: 16px 18px;
  border-bottom: 1px solid #202b3c;
  background: #0d1725;
}
.cora-chat-heading h3 {
  margin: 0;
  font-size: 18px;
}
.cora-chat-heading p:not(.eyebrow) {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.cora-chat-messages {
  min-height: 0;
  overflow: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: radial-gradient(circle at 80% 0, rgba(114, 80, 237, 0.08), transparent 28%), #0a1320;
  overscroll-behavior: contain;
}
.cora-msg {
  max-width: min(82%, 760px);
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid #26384e;
  background: #101d2d;
  align-self: flex-start;
}
.cora-msg.user {
  align-self: flex-end;
  background: #18334b;
  border-color: #32506d;
}
.cora-msg strong {
  display: block;
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 5px;
}
.cora-msg p {
  margin: 0;
  line-height: 1.58;
  color: #eaf1f8;
  font-size: 13px;
}
.cora-chat-form {
  display: grid;
  gap: 9px;
  padding: 12px 14px;
  border-top: 1px solid #202b3c;
  background: #0c1624;
}
.cora-chat-form select,
.cora-chat-form textarea {
  width: 100%;
  border: 1px solid #2d435e;
  border-radius: 12px;
  background: #0a1726;
  color: #fff;
  padding: 10px 12px;
  outline: none;
}
.cora-chat-form textarea {
  resize: vertical;
  min-height: 86px;
  max-height: 190px;
}
.cora-chat-form textarea:focus,
.cora-chat-form select:focus {
  border-color: #7250ed;
  box-shadow: 0 0 0 3px rgba(114, 80, 237, 0.12);
}
.cora-chat-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cora-chat-actions span {
  font-size: 10px;
  color: var(--muted);
}
.cora-editor-side {
  min-height: 0;
  overflow: auto;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 11px;
  background: #0b1522;
}
.cora-side-card {
  padding: 14px;
  border: 1px solid #26384d;
  border-radius: 15px;
  background: #101c2b;
}
.cora-side-card h3 {
  margin: 0 0 7px;
  font-size: 15px;
}
.cora-side-card p:not(.eyebrow) {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.cora-side-card button {
  width: 100%;
  margin-top: 8px;
}
.cora-native-status strong,
.cora-native-status span {
  display: block;
}
.cora-native-status strong {
  color: var(--accent);
  margin-bottom: 5px;
}
.cora-native-status span {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}
.card-actions > .ai-action,
.card-actions > .primary {
  min-width: 104px;
}
.card-actions > .primary:disabled {
  opacity: 0.4;
}
@media (max-width: 900px) {
  .cora-native-editor {
    grid-template-columns: 1fr;
  }
  .cora-chat-panel {
    border-right: 0;
  }
  .cora-editor-side {
    display: none;
  }
  .cora-chat-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .cora-chat-actions .primary {
    width: 100%;
  }
}
@media (max-width: 620px) {
  .cora-native-editor {
    height: 100%;
  }
  .cora-chat-heading {
    padding: 12px;
  }
  .cora-chat-heading p:not(.eyebrow) {
    display: none;
  }
  .cora-chat-messages {
    padding: 12px;
  }
  .cora-msg {
    max-width: 92%;
  }
  .cora-chat-form {
    padding: 10px;
  }
  .cora-header #openCoraExternal {
    grid-column: 1/-1;
    width: 100%;
  }
  .cora-context {
    display: none;
  }
  .cora-dialog {
    overflow: hidden;
  }
}

/* CORA AI EXECUTOR 20260822 */
.cora-chat-panel {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}
.cora-execution-panel {
  padding: 12px 14px;
  border-bottom: 1px solid #202b3c;
  background: linear-gradient(180deg, #0d1827, #0b1421);
}
.cora-execution-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.cora-execution-head small,
.cora-execution-head strong {
  display: block;
}
.cora-execution-head small {
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--accent);
  font-weight: 900;
}
.cora-execution-head strong {
  margin-top: 3px;
  font-size: 12px;
  color: #f1f6fb;
}
.cora-execution-head > span {
  flex: none;
  padding: 6px 9px;
  border: 1px solid #34506b;
  border-radius: 999px;
  background: #102235;
  color: #b9d7ed;
  font-size: 10px;
  font-weight: 800;
}
.cora-execution-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}
.cora-execution-steps span {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid #26384d;
  border-radius: 10px;
  background: #0b1725;
  color: #75899d;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cora-execution-steps i {
  flex: none;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #182638;
  color: #8295a7;
  font-size: 9px;
  font-style: normal;
}
.cora-execution-steps span.done {
  border-color: rgba(85, 214, 190, 0.28);
  color: #aeece1;
  background: rgba(85, 214, 190, 0.07);
}
.cora-execution-steps span.done i {
  background: rgba(85, 214, 190, 0.18);
  color: #7de6d3;
}
.cora-execution-steps span.active {
  border-color: rgba(114, 80, 237, 0.58);
  color: #fff;
  background: rgba(114, 80, 237, 0.14);
  box-shadow: 0 0 0 2px rgba(114, 80, 237, 0.08);
}
.cora-execution-steps span.active i {
  background: #7250ed;
  color: #fff;
}
.cora-execution-steps span.failed {
  border-color: rgba(255, 108, 108, 0.42);
  color: #ffd0d0;
  background: rgba(255, 78, 78, 0.08);
}
.cora-execution-steps span.failed i {
  background: #8f3434;
  color: #fff;
}
.cora-execution-report {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #1e3043;
}
.cora-execution-report > div {
  min-width: 0;
  flex: 1;
}
.cora-execution-report small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-bottom: 4px;
}
.cora-execution-report p {
  margin: 0;
  color: #dce8f2;
  font-size: 10px;
  line-height: 1.45;
  white-space: normal;
  word-break: break-word;
}
.cora-execution-report button {
  width: auto;
  min-width: 174px;
  margin: 0;
}
.danger-soft {
  border-color: rgba(255, 122, 122, 0.28) !important;
  color: #ffc1c1 !important;
  background: rgba(121, 37, 37, 0.12) !important;
}
.danger-soft:hover {
  background: rgba(151, 43, 43, 0.2) !important;
}
@media (max-width: 900px) {
  .cora-execution-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .cora-execution-panel {
    padding: 10px 12px;
  }
  .cora-execution-report {
    align-items: stretch;
    flex-direction: column;
  }
  .cora-execution-report button {
    width: 100%;
  }
}
@media (max-width: 620px) {
  .cora-execution-head {
    margin-bottom: 8px;
  }
  .cora-execution-steps {
    display: flex;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .cora-execution-steps::-webkit-scrollbar {
    display: none;
  }
  .cora-execution-steps span {
    flex: 0 0 auto;
    padding: 6px 8px;
  }
  .cora-execution-panel {
    padding: 8px 10px;
  }
  .cora-execution-report {
    margin-top: 8px;
    padding-top: 8px;
  }
  .cora-execution-report p {
    font-size: 9px;
  }
  .cora-chat-messages {
    min-height: 120px;
  }
}

/* CORA PWA MOBILE LAYOUT FIX 20260822 */
@media (max-width: 620px) {
  .cora-dialog {
    width: 100vw;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100dvh;
    margin: 0;
    inset: 0;
    border: 0;
    border-radius: 0;
    padding: 0;
    overflow: hidden;
  }
  .cora-shell {
    width: 100%;
    height: 100dvh;
    min-width: 0;
    overflow: hidden;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }
  .cora-context {
    display: none;
  }
  .cora-native-editor {
    width: 100%;
    height: auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    display: block;
  }
  .cora-chat-panel {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    border: 0;
    display: grid;
    grid-template-rows: auto auto minmax(120px, 1fr) auto;
    overflow: hidden;
  }
  .cora-chat-heading,
  .cora-execution-panel,
  .cora-chat-messages,
  .cora-chat-form {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
  }
  .cora-header {
    grid-template-columns: auto auto minmax(0, 1fr);
    gap: 9px;
    padding: 10px 12px;
  }
  .cora-project-title {
    min-width: 0;
    overflow: hidden;
  }
  .cora-project-title strong,
  .cora-project-title span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .cora-header #openCoraExternal {
    grid-column: 1/-1;
    width: 100%;
    min-width: 0;
    margin: 0;
  }
  .cora-execution-panel {
    padding: 9px 10px;
  }
  .cora-execution-head {
    align-items: flex-start;
    gap: 8px;
  }
  .cora-execution-head > div {
    min-width: 0;
  }
  .cora-execution-head strong {
    overflow-wrap: anywhere;
  }
  .cora-execution-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    padding: 0;
  }
  .cora-execution-steps span {
    min-width: 0;
    width: 100%;
    padding: 7px 8px;
    white-space: normal;
    line-height: 1.18;
    overflow: visible;
    text-overflow: clip;
  }
  .cora-chat-messages {
    padding: 10px;
    gap: 10px;
    overscroll-behavior: contain;
    overflow-y: auto;
  }
  .cora-msg,
  .cora-msg.user {
    box-sizing: border-box;
    max-width: 88%;
    min-width: 0;
    overflow: hidden;
  }
  .cora-msg p {
    overflow-wrap: anywhere;
    word-break: normal;
  }
  .cora-chat-form {
    box-sizing: border-box;
    padding: 10px;
    gap: 8px;
  }
  .cora-chat-form select,
  .cora-chat-form textarea,
  .cora-chat-actions,
  .cora-chat-actions .primary {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }
  .cora-chat-form textarea {
    min-height: 96px;
    max-height: 150px;
    resize: none;
    overflow-y: auto;
  }
  .cora-footer {
    min-height: 34px;
    padding: 8px 10px;
  }
  .cora-footer span:last-child {
    margin-left: auto;
  }
}
