/* Portfolio creation uses the shared Insightfolio tokens, assets and controls. */
#portfolio-workspace { margin-top: 92px; margin-bottom: 72px; }
#portfolio-workspace [hidden] { display: none !important; }
#portfolio-workspace button, #portfolio-workspace input, #portfolio-workspace select { font-family: var(--if-font-sans-serif); }
#portfolio-workspace button:focus-visible, #portfolio-workspace input:focus-visible, #portfolio-workspace select:focus-visible, #portfolio-workspace a:focus-visible { outline: 2px solid var(--if-border-focus); outline-offset: 3px; }
#portfolio-workspace .pc-heading { padding: 24px 0 32px; }
#portfolio-workspace h1 { font-size: 38px; letter-spacing: -.6px; margin-bottom: 12px; }
#portfolio-workspace .pc-heading p { color: var(--if-text-primary); font-size: 16px; margin: 0; }
#portfolio-workspace .pc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
#portfolio-workspace .pc-editor { min-width: 0; }
#portfolio-workspace .pc-label { font-size: 15px; font-weight: 700; display: block; margin-bottom: 8px; }
#portfolio-workspace .pc-region-row { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: center; margin-bottom: 24px; }
#portfolio-workspace .pc-help { font-size: 13px; color: var(--if-text-primary); opacity: .75; margin: 0; }
#portfolio-workspace .pc-select { border-radius: 31px; }
#portfolio-workspace .pc-select select { display: block; width: 100%; }
#portfolio-workspace .pc-search-heading { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 8px; flex-wrap: wrap; }
#portfolio-workspace .pc-search-heading .pc-label { margin: 0; }
#portfolio-workspace .pc-link { border: 0; padding: 0; background: none; color: var(--if-link-blue-hover); font-size: 13px; text-align: left; }
#portfolio-workspace .pc-link:hover { text-decoration: underline; text-underline-offset: 3px; }
#portfolio-workspace .pc-broker-link { color: var(--if-link-blue-hover); font-size: 13px; }
#portfolio-workspace .pc-search { display: block; position: relative; z-index: 2; }
#portfolio-workspace #search-field { font-size: 16px; padding: 18px 54px; z-index: auto; }
#portfolio-workspace #search-field:focus { box-shadow: none; }
#portfolio-workspace #search-field::-webkit-search-cancel-button { display: none; }
#portfolio-workspace #search-icon { top: 19px; pointer-events: none; }
#portfolio-workspace .pc-clear { position: absolute; right: 10px; top: 10px; width: 40px; height: 40px; border: 0; background: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
#portfolio-workspace .pc-clear img { width: 20px; height: 20px; }
#portfolio-workspace .pc-search[data-open="true"] { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
#portfolio-workspace #search-results, #portfolio-workspace #search-message { position: absolute; top: 60px; left: -1px; width: calc(100% + 2px); background: var(--if-bg-surface); border: 1px solid var(--if-border-color); border-top: 0; border-radius: 0 0 24px 24px; box-shadow: 0 8px 16px var(--if-shadow); overflow-x: hidden; max-height: 400px; }
#portfolio-workspace .pc-option { padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
#portfolio-workspace .pc-option[aria-selected="true"], #portfolio-workspace .pc-option:hover { background: var(--if-light-grey); }
#portfolio-workspace .pc-option-name { font-size: 14px; overflow-wrap: anywhere; margin: 0; }
#portfolio-workspace .pc-id { display: block; font-size: 12px; color: var(--if-text-primary); opacity: .7; overflow-wrap: anywhere; margin-top: 3px; }
#portfolio-workspace .pc-result-badge { font-size: 12px; white-space: nowrap; color: var(--if-text-secondary); }
#portfolio-workspace .pc-search-message { padding: 18px 20px; font-size: 13px; }
#portfolio-workspace .pc-search-message p { margin: 0 0 6px; }
#portfolio-workspace .pc-popular { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; min-height: 28px; }
#portfolio-workspace .pc-chip { background: var(--if-bg-surface); border: 1px solid var(--if-border-color); border-radius: 20px; padding: 3px 10px; font-size: 12px; color: var(--if-text-primary); opacity: .75; }
#portfolio-workspace .pc-chip:hover { background: var(--if-light-grey); opacity: 1; }
#portfolio-workspace .pc-holdings-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 28px 0 12px; flex-wrap: wrap; }
#portfolio-workspace h2 { font-size: 18px; margin: 0; }
#portfolio-workspace .pc-count { font: 400 13px/1.5 var(--if-font-sans-serif); opacity: .7; margin-left: 7px; }
#portfolio-workspace fieldset { padding: 0; margin: 0; border: 0; min-width: 0; }
#portfolio-workspace .pc-segment { display: flex; align-items: stretch; min-width: 0; }
#portfolio-workspace .pc-segment label { position: relative; flex: 1; min-width: 0; cursor: pointer; }
#portfolio-workspace .pc-segment input { position: absolute; width: 1px; height: 1px; opacity: 0; clip-path: inset(50%); }
#portfolio-workspace .pc-segment span { display: flex; align-items: center; justify-content: center; white-space: nowrap; height: 46px; padding: 10px 17px; font-size: 16px; border: 1px solid var(--if-border-color); background: none; }
#portfolio-workspace .pc-segment b { font-weight: 400; margin-left: 4px; }
#portfolio-workspace .pc-segment label:first-child span { border-radius: 31px 0 0 31px; }
#portfolio-workspace .pc-segment label:last-child span { border-radius: 0 31px 31px 0; margin-left: -1px; }
#portfolio-workspace .pc-segment input:checked + span { background: var(--if-anthrazit); color: var(--if-bg-surface); border-color: var(--if-anthrazit); position: relative; }
#portfolio-workspace .pc-segment input:focus-visible + span { outline: 2px solid var(--if-border-focus); outline-offset: 3px; z-index: 1; }
#portfolio-workspace .pc-mode span { height: 34px; font-size: 13px; padding: 5px 13px; }
#portfolio-workspace #mode-note { margin-bottom: 12px; }
#portfolio-workspace .pc-rows { display: grid; gap: 8px; }
#portfolio-workspace .pc-row { display: grid; grid-template-columns: minmax(0, 1fr) 94px 32px; gap: 10px; align-items: center; background: var(--if-light-grey); border-radius: 16px; padding: 16px; }
#portfolio-workspace .pc-instrument { min-width: 0; }
#portfolio-workspace .pc-name { font-size: 14px; line-height: 1.4; display: block; overflow-wrap: anywhere; }
#portfolio-workspace .pc-amount { display: flex; align-items: center; background: var(--if-bg-surface); border: 1px solid transparent; border-radius: 31px; padding-right: 12px; min-width: 0; height: 44px; gap: 2px; }
/* Keep the focus ring around the complete field, including its unit. */
#portfolio-workspace .pc-amount:focus-within { border-color: var(--if-border-focus); outline: 2px solid var(--if-border-focus); outline-offset: 0; }
#portfolio-workspace .pc-amount input { background: transparent; border: 0; width: 100%; min-width: 0; text-align: right; padding: 10px 3px 10px 10px; font-size: 16px; font-variant-numeric: tabular-nums; border-radius: 31px; color: var(--if-text-primary); }
#portfolio-workspace .pc-amount input:focus { outline: none; }
#portfolio-workspace .pc-unit { font-size: 13px; color: var(--if-text-secondary); }
#portfolio-workspace .pc-remove { width: 32px; height: 40px; border: 0; background-color: transparent; background-position: center; background-size: 20px; background-repeat: no-repeat; border-radius: 50%; }
#portfolio-workspace .pc-entry-error { grid-column: 1 / -1; font-size: 12px; color: var(--if-error-text); margin: 0; }
#portfolio-workspace .pc-empty { padding: 36px 20px; text-align: center; background: var(--if-light-grey); border-radius: 16px; font-size: 14px; }
#portfolio-workspace .pc-empty strong { display: block; font-weight: 400; margin-bottom: 7px; }
#portfolio-workspace .pc-empty p { margin: 0; opacity: .7; }
#portfolio-workspace .pc-status-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; min-height: 24px; }
#portfolio-workspace #counter { font-size: 13px; margin: 0; }
#portfolio-workspace #counter[data-state="ready"] { color: var(--if-positive); }
#portfolio-workspace #counter[data-state="error"] { color: var(--if-error-text); }
#portfolio-workspace .pc-save-error { color: var(--if-error-text); font-size: 13px; margin-top: 12px; }
#portfolio-workspace .pc-summary { background: var(--if-light-grey); border-radius: 20px; padding: 24px; min-width: 0; }
#portfolio-workspace .pc-summary h2 { margin-bottom: 20px; }
#portfolio-workspace .pc-total { font: 900 34px/1.2 var(--if-font-serif); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#portfolio-workspace .pc-total-caption { font-size: 12px; margin: 5px 0 0; opacity: .7; }
#portfolio-workspace .pc-allocation-bar { display: flex; background: var(--if-bg-surface); height: 10px; border-radius: 10px; overflow: hidden; margin: 18px 0 15px; }
#portfolio-workspace .pc-allocation-bar span { height: 100%; }
#portfolio-workspace .pc-legend { display: grid; gap: 9px; }
#portfolio-workspace .pc-legend-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
#portfolio-workspace .pc-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
#portfolio-workspace .pc-legend-row b { font-weight: 400; font-variant-numeric: tabular-nums; margin-left: auto; }
#portfolio-workspace .pc-summary hr { border: 0; background: var(--if-border-color); height: 1px; margin: 22px 0; opacity: 1; }
#portfolio-workspace .pc-report-label { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
#portfolio-workspace .pc-benefits { display: grid; gap: 9px; margin-bottom: 24px; font-size: 13px; }
#portfolio-workspace .pc-benefits > div { display: flex; align-items: center; gap: 9px; opacity: .75; }
#portfolio-workspace .pc-benefits img { width: 18px; height: 18px; flex-shrink: 0; }
#portfolio-workspace .pc-tone { margin-bottom: 16px; }
#portfolio-workspace .pc-tone legend { font-size: 14px; margin-bottom: 9px; float: none; }
#portfolio-workspace .pc-tone .pc-segment span { font-size: 14px; padding: 10px 8px; }
#portfolio-workspace .pc-analyze { min-height: 54px; width: 100%; font-size: 16px; font-weight: 700; padding: 16px 20px; border-radius: 40px; }
#portfolio-workspace .pc-analyze:disabled { opacity: .35; cursor: default; }
#portfolio-workspace .pc-button-help { font-size: 12px; text-align: center; opacity: .7; margin: 10px 0 0; }
#portfolio-workspace .pc-notice { padding: 15px 0; margin-bottom: 18px; border-bottom: 1px solid var(--if-border-color); font-size: 13px; }
#portfolio-workspace .pc-notice strong { display: block; margin-bottom: 5px; }
#portfolio-workspace .pc-notice p { margin: 0; }
#portfolio-workspace .pc-notice-actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 12px; }
#portfolio-workspace .pc-handoff { display: flex; align-items: center; gap: 24px; justify-content: space-between; background: var(--if-violett-muted); border-radius: 16px; padding: 20px 24px; font-size: 14px; margin-bottom: 28px; }
#portfolio-workspace .pc-handoff p { margin: 5px 0 0; }
#portfolio-workspace .pc-handoff > a { flex: 0 0 210px; font-size: 13px; color: var(--if-link-blue-hover); }
#portfolio-workspace .pc-unmatched { color: var(--if-warning); }
#portfolio-workspace .pc-import-hints { margin-bottom: 24px; }
#portfolio-workspace[data-mode="value"] .pc-row { grid-template-columns: minmax(0,1fr) 134px 32px; }
[data-theme="dark"] #portfolio-workspace .pc-benefits img { filter: invert(1); }
@media (max-width: 991px) {
  #portfolio-workspace .pc-layout { grid-template-columns: minmax(0,1fr) 260px; gap: 24px; }
  #portfolio-workspace .pc-summary { padding: 20px; }
  #portfolio-workspace .pc-region-row { grid-template-columns: 1fr; gap: 8px; }
  #portfolio-workspace .pc-row { grid-template-columns: minmax(0,1fr) 84px 28px; padding: 14px 12px; gap: 6px; }
  #portfolio-workspace[data-mode="value"] .pc-row { grid-template-columns: minmax(0,1fr) 122px 28px; }
}
@media (max-width: 767px) {
  #portfolio-workspace { padding: 0 24px; margin-top: 78px; margin-bottom: 40px; }
  #portfolio-workspace .pc-heading { padding: 18px 0 26px; }
  #portfolio-workspace h1 { font-size: 30px; }
  #portfolio-workspace .pc-layout { grid-template-columns: 1fr; gap: 24px; }
  #portfolio-workspace .pc-summary { padding: 22px; }
  #portfolio-workspace .pc-total { font-size: 30px; }
  #portfolio-workspace #search-field { padding-left: 48px; }
  #portfolio-workspace .pc-option { padding: 13px 16px; }
  #portfolio-workspace .pc-chip { min-height: 36px; }
  #portfolio-workspace .pc-legend { grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 22px; }
  #portfolio-workspace .pc-tone .pc-segment span { font-size: 16px; }
  #portfolio-workspace .pc-handoff { display: block; padding: 18px; }
  #portfolio-workspace .pc-handoff > a { display: inline-block; margin-top: 14px; }
}
@media (pointer: coarse) {
  #portfolio-workspace .pc-row { grid-template-columns: minmax(0,1fr) 82px 44px; }
  #portfolio-workspace .pc-remove { width: 44px; height: 44px; }
  #portfolio-workspace .pc-mode span, #portfolio-workspace .pc-chip { min-height: 44px; }
  #portfolio-workspace .pc-link { min-height: 32px; }
}
@media (max-width: 480px) {
  #portfolio-workspace[data-mode="value"] .pc-row { grid-template-columns: minmax(0,1fr) 44px; gap: 12px; }
  #portfolio-workspace[data-mode="value"] .pc-instrument { grid-column: 1 / -1; }
  #portfolio-workspace[data-mode="value"] .pc-amount { width: 100%; max-width: 190px; justify-self: end; }
  #portfolio-workspace[data-mode="value"] .pc-remove { width: 44px; height: 44px; }
}
