* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: #f3f7f7; color: #172f36; font: 15px/1.5 "Segoe UI","Microsoft YaHei",sans-serif; }
.portal-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px max(22px, calc((100% - 1232px)/2)); background: #142e3a; color: #f1fbfd; }
.portal-brand { display: flex; align-items: center; gap: 11px; font-size: 18px; font-weight: 700; line-height: 1.24; }
.portal-brand small { display: block; margin-top: 3px; color: #bdd4dc; font-size: 12px; font-weight: 500; }
.portal-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: #9be6ce; color: #133d36; }
#preview-badge { padding: 4px 10px; border: 1px solid #5a8a87; border-radius: 12px; color: #d2f4eb; font-size: 13px; }
main { width: min(800px, calc(100% - 32px)); margin: 32px auto; }
section { background: white; border: 1px solid #cddddd; border-radius: 12px; padding: 20px; margin: 16px 0; }
h1,h2 { margin: 0 0 8px; }
form, nav { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin: 12px 0; }
form h2 { flex-basis: 100%; }
label { display: grid; gap: 5px; }
input,button,select { border: 1px solid #95b6bb; border-radius: 7px; padding: 8px; font: inherit; }
button { color: white; background: #166958; cursor: pointer; }
button:disabled { opacity: .65; cursor: default; }
button:hover:not(:disabled), #workbench:hover { filter: brightness(.95); }
:focus-visible { outline: 2px solid #008578; outline-offset: 3px; }
.secondary { background: white; color: #165c50; }
#bound-shops { list-style: none; padding: 0; }
#bound-shops li { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid #dee8eb; }
#bound-shops button { color: #176457; background: white; }
a { color: #176457; }
#account-role { display: inline-block; margin: 4px 0; padding: 3px 8px; border-radius: 5px; background: #e6f2ee; color: #145748; font-weight: 600; }
#test-subscription { color: #50676b; }
#workbench { padding: 8px 12px; border-radius: 7px; color: white; background: #166958; text-decoration: none; }
#owner-actions { padding: 10px 0; border-top: 1px solid #dee8eb; }
.account-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.account-heading h1 { margin: 0; }
summary { cursor: pointer; }
.admin-row { padding: 6px 0; border-bottom: 1px solid #dee8eb; overflow-wrap: anywhere; }
.admin-row button { margin-left: 10px; }

#auth-layout { display: grid; grid-template-columns: minmax(0, 440px); justify-content: center; align-items: start; gap: 18px; margin-top: clamp(24px, 6vh, 68px); }
#auth-layout:has(#preview-guide:not([hidden])) { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
#auth, #preview-guide { min-width: 0; margin: 0; padding: clamp(18px, 4vw, 28px); }
#auth { width: min(100%, 440px); }
#auth h1 { font-size: 26px; line-height: 1.2; }
#auth h1:focus { outline: none; }
#auth-hint, #preview-guide p { color: #48626a; }
#auth-hint { margin: 0 0 18px; }
#auth form, #auth label {display:grid; width:100%}
#auth form[hidden] {display:none}
.channels {display:flex; border-radius:8px; background:#edf3f0; padding:4px; gap:4px}
.channels button {flex:1; background:transparent; color:#435e55; border-color:transparent}
.channels button[aria-pressed=true] {background:white; color:#135b4d; border-color:#bfd4ca}
.contact-field {display:flex; align-items:center; gap:8px}
.contact-field input {flex:1; min-width:0}
#auth .link {background:none; color:#176457; border:none; padding:4px}
#auth nav {justify-content:space-between; margin-bottom:0}
#auth input { min-height: 43px; min-width: 0; }
#auth form > button { min-height: 42px; font-weight: 600; }
.password-strength { --strength-color: #48626a; display: grid; gap: 5px; color: #48626a; font-size: 13px; }
.password-strength-copy { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
.password-strength strong { color: var(--strength-color); }
.password-strength-bars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.password-strength-bars span { height: 5px; border-radius: 3px; background: #e4ebed; }
.password-strength[data-strength="1"] { --strength-color: #a13f32; }
.password-strength[data-strength="2"] { --strength-color: #885103; }
.password-strength[data-strength="3"] { --strength-color: #176457; }
.password-strength[data-strength="1"] .password-strength-bars span:first-child,
.password-strength[data-strength="2"] .password-strength-bars span:nth-child(-n+2),
.password-strength[data-strength="3"] .password-strength-bars span { background: var(--strength-color); }
#preview-guide { border: 1px solid #cddddd; border-radius: 12px; background: #eaf3f1; }
#preview-guide h2 { font-size: 20px; }
#preview-guide p { margin: 5px 0 0; }
.preview-role { margin-top: 16px; }
.preview-role button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; font-weight: 600; }
#preview-guide .preview-note { margin-top: 18px; padding-top: 12px; border-top: 1px solid #cbded9; font-size: 13px; }
#email-delivery { margin: 0; color: #48626a; }
.test-code { display: grid; gap: 8px; background: #ecf5f1; padding: 9px; border-radius: 7px; }
.test-code code { overflow-wrap: anywhere; color: #165c50; }
.portal-notice:not(:empty) { margin: 14px 0 0; padding: 9px 12px; border-radius: 7px; background: #e4f1ed; color: #214e42; }
.portal-notice[data-kind=error] { background: #fcf0ed; color: #7f3025; }
@media (max-width: 620px) {
  .portal-top { padding-inline: 16px; }
  #auth-layout:has(#preview-guide:not([hidden])) { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  #preview-guide { width: min(100%, 440px); }
}
.seller-shops h1 { margin-top: 14px; }
.shop-toolbar, .shop-entry, .shop-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.shop-toolbar, .shop-entry { justify-content: space-between; }
.shop-toolbar p, .shop-entry p { margin: 4px 0; }
.shop-list { list-style: none; padding: 0; margin: 12px 0 0; }
.shop-entry { padding: 14px 0; border-top: 1px solid #dee8eb; }
.shop-entry h3 { display: inline; margin-right: 8px; overflow-wrap: anywhere; }
.shop-secondary { background: white; color: #166958; }
.shop-detail { color: #50676b; }
.shop-status { font-size: 13px; background: #e6f2ee; border-radius: 5px; padding: 2px 6px; }
.shop-status[data-status="reauthorize"] { background: #fff1d3; color: #75450c; }
.shop-form { display: grid; gap: 10px; align-items: start; }
.shop-form input { width: 100%; }
.shop-form button { justify-self: start; }
#shop-action { width: min(480px, calc(100% - 32px)); padding: 20px; border: 1px solid #95b6bb; border-radius: 12px; }
#shop-action::backdrop { background: #17333b75; }
#shop-action p { margin: 0; }
