/* KeepSIM Phase 1 — cream/gold partner theme. */
.keepsim-panel{--ks-brown:#65472a;--ks-gold:#ad7e40}
.keepsim-subtitle{font-weight:400;font-size:.7em;color:#a17b4b;white-space:normal}
.ks-warning{border:1px solid #e5caa3;background:#fff7ea;border-radius:12px;padding:13px 16px;color:#805c34;font-size:12px;margin-bottom:18px}
.ks-summary-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:14px}
.ks-summary{background:linear-gradient(135deg,#fff,#f8efe2);border:1px solid #e9dbc8;border-radius:15px;padding:18px;display:flex;flex-direction:column;gap:5px;min-width:0}
.ks-summary small{font-size:11px;color:#95806d}.ks-summary strong{font-family:'Manrope',sans-serif;color:#55381e;font-size:29px;overflow-wrap:anywhere}.ks-summary span{font-size:11px;color:#ae906c}
.ks-tab-actions{display:flex;gap:9px;flex-wrap:wrap;margin:21px 0 14px}
.ks-tab-actions button,.ks-secondary{border:1px solid #e5d3b9;background:#fff;color:#795932;border-radius:10px;padding:10px 14px;font:600 12px 'Prompt',sans-serif;cursor:pointer}
.ks-tab-actions button.active{background:#876135;color:#fff;border-color:#876135}
.ks-edit-form{padding:20px;border:1px solid #eadac6;border-radius:15px;background:#fff;margin-bottom:18px}
.ks-edit-form>p{font-size:12px;color:#8d7963;line-height:1.8}
.ks-edit-form h3{margin:0 0 10px}
.ks-grid-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.ks-grid-fields label{display:flex;flex-direction:column;gap:6px;color:#684c2e;font-size:12px;font-weight:600}
.ks-grid-fields input,.ks-grid-fields select,.ks-edit-form textarea{width:100%;min-height:44px;border:1px solid #e4d3c0;border-radius:10px;padding:8px 12px;background:#fffdf9;color:#4b3524;font:400 13px 'Prompt',sans-serif}
.ks-edit-form textarea{min-height:145px;resize:vertical}
/* KeepSIM fixed network amount: visible but non-editable for members */
.ks-grid-fields #ksTopupAmount[readonly],.ks-manual-amount input[readonly]{background:#f4efe7;color:#684c2e;cursor:not-allowed;opacity:1;font-weight:700}
.ks-bulk-fixed-note{grid-column:1/-1;margin:0;padding:12px 14px;border:1px solid #e7dac8;border-radius:10px;background:#fcf8f1;font-weight:500;color:#725135}
.ks-check{display:flex;gap:9px;align-items:flex-start;font-size:12px;margin-top:14px;color:#755a3d}
.ks-check input{margin-top:4px;accent-color:#9f7441}.ks-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:18px}
.ks-primary{border:0;background:linear-gradient(130deg,#c79e67,#926434);color:white;border-radius:10px;padding:11px 20px;font:600 13px 'Prompt',sans-serif;cursor:pointer}
.ks-primary:disabled,.ks-mini:disabled{cursor:not-allowed;opacity:.5}
.ks-notice{white-space:pre-line;color:#725e48;font-size:12px;min-height:22px;margin:10px 0}.ks-notice.error{color:#a23e37}
.ks-list-header{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:28px 0 12px}.ks-list-header h3{font-size:18px;margin:0;color:#4b301f}
.ks-table-wrap{overflow-x:auto;border:1px solid #e6dac9;border-radius:12px}.ks-table{border-collapse:collapse;width:100%;min-width:810px;font-size:12px;background:#fff}.ks-table th{background:#f7f0e5;color:#816344;font-size:11px;text-align:left}.ks-table td,.ks-table th{padding:12px 10px;border-bottom:1px solid #f1e8da;vertical-align:middle}.ks-table tbody tr:last-child td{border-bottom:0}
.ks-row-actions{white-space:nowrap}.ks-mini{background:#f8f0e5;border:1px solid #e7d4b8;color:#78542e;border-radius:7px;padding:6px 9px;margin-right:6px;cursor:pointer}.ks-mini.danger{color:#ae4c43;background:#fff5f2}
.ks-pages{display:flex;align-items:center;justify-content:center;gap:12px;margin-top:16px;font-size:12px;color:#886d53}.ks-pages button:disabled{opacity:.5;cursor:not-allowed}
.ks-wallet-row{display:flex;justify-content:space-between;gap:15px;border-top:1px solid #eee1d0;padding:10px 0;font-size:12px;color:#755c41}
@media(max-width:700px){.ks-summary-grid{grid-template-columns:1fr 1fr}.ks-summary:last-child{grid-column:span 2}.ks-grid-fields{grid-template-columns:1fr}.ks-tab-actions button{flex:1}.ks-summary strong{font-size:25px}}
@media(max-width:390px){.ks-summary-grid{grid-template-columns:1fr}.ks-summary:last-child{grid-column:auto}}

.ks-file-label{display:block;font-size:12px;color:#7b613e;margin:9px 0}.ks-file-label input{display:block;margin-top:8px;font-size:12px}

/* V25.1: provider marks, balance tracking, member-reported top-up */
.ks-network-list{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin:12px 0 17px}
.ks-network-chip{border:1px solid #eadcc9;background:#fff;border-radius:12px;padding:9px;display:flex;align-items:center;gap:10px;min-width:0}
.ks-network-chip span{font:500 10px/1.55 'Prompt',sans-serif;color:#967a5a}
.ks-brand{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;flex:none}
.ks-brand img{width:90px;max-width:100%;height:31px;object-fit:contain;display:block}
.ks-provider-missing{color:#a69281;font-size:11px}
.ks-field-hint{color:#a48359;font-size:11px;font-weight:400}
.ks-phone{font-weight:700;letter-spacing:.3px;color:#513620}
.ks-table{min-width:1080px}
.ks-manual-panel{max-width:none}
.ks-manual-head{display:flex;justify-content:space-between;align-items:end;gap:15px;margin:16px 0}
.ks-manual-head label{font-size:12px;font-weight:600;display:flex;flex-direction:column;gap:7px;flex:1;max-width:420px}
.ks-manual-head input{border:1px solid #e4d3c0;border-radius:10px;padding:11px 13px;min-height:44px;background:#fffdf9;width:100%;font:400 13px 'Prompt',sans-serif}
.ks-manual-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.ks-manual-card{display:grid;grid-template-columns:auto 1fr;gap:6px 12px;align-items:center;padding:13px 14px;border:1px solid #eadcc9;border-radius:12px;background:#fffdf9;min-width:0}
.ks-manual-card>input[type=checkbox]{grid-row:span 4;accent-color:#ae824d;width:17px;height:17px;align-self:start;margin-top:4px}
.ks-manual-phone{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;color:#553819;font-size:14px}
.ks-manual-phone strong{font-family:'Manrope','Prompt',sans-serif}
.ks-manual-meta{color:#8b7158;font-size:11px}
.ks-manual-amount{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:12px;color:#705136}
.ks-manual-amount input{max-width:112px;min-height:35px;border:1px solid #ddc7aa;border-radius:8px;padding:6px 10px;text-align:right;font:700 13px 'Manrope',sans-serif;color:#5b3b20}
.ks-manual-amount input:disabled{opacity:.54;background:#f4eee5}
.ks-manual-min{font-size:10px;color:#a28c75}
.ks-manual-summary{margin-top:17px;border-radius:11px;border:1px solid #e3ccb0;background:#faf2e5;padding:14px 16px;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;color:#735333;font-size:13px}
.ks-manual-summary strong{font-size:18px;color:#795022}
.ks-confirm{padding:12px 15px;background:#fffcf6;border:1px dashed #dfbf98;border-radius:10px;line-height:1.8}
.ks-history-title{margin-top:28px!important}
.ks-history-row{padding:12px 0;border-top:1px solid #ecdfcf;display:flex;flex-direction:column;gap:4px;font-size:12px}
.ks-history-row strong{color:#674522}.ks-history-row span{color:#947e69;font-size:11px}
.ks-empty{grid-column:1/-1;color:#8c7965;font-size:12px}
@media(max-width:1050px){.ks-network-list{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:750px){.ks-manual-list{grid-template-columns:1fr}.ks-manual-head{align-items:stretch;flex-wrap:wrap}.ks-manual-head label{max-width:none}}
@media(max-width:390px){.ks-network-list{grid-template-columns:1fr 1fr}.ks-network-chip{padding:7px;flex-direction:column;gap:2px}.ks-brand img{width:78px;height:27px}.ks-manual-summary{font-size:12px}}

.ks-line-card {
  background: #fffcf7;
  border: 1px solid #e6d4b9;
  border-radius: 15px;
  padding: 16px;
  margin-bottom: 18px;
}
.ks-line-heading, .ks-line-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.ks-line-heading h3 { margin: 0; font-size: 16px; color: var(--ks-brown); }
#ksLineStatus { color: #735637; font-size: 12px; }
.ks-line-actions { margin-top: 12px; }
.ks-line-actions button { min-height: 40px; }
.ks-line-actions button:focus-visible { outline: 2px solid #69502e; outline-offset: 3px; }
.ks-line-actions button:not(:disabled):hover { filter: brightness(.95); }
.ks-line-card p { margin: 10px 0 0; color: #70563d; font-size: 12px; overflow-wrap: anywhere; }
.ks-line-card p:empty, .ks-line-card [hidden] { display: none; }

.ks-link-steps { padding-inline-start: 22px; margin: 12px 0 0; color: #65472a; font-size: 13px; line-height: 1.8; }
.ks-link-code { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.ks-link-code input { max-width: 100%; box-sizing: border-box; width: 27ch; padding: 10px; border: 1px solid #e6d4b9; border-radius: 8px; background: white; color: #51391f; font: 14px monospace; }
.ks-link-code a { color: #79532e; font-weight: 600; font-size: 13px; padding: 8px; }


.ks-date-field { display: grid; gap: 6px; align-content: start; }
.ks-date-tools { position: relative; }
.ks-date-tools #ksExpires { width: 100%; min-width: 0; padding-right: 48px; box-sizing: border-box; }
.ks-calendar-icon { position: absolute; inset: 0 0 0 auto; width: 44px; display: grid; place-items: center; color: #765637; border-radius: 8px; }
.ks-calendar-icon:focus-within { outline: 2px solid #a67b43; outline-offset: -3px; }
.ks-calendar-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.ks-date-tools #ksNativeDate { position: absolute; inset: 0; width: 100%; height: 100%; min-width: 0; box-sizing: border-box; opacity: 0; cursor: pointer; padding: 0; }
#ksNativeDate::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; cursor: pointer; }

.ks-mobile, #ksSheet:not([open]) { display: none; }
.ks-network-group, #ksNetworkInfo { display: contents; }

.keepsim-panel .ks-summary-grid { order: 1; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0; margin: 0 0 8px; border: 1px solid #e6d8c6; border-radius: 10px; background: #fcf8f1; }
.keepsim-panel .ks-summary { grid-column: auto; border: 0; border-radius: 0; padding: 8px 3px; background: none; gap: 1px; text-align: center; line-height: 1.4; }
.ks-summary + .ks-summary { border-left: 1px solid #e6d8c6; }
.ks-summary strong { font-size: 21px; }
.ks-summary:not(:last-child) span { display: none; }
.ks-line-card { order: 2; padding: 0 10px; border-radius: 10px; margin: 0; }
.ks-line-heading { min-height: 44px; justify-content: space-between; }
.ks-line-heading h3 { display: none; }
#ksLineStatus::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #aa9274; margin-right: 7px; }
#ksLineStatus.ks-linked::before { background: #42864c; }
.ks-disclosure { border: 0; background: transparent; color: #65472a; font: inherit; min-height: 44px; }
.ks-disclosure::after, .ks-compact-list summary::after { content: ''; display: inline-block; width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); margin: 0 3px 3px 8px; }
.ks-disclosure[aria-expanded="true"]::after, .ks-compact-list details[open] summary::after { transform: rotate(225deg); margin-bottom: -2px; }
.ks-line-card:has(#ksLineToggle[aria-expanded="false"]) #ksLineTools { display: none; }
#ksLineTools { padding-bottom: 10px; }
.keepsim-panel .ks-notice:empty { display: none; }

@media (max-width: 700px) {
  #partnerKeepSIMPanel { display: flex; flex-direction: column; padding: 14px; min-width: 0; }
  #partnerKeepSIMPanel .ks-mobile { display: block; }
  #partnerKeepSIMPanel > .partner-title { align-items: center; margin: 0 0 12px; }
  #partnerKeepSIMPanel .partner-title h2 { margin: 0; font-size: 22px; }
  #partnerKeepSIMPanel .partner-title p, #partnerKeepSIMPanel .partner-live,
  .keepsim-subtitle, #partnerKeepSIMPanel .ks-desktop,
  #partnerKeepSIMPanel > .ks-edit-form, #partnerKeepSIMPanel > .ks-table-wrap,
  #partnerKeepSIMPanel > .ks-one-page, #ksShowSingle, #ksShowBulk { display: none; }
  .keepsim-panel > .ks-notice { order: 3; }
  .keepsim-panel .ks-list-header { order: 4; margin: 12px 0 5px; }
  .ks-list-header h3 { font-size: 16px; }
  #ksRefresh { font-size: 11px; padding: 5px 9px; }
  .ks-compact-list { order: 5; max-height: 178px; overflow: auto; border: 1px solid #e6d8c6; background: white; border-radius: 10px; }
  .ks-compact-list details + details { border-top: 1px solid #ede3d5; }
  .ks-compact-list summary { display: grid; grid-template-columns: auto minmax(0,1fr) auto 12px; align-items: center; gap: 5px; min-height: 43px; padding: 5px 8px; cursor: pointer; font-size: clamp(12px,3.4vw,15px); font-variant-numeric: tabular-nums; }
  .ks-compact-list summary::-webkit-details-marker { display: none; }
  .ks-compact-list summary::after { margin-left: 0; }
  .ks-carrier { justify-self: start; color: #785a36; background: #f7f0e4; border-radius: 5px; padding: 1px 4px; font-size: 10px; line-height: 1.4; }
  .ks-expiry { white-space: nowrap; }
  .ks-row-detail, .ks-compact-list .ks-empty { margin: 0; padding: 7px 10px 10px; font-size: 12px; }
  .ks-row-detail { background: #fcf8f1; }
  .ks-row-detail button { margin-top: 5px; min-height: 36px; }
  .keepsim-panel > .ks-pages { order: 6; margin: 7px 0; }
  .ks-tab-actions { order: 7; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0; }
  .ks-tab-actions button { padding: 7px 4px; min-height: 44px; }
  .ks-network-group { display: block; order: 8; border: 1px solid #e6d8c6; border-radius: 10px; padding: 0 10px; }
  #ksNetworkToggle { width: 100%; text-align: left; font-weight: 600; }
  #ksNetworkToggle::after { float: right; margin-top: 7px; }
  #ksNetworkToggle[aria-expanded="false"] + #ksNetworkInfo { display: none; }
  #ksNetworkInfo, .keepsim-panel .ks-network-list { display: block; }
  .keepsim-panel .ks-network-list { margin: 0; }
  .keepsim-panel .ks-network-chip { flex-direction: row; justify-content: space-between; border: 0; border-top: 1px solid #eee3d5; border-radius: 0; padding: 4px 0; }
  .ks-network-chip img { width: 54px; height: 24px; }
  .keepsim-panel > .ks-warning { order: 9; margin: 8px 0 0; padding: 8px; }
  .keepsim-panel:has(#ksNetworkToggle[aria-expanded="false"]) > .ks-warning { display: none; }
  #ksSheet { position: fixed; inset: auto 0 0; width: 100%; max-width: 560px; max-height: 90vh; max-height: 90dvh; margin: 0 auto; padding: 0; background: #fffdf9; color: var(--ink); border: 1px solid #e6d8c6; border-bottom: 0; border-radius: 18px 18px 0 0; overflow: hidden; }
  #ksSheet[open] { display: flex; flex-direction: column; }
  #ksSheet::backdrop { background: rgb(44 33 23 / 44%); }
  html:has(#ksSheet[open]) { overflow: hidden; }
  #ksSheet header { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px 3px; flex: none; }
  #ksSheet h3 { margin: 0; }
  #ksSheetClose { border: 0; background: transparent; color: #674d32; font-size: 24px; width: 44px; height: 44px; }
  #ksSheetScroll { overflow: auto; overscroll-behavior: contain; padding: 0 16px max(14px,env(safe-area-inset-bottom)); }
  #ksSheetTabs { display: flex; margin: 4px 0 12px; }
  #ksSheetTabs button { flex: 1; padding: 8px; min-height: 44px; border: 1px solid #e4d3c0; border-radius: 8px; color: #6a4a2b; background: #faf5ed; }
  #ksSheetTabs [aria-pressed="true"] { background: #866039; color: white; }
  #ksSheet .ks-edit-form { border: 0; padding: 0; margin: 0; background: transparent; }
  #ksSheet .ks-grid-fields { grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); gap: 10px; }
  #ksSheet .ks-grid-fields > * { min-width: 0; }
  #ksSingleForm .ks-grid-fields > :first-child, #ksTopupWrap { grid-column: 1 / -1; }
  #ksSheet input:not([type="checkbox"]), #ksSheet select, #ksSheet textarea { min-width: 0; max-width: 100%; font-size: 16px; }
  #ksSheet .ks-calendar-icon { bottom: auto; height: 44px; }
  #ksHint { color: #846c50; font-size: 10px; }
  #ksSheet .ks-actions { margin-top: 12px; }
  #ksSheet .ks-actions button { flex: 1; min-height: 44px; padding-inline: 9px; }
  #ksEnabled { appearance: none; flex: none; width: 36px; height: 21px; border-radius: 12px; background: #897d71; margin: 0; cursor: pointer; }
  #ksEnabled::before { content: ''; display: block; margin: 3px; width: 15px; height: 15px; border-radius: 50%; background: white; }
  #ksEnabled:checked { background: #936a3b; }
  #ksEnabled:checked::before { transform: translateX(15px); }
  #ksSheet #ksManualTitle, #ksSheet #ksManualPanel > .mp-kicker, #ksSheet #ksWalletPanel h3 { display: none; }
}
@media (max-width: 700px) {
  #ksRuleNote { color: #795d40; margin: 5px 0; }
  #ksRuleNote:empty { display: none; }
}
