.pj-form {
  height: calc(100vh - 110px);
  min-height: calc(100vh - 110px);
  overflow: hidden;
}

.pj-shell {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 10px;
  min-width: 0;
}

.pj-topArea {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  gap: 8px;
}

/* grids */
.pj-grid {
  min-width: 0;
}

.pj-grid--two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pj-grid--three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pj-grid--deadline {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

/* fields */
.pj-field {
  width: 100%;
  min-width: 0;
  height: 52px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.14);
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.05));
  color: #fff;
  padding: 0 15px;
  font-size: 15px;
  font-weight: 800;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 8px 18px rgba(0,0,0,0.12);
}

.pj-field:focus {
  border-color: rgba(124,192,255,0.42);
  box-shadow: 0 0 0 3px rgba(124,192,255,0.12), 0 10px 20px rgba(38,98,175,0.18);
}

.pj-field::placeholder {
  color: rgba(255,255,255,0.82);
  font-weight: 800;
}

.pj-title {
  height: 56px;
  font-size: 17px;
  font-weight: 900;
}

.pj-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.78) 50%),
    linear-gradient(135deg, rgba(255,255,255,0.78) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) calc(50% - 3px),
    calc(100% - 13px) calc(50% - 3px);
  background-size: 7px 7px, 7px 7px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.pj-select.has-value {
  background-image: none;
  padding-right: 10px;
}

.pj-select option {
  background: #fff;
  color: #111;
}

.pj-dateField {
  color: rgba(255,255,255,0.82);
}

.pj-dateField:valid {
  color: #fff;
}

.pj-dateField::-webkit-datetime-edit {
  color: rgba(255,255,255,0.82);
}

.pj-dateField:valid::-webkit-datetime-edit {
  color: #fff;
}

.pj-tagInput {
  text-align: center;
}

/* main switch area */
.pj-primaryPane {
  min-height: 0;
  height: 100%;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.10);
  background:
    radial-gradient(420px 180px at 0% 0%, rgba(124,192,255,0.12), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03));
  box-shadow: 0 16px 34px rgba(0,0,0,0.18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.pj-compose,
.pj-detailsPane {
  width: 100%;
  min-height: 0;
}

.pj-compose {
  display: flex;
  flex-direction: column;
  padding: 10px;
  height: 100%;
}

.pj-compose.is-hidden {
  display: none !important;
}

.pj-composeMain {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}

.pj-composeBottom {
  flex: 0 0 auto;
  display: grid;
  gap: 6px;
  padding-top: 8px;
}

.pj-textarea {
  width: 100%;
  height: 100%;
  min-height: 0;
  resize: none;
  padding: 14px 15px;
  line-height: 1.42;
  font-size: 15px;
  font-weight: 700;
}

.pj-detailsPane {
  display: none;
  padding: 10px;
  gap: 8px;
  align-content: start;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.pj-detailsPane.is-visible {
  display: grid;
}

.pj-detailsPane::-webkit-scrollbar {
  width: 5px;
}

.pj-detailsPane::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.14);
  border-radius: 999px;
}

/* ensure details fully take the main pane when opened */
.pj-primaryPane.is-details .pj-compose {
  display: none !important;
}

.pj-primaryPane.is-details .pj-detailsPane {
  display: grid !important;
}

.pj-primaryPane:not(.is-details) .pj-detailsPane {
  display: none !important;
}

.pj-primaryPane:not(.is-details) .pj-compose {
  display: flex;
}

/* prefill chips */
.pj-prefillMeta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.pj-chip {
  max-width: 100%;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,0.09);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

/* add/hide more details bar - lighter and less dominant */
.pj-moreBar {
  height: 42px;
  width: 100%;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.94);
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  cursor: pointer;
  box-shadow: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  flex-shrink: 0;
}

.pj-moreBar:hover {
  background: rgba(255,255,255,0.08);
}

.pj-moreBar__icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.09);
  font-size: 15px;
  font-weight: 900;
  flex: 0 0 22px;
}

/* upload row */
.pj-uploadRow {
  min-height: 48px;
  border-radius: 14px;
  border: 1px dashed rgba(255,255,255,0.16);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.03));
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  flex-shrink: 0;
}

.pj-uploadRow:hover {
  border-color: rgba(255,255,255,0.22);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.04));
}

.pj-uploadRow.is-drag {
  border-color: rgba(111,168,255,.35);
  background: rgba(111,168,255,.08);
  box-shadow: 0 0 0 3px rgba(111,168,255,.08);
}

.pj-uploadBtn {
  height: 34px;
  min-width: 104px;
  padding: 0 14px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(124,192,255,0.24), rgba(77,143,255,0.12));
  border: 1px solid rgba(124,192,255,0.22);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(77,143,255,0.10);
  pointer-events: none;
}

#userfile {
  position: fixed !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  display: block !important;
}

.pj-fileList {
  display: none !important;
}

/* uploaded files area - compact so it never takes over phone screen */
.pj-uploadedFiles {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  max-height: 110px;
}

.pj-uploadedFiles::-webkit-scrollbar {
  width: 5px;
}

.pj-uploadedFiles::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.16);
  border-radius: 999px;
}

/* upload item */
.pj-upItem {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 8px;
  align-items: center;
  border-radius: 14px;
  padding: 8px 10px 7px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  min-width: 0;
}

.pj-upItem.is-error {
  border-color: rgba(248,113,113,0.35);
}

.pj-upItem.is-done {
  border-color: rgba(255,255,255,0.10);
}

.pj-upItem__main {
  min-width: 0;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.pj-upItem__icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 13px;
  flex: 0 0 30px;
}

