*{box-sizing:border-box}body{margin:0;font-family:Inter,"Noto Sans TC","Microsoft JhengHei",sans-serif;background:#f5f7fa;color:#172033}button,input{font:inherit}.login-shell{min-height:100vh;display:grid;place-items:center;padding:24px;background:linear-gradient(135deg,#eef3f8,#fff)}.login-card{width:min(440px,100%);background:#fff;border:1px solid #e5eaf0;border-radius:22px;padding:34px;box-shadow:0 18px 60px #22334b18}.brand{display:flex;align-items:center;gap:13px}.mark{width:46px;height:46px;border-radius:13px;background:#173a5e;color:#fff;display:grid;place-items:center;font-weight:800;font-size:24px}.brand h1,.brand p{margin:0}.brand h1{font-size:16px;letter-spacing:.06em}.brand p,.brand span{display:block;color:#738095;font-size:13px;margin-top:3px}.login-card h2{margin:36px 0 4px}.muted,.login-card small{color:#7b8798}.login-card label{display:block;margin:18px 0 0;font-size:13px;font-weight:700}.login-card input{width:100%;margin-top:7px;padding:12px 14px;border:1px solid #d7dee8;border-radius:10px}.login-card button{width:100%;margin:22px 0 16px;padding:13px;border:0;border-radius:10px;background:#173a5e;color:#fff;font-weight:800}.error{margin-top:18px;padding:11px;border-radius:9px;background:#fff0f0;color:#a42929}header{height:76px;background:#fff;border-bottom:1px solid #e5eaf0;display:flex;align-items:center;justify-content:space-between;padding:0 5vw}.user{display:flex;align-items:center;gap:15px}.user form{margin:0}.ghost{border:1px solid #d7dee8;background:#fff;border-radius:9px;padding:8px 13px}.dashboard{max-width:1180px;margin:auto;padding:58px 28px}.hero p{font-size:13px;font-weight:800;color:#52708d;letter-spacing:.12em}.hero h1{font-size:34px;margin:5px 0 8px}.hero span{color:#748094}.cards{display:grid;grid-template-columns:repeat(2,1fr);gap:20px;margin-top:38px}.app-card{text-decoration:none;color:inherit;background:#fff;border:1px solid #e2e8ef;border-radius:18px;padding:25px;display:grid;grid-template-columns:58px 1fr auto;align-items:center;gap:18px;min-height:132px;box-shadow:0 8px 28px #263b5510;transition:.18s}.app-card[href]:hover{transform:translateY(-2px);border-color:#9fb1c4;box-shadow:0 14px 34px #263b5519}.app-icon{width:54px;height:54px;border-radius:14px;background:#edf3f8;display:grid;place-items:center;font-size:27px;color:#173a5e}.app-card h2{font-size:18px;margin:0 0 5px}.app-card p{margin:0;color:#7a8797}.enter{font-size:13px;font-weight:800;color:#466985}.admin{opacity:.75}@media(max-width:720px){.cards{grid-template-columns:1fr}.app-card{grid-template-columns:54px 1fr}.enter{grid-column:2}.hero h1{font-size:27px}header{padding:0 20px}.dashboard{padding:38px 20px}}


/* Portal logo: fixed box, uncropped image, responsive text. */
.brand{min-width:0;max-width:100%}
.brand-text{min-width:0;overflow-wrap:anywhere}
.portal-logo{flex:0 0 104px;width:104px;height:54px;max-width:104px;max-height:54px;display:flex;align-items:center;justify-content:center;background:transparent}
.portal-logo img.portal-logo-image{display:block;width:100%;height:100%;max-width:104px;max-height:54px;object-fit:contain;object-position:center;margin:0;padding:0;border:0}
.login-card .portal-logo{flex-basis:80px;width:80px;height:42px;max-width:80px;max-height:42px}
.login-card .portal-logo img.portal-logo-image{max-width:80px;max-height:42px}
header{min-height:76px;height:auto;padding-top:12px;padding-bottom:12px;gap:16px;flex-wrap:wrap}
header>.brand{flex:1 1 280px}
.user{flex:0 0 auto;max-width:100%;flex-wrap:wrap}
@media(max-width:480px){
 .login-shell{padding:16px}
 .login-card{padding:24px}
 .brand{gap:10px}
 .login-card .brand h1{font-size:14px}
 header{padding:12px 16px}
 header>.brand{flex-basis:100%}
 header .portal-logo{flex-basis:88px;width:88px;height:46px;max-width:88px;max-height:46px}
 header .portal-logo img.portal-logo-image{max-width:88px;max-height:46px}
}

.dashboard>.login-card{width:100%;max-width:none;margin:18px 0;overflow-x:auto}.dashboard .login-card form{display:grid;gap:12px;margin-top:16px}.dashboard .login-card label{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.dashboard .login-card input[type=checkbox]{width:auto}.dashboard table{width:100%;border-collapse:collapse}.dashboard th,.dashboard td{text-align:left;padding:10px;border-bottom:1px solid #dbe3dc}.dashboard details>summary{cursor:pointer;font-weight:700}

/* v0.8.2: shared account controls */
.account-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:nowrap;flex-shrink:0}.account-actions form{display:flex;margin:0;padding:0}.account-actions .portal-return-button,.account-actions button{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:40px;padding:9px 14px;border-radius:8px;font:inherit;line-height:1.25;white-space:nowrap;text-decoration:none;cursor:pointer}.account-actions .portal-return-button{background:#fff;color:#294d42;border:1px solid #c3d1c8}.account-actions .portal-return-button:hover{background:#eef5f1}.account-actions .portal-return-button:focus-visible,.account-actions button:focus-visible{outline:3px solid #78bfb2;outline-offset:3px}.account-meta{display:flex;flex-direction:column;gap:4px;text-align:right}.account-meta small{display:block;font-size:12px}.account-actions button{margin:0}.account-actions{margin-left:auto}
header>.user{margin-left:auto;justify-content:flex-end;flex-wrap:wrap}.user .account-actions button,.user .portal-return-button{background:#fff;color:#294d42;border:1px solid #c3d1c8}header>a.brand{text-decoration:none;color:inherit}
@media(max-width:760px){header>.user{width:100%;justify-content:flex-end}}

/* Compact administration forms; confined to administration page. */
.admin-dashboard .login-card{padding:20px 24px;border-radius:14px}
.admin-dashboard .login-card h2{margin:0 0 12px;font-size:18px}
.admin-dashboard .login-card form{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 20px}
.admin-dashboard .login-card label{display:flex;flex-direction:column;align-items:stretch;margin:0;gap:5px;min-width:0}
.admin-dashboard .login-card input:not([type=checkbox]),.admin-dashboard .login-card select{width:100%;min-width:0;margin:0;padding:8px 10px;border:1px solid #d7dee8;border-radius:8px;font:inherit}
.admin-dashboard .login-card label.permission-field{flex-direction:row;align-items:center;gap:8px}
.admin-dashboard .login-card input[type=checkbox]{width:16px;height:16px;margin:0;flex:0 0 16px}
.admin-dashboard .login-card button{width:auto;justify-self:start;padding:9px 16px;margin:4px 0;grid-column:1/-1}
.admin-dashboard .user-card{padding:14px 20px;margin:10px 0}
.admin-dashboard .user-card summary{font-size:14px;overflow-wrap:anywhere}
.admin-dashboard .user-card form+form{border-top:1px solid #e5eaf0;padding-top:14px}
@media(max-width:640px){.admin-dashboard .login-card form{grid-template-columns:1fr}.admin-dashboard .login-card{padding:16px}}
