/* Order sheet hierarchy. Loaded after styles.css; scoped to order presentations. */
.orders-page-head {
  flex-wrap: wrap;
}

.orders-page-head > .flow-actions {
  flex-shrink: 0;
}

.today-order-card .today-order-heading {
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.today-order-card .today-order-heading > div {
  min-width: 0;
}

.today-order-card .today-order-heading h2 {
  margin: 0 0 5px;
  font-size: 20px;
  line-height: 1.45;
  letter-spacing: -.5px;
  overflow-wrap: anywhere;
}

.today-order-card .today-order-heading p {
  margin: 0;
  line-height: 1.6;
}

.today-order-card .today-order-heading > .badge {
  flex-shrink: 0;
  margin-top: 3px;
}

.order-decision-summary {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 12px;
  margin: 0 0 20px;
}

.order-decision {
  min-width: 0;
  padding: 20px;
  border: 1px solid #dde4db;
  border-radius: 12px;
  background: #f5f7f3;
  color: #55645b;
}

.order-decision:only-child {
  grid-column: 1 / -1;
}

.order-decision .decision-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 10px;
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
}

.order-decision .decision-label > span {
  padding: 2px 7px;
  border: 1px solid #e4ceab;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  background: #fffaf2;
}

.order-decision > strong {
  display: block;
  font-size: 25px;
  font-weight: 750;
  line-height: 1.4;
  letter-spacing: -.65px;
  overflow-wrap: anywhere;
}

.order-decision > p {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.order-decision.has-buy {
  border-color: #79ab90;
  background: #eaf5ee;
  color: #1b5d3f;
  box-shadow: inset 4px 0 #347955;
}

.order-decision.has-sell {
  border-color: #d7b38d;
  background: #fff4e9;
  color: #85501f;
  box-shadow: inset 4px 0 #b57a34;
}

.order-decision.decision-pending {
  border-color: #e3cda9;
  background: #fff6e7;
  color: #805723;
}

.order-decision.decision-error {
  border-color: #e5bfb4;
  background: #fff2ec;
  color: #8b4230;
}

.today-pending {
  border: 1px solid #dfe5da;
  background: #f3f6ef;
  color: var(--ink);
}

.today-pending p {
  color: #586b5e;
}

.today-order-card .order-history {
  padding: 0;
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8faf6;
}

.today-order-card .order-history > summary {
  padding: 15px 17px;
  font-size: 13px;
  font-weight: 600;
}

.history-readonly {
  display: inline-block;
  margin-left: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.today-order-card .order-history > div {
  padding: 0 15px 15px;
}

@media (max-width: 620px) {
  .orders-page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }

  .orders-page-head .flow-actions {
    flex-wrap: nowrap;
  }

  .orders-page-head .button {
    flex: 1;
  }

  [data-screen="orders"] .today-pending {
    padding: 17px;
  }

  .today-order-card .today-order-heading {
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 16px;
  }

  .today-order-card .today-order-heading h2 {
    font-size: 18px;
  }

  .order-decision-summary {
    grid-template-columns: 1fr;
    gap: 9px;
    margin-bottom: 17px;
  }

  .order-decision {
    padding: 16px;
  }

  .order-decision > strong {
    font-size: 23px;
  }

  .order-decision.no-sell,
  .order-decision.has-sell {
    padding: 13px 16px;
  }

  .order-decision.no-sell > strong,
  .order-decision.has-sell > strong {
    font-size: 20px;
  }

  .order-decision.no-sell .decision-label,
  .order-decision.has-sell .decision-label {
    margin-bottom: 4px;
  }

  .order-decision.no-sell > p,
  .order-decision.has-sell > p {
    margin-top: 5px;
  }
}

.order-presentation {
  container-type: inline-size;
  min-width: 0;
  font-size: 14px;
  line-height: 1.6;
}

.order-presentation .sheet-heading h3 {
  margin: 0 0 5px;
  font-size: 21px;
  line-height: 1.4;
  letter-spacing: -.5px;
}

.order-presentation .sheet-heading p {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--muted);
}

.order-presentation .sheet-session {
  margin: 0 0 19px;
}

.order-presentation .sheet-session p {
  gap: 7px 14px;
  margin: 5px 0;
  align-items: baseline;
}

.order-presentation .sheet-session p > span {
  min-width: 58px;
  font-size: 12px;
}

.order-presentation .sheet-session strong {
  font-size: 14px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.order-presentation .sheet-session .sheet-time-change {
  font-size: 12px;
  color: var(--muted);
}

.order-presentation .sheet-block {
  margin: 0 0 20px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  min-width: 0;
}

.order-presentation .sheet-block-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 17px;
}

.order-presentation .sheet-block-heading h4,
.order-presentation .sheet-block h4 {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 700;
}

