/* ShareHome v64 — isolate table cells from generic .actions flex and contain forms. */
.app-shell .periods-management-table{overflow-x:auto;overflow-y:visible}
.app-shell .periods-management-table table{table-layout:fixed;width:100%;min-width:1040px;border-collapse:separate;border-spacing:0}
.app-shell .periods-management-table th,.app-shell .periods-management-table td{vertical-align:middle;overflow-wrap:break-word;word-break:normal}
.app-shell .periods-management-table th:nth-child(1){width:16%}
.app-shell .periods-management-table th:nth-child(2){width:10%}
.app-shell .periods-management-table th:nth-child(3){width:11%}
.app-shell .periods-management-table th:nth-child(4){width:23%}
.app-shell .periods-management-table th:nth-child(5){width:13%}
.app-shell .periods-management-table th:nth-child(6){width:12%}
.app-shell .periods-management-table th:nth-child(7){width:15%}
.app-shell .periods-management-table td.period-action-cell{display:table-cell!important;min-width:0!important;width:auto!important;padding:9px!important;white-space:normal!important}
.app-shell .periods-management-table td.period-action-cell form{display:block!important;margin:5px 0 0!important;min-width:0!important}
.app-shell .periods-management-table td.period-action-cell .button{display:block!important;width:100%!important;max-width:100%;min-width:0!important;white-space:normal!important;line-height:1.5!important;padding:8px 6px!important}
.app-shell .periods-management-table td.period-action-cell .muted{display:block}
.app-shell .periods-management-table tr[hidden]{display:none!important}
.app-shell .periods-management-table .period-manage-row td{padding:0!important;background:#f3f8fa!important}
.period-manage-panel{padding:16px 18px;background:linear-gradient(145deg,#f4faff,#edf8f5);border:1px solid #d9e6e6;border-radius:12px;margin:7px}
.period-manage-panel header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:13px}
.period-manage-panel h3{margin:3px 0;font-size:16px}
.period-manage-panel .period-manage-close{border:1px solid #d3e1e2;background:#fff;border-radius:10px;font-size:22px;cursor:pointer;width:38px;height:38px;flex:none}
.period-manage-options{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,295px),1fr));gap:12px;align-items:start}
.period-manage-box{background:#fff;border:1px solid #e1e9ec;border-radius:12px;padding:13px;min-width:0}
.period-manage-box h4{margin:0 0 11px;font-size:14px}
.period-manage-box .inline-allocation-form,.period-manage-options .transfer-form{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;width:100%!important;min-width:0!important;max-width:100%!important;position:static!important;padding:0!important;background:transparent!important;box-shadow:none!important;border:0!important}
.period-manage-box .inline-allocation-form input,.period-manage-box .inline-allocation-form select,.period-manage-options .transfer-form input,.period-manage-options .transfer-form select{min-width:0;width:100%;height:auto;min-height:40px}
.period-manage-box .inline-allocation-form>*{min-width:0}
.period-manage-box .inline-allocation-form .mini-check,.period-manage-box .inline-allocation-form small{white-space:normal;line-height:1.7}
.period-manage-box button,.period-manage-options .transfer-form button{white-space:normal;min-width:0}
.ownership-transfer-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.ownership-transfer-fields>fieldset{margin:0;min-width:0;border:1px solid #dbe6e8;border-radius:12px;padding:12px}
.ownership-transfer-fields>fieldset legend{font-weight:750;padding:0 6px}
.ownership-transfer-fields label:not(.transfer-choice){display:grid;gap:7px;align-content:start;font-weight:650}
.ownership-transfer-fields input:not([type=radio]):not([type=checkbox]),.ownership-transfer-fields select{border:1px solid #d8e1e8;border-radius:10px;background:#fff;padding:9px;width:100%;min-width:0;min-height:42px}
.ownership-transfer-fields small{display:block;margin-top:7px;color:#637982;line-height:1.9}
.transfer-choice{display:flex!important;align-items:flex-start;gap:9px;padding:8px 0;cursor:pointer;line-height:1.8;font-weight:600}
.transfer-choice>input{width:18px;height:18px;flex:none;margin-top:4px}
.transfer-period-choices{border-top:1px solid #dbe6e8;margin-top:9px;padding:12px 0;max-height:260px;overflow:auto}
.transfer-period-choices .transfer-choice{border-bottom:1px solid #edf1f3}
.ownership-new-buyer,.ownership-transfer-confirm{margin-top:15px}
.ownership-transfer-confirm h3{margin-top:0}
.ownership-transfer-confirm p{line-height:1.8}
.ownership-transfer-form .owner-wizard-content{max-width:100%}
.ownership-chain{margin-top:15px}
.ownership-chain table{width:100%;border-collapse:collapse}
.ownership-chain th,.ownership-chain td{padding:10px 9px;text-align:right;border-bottom:1px solid #e1e9eb}
.ownership-chain .table-wrap{overflow:auto}
@media(max-width:900px){
  .app-shell .periods-management-table table{min-width:0!important;width:100%!important;table-layout:auto}
  .app-shell .periods-management-table td.period-action-cell{display:flex!important;width:100%!important;min-width:0!important;align-items:center;gap:7px;flex-wrap:wrap}
  .app-shell .periods-management-table td.period-action-cell::before{flex-basis:100%}
  .app-shell .periods-management-table td.period-action-cell form{margin:0!important;flex:1 1 135px}
  .app-shell .periods-management-table td.period-action-cell button{flex:1 1 135px}
  .app-shell .periods-management-table .period-manage-row td{display:block!important;width:100%!important}
  .period-manage-options{grid-template-columns:1fr}
  .ownership-transfer-fields{grid-template-columns:1fr}
}
@media(max-width:520px){
  .period-manage-panel{padding:11px;margin:4px}
  .period-manage-box .inline-allocation-form,.period-manage-options .transfer-form{grid-template-columns:1fr}
  .ownership-transfer-fields>fieldset{padding:10px}
  .ownership-chain th,.ownership-chain td{font-size:12px;padding:7px}
}


/* v64 — Fix allocation checkboxes inheriting global input{width:100%}.
   Isolated to the allocation panel: no effects on other checkbox controls. */
.app-shell .allocation-panel-row .allocation-option-grid{
  grid-template-columns:repeat(3,minmax(0,1fr));
  align-items:stretch;
}
.app-shell .allocation-panel-row .allocation-option-grid > label.allocation-check{
  display:grid!important;
  grid-template-columns:20px minmax(0,1fr)!important;
  align-items:start!important;
  justify-content:stretch!important;
  gap:10px!important;
  min-width:0;
  box-sizing:border-box;
  text-align:right;
  direction:rtl;
  white-space:normal!important;
  overflow:hidden;
}
.app-shell .allocation-panel-row .allocation-check > input[type="checkbox"]{
  display:block!important;
  width:20px!important;min-width:20px!important;max-width:20px!important;
  height:20px!important;min-height:20px!important;max-height:20px!important;
  padding:0!important;
  margin:3px 0 0!important;
  flex:none!important;
  box-sizing:border-box!important;
  appearance:auto;
  cursor:pointer;
}
.app-shell .allocation-panel-row .allocation-check > span{
  display:block!important;
  width:auto!important;min-width:0!important;max-width:100%!important;
  margin:0!important;padding:0!important;
  text-align:right!important;direction:rtl;
  white-space:normal!important;overflow-wrap:break-word;
}
.app-shell .allocation-panel-row .allocation-check > span > b,
.app-shell .allocation-panel-row .allocation-check > span > small{
  display:block!important;
  max-width:100%;
  text-align:right!important;
  white-space:normal!important;
  line-height:1.7;
}
@media(max-width:900px){
  .app-shell .allocation-panel-row .allocation-option-grid{grid-template-columns:1fr!important}
}

/* v64 - Normalize ordinary checkbox/radio controls in ALL forms, not just allocation.
   The original design system applies input{width:100%;min-height:46px;padding:10px}.
   These are choice controls, not text fields. Exclude bespoke hidden/toggle inputs. */
.app-shell label:not(.management-switch):not(.occasion-show-toggle):not(.lottery-quarter-mode label) :is(input[type="checkbox"],input[type="radio"]):not(.management-switch-input),
.app-shell .permission-group :is(input[type="checkbox"],input[type="radio"]){
  width:20px!important;min-width:20px!important;max-width:20px!important;
  height:20px!important;min-height:20px!important;max-height:20px!important;
  padding:0!important;margin-inline:0!important;
  box-sizing:border-box!important;flex:0 0 20px!important;
  vertical-align:middle;cursor:pointer;
}
/* The label itself should provide the spacing; never let text become a narrow grid item. */
.app-shell :is(.mini-check,.transfer-choice,.bank-default-switch,.usage-select-all,.management-create-toggle,.group-toggle,.cleanup-choice,.calendar-toggle-row,.filter-check){
  min-width:0;white-space:normal;overflow-wrap:break-word;
}
.app-shell :is(.mini-check,.transfer-choice,.bank-default-switch,.management-create-toggle,.group-toggle) > :is(span,b,small){
  min-width:0;overflow-wrap:break-word;
}
/* Management forms: override the generic "all inline-allocation-form inputs" width rule. */
.app-shell .period-manage-options .inline-allocation-form label.mini-check{
  display:flex!important;flex-direction:row!important;align-items:center!important;
  justify-content:flex-start!important;gap:9px!important;
  min-width:0;line-height:1.8;white-space:normal;
}
.app-shell .period-manage-options .inline-allocation-form label.mini-check > input[type="checkbox"]{
  width:20px!important;min-width:20px!important;max-width:20px!important;
  height:20px!important;min-height:20px!important;max-height:20px!important;
  padding:0!important;margin:0!important;flex:0 0 20px!important;
}
/* Transfer form radio/checkbox labels: long text must stay beside the control. */
.app-shell .ownership-transfer-fields label.transfer-choice,
.app-shell .ownership-transfer-confirm label.transfer-choice{
  display:flex!important;flex-direction:row!important;align-items:flex-start!important;
  gap:10px!important;white-space:normal!important;
  overflow-wrap:anywhere;min-width:0;
}
/* Maintain custom hidden toggles and switches: those inputs are intentionally invisible. */
.app-shell .occasion-show-toggle > input[type="checkbox"]{
  width:1px!important;min-width:1px!important;max-width:1px!important;
  height:1px!important;min-height:1px!important;max-height:1px!important;
}
/* The allocation choice card spans must never be stretched by generic label styling. */
.app-shell .allocation-panel-row .allocation-check > span{min-width:0!important;overflow-wrap:anywhere!important}
@media (max-width:600px){
  .app-shell .allocation-panel-row .allocation-option-grid{grid-template-columns:minmax(0,1fr)!important}
  .app-shell .allocation-panel-row .allocation-check{min-width:0!important}
}

/* v65 — Conditional allocation acknowledgements (hidden beats the grid !important rules). */
.app-shell .allocation-panel-row .allocation-option-grid > .allocation-conditional-check[hidden]{display:none!important}
.app-shell .allocation-panel-row .allocation-option-grid:has(.allocation-conditional-check[hidden]){grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr))}
.allocation-advice-status{margin:8px 0 0;padding:9px 12px;border:1px solid #dbe7ef;border-radius:10px;background:#f3f8fc;color:#41566b;font-size:12px;line-height:1.8}
.allocation-advice-status[hidden]{display:none!important}
.allocation-advice-status.is-error{background:#fff7f5;border-color:#efb9b0;color:#9c4037}
.allocation-panel-actions button:disabled{opacity:.55;cursor:wait}
