.treeid-app,
.treeid-app * {
  box-sizing: border-box;
}

.treeid-app {
  width: 100%;
  max-width: 100%;
  color: #122023;
  font-family: inherit;
}

.treeid-hero-banner,
.treeid-main-card,
.treeid-result-card {
  width: 100%;
  max-width: 100%;
}

.treeid-hero-banner {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, .75fr);
  gap: 24px;
  align-items: stretch;
  padding: 30px;
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 18%, rgba(34, 211, 238, .34), transparent 30%),
    linear-gradient(135deg, #112c34 0%, #17515b 46%, #4c3a9b 100%);
  box-shadow: 0 22px 58px rgba(17, 44, 52, .2);
  color: #ffffff;
}

.treeid-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 10px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(34, 211, 238, .14);
  color: #0f8ea0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.treeid-hero-banner .treeid-kicker {
  background: rgba(255, 255, 255, .16);
  color: #d9fbff;
}

.treeid-hero-copy h2,
.treeid-card-head h3,
.treeid-result-head h3,
.treeid-limit h3,
.treeid-modal-panel h3 {
  margin: 0;
  color: inherit;
  line-height: 1.08;
}

.treeid-hero-copy h2 {
  max-width: 760px;
  font-size: clamp(34px, 5vw, 60px);
}

.treeid-hero-copy p {
  max-width: 760px;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, .86);
  font-size: 17px;
  line-height: 1.62;
}

.treeid-hero-actions,
.treeid-actions,
.treeid-result-actions,
.treeid-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.treeid-hero-actions {
  margin-top: 22px;
}

.treeid-hero-card {
  display: grid;
  align-content: center;
  gap: 14px;
  min-height: 270px;
}

.treeid-scan-orbit {
  display: grid;
  place-items: center;
  width: 164px;
  height: 164px;
  margin: 0 auto 8px;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 42px;
  background: rgba(255, 255, 255, .14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24), 0 24px 48px rgba(0, 0, 0, .18);
  backdrop-filter: blur(10px);
}

.treeid-scan-orbit img {
  width: 96px;
  height: 96px;
}

.treeid-mini-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 16px;
  background: rgba(255, 255, 255, .12);
  color: #ffffff;
}

.treeid-mini-stat strong {
  font-size: 22px;
}

.treeid-mini-stat span {
  color: rgba(255, 255, 255, .78);
  font-size: 13px;
}

.treeid-main-card,
.treeid-result-card {
  margin-top: 18px;
  padding: 24px;
  border: 1px solid rgba(16, 104, 118, .13);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 18px 52px rgba(15, 48, 55, .11);
}

.treeid-card-head,
.treeid-result-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.treeid-card-head h3,
.treeid-result-head h3 {
  font-size: 26px;
  color: #13292e;
}

.treeid-card-head p,
.treeid-result-head p {
  max-width: 430px;
  margin: 0;
  color: #597279;
  line-height: 1.5;
}

.treeid-form {
  display: grid;
  gap: 16px;
}

.treeid-upload-panel {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(0, 1fr);
  gap: 16px;
}

.treeid-upload-panel-simple {
  grid-template-columns: 1fr;
}

.treeid-preview {
  position: relative;
  height: clamp(240px, 34vw, 340px);
  min-height: 0;
  max-height: 340px;
  overflow: hidden;
  border: 2px dashed rgba(45, 212, 140, .58);
  border-radius: 20px;
  background: linear-gradient(135deg, #f2fff8, #f8fffb);
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.treeid-preview:hover {
  border-color: rgba(16, 185, 129, .88);
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, .12), 0 16px 36px rgba(15, 48, 55, .08);
  transform: translateY(-1px);
}

.treeid-dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.treeid-preview img {
  display: none;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  background: #f6fffb;
}

.treeid-preview.has-image img {
  display: block;
}

.treeid-preview.has-image {
  border-style: solid;
  border-color: rgba(16, 185, 129, .34);
  background: #f6fffb;
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, .08);
}

.treeid-preview.has-image .treeid-preview-empty {
  display: none;
}

.treeid-preview-empty {
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 0;
  padding: 20px;
  text-align: center;
  color: #587178;
}

.treeid-preview-empty span {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-bottom: 8px;
  border-radius: 20px;
  background: #dcfce7;
  color: #0f9f6e;
  font-weight: 800;
}

.treeid-preview-empty strong {
  display: block;
  color: #13292e;
  font-size: 20px;
}

.treeid-preview-empty small {
  display: block;
  margin-top: 4px;
  color: #789097;
}

.treeid-simple-actions {
  justify-content: flex-end;
}

.treeid-upload-actions {
  display: grid;
  gap: 12px;
  align-content: start;
}

.treeid-upload-btn {
  display: grid;
  gap: 4px;
  min-height: 112px;
  padding: 18px;
  border: 1px solid rgba(20, 128, 145, .16);
  border-radius: 18px;
  background: #f7fcfc;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.treeid-upload-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(20, 128, 145, .4);
  box-shadow: 0 14px 30px rgba(15, 48, 55, .09);
}

