/* Fixed-size shell: the network only fills the inner scrolling area. */
body #plan-detail-dialog { color-scheme:light; position:fixed; inset:0; width:calc(100% - 24px); max-width:430px; max-height:calc(100dvh - 32px); margin:auto; padding:0; border:0; border-radius:24px; background:#fff9ec; color:#68442c; box-shadow:0 16px 44px #0004; overflow:hidden; font:700 13px/1.4 Arial,"Microsoft YaHei",sans-serif; }
body #plan-detail-dialog:not([open]),body #plan-detail-dialog [hidden] { display:none!important; }
#plan-detail-dialog::backdrop { background:#05101d99; }
#plan-detail-dialog *, #plan-detail-dialog *::before, #plan-detail-dialog *::after { box-sizing:border-box; }
.plan-detail-surface { position:relative; display:flex; flex-direction:column; height:min(690px,calc(100dvh - 48px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px))); padding:16px 18px; }
#plan-detail-dialog[open] > .plan-detail-surface { animation:orchard-modal-enter 160ms cubic-bezier(.2,.7,.3,1) both; }
.plan-detail-scroll { flex:1; min-height:0; overflow:auto; overscroll-behavior:contain; scrollbar-width:none; }
.plan-detail-scroll::-webkit-scrollbar { display:none; width:0; height:0; }
body #plan-detail-dialog .plan-detail-close { flex:0 0 44px; width:44px; height:44px; padding:0; border:1px solid #f0d28d; border-radius:12px; background:linear-gradient(#fff9df,#ffe6a1); color:#795032; box-shadow:inset 0 2px #fff,0 2px #edd293; font:32px/1 Arial,sans-serif; cursor:pointer; }
#plan-detail-dialog .farm-plan-detail-card { padding:14px 0 0; }
#plan-detail-dialog .farm-plan-detail-hero { display:grid; grid-template-columns:86px minmax(0,1fr); align-items:center; gap:12px; }
#plan-detail-dialog .plan-detail-image { width:86px; height:96px; object-fit:contain; }
#plan-detail-dialog .farm-plan-hero-copy { min-width:0; }
#plan-detail-dialog .farm-plan-hero-title { display:flex; justify-content:space-between; align-items:center; gap:7px; }
body #plan-detail-dialog .farm-plan-hero-title h1 { margin:0; color:#68442c; font:900 22px/1.15 "Orchard Plans","Microsoft YaHei",sans-serif; overflow-wrap:anywhere; }
#plan-detail-dialog .plan-status { position:static; display:inline-flex; width:auto; max-width:none; flex:none; padding:4px 7px; border-radius:8px; background:#28c64a; color:white; font-size:10px; }
#plan-detail-dialog .plan-status.presale { background:#ffe4a1; color:#82561d; }
#plan-detail-dialog .farm-plan-hero-rows { display:grid; gap:5px; margin-top:10px; }
#plan-detail-dialog .farm-plan-hero-rows > span { display:flex; justify-content:space-between; gap:6px; }
#plan-detail-dialog small { font-size:11px; line-height:1.3; color:#8a745a; }
#plan-detail-dialog .farm-plan-hero-rows strong { color:#197949; font-size:14px; }
#plan-detail-dialog .farm-plan-requirements { display:flex; justify-content:space-between; gap:12px; margin:12px 0; padding:10px 0; border-block:1px solid #e8dab9; }
#plan-detail-dialog .farm-plan-requirements span { min-width:0; }
#plan-detail-dialog .farm-plan-requirements span:last-child { text-align:right; }
#plan-detail-dialog .farm-plan-requirements strong,#plan-detail-dialog .farm-plan-requirements small { display:block; overflow-wrap:anywhere; }
#plan-detail-dialog .farm-plan-requirements strong { margin-top:3px; font-size:12px; }
#plan-detail-dialog .return-simulator { margin:0; padding:0; border:0; background:none; box-shadow:none; }
#plan-detail-dialog .simulator-heading { display:flex; justify-content:space-between; gap:10px; }
#plan-detail-dialog .simulator-heading > span { min-width:0; }
#plan-detail-dialog .simulator-heading > span:last-child { text-align:right; }
#plan-detail-dialog .simulator-heading small,#plan-detail-dialog .simulator-heading strong { display:block; overflow-wrap:anywhere; }
#plan-detail-dialog .simulator-heading strong { color:#197949; font-size:15px; }
body #plan-detail-dialog .investment-amount-input { width:100%; height:48px; padding:10px 12px; margin:9px 0 0; border:1px solid #d6c3a2; border-radius:12px; background:#fffdfa; color:#674228; font:800 18px/1.2 Arial,sans-serif; box-shadow:none; }
#plan-detail-dialog .quick-amounts { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:8px; }
#plan-detail-dialog .quick-amounts button { min-height:44px; border:1px solid #e2c897; border-radius:10px; background:#fff0cc; color:#79522c; font-size:12px; font-weight:800; }
#plan-detail-dialog .amount-guidance { margin:7px 0 10px; color:#8a745a; font-size:10px; }
body #plan-detail-dialog .investment-submit { width:100%; min-height:48px; margin:10px 0 0; padding:10px; border:0; border-radius:12px; background:linear-gradient(#ff9c22,#f77915); box-shadow:0 3px #c75e13; color:white; font:900 16px/1.3 "Orchard Plans","Microsoft YaHei",sans-serif; cursor:pointer; }
#plan-detail-dialog .investment-note { margin:9px 0 0; color:#8a745a; font-size:10px; line-height:1.4; }
#plan-detail-dialog .field-error { margin-top:8px; font-size:12px; color:#b43c2c; }
#plan-detail-dialog .field-error:empty { display:none; }
.plan-detail-placeholder { min-height:390px; padding:20px 0; }
.plan-detail-placeholder i { display:block; height:92px; margin:0 0 18px; border-radius:12px; background:#eee5d2; }
.plan-detail-placeholder i:nth-child(2) { height:48px; }
#plan-detail-dialog .v3-error-state { width:100%; margin:25px 0; }
body #plan-detail-dialog .v3-dialog-overlay { position:absolute; z-index:10; inset:0; display:flex; align-items:center; padding:18px; border-radius:24px; background:#fff9ec; overflow:auto; }
body #plan-detail-dialog .v3-dialog-sheet { width:100%; max-width:none; max-height:100%; margin:0; padding:0; border:0; background:transparent; box-shadow:none; overflow:auto; }
#plan-detail-dialog .v3-dialog-grabber { display:none; }
#plan-detail-dialog button:disabled { opacity:.55; cursor:default; }
#plan-detail-dialog :focus-visible { outline:2px solid #299863; outline-offset:2px; }
@media(prefers-reduced-motion:reduce) { #plan-detail-dialog[open] > .plan-detail-surface { animation:none; } }
@media(max-width:350px) { .plan-detail-surface { padding:14px; } #plan-detail-dialog .farm-plan-detail-hero { grid-template-columns:72px minmax(0,1fr); gap:8px; } #plan-detail-dialog .plan-detail-image { width:72px; } body #plan-detail-dialog .farm-plan-hero-title h1 { font-size:19px; } }
/* Isolate the dialog from the legacy page's dark/gold component variables. */
#plan-detail-dialog { --ci-copy:#68442c; --ci-muted:#8a745a; --ci-green:#197949; --ci-gold-bright:#a85217; --ci-line:#e8dab9; }
#plan-detail-dialog .v3-dialog-head { background:none; }
#plan-detail-dialog .v3-dialog-head h2 { font:900 23px/1.2 "Orchard Plans","Microsoft YaHei",sans-serif; }
#plan-detail-dialog .v3-dialog-close { width:44px; height:44px; border:1px solid #f0d28d; border-radius:12px; background:#fff0cc; color:#795032; }
#plan-detail-dialog .v3-confirm-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); }
#plan-detail-dialog .v3-confirm-metrics small { font-size:10px; }
#plan-detail-dialog .v3-confirm-metrics strong { overflow-wrap:anywhere; }
#plan-detail-dialog .simulator-heading > span:first-child strong { display:none; }
/* Two primary amounts; the estimated date is supporting text, not another tile. */
#plan-detail-dialog .plan-return-summary { margin-top:12px; padding:12px 14px; border:1px solid #eadab9; border-radius:14px; background:#fff1cb; }
#plan-detail-dialog .plan-return-profit { display:flex; align-items:baseline; justify-content:space-between; gap:12px; color:#80674c; font-size:12px; }
#plan-detail-dialog .plan-return-profit strong { color:#197949; font-size:14px; overflow-wrap:anywhere; text-align:right; }
#plan-detail-dialog .plan-return-maturity { margin-top:10px; padding-top:10px; border-top:1px solid #e8d8b3; text-align:center; }
#plan-detail-dialog .plan-return-maturity span { display:block; color:#795638; font-size:12px; }
#plan-detail-dialog .plan-return-maturity strong { display:block; margin-top:4px; color:#16734b; font:900 27px/1.15 "Orchard Plans","Microsoft YaHei",sans-serif; overflow-wrap:anywhere; }
#plan-detail-dialog .plan-return-due { margin:8px 0 0; color:#8a745a; font-size:10px; font-weight:400; line-height:1.5; text-align:center; overflow-wrap:anywhere; }
#plan-detail-dialog .plan-return-due span:last-child { white-space:nowrap; }
/* One stable shell, two panels: switching never reopens the native dialog. */
#plan-detail-dialog .my-plans-heading h2 { font-size:25px; }
#plan-detail-dialog .plans-dialog-tabs { display:grid; grid-template-columns:1fr 1fr; flex:none; gap:5px; margin:12px 0 0; padding:4px; border-radius:13px; background:#eee3ca; }
#plan-detail-dialog .plans-dialog-tabs button { min-width:0; min-height:44px; padding:8px; border:0; border-radius:10px; background:transparent; color:#82674e; font:900 14px/1.2 "Orchard Plans","Microsoft YaHei",sans-serif; overflow-wrap:anywhere; cursor:pointer; }
#plan-detail-dialog .plans-dialog-tabs button[aria-selected="true"] { background:#fff9ec; color:#674228; box-shadow:0 2px 4px #68442c18; }
#plan-detail-dialog .farm-plan-requirements, #plan-detail-dialog .investment-note { display:none; }
#plan-detail-dialog .return-simulator { margin-top:14px; }
body #plan-detail-dialog .investment-amount-input:focus, body #plan-detail-dialog .investment-amount-input:focus-visible { outline:none; border-color:#bfa27c; box-shadow:none; }