.order-presentation .sheet-block-heading > small {
  padding: 3px 9px;
  border-radius: 6px;
  background: #eef1ed;
  color: #5b6d65;
  font-size: 11px;
  line-height: 1.5;
  white-space: nowrap;
}

.order-presentation .sheet-market {
  padding: 15px 18px;
  background: #f6f8f5;
  border-color: #edf0eb;
}

.order-presentation .sheet-market h4 {
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--muted);
}

.order-presentation .sheet-market-values {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
}

.order-presentation .sheet-market-values p {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 12px;
  align-items: baseline;
  min-width: 0;
}

.order-presentation .sheet-market-values p > span:first-child {
  font-size: 12px;
  color: #586a61;
}

.order-presentation .sheet-market-values p > strong {
  font-size: 14px;
  font-weight: 650;
}

.order-presentation .sheet-market-values p > small {
  grid-column: 1 / -1;
  font-size: 11px;
  color: var(--muted);
}

.order-presentation .sheet-money {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  max-width: 100%;
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
}

.order-presentation .sheet-money strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.35px;
  overflow-wrap: anywhere;
}

.order-presentation .sheet-money small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.6;
}

.order-presentation .sheet-market .sheet-money {
  flex-direction: row;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px 7px;
}

.order-presentation .sheet-market .sheet-money strong {
  font-size: 15px;
  font-weight: 650;
}

.order-presentation .sheet-market .sheet-money small {
  font-size: 11px;
}

.order-presentation .sheet-account {
  background: #fff;
}

.order-presentation .sheet-account-values {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1.1fr;
  gap: 0;
  align-items: stretch;
}

.order-presentation .sheet-account-values > p {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 1px 20px;
  border-left: 1px solid var(--line);
}

.order-presentation .sheet-account-values > p:first-child {
  padding-left: 0;
  border-left: 0;
}

.order-presentation .sheet-account-values > p:last-child {
  padding-right: 0;
}

.order-presentation .sheet-account-values p > span:first-child {
  min-width: 0;
  font-size: 13px;
  color: #596d63;
}