.pj-upItem__metaWrap {
  min-width: 0;
}

.pj-upItem__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 800;
  color: #fff;
}

.pj-upItem__remove {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.pj-upItem__remove:hover {
  background: rgba(255,255,255,0.16);
}

.pj-upItem__meta {
  margin-top: 3px;
  font-size: 10px;
  line-height: 1.25;
  color: rgba(255,255,255,0.68);
}

/* thin modern upload progress bar */
.pj-upItem__bar {
  grid-column: 1 / -1;
  margin-top: 5px;
  height: 2px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
}

.pj-upItem__bar span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(147,197,253,.95) 0%, rgba(96,165,250,.95) 100%);
  transition: width .18s ease;
}

.pj-upItem.is-done .pj-upItem__bar span {
  background: linear-gradient(90deg, rgba(74,222,128,.95) 0%, rgba(34,197,94,.95) 100%);
}

.pj-upItem.is-error .pj-upItem__bar span {
  background: linear-gradient(90deg, rgba(248,113,113,.95) 0%, rgba(220,38,38,.95) 100%);
}

.pj-upItem__error {
  grid-column: 1 / -1;
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.3;
  color: #fca5a5;
}

/* actions */
.pj-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pj-btn {
  min-width: 0;
  height: 58px;
  border: 0;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
  text-align: center;
  padding: 0 10px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.pj-btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
  color: #fff;
}

.pj-btn--ghost {
  color: #fff;
  background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.05));
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 14px 28px rgba(0,0,0,0.22);
}

.pj-btn--soft {
  color: #fff;
  background: linear-gradient(180deg, rgba(134,145,171,0.48), rgba(89,101,128,0.30));
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 14px 28px rgba(18,26,40,0.28);
}

.pj-btn--primary {
  color: #fff;
  background: linear-gradient(180deg, rgba(135,198,255,1), rgba(90,154,255,0.86));
  border: 1px solid rgba(124,192,255,0.28);
  box-shadow: 0 16px 30px rgba(77,143,255,0.30);
}

.pj-btn.is-busy {
  opacity: .72;
}

/* errors */
.pj-error {
  min-height: 12px;
  font-size: 11px;
  line-height: 1.2;
  color: #ff8d8d;
  padding-left: 4px;
}

/* tablet */
@media (max-width: 900px) {
  .pj-form {
    height: calc(100vh - 96px);
    min-height: calc(100vh - 96px);
  }

  .pj-title {
    height: 54px;
    font-size: 16px;
  }

  .pj-field {
    height: 50px;
    font-size: 14px;
  }

  .pj-btn {
    height: 56px;
    font-size: 16px;
  }
}

/* phone */
@media (max-width: 640px) {
  .pj-form {
    height: calc(100vh - 86px);
    min-height: calc(100vh - 86px);
    overflow: hidden;
    padding: 0;
  }

  .pj-shell {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .pj-topArea {
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr) 40px 48px auto;
    gap: 7px;
  }

  .pj-grid--three,
  .pj-grid--two,
  .pj-grid--deadline {
    gap: 6px;
  }

  .pj-grid--deadline {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .pj-field {
    height: 48px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 800;
    padding: 0 10px;
  }

  .pj-title {
    height: 52px;
    font-size: 15px;
  }

  .pj-select {
    padding-right: 12px;
    background-position: calc(100% - 12px) calc(50% - 3px), calc(100% - 7px) calc(50% - 3px);
  }

  .pj-select.has-value {
    background-image: none;
    padding-right: 10px;
    text-overflow: ellipsis;
  }

  .pj-primaryPane {
    height: 100%;
    min-height: 0;
  }

  .pj-compose,
  .pj-detailsPane {
    padding: 8px;
    min-height: 0;
  }

  .pj-compose {
    height: 100%;
  }

  .pj-composeMain {
    min-height: 0;
  }

  .pj-textarea {
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 12px;
    font-size: 14px;
    line-height: 1.4;
  }

  .pj-composeBottom {
    padding-top: 8px;
  }

  .pj-moreBar {
    height: 40px;
    min-height: 40px;
    border-radius: 13px;
    font-size: 12px;
    padding: 0 12px;
  }

  .pj-moreBar__icon {
    width: 20px;
    height: 20px;
    font-size: 14px;
    flex-basis: 20px;
  }

  .pj-uploadRow {
    min-height: 48px;
    border-radius: 14px;
    padding: 7px 8px;
    gap: 8px;
    grid-template-columns: auto 1fr;
  }

  .pj-uploadBtn {
    min-width: 96px;
    height: 32px;
    font-size: 12px;
    padding: 0 10px;
    border-radius: 11px;
  }

  .pj-uploadedFiles {
    gap: 6px;
    max-height: 84px;
  }

  .pj-upItem {
    padding: 7px 8px 6px;
    border-radius: 12px;
  }

  .pj-upItem__main {
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 8px;
  }

  .pj-upItem__icon {
    width: 26px;
    height: 26px;
    border-radius: 9px;
    font-size: 11px;
    flex-basis: 26px;
  }

  .pj-upItem__name {
    font-size: 11px;
  }

  .pj-upItem__meta,
  .pj-upItem__error {
    font-size: 9px;
  }

  .pj-upItem__remove {
    width: 24px;
    height: 24px;
    font-size: 14px;
  }

  .pj-upItem__bar {
    height: 2px;
    margin-top: 4px;
  }

  .pj-actions {
    min-height: 54px;
    gap: 8px;
  }

  .pj-btn {
    height: 54px;
    border-radius: 16px;
    font-size: 14px;
    padding: 0 8px;
  }

  .pj-chip {
    font-size: 10px;
    min-height: 26px;
  }
}