/* RoiKib desktop composer polish — visual-only patch, 2026-10-21.
   IMPORTANT: preserve Discuz native editor, toolbar, upload controls, iframe,
   form fields, JavaScript and iframe heights. Only scoped appearance rules.
   Targets the desktop post/reply/edit page; does not apply to touch/mobile.
*/

@media screen and (min-width: 769px) {
  /* Spacious, centered post composer container. */
  body.rk-v3.pg_post #postform #ct {
    box-sizing: border-box;
    border: 1px solid #e0e7f5;
    border-radius: 20px;
    background: #ffffff;
    padding: clamp(18px, 2.4vw, 30px) !important;
    box-shadow: 0 14px 46px rgba(27, 48, 98, 0.075);
  }

  /* Keep editor panels and attachment menus free of accidental clipping. */
  body.rk-v3.pg_post #postform #ct .bm,
  body.rk-v3.pg_post #postform #editorbox,
  body.rk-v3.pg_post #postform #postbox {
    overflow: visible;
  }

  /* Modern tabs, without changing their onclick / native switching logic. */
  body.rk-v3.pg_post #postform ul.tb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 0;
    margin: 0 0 22px !important;
    padding: 7px !important;
    border: 1px solid #e7ebf6;
    border-radius: 13px;
    background: #f4f6fc;
    box-sizing: border-box;
  }
  body.rk-v3.pg_post #postform ul.tb > li {
    float: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
  }
  body.rk-v3.pg_post #postform ul.tb > li.y { margin-left: auto; }
  body.rk-v3.pg_post #postform ul.tb > li > a {
    display: inline-block;
    box-sizing: border-box;
    min-height: 38px;
    padding: 9px 15px !important;
    border: 1px solid transparent !important;
    border-radius: 10px;
    background: transparent;
    color: #506181;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3 !important;
    text-decoration: none;
    transition: color .16s ease, background .16s ease, border-color .16s ease;
  }
  body.rk-v3.pg_post #postform ul.tb > li.a > a,
  body.rk-v3.pg_post #postform ul.tb > li > a:hover {
    border-color: #dce6ff !important;
    background: #ffffff;
    color: #2952bf;
    box-shadow: 0 2px 8px rgba(38, 74, 156, .06);
  }

  /* Thread title input: unifies colors, focus and touch target size.
     Do not touch its ID, name, maxlength or validation logic. */
  body.rk-v3.pg_post #postform #subject {
    box-sizing: border-box;
    width: min(840px, 100%);
    max-width: 100%;
    min-height: 47px;
    padding: 11px 14px !important;
    border: 1px solid #cedaf0 !important;
    border-radius: 11px;
    background: #ffffff;
    color: #1d2e53;
    font-size: 17px !important;
    font-weight: 500;
    line-height: 1.45;
    box-shadow: inset 0 1px 2px rgba(25, 45, 80, .025);
    transition: border-color .15s ease, box-shadow .15s ease;
  }
  body.rk-v3.pg_post #postform #subject:focus {
    outline: none;
    border-color: #5678db !important;
    box-shadow: 0 0 0 3px rgba(64, 98, 214, .12);
  }

  /* Native Discuz WYSIWYG area. Do NOT resize #e_iframe / textarea,
     hide toolbar items, change overflow on upload popovers, or alter JS. */
  body.rk-v3.pg_post #postform .edt {
    box-sizing: border-box;
    max-width: 100%;
    border: 1px solid #dbe4f4;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 7px 22px rgba(30, 50, 100, .04);
    overflow: visible;
  }
  body.rk-v3.pg_post #postform .edt .bar,
  body.rk-v3.pg_post #postform .edt #e_controls {
    background-color: #f7f9fe;
    border-bottom-color: #e5ebf7;
    border-top-left-radius: 13px;
    border-top-right-radius: 13px;
  }
  body.rk-v3.pg_post #postform .edt .area {
    background-color: #ffffff;
  }
  body.rk-v3.pg_post #postform .edt .bbar {
    background-color: #fafbfe;
    border-top-color: #edf1f9;
    border-bottom-left-radius: 13px;
    border-bottom-right-radius: 13px;
    color: #63718b;
  }

  /* Optional settings and attachments remain normal Discuz controls. */
  body.rk-v3.pg_post #postform .exfm {
    box-sizing: border-box;
    max-width: 100%;
    border: 1px solid #e5eaf4;
    border-radius: 13px;
    background: #fafbff;
  }
  body.rk-v3.pg_post #postform .pnpost {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid #edf1f8;
  }
  body.rk-v3.pg_post #postform button#postsubmit.pnc {
    box-sizing: border-box;
    min-height: 46px;
    padding: 10px 25px !important;
    border: 1px solid #3157c9 !important;
    border-radius: 11px;
    background: #345de0 !important;
    color: white !important;
    box-shadow: 0 6px 15px rgba(52, 93, 224, .19);
    font-size: 16px !important;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
  }
  body.rk-v3.pg_post #postform button#postsubmit.pnc:hover {
    background: #274fc9 !important;
  }
  body.rk-v3.pg_post #postform button#postsubmit.pnc:focus-visible,
  body.rk-v3.pg_post #postform ul.tb > li > a:focus-visible {
    outline: 3px solid rgba(65, 102, 224, .45);
    outline-offset: 2px;
  }
}

/* Narrow desktop: keep native toolbar width & visible upload menus. */
@media screen and (min-width: 769px) and (max-width: 1024px) {
  body.rk-v3.pg_post #postform #ct { padding: 16px !important; }
  body.rk-v3.pg_post #postform ul.tb { margin-bottom: 15px !important; }
  body.rk-v3.pg_post #postform ul.tb > li > a { padding: 8px 10px !important; font-size: 13px; }
  body.rk-v3.pg_post #postform #subject { width: min(680px, 100%); }
}