.order-presentation .sheet-account-values b {
  margin-left: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.order-presentation .sheet-total .sheet-money strong {
  font-size: 25px;
  letter-spacing: -.7px;
}

.order-presentation .sheet-total .sheet-money small {
  font-size: 13px;
}

.order-presentation .sheet-account-values .sheet-stock {
  grid-column: auto;
}

.order-presentation .sheet-holdings {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 12px;
}

.order-presentation .sheet-holdings > strong {
  font-size: 20px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

.order-presentation .sheet-holdings > span {
  color: var(--muted);
  font-size: 12px;
}

.order-presentation .sheet-holdings .sheet-money {
  display: inline-flex;
  vertical-align: baseline;
}

.order-presentation .sheet-holdings .sheet-money strong {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

.order-presentation .sheet-stock-value {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 7px;
  width: auto;
  padding: 0;
  font-size: 12px;
  color: var(--muted);
}

.order-presentation .sheet-stock-value .sheet-money {
  margin: 0;
}

.order-presentation .sheet-stock-value .sheet-money strong {
  font-size: 15px;
  font-weight: 600;
}

.order-presentation .sheet-stock-value .sheet-money small {
  font-size: 11px;
}

.order-presentation .sheet-valuation {
  margin: 17px 0 0;
  padding-top: 12px;
  border-top: 1px solid #edf0eb;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}

.order-presentation .sheet-orders {
  padding: 0 20px 17px;
  border-color: #a9c7b4;
  background: #fcfefb;
  overflow: hidden;
}

.order-presentation .sheet-orders > .sheet-block-heading {
  margin: 0 -20px 18px;
  padding: 14px 20px;
  border-bottom: 1px solid #d4e3d6;
  background: #e9f3eb;
}

.order-presentation .sheet-orders .sheet-block-heading h4 {
  color: var(--green-dark);
  font-size: 17px;
}

.order-presentation .sheet-orders .sheet-block-heading > small {
  background: #fff;
  color: var(--green);
  font-weight: 650;
}

.order-presentation .sheet-buy-plan {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  margin: 0 0 16px;
  padding: 15px 17px;
  border: 1px solid #dce8dc;
  border-radius: 10px;
  background: #f1f7ef;
}

.order-presentation .sheet-buy-allocation {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.order-presentation .sheet-buy-allocation > span {
  color: #506958;
  font-size: 12px;
}

.order-presentation .sheet-buy-allocation > strong {
  color: var(--green-dark);
  font-size: 20px;
  line-height: 1.45;
  letter-spacing: -.45px;
}

.order-presentation .sheet-buy-amount {
  min-width: 0;
  text-align: right;
}

.order-presentation .sheet-buy-amount .sheet-money {
  align-items: flex-end;
}

.order-presentation .sheet-buy-amount .sheet-money strong {
  color: var(--green-dark);
  font-size: 22px;
  letter-spacing: -.5px;
}

.order-presentation .order-table-wrap {
  max-width: 100%;
  border-color: #d5e1d4;
  border-radius: 10px;
  background: #fff;
}

.order-presentation .order-table {
  width: 100%;
  font-size: 13px;
  line-height: 1.65;
}

.order-presentation .order-table th,
.order-presentation .order-table td {
  padding: 16px 13px;
  border-bottom-color: #e1e9df;
}

.order-presentation .order-table thead th {
  padding-top: 10px;
  padding-bottom: 10px;
  background: #f6f9f4;
  color: #5c6e62;
  font-size: 11px;
  font-weight: 600;
}

.order-presentation .order-table thead th:first-child {
  width: 26%;
}

.order-presentation .order-table thead th:nth-child(2) {
  width: 17%;
  text-align: right;
}

.order-presentation .order-table thead th:nth-child(3) {
  width: 24%;
}

.order-presentation .order-table tbody th {
  background: #fff;
  color: var(--green);
  font-size: 14px;
  font-weight: 650;
}

.order-presentation .order-table tbody .sell th {
  color: #945723;
}

.order-presentation .order-table td:nth-child(2) {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.25px;
  white-space: nowrap;
}

.order-presentation .order-table td:nth-child(3) {
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
}

.order-presentation .order-table td:nth-child(4) {
  color: #52665a;
  font-size: 12px;
}

.order-presentation .order-type-code {
  display: block;
  white-space: nowrap;
  font-size: .9em;
  font-weight: 500;
}

.order-presentation .sheet-no-orders {
  margin: 0;
  padding: 18px;
  border: 1px solid #dce5d8;
  background: #f6f9f3;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.order-presentation .sheet-footnotes {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.today-order-card .sheet-execution-note {
  margin: 10px 0 21px;
  padding: 15px 18px;
  border: 1px solid #ead5ae;
  border-left: 4px solid #b57a34;
  border-radius: 10px;
  background: #fff6e7;
  color: #775423;
  font-size: 13px;
  line-height: 1.75;
}

.today-order-card .sheet-status-header {
  margin-bottom: 5px;
}

@media (max-width: 900px) {
  .order-presentation .sheet-account-values {
    grid-template-columns: 1fr 1fr;
    gap: 18px 0;
  }

  .order-presentation .sheet-account-values .sheet-total {
    grid-column: 1 / -1;
    padding: 0 0 17px;
    border-bottom: 1px solid var(--line);
  }

  .order-presentation .sheet-account-values .sheet-cash {
    padding-left: 0;
    border-left: 0;
  }

  .order-presentation .sheet-total .sheet-money {
    flex-direction: row;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 3px 12px;
  }
}

@media (max-width: 620px) {
  .today-order-card .card-body {
    padding: 18px 14px;
  }

  .order-presentation .sheet-heading h3 {
    font-size: 19px;
  }

  .order-presentation .sheet-heading p {
    font-size: 12px;
  }

  .order-presentation .sheet-session {
    margin-bottom: 17px;
  }

  .order-presentation .sheet-session p {
    gap: 4px 9px;
    font-size: 12px;
  }

  .order-presentation .sheet-session p > span {
    min-width: 48px;
    font-size: 11px;
  }

  .order-presentation .sheet-session strong {
    font-size: 12px;
  }

  .order-presentation .sheet-session .sheet-time-change {
    font-size: 11px !important;
  }

  .order-presentation .sheet-block {
    padding: 17px 14px;
    margin-bottom: 17px;
    border-radius: 12px;
  }

  .order-presentation .sheet-block-heading {
    margin-bottom: 15px;
  }

  .order-presentation .sheet-block-heading h4 {
    font-size: 15px;
  }

  .order-presentation .sheet-market {
    padding: 13px 14px;
  }

  .order-presentation .sheet-market-values {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .order-presentation .sheet-market-values p {
    gap: 2px 10px;
  }

  .order-presentation .sheet-market-values p > small {
    font-size: 10px;
  }

  .order-presentation .sheet-account-values {
    grid-template-columns: 1fr 1fr;
    gap: 15px 0;
  }

  .order-presentation .sheet-account-values > p {
    gap: 6px;
    padding: 0 12px;
  }

  .order-presentation .sheet-account-values .sheet-total {
    padding-bottom: 15px;
  }

  .order-presentation .sheet-total .sheet-money {
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
  }

  .order-presentation .sheet-total .sheet-money strong {
    font-size: 25px;
  }

  .order-presentation .sheet-total .sheet-money small {
    font-size: 12px;
  }

  .order-presentation .sheet-money strong {
    font-size: 17px;
  }

  .order-presentation .sheet-money small {
    font-size: 11px;
  }

  .order-presentation .sheet-account-values p > span:first-child,
  .order-presentation .sheet-account-values b {
    font-size: 12px;
  }

  .order-presentation .sheet-account-values b {
    margin-left: 4px;
  }

  .order-presentation .sheet-holdings {
    gap: 2px 8px;
  }

  .order-presentation .sheet-holdings > strong {
    font-size: 18px;
  }

  .order-presentation .sheet-holdings > span {
    font-size: 11px;
  }

  .order-presentation .sheet-stock-value {
    padding: 0;
    width: auto;
    gap: 2px 6px;
    font-size: 11px;
  }

  .order-presentation .sheet-stock-value .sheet-money strong {
    font-size: 14px;
  }

  .order-presentation .sheet-stock-value .sheet-money small {
    font-size: 10px;
  }

  .order-presentation .sheet-valuation {
    margin-top: 15px;
    font-size: 10px;
  }

  .order-presentation .sheet-orders {
    padding: 0 12px 14px;
  }

  .order-presentation .sheet-orders > .sheet-block-heading {
    margin: 0 -12px 14px;
    padding: 13px 14px;
  }

  .order-presentation .sheet-orders .sheet-block-heading h4 {
    font-size: 16px;
  }

  .order-presentation .sheet-buy-plan {
    display: grid;
    grid-template-columns: 1fr;
    gap: 11px;
    padding: 13px;
    margin-bottom: 12px;
  }

  .order-presentation .sheet-buy-allocation {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
  }

  .order-presentation .sheet-buy-allocation > strong {
    font-size: 19px;
  }

  .order-presentation .sheet-buy-amount {
    padding-top: 9px;
    border-top: 1px solid #dce8dc;
    text-align: left;
  }

  .order-presentation .sheet-buy-amount .sheet-money {
    align-items: flex-start;
  }

  .order-presentation .sheet-buy-amount .sheet-money strong {
    font-size: 21px;
  }
}

/* Sidebar, dialogs and saved sheets can be narrow even on a wide viewport. */
@container (max-width: 640px) {
  .order-presentation .order-table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .order-presentation .order-table {
    display: block;
    width: 100%;
  }

  .order-presentation .order-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .order-presentation .order-table tbody {
    display: grid;
    gap: 10px;
    width: 100%;
  }

  .order-presentation .order-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 12px 14px;
    width: 100%;
    padding: 14px;
    border: 1px solid #d5e1d4;
    border-left: 3px solid #45866b;
    border-radius: 9px;
    background: #fff;
  }

  .order-presentation .order-table tbody tr.sell {
    border-left-color: #b58356;
  }

  .order-presentation .order-table tbody th,
  .order-presentation .order-table tbody td {
    display: block;
    padding: 0;
    min-width: 0;
    border: 0;
    text-align: left;
    background: transparent;
  }

  .order-presentation .order-table tbody th::before,
  .order-presentation .order-table tbody td::before {
    display: block;
    content: attr(data-label);
    margin-bottom: 4px;
    color: #69796d;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0;
  }

  .order-presentation .order-table tbody th {
    grid-column: 1 / -1;
    padding-bottom: 11px;
    border-bottom: 1px solid #e6ece3;
    font-size: 14px;
  }

  .order-presentation .order-type-code {
    display: inline;
    white-space: normal;
  }

  .order-presentation .order-table td:nth-child(2) {
    font-size: 21px;
    font-weight: 700;
    line-height: 1.6;
    white-space: normal;
  }

  .order-presentation .order-table td:nth-child(3) {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.65;
  }

  .order-presentation .order-condition-part {
    white-space: nowrap;
    max-width: 100%;
  }

  .order-presentation .order-table td:nth-child(4) {
    grid-column: 1 / -1;
    padding-top: 11px;
    border-top: 1px solid #e6ece3;
    font-size: 12px;
    line-height: 1.7;
  }
}

@media (max-width: 620px) {
  .order-presentation .sheet-footnotes {
    font-size: 10px;
    gap: 4px;
  }

  .today-order-card .sheet-execution-note {
    padding: 12px 14px;
    margin: 9px 0 18px;
    font-size: 12px;
    line-height: 1.75;
  }
}

@media (max-width: 360px) {
  .order-presentation .sheet-account-values {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .order-presentation .sheet-account-values > p,
  .order-presentation .sheet-account-values > p:last-child {
    padding: 0;
    border-left: 0;
  }

  .order-presentation .sheet-account-values .sheet-total {
    padding-bottom: 14px;
  }

  .order-presentation .sheet-account-values .sheet-stock {
    padding-top: 14px;
    border-top: 1px solid var(--line);
  }

  .order-presentation .order-table tbody tr {
    grid-template-columns: 1fr;
    gap: 11px;
  }

  .order-presentation .order-table td:nth-child(3) {
    padding-top: 10px;
    border-top: 1px solid #e6ece3;
  }
}