.treeid-upload-btn input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.treeid-upload-btn span {
  color: #11343b;
  font-size: 18px;
  font-weight: 800;
}

.treeid-upload-btn small {
  color: #668188;
}

.treeid-grid {
  display: grid;
  gap: 14px;
}

.treeid-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.treeid-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.treeid-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.treeid-field span {
  color: #25474f;
  font-size: 13px;
  font-weight: 800;
}

.treeid-field input,
.treeid-field select,
.treeid-field textarea,
.treeid-result-textarea {
  width: 100%;
  max-width: 100%;
  border: 1px solid rgba(20, 128, 145, .18);
  border-radius: 14px;
  background: #fbfefe;
  color: #152d33;
  font: inherit;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.treeid-field input,
.treeid-field select {
  min-height: 50px;
  padding: 0 14px;
}

.treeid-field textarea,
.treeid-result-textarea {
  padding: 14px;
  resize: vertical;
  line-height: 1.55;
}

.treeid-field input::placeholder,
.treeid-field textarea::placeholder {
  color: #9fb0b5;
}

.treeid-field input:focus::placeholder,
.treeid-field textarea:focus::placeholder {
  color: transparent;
}

.treeid-field input:focus,
.treeid-field select:focus,
.treeid-field textarea:focus,
.treeid-result-textarea:focus {
  border-color: #22c7d9;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(34, 199, 217, .14);
}

.treeid-wide {
  width: 100%;
}

.treeid-primary-btn,
.treeid-secondary-btn,
.treeid-play-link,
.treeid-report-btn,
.treeid-limit a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.treeid-primary-btn {
  background: linear-gradient(135deg, #0fb5c8, #4f46e5);
  color: #ffffff;
  box-shadow: 0 14px 24px rgba(15, 181, 200, .24);
}

.treeid-secondary-btn {
  border: 1px solid rgba(20, 128, 145, .18);
  background: #ffffff;
  color: #173941;
}

.treeid-play-link,
.treeid-limit a {
  background: #dffafd;
  color: #0f5964;
}

.treeid-report-btn {
  border: 1px solid rgba(219, 39, 119, .22);
  background: #fff1f7;
  color: #9d174d;
}

.treeid-limit,
.treeid-loader,
.treeid-error {
  margin-top: 18px;
  border-radius: 18px;
  padding: 18px;
}

.treeid-limit {
  border: 1px solid rgba(79, 70, 229, .16);
  background: #f6f5ff;
}

.treeid-limit p {
  margin: 8px 0 14px;
  color: #56636f;
}

.treeid-loader {
  position: fixed;
  z-index: 9997;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 22px;
  background: rgba(7, 24, 29, .58);
  color: #173941;
}

.treeid-loader > div:last-child {
  width: min(430px, 100%);
  padding: 24px;
  border: 1px solid rgba(34, 199, 217, .18);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .28);
}

.treeid-loader[hidden],
.treeid-limit[hidden],
.treeid-error[hidden],
.treeid-result-card[hidden],
.treeid-modal[hidden],
.treeid-download-menu[hidden] {
  display: none !important;
}

.treeid-loader-ring {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 4px solid rgba(34, 199, 217, .2);
  border-top-color: #0fb5c8;
  border-radius: 50%;
  animation: treeid-spin .8s linear infinite;
}

.treeid-loader span {
  display: block;
  margin-top: 3px;
  color: #668188;
}

.treeid-error {
  border: 1px solid rgba(220, 38, 38, .18);
  background: #fff1f2;
  color: #9f1239;
}

.treeid-result-card {
  position: fixed;
  z-index: 9998;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 18px;
  border: 0;
  border-radius: 0;
  background: rgba(7, 24, 29, .62);
  box-shadow: none;
}

.treeid-result-panel {
  width: min(1120px, 100%);
  max-height: min(860px, 94vh);
  overflow: auto;
  padding: 22px;
  border: 1px solid rgba(34, 199, 217, .16);
  border-radius: 26px;
  background:
    radial-gradient(circle at 100% 0%, rgba(34, 211, 238, .12), transparent 28%),
    #ffffff;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .32);
}

.treeid-result-head {
  align-items: center;
  margin-bottom: 18px;
}

.treeid-result-close {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid rgba(20, 128, 145, .16);
  border-radius: 999px;
  background: #f4fbfb;
  color: #173941;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.treeid-result-layout {
  display: grid;
  grid-template-columns: minmax(230px, 340px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.treeid-result-photo-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(20, 128, 145, .12);
  border-radius: 20px;
  background: #f6fffb;
}

.treeid-result-photo-card span {
  color: #0f8ea0;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.treeid-result-photo-card img {
  width: 100%;
  height: 280px;
  border-radius: 16px;
  object-fit: contain;
  background: #ffffff;
}

.treeid-result-content {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.treeid-result-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.treeid-result-summary div {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(79, 70, 229, .12);
  border-radius: 16px;
  background: linear-gradient(135deg, #f7fbff, #f8f7ff);
}

.treeid-result-summary strong,
.treeid-result-summary span {
  display: block;
}

.treeid-result-summary strong {
  overflow: hidden;
  color: #13292e;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.treeid-result-summary span {
  margin-top: 4px;
  color: #71868c;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.treeid-result-sections {
  display: grid;
  gap: 12px;
}

.treeid-section-card {
  padding: 15px 16px;
  border: 1px solid rgba(20, 128, 145, .12);
  border-left: 5px solid #0fb5c8;
  border-radius: 16px;
  background: #fbfefe;
}

.treeid-section-card h4 {
  margin: 0 0 8px;
  color: #0f5964;
  font-size: 15px;
}

.treeid-section-card p {
  margin: 0;
  color: #25474f;
  line-height: 1.58;
  white-space: pre-line;
}

.treeid-edit-box {
  border: 1px solid rgba(20, 128, 145, .12);
  border-radius: 16px;
  background: #f8fcfd;
}

.treeid-edit-box summary {
  padding: 13px 15px;
  color: #173941;
  font-weight: 900;
  cursor: pointer;
}

.treeid-result-textarea {
  min-height: 240px;
  border: 0;
  border-top: 1px solid rgba(20, 128, 145, .12);
  border-radius: 0 0 16px 16px;
  background: #ffffff;
}

.treeid-result-actions {
  position: sticky;
  bottom: -22px;
  z-index: 2;
  margin: 18px -22px -22px;
  padding: 14px 22px;
  border-top: 1px solid rgba(20, 128, 145, .12);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(10px);
}

.treeid-download {
  position: relative;
}

.treeid-download-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 0;
  min-width: 190px;
  padding: 8px;
  border: 1px solid rgba(20, 128, 145, .16);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(15, 48, 55, .18);
}

.treeid-download-menu button {
  display: block;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #173941;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.treeid-download-menu button:hover {
  background: #effbfc;
}

.treeid-status {
  min-height: 22px;
  margin-top: 10px;
  color: #0f8a5f;
  font-size: 14px;
  font-weight: 700;
}

.treeid-modal {
  position: fixed;
  z-index: 9999;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(7, 24, 29, .58);
}

.treeid-modal-panel {
  width: min(560px, 100%);
  max-height: min(760px, 92vh);
  overflow: auto;
  padding: 22px;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 26px 80px rgba(0, 0, 0, .28);
}

.treeid-modal-panel p {
  color: #597279;
  line-height: 1.5;
}

@keyframes treeid-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
  .treeid-mobile-host,
  .treeid-mobile-host.content-panel,
  .treeid-mobile-host.app-stage-panel,
  .app-stage-container.treeid-mobile-host,
  .app-stage-section.treeid-mobile-host {
    width: 100%;
    max-width: none;
    padding-left: 0;
    padding-right: 0;
  }

  .treeid-app {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding-left: 12px;
    padding-right: 12px;
    overflow-x: hidden;
  }

  .treeid-hero-banner {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 22px 16px;
    border-radius: 18px;
  }

  .treeid-hero-copy h2 {
    font-size: clamp(30px, 10vw, 42px);
  }

  .treeid-hero-copy p {
    font-size: 15px;
  }

  .treeid-hero-card {
    min-height: 0;
  }

  .treeid-scan-orbit {
    width: 126px;
    height: 126px;
    border-radius: 32px;
  }

  .treeid-scan-orbit img {
    width: 74px;
    height: 74px;
  }

  .treeid-main-card,
  .treeid-result-card {
    padding: 16px;
    border-radius: 18px;
  }

  .treeid-result-card {
    padding: 10px;
    border-radius: 0;
  }

  .treeid-result-panel {
    max-height: 94vh;
    padding: 14px;
    border-radius: 20px;
  }

  .treeid-result-layout,
  .treeid-result-summary {
    grid-template-columns: 1fr;
  }

  .treeid-result-photo-card img {
    height: 210px;
  }

  .treeid-result-actions {
    position: static;
    margin: 14px 0 0;
    padding: 0;
    border-top: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .treeid-preview {
    height: 230px;
    max-height: 230px;
  }

  .treeid-card-head,
  .treeid-result-head,
  .treeid-upload-panel,
  .treeid-grid.two,
  .treeid-grid.three {
    grid-template-columns: 1fr;
  }

  .treeid-card-head,
  .treeid-result-head {
    display: grid;
  }

  .treeid-card-head p,
  .treeid-result-head p {
    max-width: none;
  }

  .treeid-field,
  .treeid-wide,
  .treeid-field input,
  .treeid-field select,
  .treeid-field textarea,
  .treeid-actions,
  .treeid-actions button,
  .treeid-result-actions,
  .treeid-result-actions button,
  .treeid-primary-btn,
  .treeid-secondary-btn,
  .treeid-report-btn,
  .treeid-play-link,
  .treeid-limit a {
    width: 100%;
  }

  .treeid-result-actions {
    display: grid;
  }

  .treeid-download {
    width: 100%;
  }

  .treeid-download-menu {
    position: static;
    width: 100%;
    min-width: 0;
    margin-top: 8px;
  }
}
